<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><generator uri="https://jekyllrb.com/" version="3.9.5">Jekyll</generator><link href="https://keivanipchihagh.github.io//feed.xml" rel="self" type="application/atom+xml" /><link href="https://keivanipchihagh.github.io//" rel="alternate" type="text/html" hreflang="en-US" /><updated>2024-06-01T01:42:13+04:30</updated><id>https://keivanipchihagh.github.io//feed.xml</id><title type="html">Keivan Ipchi Hagh</title><subtitle>Keivan Ipchi Hagh's personal site.</subtitle><author><name>Keivan Ipchi Hagh</name><email>keivanipchihagh@email.com</email></author><entry><title type="html">How Cloudflare’s Workers Help You Bypass Blockages</title><link href="https://keivanipchihagh.github.io//how-cloudflare-workers-help-you-bypass-blockages/" rel="alternate" type="text/html" title="How Cloudflare’s Workers Help You Bypass Blockages" /><published>2024-04-12T08:15:00+04:30</published><updated>2024-04-12T08:15:00+04:30</updated><id>https://keivanipchihagh.github.io//how-cloudflare-workers-help-you-bypass-blockages</id><content type="html" xml:base="https://keivanipchihagh.github.io//how-cloudflare-workers-help-you-bypass-blockages/"><![CDATA[<p>There’s nothing more frustrating than finding out that your domain is occasionally blocked by Internet Service Providers (ISPs) for no apparent reason. In this article, I’ll share my personal experience and how Cloudflare Workers came to the rescue.</p>

<h2 id="understanding-isp-blockage">Understanding ISP Blockage</h2>
<p>ISPs may block websites due to various reasons, including legal requirements, content filtering, regional restrictions, or perhaps just a digital whim. But here’s the twist: innocent websites like mine can get caught in the crossfire. Suddenly, functionality stumbles, performance wavers, and I’m left scratching my head in the darkness. 😕</p>

<h2 id="the-frustration-of-blocked-access">The Frustration of Blocked Access</h2>
<p>Imagine the shock of realizing that your website is inaccessible to certain when you desperately need it. It’s like having a physical store with a <em>“Closed”</em> sign during peak business hours. It’s a real bummer!</p>

<p>I’ve set up my personal cloud workstation on a remote server. It houses everything from <a href="https://prometheus.io/">Prometheus</a> and <a href="https://grafana.com/">Grafana</a> for monitoring my cluster and services to <a href="https://www.pgadmin.org/">pgAdmin</a> for database management. This server isn’t just a convenience; it’s my lifeline for monitoring my Kubernetes cluster’s health and performance.</p>

<p>Yet, it gets blocked at times. The digital barricades rise, leaving me stranded outside my own virtual storefront. Why? Who knows! But I refuse to accept defeat ⚔️. Enter Cloudflare Workers — the heroes that swoop in when ISPs play gatekeepers.</p>

<h2 id="the-battle-against-isp-blockage">The Battle Against ISP Blockage</h2>
<p>Assuming you already have your domain set up on Cloudflare, let’s begin setting up your subdomain:</p>

<h3 id="1-deploy-your-worker">1. Deploy your worker</h3>
<p>Head to your Cloudflare panel’s <em>“Workers and Pages”</em> section and hit the <em>“Create application”</em> button. Create a worker and give it an awesome name (For example, <code class="language-plaintext highlighter-rouge">my-awesome-site</code>). Then, copy and paste the following code and replace the placeholders with your domain. Finally, hit the deploy button. 🚀</p>

<div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">HOSTNAME</span> <span class="o">=</span> <span class="dl">"</span><span class="s2">my-awesome-site.com</span><span class="dl">"</span>
<span class="nx">PROTOCOL</span> <span class="o">=</span> <span class="dl">"</span><span class="s2">https</span><span class="dl">"</span>
<span class="nx">INBOUND_PORT</span> <span class="o">=</span> <span class="mi">443</span><span class="p">;</span>

<span class="nx">addEventListener</span><span class="p">(</span>
    <span class="dl">"</span><span class="s2">fetch</span><span class="dl">"</span><span class="p">,</span> <span class="nx">event</span> <span class="o">=&gt;</span> <span class="p">{</span>
        <span class="kd">let</span> <span class="nx">url</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">URL</span><span class="p">(</span><span class="nx">event</span><span class="p">.</span><span class="nx">request</span><span class="p">.</span><span class="nx">url</span><span class="p">);</span>

        <span class="nx">url</span><span class="p">.</span><span class="nx">hostname</span> <span class="o">=</span> <span class="nx">HOSTNAME</span><span class="p">;</span>
        <span class="nx">url</span><span class="p">.</span><span class="nx">protocol</span> <span class="o">=</span> <span class="nx">PROTOCOL</span><span class="p">;</span>
        <span class="nx">url</span><span class="p">.</span><span class="nx">port</span> <span class="o">=</span> <span class="nx">INBOUND_PORT</span><span class="p">;</span>

        <span class="nx">event</span><span class="p">.</span><span class="nx">respondWith</span><span class="p">(</span>
            <span class="nx">fetch</span><span class="p">(</span><span class="k">new</span> <span class="nx">Request</span><span class="p">(</span><span class="nx">url</span><span class="p">,</span> <span class="nx">event</span><span class="p">.</span><span class="nx">request</span><span class="p">))</span>
        <span class="p">)</span>
    <span class="p">}</span>
<span class="p">)</span>
</code></pre></div></div>

<p>The code above turns your worker into a simple HTTPS router.</p>

<h3 id="2-giving-your-worker-an-address">2. Giving your worker an address</h3>
<p>Your worker already has an address, but it’s an ugly one and not very memorable. To solve this, head to the <em>“Custom Domains”</em> of your worker settings and create a new one pointing to your worker. Wait a few minutes for it to create the certificates and set the DNS settings and Voilà!</p>

<p><strong>Pro tip</strong>: I usually address my workers with a subdomain. If my actual domain is <code class="language-plaintext highlighter-rouge">my-awesome-site.com</code>, I’ll address my worker as <code class="language-plaintext highlighter-rouge">cfw.my-awesome-site.com</code> which makes it easy to remember.</p>

<h2 id="benefits-of-using-cloudflare-workers">Benefits of Using Cloudflare Workers</h2>
<ul>
  <li>Speed: Cloudflare’s global network ensures faster response times. It will reduce latency, even when from distant locations.</li>
  <li>Reliability: Cloudflare’s infrastructure is redundant and scalable. No more worrying about downtime due to ISPs.</li>
  <li>Security: Workers operate at the edge, providing DDoS protection and SSL/TLS encryption.</li>
  <li>IP protection: Cloudflare workers hide your server IP address.</li>
</ul>

<h2 id="real-life-success-story">Real-Life Success Story</h2>
<p>After implementing Cloudflare Workers, my website’s accessibility improved. I simply switch to my secondary subdomain whenever my original domain isn’t doesn’t load. ISPs can still (<em>technically</em>) block Cloudflare workers, but that’s very unlikely as many websites depend on it.</p>

<h2 id="conclusion">Conclusion</h2>
<p>Don’t let ISP blockage hinder your online presence. Cloudflare Workers empower website owners to take control. Happy browsing! 🌐🚀</p>]]></content><author><name>Keivan Ipchi Hagh</name><email>keivanipchihagh@email.com</email></author><category term="tips" /><category term="technology" /><category term="security" /><category term="vpn" /><category term="networking" /><category term="cloudflare" /><summary type="html"><![CDATA[There’s nothing more frustrating than finding out that your domain is occasionally blocked by Internet Service Providers (ISPs) for no apparent reason. In this article, I’ll share my personal experience and how Cloudflare Workers came to the rescue.]]></summary></entry><entry><title type="html">Deploy Your Resume Into Production!</title><link href="https://keivanipchihagh.github.io//deploy-your-resume-into-production/" rel="alternate" type="text/html" title="Deploy Your Resume Into Production!" /><published>2024-01-06T11:10:00+03:30</published><updated>2024-01-06T11:10:00+03:30</updated><id>https://keivanipchihagh.github.io//deploy-your-resume-into-production</id><content type="html" xml:base="https://keivanipchihagh.github.io//deploy-your-resume-into-production/"><![CDATA[<p>In the tech world, “deploying into production” signifies the final step of making an application live and accessible to users. So why not apply the same concept to your resume? 🚀</p>

<p>By deploying your resume into production, you can make it easily accessible to recruiters and hiring managers with a simple URL. Plus, you don’t have to worry about updating all your copies every time you make a change.</p>

<p>In this article, I’ll show you how I deployed my resume written in <a href="https://docs.google.com/">Google Docs</a> on <a href="https://www.cloudflare.com/">Cloudflare</a>. Although, you can use any other hosting for your resume. Here’s a step-by-step guide on how I did it:</p>

<h2 id="step-1-make-your-resume-accessible">Step 1: Make Your Resume Accessible</h2>
<p>First, ensure your resume in Google Docs is polished and ready for the spotlight. Then, share it with anyone with the link, but with viewer access only!</p>

<figure>
<img src="/deploy-your-resume-into-production/docs.jpg" alt="Google Docs general access" />
<figcaption>Fig 1. Google Docs general access</figcaption>
</figure>

<h2 id="step-2-set-up-a-subdomain-on-cloudflare">Step 2: Set Up a Subdomain on Cloudflare</h2>
<p>This is where you flex your DNS muscles. Just don’t go down the rabbit hole of DNS configuration for too long — we’ve all been there.</p>

<p>Log in to your domain registrar and navigate to the <em>DNS</em> settings. Create a new <em>CNAME</em> record for your subdomain (e.g., <code class="language-plaintext highlighter-rouge">resume.example.com</code>) and point it to somewhere you like (it doesn’t matter where because we only need the alias). Don’t forget to set its proxy status to Proxied as shown below:</p>

<ul>
  <li>Type: <code class="language-plaintext highlighter-rouge">CNAME</code></li>
  <li>Name: <code class="language-plaintext highlighter-rouge">resume</code></li>
  <li>Target: <code class="language-plaintext highlighter-rouge">domain.com</code></li>
  <li>Proxy status: <code class="language-plaintext highlighter-rouge">Proxied</code></li>
  <li>TTL: <code class="language-plaintext highlighter-rouge">Auto</code></li>
</ul>

<figure>
<img src="/deploy-your-resume-into-production/cloudflare.jpg" alt="Cloudflare DNS settings snapshot" />
<figcaption>Fig 2. Cloudflare DNS settings snapshot</figcaption>
</figure>

<h2 id="step-3-create-a-redirect-rule">Step 3: Create a redirect rule</h2>
<p>Head to the “Rules” section and create a new “Redirect Rule” with the following config:</p>

<p>If…</p>
<ul>
  <li>Tupe: <code class="language-plaintext highlighter-rouge">Custom filter expression</code></li>
  <li>Field: <code class="language-plaintext highlighter-rouge">Hostname</code></li>
  <li>Operator: <code class="language-plaintext highlighter-rouge">equals</code></li>
  <li>Value: <code class="language-plaintext highlighter-rouge">resume.example.com(same as the one in step 2)</code></li>
</ul>

<p>Then…</p>
<ul>
  <li>Type: <code class="language-plaintext highlighter-rouge">Dynamic</code></li>
  <li>URL: <code class="language-plaintext highlighter-rouge">concat(“https://docs.google.com/document/d/...", http.request.uri.path) - (replace your share link)</code></li>
  <li>Status Code = <code class="language-plaintext highlighter-rouge">301</code> (permanently moved)</li>
  <li>Preserve query string: <code class="language-plaintext highlighter-rouge">Checked</code></li>
</ul>

<figure>
<img src="/deploy-your-resume-into-production/rules.jpg" alt="Cloudflare Redirect Rules" />
<figcaption>Fig 3. Cloudflare Redirect Rules</figcaption>
</figure>

<p><strong>What is the “Preserve query string”?</strong> This way you can pass query parameters to your URL. This is crucial if you want to create a download link for your resume.</p>

<p>To view your resume: <code class="language-plaintext highlighter-rouge">https://resume.example.com</code></p>

<p>To download your resume: <code class="language-plaintext highlighter-rouge">https://resume.example.com/export?format=pdf</code></p>

<p>This approach not only makes your resume accessible and professional but also adds a touch of fun and creativity to the process. By following these steps, you can ensure your resume is always available and up-to-date, ready to impress potential employers. Plus, it’s a great conversation starter in interviews — who wouldn’t be impressed by a resume that’s been deployed to production?</p>]]></content><author><name>Keivan Ipchi Hagh</name><email>keivanipchihagh@email.com</email></author><category term="resume" /><category term="docs" /><category term="production" /><category term="cv" /><category term="cloudflare" /><summary type="html"><![CDATA[Why not apply the same concept to your resume?]]></summary></entry><entry><title type="html">What is a shell? 🐚 adalah kerang ajaib?</title><link href="https://keivanipchihagh.github.io//apa-itu-shell/" rel="alternate" type="text/html" title="What is a shell? 🐚 adalah kerang ajaib?" /><published>2020-01-25T08:28:47+03:30</published><updated>2020-01-25T08:28:47+03:30</updated><id>https://keivanipchihagh.github.io//apa-itu-shell</id><content type="html" xml:base="https://keivanipchihagh.github.io//apa-itu-shell/"><![CDATA[<p><a href="http://www.youtube.com/watch?v=tc4ROCJYbm0&amp;t=70" target="_blank" rel="noopener">Dulu</a> Sebelum adanya <abbr title="Graphical User Interface">GUI</abbr> cara user berinteraksi dengan komputer menggunakan <abbr title="Command Line Interface">CLI</abbr> yaitu mengetik baris perintah pada sebuah antarmuka dalam bentuk baris teks seperti 👇.</p>

<figure>
<img src="/apa-itu-shell/terminal_nginx.gif" alt="installing nginx in ubuntu" />
<figcaption>Fig 1. Terminal emulator, instalasi package dan check service.</figcaption>
</figure>

<p>Jika kamu pernah menggunakan unix/linux mungkin pernah menggunakan program diatas, bahkan mungkin setiap hari menggunakannya untuk mengeksekusi suatu perintah melalui <a href="http://en.wikipedia.org/wiki/List_of_terminal_emulators" target="_blank" rel="noopener">terminal emulator</a>.</p>

<p>User<sup id="user"><a href="#user-ref">[1]</a></sup> tidak bisa secara langsung berkomunikasi dengan sebuah hardware komputer, maka dari itu kita membutuhkan sebuah sistem operasi; <strong>Kernel</strong> adalah program yang merupakan inti utama dari sistem operasi komputer.</p>

<figure>
<img src="/apa-itu-shell/kernel.png" alt="kernel central of operating system" />
<figcaption>Fig 2. bagan kernel.</figcaption>
</figure>

<p>Kernel memfasilitasi interaksi antara komponen perangkat keras dan perangkat lunak, berperan untuk menangani permintaan input/ouput dari perangkat lunak, selanjutnya menerjemahkannya ke dalam pemrosesan data untuk diintruksikan ke CPU, sehingga Hardware(cpu, memory, devices) mengerti perintah yang dimaksud dari pengguna.</p>

<p>Ketika kita menginputkan suatu perintah pada terminal emulator, kernel tidak langsung mengerti perintah yang kita ketik, kita membutuhkan suatu interface sebagai perantara menuju kernel yaitu <strong>Shell</strong>.</p>

<figure>
<img src="/apa-itu-shell/shell.png" alt="shell" />
<figcaption>Fig 3. bagan komunikasi shell.</figcaption>
</figure>

<p><mark>Shell adalah sebuah command-line interpreter; program yang berperan sebagai penerjemah perintah yang diinputkan oleh User yang melalui terminal</mark>, sehingga perintah tersebut bisa dimengerti oleh si Kernel.</p>

<p>Login shell biasanya ditetapkan oleh local System Administrator ketika pada saat pertama user kamu dibuat, kamu bisa lihat login shell yang sedang kamu gunakan dengan perintah dibawah ini.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span><span class="nb">echo</span> <span class="nv">$SHELL</span>
<span class="c"># atau</span>
<span class="nv">$ </span><span class="nb">echo</span> <span class="nv">$0</span>
</code></pre></div></div>

<p>Setiap shell mempunyai default prompt. beberapa shell yang paling umum:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span><span class="o">(</span>dollar sign<span class="o">)</span>   <span class="c"># sh, ksh, bash</span>
% <span class="o">(</span>percent sign<span class="o">)</span>  <span class="c"># csh, tcsh</span>
</code></pre></div></div>

<h5 id="terminologi-pada-shell-prompt">Terminologi pada shell prompt</h5>

<p>Shell prompt adalah tempat dimana kita menuliskan suatu perintah, berikut adalah terminologinya ini membantu, jika kamu ingin mengetahui bagian-bagianya.</p>

<figure>
<img src="/apa-itu-shell/term_shell_prompt.png" alt="shell" />
<figcaption>Fig 4. bagian-bagin dari shell prompt.</figcaption>
</figure>

<p>Dibawah ini salah satu contoh perintah sederhana untuk menampilkan sebuah arsitektur CPU komputer yang sedang saya gunakan.</p>

<figure>
<img src="/apa-itu-shell/terminal_lscpu.gif" alt="installing nginx in ubuntu" />
<figcaption>Fig 5. menampilkan informasi tentang arsitektur CPU.</figcaption>
</figure>

<p>Dari perintah yang contohkan, ketika user mengetikan suatu inputan perintah di terminal dan menekan <kbd>ENTER</kbd>, maka shell akan mengubah perintah user menjadi bahasa yang bisa dipahami oleh kernel, dan Kernel menerjemahkannya ke dalam pemrosesan data untuk diintruksikan ke Hardware sehingga menghasilkan output yg sesuai dengan perintah user.</p>

<p>Shell mempunyai beberapa macam dan turunan, berikut yang paling umum.</p>

<figure>
<img src="/apa-itu-shell/shell_evolution.png" alt="shell evolution" />
<figcaption>Fig 6. evaluasi shell dari tahun ke tahun.</figcaption>
</figure>

<p>Sedikit penjelasan dari gambar diatas.</p>

<ul>
  <li>Bourne shell <code class="language-plaintext highlighter-rouge">sh</code>
Dikembangkan oleh Stephen Bourne di Bell Labs, yang kala itu sebagai pengganti Thompson shell(diciptakan Ken Thompson), banyak sistem unix-like tetap memiliki <code class="language-plaintext highlighter-rouge">/bin/sh</code>—yang mana menjadi symbolic link atau hard link, bahkan ketika shell lain yang digunakan tetap <code class="language-plaintext highlighter-rouge">sh</code> adalah sebagai dasarnya, sebagai kompatibilitas perintah.</li>
  <li>Korn shell <code class="language-plaintext highlighter-rouge">ksh</code> Unix shell yang dikembangkan oleh David Korn di Bell Labs,
inisialiasi pengembangan ini berdasar pada source code Bourne shell, namun juga memiliki fitur <code class="language-plaintext highlighter-rouge">csh</code> dan <code class="language-plaintext highlighter-rouge">sh</code>, pengembanganya pun pada saat saya menulis ini pun terus <a href="http://github.com/att/ast" target="_blank" rel="noopener">terawat</a>.</li>
  <li>Bourne again shell <code class="language-plaintext highlighter-rouge">bash</code>
adalah proyek ini open source <a href="http://gnu.org/software/bash/" target="_blank" rel="noopener">GNU project</a> memilki kompatibel dengan <code class="language-plaintext highlighter-rouge">sh</code> yang menggabungkan fitur penting dari <code class="language-plaintext highlighter-rouge">ksh</code> dan <code class="language-plaintext highlighter-rouge">csh</code>, dan menjadi salah satu shell yang paling umum digunakan (umumnya menjadi default shell login Linux dan Apple’s macOS Mojave).</li>
  <li>Z shell <code class="language-plaintext highlighter-rouge">zsh</code> ini mempunyai wadah komunitasnya disebutnya <a href="http://ohmyz.sh/" target="_blank" rel="noopener">“Oh My Zsh”</a>, plug-in dan theme <code class="language-plaintext highlighter-rouge">zsh</code> bisa kita temukan di komunitas ini, saya saat ini menggunakan <code class="language-plaintext highlighter-rouge">zsh</code>, shell ini juga menjadi default dari sistem operasi macOS Catalina, yang menggantikan bash.</li>
  <li>friendly interactive shell <code class="language-plaintext highlighter-rouge">fish</code>
yah sesuai dengan <a href="http://fishshell.com/" target="_blank" rel="noopener">deskripsi</a> di web nya, menurut saya shell ini fun banget, fitur yang saya sukai dari shell ini autosuggestions, dan konfigurasi yang mudah melalui web based.</li>
</ul>

<p>Masih banyak yang belum dijelaskan pada tulisan ini jika masih tertarik, baca lebih <a href="http://en.wikipedia.org/wiki/List_of_command-line_interpreters#Operating_system_shells" target="_blank" rel="noopener">banyak</a> dan juga <a href="http://en.wikipedia.org/wiki/Comparison_of_command_shells" target="_blank" rel="noopener">komparasinya</a> masing-masing shell.</p>

<p>Jika kamu tertarik untuk mengubah default shell login pada sistem operasi, kamu bisa menginstall dengan cara mengikuti didokumentasi/cara penginstallan dimasing-masing shell disini saya tidak membahas karena distro yang kita pakai mungkin berbeda-beda.</p>

<p>Untuk menjadikan default shell login pada OS bisa menggunakan perintah ini.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># command</span>
<span class="nv">$ </span><span class="nb">sudo </span>chsh <span class="o">[</span>options] <span class="o">[</span>LOGIN]

<span class="c"># contoh penggunaan</span>
<span class="nv">$ </span><span class="nb">sudo </span>chsh <span class="nt">-s</span> /user/bin/zsh harpi
<span class="c"># mengubah default shell user harpi menjadi zsh shell.</span>
<span class="nv">$ </span>reboot

<span class="c"># atau kamu juga bisa mengubah file /etc/passwd dan edit secara manual user shellnya.</span>
<span class="c"># jika masih bingung manfaatkan perintah man untuk melihat manual page.</span>
<span class="nv">$ </span>man chsh
</code></pre></div></div>

<p>Terakhir untuk tulisan ini, shell memilki berbagai macam, pilihlah shell yang sesuai dengan keinginanmu untuk menunjang produktivitas dan sesuaikan dengan kebutuhan, terlalu banyak plugin dan kebingungan memilih tema itu buruk 😁.</p>

<p>Terimakasih sudah baca, <em>penulis menerima kritik dan saran.</em></p>

<h5 id="notes">Notes</h5>

<p><small id="user-ref"><sup><a href="#user">[1]</a></sup> Manusia yang mengoperasikan dan mengendalikan sistem komputer.</small></p>

<h5 id="resources">Resources</h5>

<ul>
  <li><a href="http://developer.ibm.com/tutorials/l-linux-shells/">Evolution shells in Linux</a></li>
  <li><a href="http://www.linfo.org/kernel.html">Kernel Defintion</a></li>
  <li><a href="http://www.cis.rit.edu/class/simg211/unixintro/Shell.html">The Shell</a></li>
</ul>]]></content><author><name>Keivan Ipchi Hagh</name><email>keivanipchihagh@email.com</email></author><category term="unix/linux" /><category term="cli" /><summary type="html"><![CDATA[Shell adalah sebuah command-line interpreter; program yang berperan sebagai penerjemah perintah yang diinputkan oleh User yang melalui terminal, sehingga perintah tersebut bisa dimengerti oleh si Kernel.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://keivanipchihagh.github.io//apa-itu-shell/shell_evolution.png" /><media:content medium="image" url="https://keivanipchihagh.github.io//apa-itu-shell/shell_evolution.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>