<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Home | 空垠尘</title><link>/en/</link><description>Minimalist Static · Boundless Edge</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>Dukang Xu</managingEditor><webMaster>Dukang Xu</webMaster><copyright>© 2026 空垠尘</copyright><lastBuildDate>Fri, 25 Sep 2026 16:00:00 +0800</lastBuildDate><atom:link href="/en/index.xml" rel="self" type="application/rss+xml"/><item><title>DevOps Troubleshooting and Debugging Playbook</title><link>/en/linux-troubleshooting/</link><pubDate>Fri, 25 Sep 2026 16:00:00 +0800</pubDate><author>Dukang Xu</author><guid isPermaLink="true">/en/linux-troubleshooting/</guid><description>A hands-on diagnostic guide tackling the most notorious production issues: Too Many Open Files limits, phantom full disks, inode exhaustion, zombie processes, Linux OOM killers, and clock skew.</description><content:encoded><![CDATA[<h2 id="introduction-a-systematic-mindset-for-devops-debugging">Introduction: A Systematic Mindset for DevOps Debugging</h2>
<p>In Linux and macOS operations, weird system glitches inevitably emerge:</p>
<ul>
<li>The disk shows gigabytes of free space, yet writes fail with <code>No space left on device</code>.</li>
<li>A port is locked, but no listening process is found.</li>
<li>Containers or backend services vanish silently without application crash logs.</li>
<li>Sudden connection spikes crash systems with <code>Too many open files</code>.</li>
</ul>
<p>Effective troubleshooting is a <strong>systematic deductive process</strong>. This playbook collects 6 high-impact real-world issues with battle-tested root-cause fixes.</p>
<pre tabindex="0"><code class="language-mermaid" data-lang="mermaid">flowchart TD
    Issue[&#34;System Anomalies &amp; Alerts&#34;] --&gt; A[&#34;1. File Descriptor Limits&lt;br/&gt;(Too Many Open Files)&#34;]
    Issue --&gt; B[&#34;2. Phantom Full Disks&lt;br/&gt;(Inode Exhaustion / Unreleased FD)&#34;]
    Issue --&gt; C[&#34;3. Port Clashes &amp; Zombies&lt;br/&gt;(Address in use / Defunct)&#34;]
    Issue --&gt; D[&#34;4. Silent Process Termination&lt;br/&gt;(Kernel OOM Killer)&#34;]
    Issue --&gt; E[&#34;5. Clock Skew &amp; Auth Failures&lt;br/&gt;(NTP Synchronization)&#34;]
    Issue --&gt; F[&#34;6. macOS Dev Bottlenecks&lt;br/&gt;(Homebrew Mirroring &amp; Network)&#34;]
</code></pre><hr>
<h2 id="1-resolving-too-many-open-files-descriptor-exhaustion">1. Resolving <code>Too Many Open Files</code> (Descriptor Exhaustion)</h2>
<p>In Unix, &ldquo;everything is a file&rdquo; (sockets, pipes, disk files). When concurrent connections exceed system thresholds, the OS denies new descriptors.</p>
<h3 id="1-permanent-linux-production-tuning">1. Permanent Linux Production Tuning</h3>
<p>Running <code>ulimit -n 65535</code> only affects the active terminal session. Make it permanent:</p>
<h4 id="-modify-system-limits-etcsecuritylimitsconf">① Modify System Limits (<code>/etc/security/limits.conf</code>)</h4>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="ln">1</span><span class="cl">* soft nofile 655350
</span></span><span class="line"><span class="ln">2</span><span class="cl">* hard nofile 655350
</span></span><span class="line"><span class="ln">3</span><span class="cl">root soft nofile 655350
</span></span><span class="line"><span class="ln">4</span><span class="cl">root hard nofile 655350
</span></span></code></pre></div><h4 id="-modify-systemd-global-daemon-limits-etcsystemdsystemconf">② Modify Systemd Global Daemon Limits (<code>/etc/systemd/system.conf</code>)</h4>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-ini" data-lang="ini"><span class="line"><span class="ln">1</span><span class="cl"><span class="k">[Manager]</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl"><span class="na">DefaultLimitNOFILE</span><span class="o">=</span><span class="s">655350</span>
</span></span><span class="line"><span class="ln">3</span><span class="cl"><span class="na">DefaultLimitNPROC</span><span class="o">=</span><span class="s">655350</span>
</span></span></code></pre></div><h4 id="-check-open-descriptors-by-process">③ Check Open Descriptors by Process</h4>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl">ls /proc/&lt;PID&gt;/fd <span class="p">|</span> wc -l
</span></span></code></pre></div><h3 id="2-macos-developer-environment-tuning">2. macOS Developer Environment Tuning</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># Check current limit</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">launchctl limit maxfiles
</span></span><span class="line"><span class="ln">3</span><span class="cl">
</span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="c1"># Temporarily raise limit for active terminal</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">sudo launchctl limit maxfiles <span class="m">65536</span> <span class="m">200000</span>
</span></span><span class="line"><span class="ln">6</span><span class="cl"><span class="nb">ulimit</span> -n <span class="m">65536</span>
</span></span></code></pre></div><hr>
<h2 id="2-phantom-full-disks--inode-exhaustion-no-space-left-on-device">2. Phantom Full Disks &amp; Inode Exhaustion (<code>No space left on device</code>)</h2>
<pre tabindex="0"><code class="language-mermaid" data-lang="mermaid">sequenceDiagram
    autonumber
    participant App as Application (Nginx / Java)
    participant Disk as Disk File (/var/log/app.log)
    participant Admin as DevOps Engineer

    App-&gt;&gt;Disk: Writes heavy logs (Holds open FD)
    Admin-&gt;&gt;Disk: rm /var/log/app.log (Removes directory entry)
    Note over Disk: Space NOT freed! Open FD still referenced
    Admin-&gt;&gt;App: Locates unreleased FD (lsof | grep deleted) &amp; truncates
    Note over Disk: Disk space reclaimed immediately!
</code></pre><h3 id="case-a-file-deleted-by-rm-but-process-holds-open-descriptor">Case A: File Deleted by <code>rm</code>, but Process Holds Open Descriptor</h3>
<p>When a large log file is removed while an application is actively writing to it, Linux unlinks the directory name, but disk blocks <strong>remain allocated</strong> until the process releases the descriptor.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># 1. Find deleted files held by active processes</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">sudo lsof <span class="p">|</span> grep -i deleted
</span></span><span class="line"><span class="ln">3</span><span class="cl">
</span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="c1"># 2. Free space gracefully without restarting the service</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">sudo truncate -s <span class="m">0</span> /proc/&lt;PID&gt;/fd/&lt;FD&gt;
</span></span><span class="line"><span class="ln">6</span><span class="cl"><span class="c1"># Or reload the service: sudo systemctl reload nginx</span>
</span></span></code></pre></div><h3 id="case-b-available-space-but-exhausted-inodes">Case B: Available Space but Exhausted Inodes</h3>
<p>Millions of tiny cache or session files can consume all filesystem inodes:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># 1. Check inode utilization</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">df -i
</span></span><span class="line"><span class="ln">3</span><span class="cl">
</span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="c1"># 2. Count directories containing the highest number of files</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">find /var/spool/ -type d -exec sh -c <span class="s2">&#34;echo -n &#39;{}: &#39;; ls -1 &#39;{}&#39; | wc -l&#34;</span> <span class="se">\;</span> <span class="p">|</span> sort -n -k <span class="m">2</span>
</span></span></code></pre></div><hr>
<h2 id="3-port-conflicts--zombie-process-cleanup">3. Port Conflicts &amp; Zombie Process Cleanup</h2>
<h3 id="1-instant-port-identification--termination">1. Instant Port Identification &amp; Termination</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># Locate process on port 8080</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">sudo lsof -i :8080
</span></span><span class="line"><span class="ln">3</span><span class="cl"><span class="c1"># Or</span>
</span></span><span class="line"><span class="ln">4</span><span class="cl">sudo ss -tulnp <span class="p">|</span> grep :8080
</span></span><span class="line"><span class="ln">5</span><span class="cl">
</span></span><span class="line"><span class="ln">6</span><span class="cl"><span class="c1"># Instantly kill whatever is holding the port</span>
</span></span><span class="line"><span class="ln">7</span><span class="cl">sudo fuser -k 8080/tcp
</span></span></code></pre></div><h3 id="2-diagnosing-zombie-processes-z--defunct">2. Diagnosing Zombie Processes (<code>Z</code> / Defunct)</h3>
<p>Zombie processes are already dead, so <code>kill -9 &lt;ZOMBIE_PID&gt;</code> does nothing. You must target the <strong>Parent Process (PPID)</strong>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># 1. List zombie processes</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">ps aux <span class="p">|</span> grep <span class="s1">&#39;Z&#39;</span>
</span></span><span class="line"><span class="ln">3</span><span class="cl">
</span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="c1"># 2. Find the Parent PID (PPID)</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">ps -o <span class="nv">ppid</span><span class="o">=</span> -p &lt;ZOMBIE_PID&gt;
</span></span><span class="line"><span class="ln">6</span><span class="cl">
</span></span><span class="line"><span class="ln">7</span><span class="cl"><span class="c1"># 3. Reload or terminate the parent to let systemd (PID 1) reap the zombie</span>
</span></span><span class="line"><span class="ln">8</span><span class="cl">sudo <span class="nb">kill</span> -HUP &lt;PARENT_PID&gt;
</span></span></code></pre></div><hr>
<h2 id="4-silent-process-termination-linux-kernel-oom-killer">4. Silent Process Termination: Linux Kernel OOM Killer</h2>
<p>When system memory runs out, the Linux kernel invokes the <strong>Out of Memory (OOM) Killer</strong> to terminate resource-heavy processes.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># Check kernel ring buffer for OOM events</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">sudo dmesg -T <span class="p">|</span> grep -i -E <span class="s2">&#34;oom|out of memory|killed process&#34;</span>
</span></span></code></pre></div><p><strong>Remediation</strong>:</p>
<ol>
<li><strong>Add Swap Space</strong> (vital for 1–2GB cloud instances &amp; Raspberry Pis):
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl">sudo fallocate -l 2G /swapfile
</span></span><span class="line"><span class="ln">2</span><span class="cl">sudo chmod <span class="m">600</span> /swapfile
</span></span><span class="line"><span class="ln">3</span><span class="cl">sudo mkswap /swapfile
</span></span><span class="line"><span class="ln">4</span><span class="cl">sudo swapon /swapfile
</span></span><span class="line"><span class="ln">5</span><span class="cl"><span class="nb">echo</span> <span class="s1">&#39;/swapfile none swap sw 0 0&#39;</span> <span class="p">|</span> sudo tee -a /etc/fstab
</span></span></code></pre></div></li>
<li><strong>Configure Memory Limits in Docker / Kubernetes</strong>.</li>
</ol>
<hr>
<h2 id="5-clock-skew-causing-tls--authentication-failures">5. Clock Skew Causing TLS &amp; Authentication Failures</h2>
<p>If system time drifts, HTTPS certificates fail verification and S3/JWT signatures are rejected.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># 1. Inspect time and NTP sync status</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">timedatectl status
</span></span><span class="line"><span class="ln">3</span><span class="cl">
</span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="c1"># 2. Set timezone and enable automatic NTP synchronization</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">sudo timedatectl set-timezone UTC
</span></span><span class="line"><span class="ln">6</span><span class="cl">sudo timedatectl set-ntp <span class="nb">true</span>
</span></span></code></pre></div><hr>
<h2 id="6-macos-homebrew-mirror-acceleration--reset">6. macOS Homebrew Mirror Acceleration &amp; Reset</h2>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln"> 1</span><span class="cl"><span class="c1"># 1. Switch to fast mirror</span>
</span></span><span class="line"><span class="ln"> 2</span><span class="cl"><span class="nb">export</span> <span class="nv">HOMEBREW_API_DOMAIN</span><span class="o">=</span><span class="s2">&#34;https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api&#34;</span>
</span></span><span class="line"><span class="ln"> 3</span><span class="cl"><span class="nb">export</span> <span class="nv">HOMEBREW_BOTTLE_DOMAIN</span><span class="o">=</span><span class="s2">&#34;https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles&#34;</span>
</span></span><span class="line"><span class="ln"> 4</span><span class="cl"><span class="nb">export</span> <span class="nv">HOMEBREW_BREW_GIT_REMOTE</span><span class="o">=</span><span class="s2">&#34;https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git&#34;</span>
</span></span><span class="line"><span class="ln"> 5</span><span class="cl"><span class="nb">export</span> <span class="nv">HOMEBREW_CORE_GIT_REMOTE</span><span class="o">=</span><span class="s2">&#34;https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git&#34;</span>
</span></span><span class="line"><span class="ln"> 6</span><span class="cl">
</span></span><span class="line"><span class="ln"> 7</span><span class="cl"><span class="c1"># 2. Reset back to official defaults</span>
</span></span><span class="line"><span class="ln"> 8</span><span class="cl"><span class="nb">unset</span> HOMEBREW_API_DOMAIN
</span></span><span class="line"><span class="ln"> 9</span><span class="cl"><span class="nb">unset</span> HOMEBREW_BOTTLE_DOMAIN
</span></span><span class="line"><span class="ln">10</span><span class="cl"><span class="nb">export</span> <span class="nv">HOMEBREW_BREW_GIT_REMOTE</span><span class="o">=</span><span class="s2">&#34;https://github.com/Homebrew/brew&#34;</span>
</span></span><span class="line"><span class="ln">11</span><span class="cl"><span class="nb">export</span> <span class="nv">HOMEBREW_CORE_GIT_REMOTE</span><span class="o">=</span><span class="s2">&#34;https://github.com/Homebrew/homebrew-core&#34;</span>
</span></span><span class="line"><span class="ln">12</span><span class="cl">brew update
</span></span></code></pre></div><hr>
<h2 id="conclusion">Conclusion</h2>
<p>Understanding fundamental OS mechanisms transforms troubleshooting from frustrating guesswork into precise, surgical problem-solving.</p>
]]></content:encoded><category>DevOps</category><category>Troubleshooting</category><category>Linux</category><category>macOS</category><category>System Tuning</category><category>Debugging</category></item><item><title>Take Back Control of Reading: An RSS Guide</title><link>/en/rss-guide/</link><pubDate>Mon, 21 Sep 2026 10:00:00 +0800</pubDate><author>Dukang Xu</author><guid isPermaLink="true">/en/rss-guide/</guid><description>In an era driven by recommendation algorithms and information overload, learn how RSS works, discover top cross-platform readers, and build your own clean, distraction-free reading stream.</description><content:encoded><![CDATA[<h2 id="introduction-why-do-we-feel-exhausted-in-the-information-flood">Introduction: Why Do We Feel Exhausted in the Information Flood?</h2>
<p>Unlock your phone, and most social and news apps greet you with algorithm-driven short videos, clickbait headlines, and endless ads. We seem to consume massive amounts of information, yet after hours of mindless scrolling, we are often left feeling depleted and empty.</p>
<p>Under algorithmic feeds:</p>
<ul>
<li><strong>Algorithms decide what you see</strong>: Platforms prioritize sensationalism and emotional triggers over thoughtful, high-value depth.</li>
<li><strong>Consumption is passive and fragmented</strong>: The creators you genuinely care about get buried deep within bloated timelines, while unsolicited content is repeatedly pushed to your screen.</li>
<li><strong>Walled gardens fragment your attention</strong>: To follow different creators, you are forced to juggle dozens of separate apps and ecosystems.</li>
</ul>
<p>Is there a way to <strong>take back control of our reading</strong>—free from algorithmic manipulation, popup ads, sorted purely chronologically, and limited strictly to what we consciously subscribe to?</p>
<p>The answer lies in an open standard that has stood the test of time: <strong>RSS (Really Simple Syndication)</strong>.</p>
<hr>
<h2 id="1-what-is-rss-a-real-world-analogy">1. What is RSS? A Real-World Analogy</h2>
<p>To understand RSS in the simplest terms:</p>
<blockquote>
<p><strong>Algorithmic Feeds</strong> are like walking through a chaotic street market where hawkers constantly shove flyers into your hands and blare loudspeakers with whatever is &ldquo;trending&rdquo;;<br>
<strong>RSS Subscriptions</strong> are like having a <strong>private mailbox</strong> outside your home. You subscribe only to the few newspapers and journals you trust. Every morning, the mail carrier quietly delivers clean editions, ready for you to read whenever you choose.</p>
</blockquote>
<pre tabindex="0"><code class="language-mermaid" data-lang="mermaid">sequenceDiagram
    autonumber
    participant Author as Content Creator / Blog
    participant Feed as RSS Feed (Data Source)
    participant Reader as RSS Reader (Your Private Mailbox)
    participant User as Reader (You)

    Author-&gt;&gt;Feed: Publishes new article / update
    Feed--&gt;&gt;Reader: Quietly fetches XML data
    Reader-&gt;&gt;User: Renders clean, ad-free typography
</code></pre><h3 id="core-benefits-of-rss">Core Benefits of RSS</h3>
<ol>
<li><strong>100% Clean, Zero Algorithmic Interference</strong>: Updates appear in reverse chronological order with no opaque weighting or &ldquo;recommended for you&rdquo; loops.</li>
<li><strong>Zero Ads or Popups</strong>: Your RSS reader parses the core title, body, code blocks, and images, rendering everything in your preferred fonts and color schemes.</li>
<li><strong>One Hub for Everything</strong>: Aggregate independent tech blogs, GitHub releases, news outlets, and academic journals all inside a single reader.</li>
<li><strong>No Clutter, No FOMO</strong>: You don&rsquo;t need push notifications. Open the reader when you&rsquo;re ready; when you close it, it will never interrupt you.</li>
</ol>
<hr>
<h2 id="2-three-steps-to-get-started-with-rss">2. Three Steps to Get Started with RSS</h2>
<p>Getting started with RSS takes just <strong>3 simple steps</strong>:</p>
<pre tabindex="0"><code class="language-mermaid" data-lang="mermaid">flowchart LR
    Step1[&#34;Step 1&lt;br/&gt;Pick an RSS Reader&#34;] --&gt; Step2[&#34;Step 2&lt;br/&gt;Copy the Site&#39;s RSS Link&#34;]
    Step2 --&gt; Step3[&#34;Step 3&lt;br/&gt;Paste &amp; Enjoy Clean Reading&#34;]
</code></pre><hr>
<h3 id="step-1-choose-an-rss-reader">Step 1: Choose an RSS Reader</h3>
<p>Pick a reader suited to your preferred operating systems and devices:</p>
<table>
	<thead>
			<tr>
					<th style="text-align: left">Platform</th>
					<th style="text-align: left">Recommended App</th>
					<th style="text-align: left">Highlights</th>
					<th style="text-align: left">Best For</th>
					<th style="text-align: left">Pricing</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td style="text-align: left"><strong>macOS / iOS</strong></td>
					<td style="text-align: left"><strong>NetNewsWire</strong></td>
					<td style="text-align: left">Native, ultra-fast, energy-efficient, iCloud sync support</td>
					<td style="text-align: left">Apple ecosystem users</td>
					<td style="text-align: left"><strong>100% Free &amp; Open Source</strong></td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Cross-Platform (Web/Win/Mac/Mobile)</strong></td>
					<td style="text-align: left"><strong>Follow</strong></td>
					<td style="text-align: left">Next-gen modern UI, AI summaries, social &amp; multimedia views</td>
					<td style="text-align: left">Users looking for modern aesthetics</td>
					<td style="text-align: left"><strong>Free Public Beta</strong></td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Windows / Mac / Linux</strong></td>
					<td style="text-align: left"><strong>Fluent Reader</strong></td>
					<td style="text-align: left">Modern card/list layout, regex filtering rules, dark mode</td>
					<td style="text-align: left">Desktop power users</td>
					<td style="text-align: left"><strong>100% Free &amp; Open Source</strong></td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Cloud Services</strong></td>
					<td style="text-align: left"><strong>Inoreader / Feedly</strong></td>
					<td style="text-align: left">Instant web access, seamless multi-device sync, rule filtering</td>
					<td style="text-align: left">Users who prefer cloud-hosted setups</td>
					<td style="text-align: left"><strong>Free tier available</strong></td>
			</tr>
	</tbody>
</table>
<blockquote>
<p>💡 <strong>Quick Recommendation</strong>:</p>
<ul>
<li>If you use a <strong>Mac or iPhone</strong>, download the open-source <strong>NetNewsWire</strong> from the App Store.</li>
<li>If you need <strong>seamless syncing across Windows, Mac, and mobile</strong>, sign up for <strong>Inoreader</strong> or try <strong>Follow</strong>.</li>
</ul>
</blockquote>
<hr>
<h3 id="step-2-find-a-websites-rss-url">Step 2: Find a Website&rsquo;s RSS URL</h3>
<p>On sites supporting RSS, you can locate the subscription URL in several ways:</p>
<ol>
<li><strong>The RSS Icon in the Footer</strong>: Look for the broadcast wave icon $\mathbf{((•))}$ or a direct <code>RSS / Feed</code> link.</li>
<li><strong>Standard URL Patterns</strong>: Most technical blogs and static generators (Hugo, WordPress, Ghost) follow predictable conventions:
<ul>
<li><code>https://example.com/index.xml</code> (Hugo blogs, including this site)</li>
<li><code>https://example.com/feed/</code> or <code>https://example.com/rss.xml</code> (WordPress / generic)</li>
<li><code>https://example.com/atom.xml</code></li>
</ul>
</li>
</ol>
<blockquote>
<p>🚀 <strong>Hands-On: Subscribe to &ldquo;空垠尘&rdquo;</strong></p>
<p>Click the <strong>RSS icon</strong> in our footer, or copy our feed URL directly:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="ln">1</span><span class="cl">https://your-domain.com/index.xml
</span></span></code></pre></div></blockquote>
<hr>
<h3 id="step-3-add-to-your-reader">Step 3: Add to Your Reader</h3>
<ol>
<li>Open your RSS reader and click <strong><code>+</code> (Add Feed)</strong>;</li>
<li>Paste the copied link and confirm;</li>
<li>The reader will automatically detect the site name and fetch recent articles for clean, instantaneous reading!</li>
</ol>
<hr>
<h2 id="3-advanced-tips-cultivating-a-high-quality-information-garden">3. Advanced Tips: Cultivating a High-Quality Information Garden</h2>
<h3 id="1-organize-with-simple-folders">1. Organize with Simple Folders</h3>
<p>Avoid dumping dozens of feeds into a single flat list. Create 3 to 4 intuitive folders based on reading rhythm:</p>
<ul>
<li>📁 <strong>Daily Reads</strong>: A select handful of high-signal creators with consistently exceptional writing.</li>
<li>📁 <strong>Tech &amp; Engineering</strong>: Official framework releases, open-source newsletters, and architecture blogs.</li>
<li>📁 <strong>Design &amp; Inspiration</strong>: Visual inspiration, photography, and product craftsmanship.</li>
<li>📁 <strong>Weekend &amp; Leisure</strong>: Long-form essays, book reviews, and thoughtful musings.</li>
</ul>
<h3 id="2-opml-exportimport-your-data-stays-yours">2. OPML Export/Import: Your Data Stays Yours</h3>
<p>One of RSS&rsquo;s greatest strengths is <strong>zero vendor lock-in</strong>.</p>
<p>Any standard reader allows you to export an <code>.opml</code> file (a standard XML outline of your feed URLs). Whenever you switch devices or migrate to a new reader app, simply import your <code>.opml</code> file, and your entire reading library is instantly restored.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-xml" data-lang="xml"><span class="line"><span class="ln">1</span><span class="cl"><span class="c">&lt;!-- OPML Example: Lightweight &amp; Universal --&gt;</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl"><span class="nt">&lt;opml</span> <span class="na">version=</span><span class="s">&#34;2.0&#34;</span><span class="nt">&gt;</span>
</span></span><span class="line"><span class="ln">3</span><span class="cl">  <span class="nt">&lt;body&gt;</span>
</span></span><span class="line"><span class="ln">4</span><span class="cl">    <span class="nt">&lt;outline</span> <span class="na">text=</span><span class="s">&#34;空垠尘&#34;</span> <span class="na">type=</span><span class="s">&#34;rss&#34;</span> <span class="na">xmlUrl=</span><span class="s">&#34;https://your-domain.com/index.xml&#34;</span><span class="nt">/&gt;</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">  <span class="nt">&lt;/body&gt;</span>
</span></span><span class="line"><span class="ln">6</span><span class="cl"><span class="nt">&lt;/opml&gt;</span>
</span></span></code></pre></div><h3 id="3-rss-everything-with-rsshub">3. &ldquo;RSS Everything&rdquo; with RSSHub</h3>
<p>If your favorite creators post on platforms without native RSS support (e.g., Bilibili, GitHub Releases, podcasts, or social platforms), you can use the open-source <strong><a href="https://docs.rsshub.app/">RSSHub</a></strong> service to generate standardized RSS feeds for thousands of web platforms.</p>
<hr>
<h2 id="4-mindful-reading-overcoming-unread-badge-anxiety">4. Mindful Reading: Overcoming Unread Badge Anxiety</h2>
<p>Beginners often feel overwhelmed when unread counts reach hundreds of articles. Keep these two golden rules in mind:</p>
<ol>
<li><strong>RSS is a River, Not a Bucket</strong>:
<ul>
<li>You don&rsquo;t have to drink every drop of water that flows past. Dip a cup when you have time; let the rest flow by when you don&rsquo;t.</li>
<li>Use the <strong>&ldquo;Mark All as Read&rdquo;</strong> button liberally to clear badges with zero guilt.</li>
</ul>
</li>
<li><strong>Prune Regularly</strong>:
<ul>
<li>If a feed no longer sparks interest after a few weeks, unsubscribe immediately.</li>
<li>A curated list of 10 remarkable feeds is infinitely more valuable than 100 noisy ones.</li>
</ul>
</li>
</ol>
<hr>
<h2 id="conclusion-a-quiet-space-in-a-noisy-world">Conclusion: A Quiet Space in a Noisy World</h2>
<p>More information is not always better—<strong>the quality of your attention determines the quality of your thoughts</strong>.</p>
<p>Through RSS, we reclaim the power of choosing what we consume from the algorithms. Pick a handful of authors you respect, make a cup of tea, and enjoy reading in a clean, tranquil space.</p>
<p>Feel free to add this blog to your RSS reader, and we look forward to meeting you in future articles.</p>
]]></content:encoded><category>RSS</category><category>Digital Life</category><category>Productivity</category><category>Reading Guide</category><category>Tools</category></item><item><title>Essential Linux &amp; DevOps Commands Handbook</title><link>/en/linux-commands/</link><pubDate>Thu, 17 Sep 2026 10:00:00 +0800</pubDate><author>Dukang Xu</author><guid isPermaLink="true">/en/linux-commands/</guid><description>A battle-tested handbook summarizing high-frequency commands in modern Linux and DevOps operations: covering SSH key matrices, Crontab pitfalls, symlink mechanics, nsenter container debugging, and modern CLI tools.</description><content:encoded><![CDATA[<h2 id="introduction-why-we-need-a-modern-command-handbook">Introduction: Why We Need a Modern Command Handbook</h2>
<p>The Linux command-line landscape is vast. Developers often resort to copying and pasting commands mechanically, only to get stuck when dealing with edge cases such as multi-host jump setups, stripped-down containers lacking debugging shells, or silent cron job failures.</p>
<p>This handbook is organized around <strong>real-world production scenarios</strong>, condensing essential workflows into 5 high-impact modules.</p>
<pre tabindex="0"><code class="language-mermaid" data-lang="mermaid">graph TD
    Root[&#34;Modern DevOps Command System&#34;]
    
    Root --&gt; A[&#34;1. SSH Matrix &amp; Remote Auth&#34;]
    A --&gt; A1[&#34;Ed25519 Modern Robust Keys&#34;]
    A --&gt; A2[&#34;~/.ssh/config Multi-Host &amp; Jump Hosts&#34;]
    A --&gt; A3[&#34;Local &amp; Dynamic Port Forwarding&#34;]
    
    Root --&gt; B[&#34;2. Scheduled Jobs &amp; Daemons&#34;]
    B --&gt; B1[&#34;Crontab Syntax &amp; Environment Traps&#34;]
    B --&gt; B2[&#34;Supervisord Process Auto-Restart&#34;]
    
    Root --&gt; C[&#34;3. File &amp; Time Management&#34;]
    C --&gt; C1[&#34;ln Symlink Practices &amp; Safe Deletion&#34;]
    C --&gt; C2[&#34;date Formatting &amp; Timestamps&#34;]
    C --&gt; C3[&#34;Disk &amp; RAM Diagnostics (df / du / free)&#34;]
    
    Root --&gt; D[&#34;4. Networking &amp; Namespaces&#34;]
    D --&gt; D1[&#34;lsof &amp; ss Port Identification&#34;]
    D --&gt; D2[&#34;nsenter Container Namespace Entry&#34;]
    
    Root --&gt; E[&#34;5. Modern CLI Toolkit&#34;]
    E --&gt; E1[&#34;ripgrep Blazing Text Search&#34;]
    E --&gt; E2[&#34;fzf Interactive Fuzzy Filtering&#34;]
    E --&gt; E3[&#34;jq Structured JSON Slicing&#34;]
</code></pre><hr>
<h2 id="1-ssh-remote-connections--key-matrices">1. SSH Remote Connections &amp; Key Matrices</h2>
<h3 id="1-modern-ssh-key-generation-ed25519-preferred">1. Modern SSH Key Generation (Ed25519 Preferred)</h3>
<p>Replace legacy RSA 2048/4096 keys with modern <strong>Ed25519</strong> elliptic-curve keys:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># Generate ed25519 key pair</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">ssh-keygen -t ed25519 -C <span class="s2">&#34;your_email@example.com&#34;</span> -f ~/.ssh/id_ed25519
</span></span><span class="line"><span class="ln">3</span><span class="cl">
</span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="c1"># Distribute public key to remote host for passwordless login</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">ssh-copy-id -i ~/.ssh/id_ed25519.pub user@192.168.1.100
</span></span></code></pre></div><h3 id="2-multi-host-management-with-sshconfig">2. Multi-Host Management with <code>~/.ssh/config</code></h3>
<p>Configure aliases in <code>~/.ssh/config</code> to avoid memorizing raw IPs, ports, and credentials:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="ln"> 1</span><span class="cl"># Cloud Server
</span></span><span class="line"><span class="ln"> 2</span><span class="cl">Host cloud
</span></span><span class="line"><span class="ln"> 3</span><span class="cl">    HostName 1.2.3.4
</span></span><span class="line"><span class="ln"> 4</span><span class="cl">    User root
</span></span><span class="line"><span class="ln"> 5</span><span class="cl">    Port 2222
</span></span><span class="line"><span class="ln"> 6</span><span class="cl">    IdentityFile ~/.ssh/id_ed25519
</span></span><span class="line"><span class="ln"> 7</span><span class="cl">
</span></span><span class="line"><span class="ln"> 8</span><span class="cl"># Local Raspberry Pi
</span></span><span class="line"><span class="ln"> 9</span><span class="cl">Host rpi
</span></span><span class="line"><span class="ln">10</span><span class="cl">    HostName 192.168.1.100
</span></span><span class="line"><span class="ln">11</span><span class="cl">    User pi
</span></span><span class="line"><span class="ln">12</span><span class="cl">    IdentityFile ~/.ssh/id_ed25519
</span></span><span class="line"><span class="ln">13</span><span class="cl">
</span></span><span class="line"><span class="ln">14</span><span class="cl"># Jump Host to Internal Network
</span></span><span class="line"><span class="ln">15</span><span class="cl">Host internal-db
</span></span><span class="line"><span class="ln">16</span><span class="cl">    HostName 10.0.0.5
</span></span><span class="line"><span class="ln">17</span><span class="cl">    User dbadmin
</span></span><span class="line"><span class="ln">18</span><span class="cl">    ProxyJump cloud
</span></span></code></pre></div><p>Connect instantly with <code>ssh cloud</code> or <code>ssh internal-db</code>.</p>
<h3 id="3-ssh-port-forwarding">3. SSH Port Forwarding</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># Local Port Forwarding (-L): Map remote DB (3306) to local 13306</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">ssh -N -L 13306:127.0.0.1:3306 user@remote-server
</span></span><span class="line"><span class="ln">3</span><span class="cl">
</span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="c1"># Dynamic SOCKS5 Proxy (-D): Turn remote server into a secure proxy tunnel</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">ssh -N -D <span class="m">10808</span> user@remote-server
</span></span></code></pre></div><hr>
<h2 id="2-cron-jobs--daemon-supervision">2. Cron Jobs &amp; Daemon Supervision</h2>
<h3 id="1-crontab-syntax--critical-pitfalls">1. Crontab Syntax &amp; Critical Pitfalls</h3>
<p>Crontab uses 5 time fields: <code>Minute Hour Day Month Weekday Command</code>.</p>
<blockquote>
<p>⚠️ <strong>Three Major Crontab Pitfalls</strong>:</p>
<ol>
<li><strong>Missing Environment Variables</strong>: Cron runs with a minimal <code>PATH</code>. Always specify <strong>absolute paths</strong> (e.g. <code>/usr/local/bin/python3</code>) or explicitly export <code>PATH</code> in your script.</li>
<li><strong>Working Directory</strong>: Cron executes in the user&rsquo;s home directory by default. Always <code>cd /path/to/workdir</code> inside scripts.</li>
<li><strong>Silent Output Loss</strong>: Always redirect stdout and stderr to a log file:
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="m">0</span> <span class="m">3</span> * * * /usr/bin/bash /opt/backup.sh &gt;&gt; /var/log/backup.log 2&gt;<span class="p">&amp;</span><span class="m">1</span>
</span></span></code></pre></div></li>
</ol>
</blockquote>
<h3 id="2-process-supervision-with-supervisord">2. Process Supervision with Supervisord</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-ini" data-lang="ini"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1">; /etc/supervisor/conf.d/my-app.conf</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl"><span class="k">[program:my-app]</span>
</span></span><span class="line"><span class="ln">3</span><span class="cl"><span class="na">directory</span><span class="o">=</span><span class="s">/opt/my-app</span>
</span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="na">command</span><span class="o">=</span><span class="s">/usr/bin/python3 app.py</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl"><span class="na">autostart</span><span class="o">=</span><span class="s">true</span>
</span></span><span class="line"><span class="ln">6</span><span class="cl"><span class="na">autorestart</span><span class="o">=</span><span class="s">true</span>
</span></span><span class="line"><span class="ln">7</span><span class="cl"><span class="na">stderr_logfile</span><span class="o">=</span><span class="s">/var/log/my-app.err.log</span>
</span></span><span class="line"><span class="ln">8</span><span class="cl"><span class="na">stdout_logfile</span><span class="o">=</span><span class="s">/var/log/my-app.out.log</span>
</span></span><span class="line"><span class="ln">9</span><span class="cl"><span class="na">user</span><span class="o">=</span><span class="s">www-data</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl">sudo supervisorctl reread
</span></span><span class="line"><span class="ln">2</span><span class="cl">sudo supervisorctl update
</span></span><span class="line"><span class="ln">3</span><span class="cl">sudo supervisorctl status
</span></span></code></pre></div><hr>
<h2 id="3-symlinks--system-timestamps">3. Symlinks &amp; System Timestamps</h2>
<h3 id="1-symbolic-links-ln--s">1. Symbolic Links (<code>ln -s</code>)</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># Create symbolic link: ln -s &lt;target_path&gt; &lt;link_name&gt;</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">ln -s /mnt/data/music ~/Music
</span></span><span class="line"><span class="ln">3</span><span class="cl">
</span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="c1"># Safe deletion: Never include a trailing slash when removing a symlink!</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">rm ~/Music      <span class="c1"># Correct: deletes the link</span>
</span></span><span class="line"><span class="ln">6</span><span class="cl">rm -rf ~/Music/ <span class="c1"># Dangerous: might delete real contents in the target directory!</span>
</span></span></code></pre></div><h3 id="2-date-formatting--timestamp-conversion">2. <code>date</code> Formatting &amp; Timestamp Conversion</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># Format current standard time</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">date +<span class="s2">&#34;%Y-%m-%d %H:%M:%S&#34;</span>
</span></span><span class="line"><span class="ln">3</span><span class="cl">
</span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="c1"># Convert Unix timestamp to human-readable date</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">date -d @1727258400 +<span class="s2">&#34;%Y-%m-%d %H:%M:%S&#34;</span>  <span class="c1"># (Linux)</span>
</span></span><span class="line"><span class="ln">6</span><span class="cl">date -r <span class="m">1727258400</span> +<span class="s2">&#34;%Y-%m-%d %H:%M:%S&#34;</span>  <span class="c1"># (macOS)</span>
</span></span></code></pre></div><hr>
<h2 id="4-container-namespace-penetration-nsenter">4. Container Namespace Penetration (<code>nsenter</code>)</h2>
<p>Minimal container images (e.g., Distroless, Alpine) often lack <code>bash</code>, <code>curl</code>, or network debugging utilities. Use <strong><code>nsenter</code></strong> to enter the container&rsquo;s namespaces directly from the host:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln"> 1</span><span class="cl"><span class="c1"># 1. Get container PID on the host</span>
</span></span><span class="line"><span class="ln"> 2</span><span class="cl"><span class="nv">PID</span><span class="o">=</span><span class="k">$(</span>docker inspect --format <span class="s1">&#39;{{ .State.Pid }}&#39;</span> &lt;container_name_or_id&gt;<span class="k">)</span>
</span></span><span class="line"><span class="ln"> 3</span><span class="cl">
</span></span><span class="line"><span class="ln"> 4</span><span class="cl"><span class="c1"># 2. Enter container network namespace only</span>
</span></span><span class="line"><span class="ln"> 5</span><span class="cl"><span class="c1"># Use host utilities directly inside the container&#39;s network stack!</span>
</span></span><span class="line"><span class="ln"> 6</span><span class="cl">sudo nsenter -t <span class="nv">$PID</span> -n ss -tulnp
</span></span><span class="line"><span class="ln"> 7</span><span class="cl">sudo nsenter -t <span class="nv">$PID</span> -n tcpdump -i eth0 port <span class="m">80</span>
</span></span><span class="line"><span class="ln"> 8</span><span class="cl">
</span></span><span class="line"><span class="ln"> 9</span><span class="cl"><span class="c1"># 3. Enter all container namespaces</span>
</span></span><span class="line"><span class="ln">10</span><span class="cl">sudo nsenter -t <span class="nv">$PID</span> -m -u -i -n -p
</span></span></code></pre></div><hr>
<h2 id="5-modern-cli-toolkit">5. Modern CLI Toolkit</h2>
<table>
	<thead>
			<tr>
					<th style="text-align: left">Task</th>
					<th style="text-align: left">Traditional Tool</th>
					<th style="text-align: left">Modern Alternative</th>
					<th style="text-align: left">Advantage</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td style="text-align: left"><strong>Code / Text Search</strong></td>
					<td style="text-align: left"><code>grep -r</code></td>
					<td style="text-align: left"><strong><code>rg</code> (ripgrep)</strong></td>
					<td style="text-align: left">Rust-based, multithreaded, respects <code>.gitignore</code></td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Fuzzy Search</strong></td>
					<td style="text-align: left">Paging tools</td>
					<td style="text-align: left"><strong><code>fzf</code></strong></td>
					<td style="text-align: left">Interactive fuzzy matching for files, history, commits</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>JSON Processing</strong></td>
					<td style="text-align: left">Manual parsing</td>
					<td style="text-align: left"><strong><code>jq</code></strong></td>
					<td style="text-align: left">Structured filtering and slice extraction</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Disk Space Analysis</strong></td>
					<td style="text-align: left"><code>du -sh *</code></td>
					<td style="text-align: left"><strong><code>ncdu</code> / <code>dust</code></strong></td>
					<td style="text-align: left">Interactive visual disk usage explorer</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>System Monitoring</strong></td>
					<td style="text-align: left"><code>top</code></td>
					<td style="text-align: left"><strong><code>btop</code> / <code>htop</code></strong></td>
					<td style="text-align: left">Modern dashboard for CPU, RAM, network, and process tree</td>
			</tr>
	</tbody>
</table>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># Power One-Liners:</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">rg <span class="s2">&#34;DATABASE_URL&#34;</span> /opt/projects/
</span></span><span class="line"><span class="ln">3</span><span class="cl"><span class="nb">history</span> <span class="p">|</span> fzf
</span></span><span class="line"><span class="ln">4</span><span class="cl">sudo lsof -i :8080
</span></span></code></pre></div>]]></content:encoded><category>Linux</category><category>DevOps</category><category>CLI</category><category>SSH</category><category>Operations</category><category>Productivity</category></item><item><title>Raspberry Pi HomeLab Setup and Tuning</title><link>/en/raspberry-pi/</link><pubDate>Sun, 13 Sep 2026 10:00:00 +0800</pubDate><author>Dukang Xu</author><guid isPermaLink="true">/en/raspberry-pi/</guid><description>A complete hands-on guide covering headless OS flashing, mirror optimization, external SSD persistent mounting with UUID, GPIO-based PWM smart fan thermal control, and Docker HomeLab environment setup.</description><content:encoded><![CDATA[<h2 id="introduction-why-the-raspberry-pi-is-the-ideal-mini-home-server">Introduction: Why the Raspberry Pi is the Ideal Mini Home Server</h2>
<p>The Raspberry Pi, with its ultra-low power consumption (2–5W at idle), silent operation, and extensive GPIO expansion capabilities, is the top choice for developers and tinkerers building a 24/7 <strong>HomeLab / Mini Server</strong>.</p>
<p>However, setting up a reliable Raspberry Pi server from scratch often involves common pitfalls:</p>
<ul>
<li>Operating without an external monitor or keyboard (<strong>Headless Setup</strong>);</li>
<li>Slow package downloads and tricky mirror configurations;</li>
<li>External drives changing drive letters or losing permissions after reboot;</li>
<li>Thermal throttling under load or loud fans running at 100% all day.</li>
</ul>
<p>This comprehensive guide brings together battle-tested practices covering <strong>OS Installation</strong>, <strong>Storage Expansion</strong>, <strong>Thermal Management</strong>, and <strong>Docker Infrastructure</strong>.</p>
<pre tabindex="0"><code class="language-mermaid" data-lang="mermaid">flowchart TD
    A[&#34;1. Headless OS Flashing&lt;br/&gt;(SSH &amp; Wi-Fi Preconfiguration)&#34;] --&gt; B[&#34;2. System Mirror &amp; Network Tuning&lt;br/&gt;(APT Acceleration / Static IP)&#34;]
    B --&gt; C[&#34;3. External SSD Mounting&lt;br/&gt;(UUID / fstab / Permissions)&#34;]
    C --&gt; D[&#34;4. GPIO Thermal Fan Control&lt;br/&gt;(PWM Regulation / Silent Operation)&#34;]
    D --&gt; E[&#34;5. Docker &amp; HomeLab Stack&lt;br/&gt;(Compose / Container Matrix)&#34;]
</code></pre><hr>
<h2 id="1-headless-os-flashing--setup-no-monitor-needed">1. Headless OS Flashing &amp; Setup (No Monitor Needed)</h2>
<h3 id="1-flash-the-os-raspberry-pi-os-lite--ubuntu-server">1. Flash the OS (Raspberry Pi OS Lite / Ubuntu Server)</h3>
<p>Use the official <strong><a href="https://www.raspberrypi.com/software/">Raspberry Pi Imager</a></strong>:</p>
<ol>
<li><strong>Choose OS</strong>: Select <code>Raspberry Pi OS Lite (64-bit)</code> or <code>Ubuntu Server (64-bit)</code>. The Lite version is headless and takes up only ~100MB of RAM.</li>
<li><strong>Advanced Settings</strong>: Click the gear icon or press <code>Ctrl + Shift + X</code> (<code>Cmd + Shift + X</code> on macOS):
<ul>
<li>Check <strong>Set hostname</strong> (e.g., <code>rpi-server</code>);</li>
<li>Check <strong>Enable SSH</strong> (set username/password or inject your SSH public key);</li>
<li>Check <strong>Configure wireless LAN</strong> (enter your Wi-Fi SSID and password);</li>
<li>Set Timezone.</li>
</ul>
</li>
<li>Flash the image onto your microSD card or USB SSD.</li>
</ol>
<h3 id="2-first-boot--ssh-remote-access">2. First Boot &amp; SSH Remote Access</h3>
<p>Insert the card and power on your Raspberry Pi. Wait 1–2 minutes, then connect from your terminal:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># Connect using mDNS hostname</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">ssh your_username@rpi-server.local
</span></span><span class="line"><span class="ln">3</span><span class="cl">
</span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="c1"># Or connect via the assigned local IP</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">ssh your_username@192.168.1.100
</span></span></code></pre></div><hr>
<h2 id="2-package-mirror-acceleration--basic-utilities">2. Package Mirror Acceleration &amp; Basic Utilities</h2>
<p>Update your APT package sources to a fast nearby mirror to speed up installations:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># Backup original sources</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
</span></span><span class="line"><span class="ln">3</span><span class="cl">
</span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="c1"># Update repositories and upgrade packages</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">sudo apt update <span class="o">&amp;&amp;</span> sudo apt upgrade -y
</span></span><span class="line"><span class="ln">6</span><span class="cl">
</span></span><span class="line"><span class="ln">7</span><span class="cl"><span class="c1"># Install essential admin tools</span>
</span></span><span class="line"><span class="ln">8</span><span class="cl">sudo apt install -y curl wget git vim htop zsh tmux net-tools ufw
</span></span></code></pre></div><hr>
<h2 id="3-persistent-external-ssd--hdd-mounting-via-uuid">3. Persistent External SSD / HDD Mounting via UUID</h2>
<p>microSD cards have limited write endurance and random I/O throughput. Connecting an external USB SSD or HDD for persistent data storage is highly recommended.</p>
<pre tabindex="0"><code class="language-mermaid" data-lang="mermaid">sequenceDiagram
    autonumber
    participant USB as External Drive / SSD
    participant Kernel as Linux Kernel
    participant Fstab as /etc/fstab Config
    participant Mount as Mount Point (/mnt/data)

    Kernel-&gt;&gt;USB: Reads Unique Device UUID
    Fstab-&gt;&gt;Kernel: Parses mount rules on boot (nofail, UUID, ext4)
    Kernel-&gt;&gt;Mount: Mounts directory &amp; assigns permissions
</code></pre><h3 id="1-find-the-drives-unique-uuid">1. Find the Drive&rsquo;s Unique UUID</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># List all block devices and filesystems</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">lsblk -f
</span></span></code></pre></div><p>Example output:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="ln">1</span><span class="cl">NAME        FSTYPE FSVER LABEL  UUID                                 MOUNTPOINT
</span></span><span class="line"><span class="ln">2</span><span class="cl">sda
</span></span><span class="line"><span class="ln">3</span><span class="cl">└─sda1      ext4   1.0   DATA   e58f2371-d41a-4d7a-8b8a-927164b18210
</span></span></code></pre></div><blockquote>
<p>⚠️ <strong>Warning</strong>: Never use device names like <code>/dev/sda1</code> in <code>fstab</code>. If other USB devices are plugged in, device paths can change and cause boot failures. Always use the <strong>UUID</strong>.</p>
</blockquote>
<h3 id="2-create-mount-point--edit-etcfstab">2. Create Mount Point &amp; Edit <code>/etc/fstab</code></h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># 1. Create target mount directory</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">sudo mkdir -p /mnt/data
</span></span><span class="line"><span class="ln">3</span><span class="cl">
</span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="c1"># 2. Edit fstab configuration</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">sudo vim /etc/fstab
</span></span></code></pre></div><p>Append the following line to the end of the file:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="ln">1</span><span class="cl">UUID=e58f2371-d41a-4d7a-8b8a-927164b18210     /mnt/data       ext4    defaults,nofail,noatime 0       2
</span></span></code></pre></div><blockquote>
<p>💡 <strong>Key Options</strong>:</p>
<ul>
<li><code>defaults</code>: Standard read/write privileges.</li>
<li><code>nofail</code>: <strong>Crucial</strong>! If the drive is disconnected, the system will continue booting normally without hanging.</li>
<li><code>noatime</code>: Disables access timestamp updates on reads, prolonging drive life.</li>
</ul>
</blockquote>
<h3 id="3-apply-mount--fix-permissions">3. Apply Mount &amp; Fix Permissions</h3>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1"># Test mount configuration without rebooting</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">sudo mount -a
</span></span><span class="line"><span class="ln">3</span><span class="cl">
</span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="c1"># Assign directory ownership to your user</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">sudo chown -R <span class="nv">$USER</span>:<span class="nv">$USER</span> /mnt/data
</span></span></code></pre></div><hr>
<h2 id="4-hardware-cooling-smart-gpio-fan-temperature-control">4. Hardware Cooling: Smart GPIO Fan Temperature Control</h2>
<p>To avoid thermal throttling while keeping your HomeLab whisper-quiet, use a simple Python script to regulate fan speed via GPIO.</p>
<h3 id="1-wiring-schema">1. Wiring Schema</h3>
<ul>
<li><strong>Fan Positive (Red)</strong> $\rightarrow$ 5V (Pin 4) or 3.3V (Pin 1)</li>
<li><strong>Fan Negative (Black)</strong> $\rightarrow$ Collector of NPN Transistor (e.g., S8050) to GND (Pin 6)</li>
<li><strong>Transistor Base</strong> $\rightarrow$ GPIO 14 (Pin 8, TXD)</li>
</ul>
<h3 id="2-smart-fan-daemon-script-temp_controlpy">2. Smart Fan Daemon Script (<code>temp_control.py</code>)</h3>
<p>Create <code>/usr/local/bin/temp_control.py</code>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="ln"> 1</span><span class="cl"><span class="ch">#!/usr/bin/env python3</span>
</span></span><span class="line"><span class="ln"> 2</span><span class="cl"><span class="c1"># -*- coding: utf-8 -*-</span>
</span></span><span class="line"><span class="ln"> 3</span><span class="cl"><span class="kn">import</span> <span class="nn">time</span>
</span></span><span class="line"><span class="ln"> 4</span><span class="cl"><span class="kn">import</span> <span class="nn">os</span>
</span></span><span class="line"><span class="ln"> 5</span><span class="cl"><span class="kn">import</span> <span class="nn">RPi.GPIO</span> <span class="k">as</span> <span class="nn">GPIO</span>
</span></span><span class="line"><span class="ln"> 6</span><span class="cl">
</span></span><span class="line"><span class="ln"> 7</span><span class="cl"><span class="n">FAN_PIN</span> <span class="o">=</span> <span class="mi">14</span>          <span class="c1"># GPIO Pin BCM 14</span>
</span></span><span class="line"><span class="ln"> 8</span><span class="cl"><span class="n">TEMP_HIGH</span> <span class="o">=</span> <span class="mf">55.0</span>      <span class="c1"># Turn on fan above 55°C</span>
</span></span><span class="line"><span class="ln"> 9</span><span class="cl"><span class="n">TEMP_LOW</span> <span class="o">=</span> <span class="mf">45.0</span>       <span class="c1"># Turn off fan below 45°C</span>
</span></span><span class="line"><span class="ln">10</span><span class="cl">
</span></span><span class="line"><span class="ln">11</span><span class="cl"><span class="n">GPIO</span><span class="o">.</span><span class="n">setwarnings</span><span class="p">(</span><span class="kc">False</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">12</span><span class="cl"><span class="n">GPIO</span><span class="o">.</span><span class="n">setmode</span><span class="p">(</span><span class="n">GPIO</span><span class="o">.</span><span class="n">BCM</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">13</span><span class="cl"><span class="n">GPIO</span><span class="o">.</span><span class="n">setup</span><span class="p">(</span><span class="n">FAN_PIN</span><span class="p">,</span> <span class="n">GPIO</span><span class="o">.</span><span class="n">OUT</span><span class="p">,</span> <span class="n">initial</span><span class="o">=</span><span class="n">GPIO</span><span class="o">.</span><span class="n">LOW</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">14</span><span class="cl">
</span></span><span class="line"><span class="ln">15</span><span class="cl"><span class="k">def</span> <span class="nf">get_cpu_temp</span><span class="p">():</span>
</span></span><span class="line"><span class="ln">16</span><span class="cl">    <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">&#34;/sys/class/thermal/thermal_zone0/temp&#34;</span><span class="p">,</span> <span class="s2">&#34;r&#34;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
</span></span><span class="line"><span class="ln">17</span><span class="cl">        <span class="k">return</span> <span class="nb">float</span><span class="p">(</span><span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">())</span> <span class="o">/</span> <span class="mf">1000.0</span>
</span></span><span class="line"><span class="ln">18</span><span class="cl">
</span></span><span class="line"><span class="ln">19</span><span class="cl"><span class="k">try</span><span class="p">:</span>
</span></span><span class="line"><span class="ln">20</span><span class="cl">    <span class="n">fan_state</span> <span class="o">=</span> <span class="kc">False</span>
</span></span><span class="line"><span class="ln">21</span><span class="cl">    <span class="k">while</span> <span class="kc">True</span><span class="p">:</span>
</span></span><span class="line"><span class="ln">22</span><span class="cl">        <span class="n">temp</span> <span class="o">=</span> <span class="n">get_cpu_temp</span><span class="p">()</span>
</span></span><span class="line"><span class="ln">23</span><span class="cl">        <span class="k">if</span> <span class="n">temp</span> <span class="o">&gt;=</span> <span class="n">TEMP_HIGH</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">fan_state</span><span class="p">:</span>
</span></span><span class="line"><span class="ln">24</span><span class="cl">            <span class="n">GPIO</span><span class="o">.</span><span class="n">output</span><span class="p">(</span><span class="n">FAN_PIN</span><span class="p">,</span> <span class="n">GPIO</span><span class="o">.</span><span class="n">HIGH</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">25</span><span class="cl">            <span class="n">fan_state</span> <span class="o">=</span> <span class="kc">True</span>
</span></span><span class="line"><span class="ln">26</span><span class="cl">        <span class="k">elif</span> <span class="n">temp</span> <span class="o">&lt;=</span> <span class="n">TEMP_LOW</span> <span class="ow">and</span> <span class="n">fan_state</span><span class="p">:</span>
</span></span><span class="line"><span class="ln">27</span><span class="cl">            <span class="n">GPIO</span><span class="o">.</span><span class="n">output</span><span class="p">(</span><span class="n">FAN_PIN</span><span class="p">,</span> <span class="n">GPIO</span><span class="o">.</span><span class="n">LOW</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">28</span><span class="cl">            <span class="n">fan_state</span> <span class="o">=</span> <span class="kc">False</span>
</span></span><span class="line"><span class="ln">29</span><span class="cl">        <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">30</span><span class="cl"><span class="k">except</span> <span class="ne">KeyboardInterrupt</span><span class="p">:</span>
</span></span><span class="line"><span class="ln">31</span><span class="cl">    <span class="n">GPIO</span><span class="o">.</span><span class="n">cleanup</span><span class="p">()</span>
</span></span></code></pre></div><h3 id="3-register-as-a-systemd-service">3. Register as a Systemd Service</h3>
<p>Create <code>/etc/systemd/system/fan-control.service</code>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-ini" data-lang="ini"><span class="line"><span class="ln"> 1</span><span class="cl"><span class="k">[Unit]</span>
</span></span><span class="line"><span class="ln"> 2</span><span class="cl"><span class="na">Description</span><span class="o">=</span><span class="s">Raspberry Pi Smart Fan Temperature Control</span>
</span></span><span class="line"><span class="ln"> 3</span><span class="cl"><span class="na">After</span><span class="o">=</span><span class="s">multi-user.target</span>
</span></span><span class="line"><span class="ln"> 4</span><span class="cl">
</span></span><span class="line"><span class="ln"> 5</span><span class="cl"><span class="k">[Service]</span>
</span></span><span class="line"><span class="ln"> 6</span><span class="cl"><span class="na">Type</span><span class="o">=</span><span class="s">simple</span>
</span></span><span class="line"><span class="ln"> 7</span><span class="cl"><span class="na">ExecStart</span><span class="o">=</span><span class="s">/usr/bin/python3 /usr/local/bin/temp_control.py</span>
</span></span><span class="line"><span class="ln"> 8</span><span class="cl"><span class="na">Restart</span><span class="o">=</span><span class="s">always</span>
</span></span><span class="line"><span class="ln"> 9</span><span class="cl"><span class="na">RestartSec</span><span class="o">=</span><span class="s">10</span>
</span></span><span class="line"><span class="ln">10</span><span class="cl">
</span></span><span class="line"><span class="ln">11</span><span class="cl"><span class="k">[Install]</span>
</span></span><span class="line"><span class="ln">12</span><span class="cl"><span class="na">WantedBy</span><span class="o">=</span><span class="s">multi-user.target</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln">1</span><span class="cl">sudo systemctl daemon-reload
</span></span><span class="line"><span class="ln">2</span><span class="cl">sudo systemctl <span class="nb">enable</span> --now fan-control.service
</span></span></code></pre></div><hr>
<h2 id="5-docker--modern-container-matrix-setup">5. Docker &amp; Modern Container Matrix Setup</h2>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="ln"> 1</span><span class="cl"><span class="c1"># 1. Install Docker via official convenience script</span>
</span></span><span class="line"><span class="ln"> 2</span><span class="cl">curl -fsSL https://get.docker.com <span class="p">|</span> bash
</span></span><span class="line"><span class="ln"> 3</span><span class="cl">
</span></span><span class="line"><span class="ln"> 4</span><span class="cl"><span class="c1"># 2. Add current user to docker group</span>
</span></span><span class="line"><span class="ln"> 5</span><span class="cl">sudo usermod -aG docker <span class="nv">$USER</span>
</span></span><span class="line"><span class="ln"> 6</span><span class="cl">
</span></span><span class="line"><span class="ln"> 7</span><span class="cl"><span class="c1"># 3. Install Docker Compose plugin</span>
</span></span><span class="line"><span class="ln"> 8</span><span class="cl">sudo apt install -y docker-compose-plugin
</span></span><span class="line"><span class="ln"> 9</span><span class="cl">
</span></span><span class="line"><span class="ln">10</span><span class="cl"><span class="c1"># 4. Configure Docker log rotation to protect disk space</span>
</span></span><span class="line"><span class="ln">11</span><span class="cl">sudo mkdir -p /etc/docker
</span></span><span class="line"><span class="ln">12</span><span class="cl">sudo tee /etc/docker/daemon.json <span class="s">&lt;&lt;-&#39;EOF&#39;
</span></span></span><span class="line"><span class="ln">13</span><span class="cl"><span class="s">{
</span></span></span><span class="line"><span class="ln">14</span><span class="cl"><span class="s">  &#34;log-driver&#34;: &#34;json-file&#34;,
</span></span></span><span class="line"><span class="ln">15</span><span class="cl"><span class="s">  &#34;log-opts&#34;: {
</span></span></span><span class="line"><span class="ln">16</span><span class="cl"><span class="s">    &#34;max-size&#34;: &#34;20m&#34;,
</span></span></span><span class="line"><span class="ln">17</span><span class="cl"><span class="s">    &#34;max-file&#34;: &#34;3&#34;
</span></span></span><span class="line"><span class="ln">18</span><span class="cl"><span class="s">  }
</span></span></span><span class="line"><span class="ln">19</span><span class="cl"><span class="s">}
</span></span></span><span class="line"><span class="ln">20</span><span class="cl"><span class="s">EOF</span>
</span></span><span class="line"><span class="ln">21</span><span class="cl">
</span></span><span class="line"><span class="ln">22</span><span class="cl">sudo systemctl restart docker
</span></span></code></pre></div><hr>
<h2 id="conclusion">Conclusion</h2>
<p>With these five steps, your Raspberry Pi transforms into an <strong>ultra-low-power, whisper-quiet, reliable, and production-ready mini server</strong> ready to host your media, backup, and self-hosted tools.</p>
]]></content:encoded><category>Raspberry Pi</category><category>HomeLab</category><category>Linux</category><category>Hardware</category><category>Docker</category><category>Server</category></item><item><title>Markdown Typography and Advanced Extensions</title><link>/en/markdown-guide/</link><pubDate>Wed, 09 Sep 2026 10:00:00 +0800</pubDate><author>Dukang Xu</author><guid isPermaLink="true">/en/markdown-guide/</guid><description>A comprehensive guide to core Markdown typography standards, bilingual spacing aesthetics, and engineering practices for mathematical equations (LaTeX) and architecture diagrams (Mermaid).</description><content:encoded><![CDATA[<h2 id="introduction-the-elegant-power-of-plain-text">Introduction: The Elegant Power of Plain Text</h2>
<p>In 2004, John Gruber and Aaron Swartz invented Markdown with a clean design goal: &ldquo;<strong>To enable people to write using an easy-to-read, easy-to-write plain text format, and optionally convert it to structurally valid XHTML or HTML.</strong>&rdquo;</p>
<p>In modern software engineering and technical writing, Markdown has become the de facto universal standard. From GitHub <code>README.md</code> files and technical blog posts to internal system architecture documentation, developers love Markdown for its minimal cognitive load and seamless version-control friendliness.</p>
<p>However, in practice, there is a massive gap between simply &ldquo;writing Markdown&rdquo; and &ldquo;crafting clean, consistent, and highly readable Markdown&rdquo;. This article explores best practices across three core dimensions: <strong>Core Typography Guidelines</strong>, <strong>Spacing and Punctuation Aesthetics</strong>, and <strong>Advanced Extensions (LaTeX Math &amp; Mermaid Diagrams)</strong>.</p>
<hr>
<h2 id="1-core-markdown-typography-guidelines">1. Core Markdown Typography Guidelines</h2>
<h3 id="11-semantic-heading-hierarchy">1.1 Semantic Heading Hierarchy</h3>
<p>Headings serve as the single source of truth for document outlines and Table of Contents (TOC) generation:</p>
<ul>
<li><strong>H1 (<code>#</code>)</strong>: Use only once per article (typically rendered automatically from the frontmatter <code>title</code>);</li>
<li><strong>H2 (<code>##</code>)</strong>: Represents top-level thematic sections;</li>
<li><strong>H3 (<code>###</code>)</strong>: Represents specific sub-modules within a section;</li>
<li><strong>Never skip heading levels</strong>: Jumping directly from <code>##</code> to <code>####</code> breaks automated TOC hierarchies and screen readers.</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="ln">1</span><span class="cl"><span class="cm">&lt;!-- Correct: Strict step-by-step hierarchy --&gt;</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl"><span class="gu">## 1. Architecture Design Principles
</span></span></span><span class="line"><span class="ln">3</span><span class="cl"><span class="gu">### 1.1 Single Responsibility
</span></span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="gu">### 1.2 Open-Closed
</span></span></span><span class="line"><span class="ln">5</span><span class="cl">
</span></span><span class="line"><span class="ln">6</span><span class="cl"><span class="cm">&lt;!-- Incorrect: Skipping levels breaks structure --&gt;</span>
</span></span><span class="line"><span class="ln">7</span><span class="cl"><span class="gu">## 1. Architecture Design Principles
</span></span></span><span class="line"><span class="ln">8</span><span class="cl"><span class="gu">#### 1.1 Single Responsibility (Skipped H3)
</span></span></span></code></pre></div><hr>
<h3 id="12-list-formatting--indentation">1.2 List Formatting &amp; Indentation</h3>
<p>Lists structure disparate points cleanly. Spacing and indentation are key to maintaining list consistency:</p>
<ul>
<li><strong>Unordered Lists</strong>: Stick to <code>-</code> globally across your articles; avoid mixing <code>*</code>, <code>+</code>, and <code>-</code>;</li>
<li><strong>Nested Indentation</strong>: Indent child lists by <strong>2 or 4 spaces</strong> relative to their parent (2 spaces recommended);</li>
<li><strong>List Spacing</strong>: Keep simple list items compact without blank lines; use loose spacing only when items contain multiple paragraphs or code blocks.</li>
</ul>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="ln">1</span><span class="cl"><span class="k">-</span> **Core Middleware Layer**
</span></span><span class="line"><span class="ln">2</span><span class="cl">  <span class="k">-</span> Authentication Guard (JWT / WebAuthn verification)
</span></span><span class="line"><span class="ln">3</span><span class="cl">  <span class="k">-</span> Rate Limiting Middleware (Token Bucket algorithm)
</span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="k">-</span> **Persistence Layer**
</span></span><span class="line"><span class="ln">5</span><span class="cl">  <span class="k">-</span> SQLite WAL Relational Database
</span></span><span class="line"><span class="ln">6</span><span class="cl">  <span class="k">-</span> Global Read-only KV Cache
</span></span></code></pre></div><hr>
<h3 id="13-code-blocks-and-syntax-highlighting">1.3 Code Blocks and Syntax Highlighting</h3>
<p>Code blocks are central to technical documentation:</p>
<ol>
<li><strong>Explicit Language Identifiers</strong>: Always declare language identifiers (e.g. <code>go</code>, <code>typescript</code>, <code>rust</code>, <code>bash</code>, <code>json</code>, <code>sql</code>) after the opening triple backticks. This triggers Chroma syntax highlighting, displays language badges, and powers one-click copy buttons;</li>
<li><strong>Inline vs. Block Code</strong>:
<ul>
<li>File paths (<code>/etc/hosts</code>), flags (<code>--minify</code>), and identifiers (<code>userToken</code>) belong in single backticks;</li>
<li>Multi-line snippets belong in standalone fenced code blocks.</li>
</ul>
</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-typescript" data-lang="typescript"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1">// Explicit language tag: typescript
</span></span></span><span class="line"><span class="ln">2</span><span class="cl"><span class="kr">interface</span> <span class="nx">UserSession</span> <span class="p">{</span>
</span></span><span class="line"><span class="ln">3</span><span class="cl">  <span class="nx">userId</span>: <span class="kt">string</span><span class="p">;</span>
</span></span><span class="line"><span class="ln">4</span><span class="cl">  <span class="nx">role</span><span class="o">:</span> <span class="s2">&#34;admin&#34;</span> <span class="o">|</span> <span class="s2">&#34;member&#34;</span><span class="p">;</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">  <span class="nx">expiresAt</span>: <span class="kt">number</span><span class="p">;</span>
</span></span><span class="line"><span class="ln">6</span><span class="cl"><span class="p">}</span>
</span></span></code></pre></div><hr>
<h3 id="14-blockquote-hierarchy">1.4 Blockquote Hierarchy</h3>
<p>Blockquotes highlight quotations, important notices, core conclusions, or architectural axioms:</p>
<blockquote>
<p><strong>Core Design Principle</strong>:</p>
<p>&ldquo;Simplicity is prerequisite for reliability. The best code is often the code you didn&rsquo;t have to write.&rdquo;</p>
<blockquote>
<p><em>— Edsger W. Dijkstra</em></p>
</blockquote>
</blockquote>
<hr>
<h2 id="2-punctuation--spacing-aesthetics">2. Punctuation &amp; Spacing Aesthetics</h2>
<p>Professional documentation pays meticulous attention to subtle typographic details:</p>
<ol>
<li><strong>Spacing Between Scripts</strong>: Maintain clean spacing when mixing different scripts (e.g. Latin letters and CJK characters);</li>
<li><strong>Punctuation Accuracy</strong>: Use standard punctuation consistent with the primary sentence language;</li>
<li><strong>Emphasis Flanking</strong>: Ensure bold (<code>**word**</code>) and italic (<code>*word*</code>) markers hug content without broken inner whitespace.</li>
</ol>
<hr>
<h2 id="3-advanced-markdown-extensions-in-action">3. Advanced Markdown Extensions in Action</h2>
<p>By embedding KaTeX and Mermaid renderers, a pure static blog can natively render intricate mathematical equations and software architecture diagrams without relying on static images.</p>
<h3 id="31-native-latex--katex-mathematical-typesetting">3.1 Native LaTeX / KaTeX Mathematical Typesetting</h3>
<p>Write standard LaTeX directly in Markdown for crisp, high-resolution formula rendering.</p>
<h4 id="inline-math">Inline Math</h4>
<p>Wrap inline formulas with single dollar signs <code>$</code>:</p>
<ul>
<li>Mass-energy equivalence: $E = mc^2$</li>
<li>Euler&rsquo;s identity: $e^{i\pi} + 1 = 0$</li>
<li>Normal distribution PDF: $f(x) = \frac{1}{\sigma\sqrt{2\pi}} e^{-\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2}$</li>
</ul>
<h4 id="display-math-block-equations">Display Math (Block Equations)</h4>
<p>Wrap standalone equation blocks with double dollar signs <code>$$</code>:</p>
<ul>
<li>
<p><strong>Gaussian Integral</strong>:
$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$</p>
</li>
<li>
<p><strong>Discrete Fourier Transform (DFT)</strong>:
$$
X_k = \sum_{n=0}^{N-1} x_n \cdot e^{-i \frac{2\pi}{N} k n} \quad (k = 0, 1, \dots, N-1)
$$</p>
</li>
<li>
<p><strong>Maxwell&rsquo;s Equations (Differential Form)</strong>:
$$
\begin{aligned}
\nabla \cdot \mathbf{E} &amp;= \frac{\rho}{\varepsilon_0} \
\nabla \cdot \mathbf{B} &amp;= 0 \
\nabla \times \mathbf{E} &amp;= -\frac{\partial \mathbf{B}}{\partial t} \
\nabla \times \mathbf{B} &amp;= \mu_0 \mathbf{J} + \mu_0 \varepsilon_0 \frac{\partial \mathbf{E}}{\partial t}
\end{aligned}
$$</p>
</li>
</ul>
<hr>
<h3 id="32-mermaid-vector-flowcharts--sequence-diagrams">3.2 Mermaid Vector Flowcharts &amp; Sequence Diagrams</h3>
<p>Declare <code>```mermaid</code> code blocks, and the browser dynamically renders responsive vector SVGs matching light/dark themes.</p>
<h4 id="modern-edge-architecture-flow-graph-lr">Modern Edge Architecture Flow (<code>graph LR</code>)</h4>
<pre tabindex="0"><code class="language-mermaid" data-lang="mermaid">flowchart LR
    Client[&#34;Client Browser&#34;] --&gt;|&#34;HTTPS / HTTP/3&#34;| CDN[&#34;Cloudflare Edge Network&#34;]
    CDN --&gt;|&#34;Cache Hit (&amp;lt; 10ms)&#34;| EdgeCache[&#34;Edge Cache&#34;]
    CDN --&gt;|&#34;Cache Miss&#34;| Pages[&#34;Cloudflare Pages Static Delivery&#34;]
    Pages --&gt;|&#34;Pure Markdown&#34;| Storage[&#34;Markdown Content&#34;]
</code></pre><h4 id="oauth-21-pkce-state-machine-sequence-sequencediagram">OAuth 2.1 PKCE State Machine Sequence (<code>sequenceDiagram</code>)</h4>
<pre tabindex="0"><code class="language-mermaid" data-lang="mermaid">sequenceDiagram
    autonumber
    actor User as User
    participant Client as Frontend Client
    participant Authz as Authz Server
    participant API as Resource API

    User-&gt;&gt;Client: Click Passkey Login
    Client-&gt;&gt;Client: Generate code_verifier and challenge
    Client-&gt;&gt;Authz: Initiate Auth Request /authorize
    Authz-&gt;&gt;User: Prompt WebAuthn biometric check
    User--&gt;&gt;Authz: Biometric signature verified
    Authz--&gt;&gt;Client: Return Authorization Code
    Client-&gt;&gt;Authz: Exchange Token /token
    Authz-&gt;&gt;Authz: Verify SHA256 matches challenge
    Authz--&gt;&gt;Client: Issue JWT Access Token
    Client-&gt;&gt;API: Fetch data with Bearer Token
    API--&gt;&gt;Client: 200 OK Return Protected Resource
</code></pre><hr>
<h2 id="4-conclusion-the-docs-as-code-philosophy">4. Conclusion: The &ldquo;Docs as Code&rdquo; Philosophy</h2>
<p>In modern software engineering, the <strong>Docs as Code</strong> paradigm offers major advantages:</p>
<ol>
<li><strong>Version Control</strong>: Documentation lives alongside source code in Git, making every iteration auditable;</li>
<li><strong>Standardized Governance</strong>: Consistent guidelines ensure high-quality knowledge assets across teams;</li>
<li><strong>Decoupled Presentation</strong>: Clean Markdown focuses entirely on content rigor, leaving visual rendering to static site engines.</li>
</ol>
<p>Adopting disciplined Markdown conventions makes every article clearer to write and a pleasure to read.</p>
]]></content:encoded><category>Markdown</category><category>Typography</category><category>LaTeX</category><category>Mermaid</category><category>Technical Writing</category></item><item><title>Why Hugo? Modern Blog Frameworks Compared</title><link>/en/why-hugo/</link><pubDate>Sat, 05 Sep 2026 10:00:00 +0800</pubDate><author>Dukang Xu</author><guid isPermaLink="true">/en/why-hugo/</guid><description>A deep architectural analysis of the four generations of personal blogging frameworks, comparing WordPress, Hexo, Astro, and Hugo across compile speed, operational overhead, and content decoupling.</description><content:encoded><![CDATA[<h2 id="introduction-the-technical-evolution-of-personal-blogs">Introduction: The Technical Evolution of Personal Blogs</h2>
<p>Building a personal blog is a rite of passage for many software engineers.</p>
<p>Over the past two decades, blogging architectures have evolved dramatically—from <strong>Dynamic Content Management Systems (CMS)</strong> to <strong>Static Site Generators (SSG)</strong>, and now to <strong>Serverless Edge Computing</strong>:</p>
<ol>
<li><strong>Generation 1: Dynamic Database-Driven (2003–2013)</strong>: Exemplified by WordPress and Typecho on the LAMP stack, querying relational databases and assembling HTML on every request;</li>
<li><strong>Generation 2: Static Generation &amp; Git Hosting (2014–2019)</strong>: Exemplified by Jekyll and Hexo, compiling local Markdown directly into static HTML deployed to platforms like GitHub Pages;</li>
<li><strong>Generation 3: Modern Componentized Frameworks (2020–present)</strong>: Exemplified by Astro and Next.js, featuring Islands Architecture to embed interactive React/Vue components into Markdown;</li>
<li><strong>Compiled High-Performance Static Engines (Hugo)</strong>: Built natively in Go to push compilation speed and resource efficiency to their physical limits.</li>
</ol>
<p>When creating this blog, our core criteria were clear: <strong>instant compilation, zero server hosting costs, zero maintenance, and complete content decoupling</strong>. This article explores the architectural trade-offs across these frameworks and why we chose Hugo.</p>
<hr>
<h2 id="1-deep-dive-into-four-blogging-paradigms">1. Deep Dive into Four Blogging Paradigms</h2>
<h3 id="11-traditional-dynamic-cms-wordpress-halo">1.1 Traditional Dynamic CMS (WordPress, Halo)</h3>
<pre tabindex="0"><code class="language-mermaid" data-lang="mermaid">sequenceDiagram
    autonumber
    actor User as Visitor (User)
    participant Web as Web Proxy (Nginx)
    participant App as App Server (PHP / Java)
    participant DB as Database (MySQL)

    User-&gt;&gt;Web: 1. Send HTTP Page Request
    Web-&gt;&gt;App: 2. Reverse Proxy Request
    App-&gt;&gt;DB: 3. Query Relational Database
    DB--&gt;&gt;App: 4. Return SQL Records
    App--&gt;&gt;Web: 5. Dynamic SSR Template Assembly
    Web--&gt;&gt;User: 6. Output Rendered HTML
</code></pre><ul>
<li><strong>Architecture</strong>: Articles, comments, and settings reside in a relational database. Every incoming request executes server-side SQL queries and template rendering before returning HTML.</li>
<li><strong>Key Advantages</strong>:
<ul>
<li>Comprehensive feature set with mature rich-text and block editors;</li>
<li>Vast ecosystem of plugins and themes for e-commerce, memberships, and forums.</li>
</ul>
</li>
<li><strong>Pain Points</strong>:
<ul>
<li><strong>Ongoing VPS Hosting Costs</strong>: Requires dedicated cloud virtual machines running 24/7;</li>
<li><strong>Concurrency &amp; I/O Bottlenecks</strong>: Vulnerable to traffic spikes, connection pool exhaustion, and out-of-memory crashes;</li>
<li><strong>Security &amp; Maintenance Overhead</strong>: Persistent risks of SQL injection, XSS vulnerabilities, and plugin exploits requiring regular patching.</li>
</ul>
</li>
</ul>
<hr>
<h2 id="2-comprehensive-comparison-matrix">2. Comprehensive Comparison Matrix</h2>
<table>
	<thead>
			<tr>
					<th style="text-align: left">Evaluation Criterion</th>
					<th style="text-align: left">Dynamic CMS (WordPress)</th>
					<th style="text-align: left">Node.js SSG (Hexo)</th>
					<th style="text-align: left">Islands SSG (Astro)</th>
					<th style="text-align: left">Compiled Static Engine (Hugo)</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td style="text-align: left"><strong>Core Language</strong></td>
					<td style="text-align: left">PHP / Java</td>
					<td style="text-align: left">JavaScript (Node.js)</td>
					<td style="text-align: left">TypeScript / JS</td>
					<td style="text-align: left"><strong>Native Go Binary</strong></td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>100-Article Build Time</strong></td>
					<td style="text-align: left">Dynamic SSR (100–300ms/req)</td>
					<td style="text-align: left">3–10s</td>
					<td style="text-align: left">1–3s</td>
					<td style="text-align: left"><strong>10–30ms (Instant)</strong></td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Runtime Dependencies</strong></td>
					<td style="text-align: left">PHP/MySQL/Web Server</td>
					<td style="text-align: left">Node.js + npm modules</td>
					<td style="text-align: left">Node.js/Vite Toolchain</td>
					<td style="text-align: left"><strong>Zero Dependencies</strong></td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Server Cost</strong></td>
					<td style="text-align: left">Continuous VM rental</td>
					<td style="text-align: left">Zero (Static hosting)</td>
					<td style="text-align: left">Zero (Static hosting)</td>
					<td style="text-align: left"><strong>Zero (Static hosting)</strong></td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Security Surface</strong></td>
					<td style="text-align: left">Vulnerable to SQLi / XSS</td>
					<td style="text-align: left"><strong>Zero Attack Surface</strong></td>
					<td style="text-align: left"><strong>Zero Attack Surface</strong></td>
					<td style="text-align: left"><strong>Zero Attack Surface</strong></td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Global CDN Cache Rate</strong></td>
					<td style="text-align: left">Requires reverse proxies</td>
					<td style="text-align: left">100% Static Cache Hit</td>
					<td style="text-align: left">100% Static Cache Hit</td>
					<td style="text-align: left"><strong>100% Static Cache Hit</strong></td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Migration Friction</strong></td>
					<td style="text-align: left">High (Database lock-in)</td>
					<td style="text-align: left">Low (Standard Markdown)</td>
					<td style="text-align: left">Medium (Component syntax)</td>
					<td style="text-align: left"><strong>Near Zero (Pure Markdown)</strong></td>
			</tr>
	</tbody>
</table>
<hr>
<h2 id="3-our-architecture-and-production-implementation">3. Our Architecture and Production Implementation</h2>
<p>Guided by these trade-offs, we designed our platform around three pillars: <strong>Hugo as the compilation core, Bear Blog&rsquo;s charcoal-slate aesthetic for visual discipline, and Cloudflare Pages for global edge distribution</strong>.</p>
<h3 id="31-content-decoupling-the-pure-content-store">3.1 Content Decoupling: The Pure Content Store</h3>
<p>We enforce strict architectural boundaries:</p>
<ul>
<li>All article sources reside in <code>posts/</code>, adhering strictly to standard YAML Frontmatter and vanilla Markdown;</li>
<li>No proprietary tags or engine-specific hooks are permitted in article markdown.</li>
</ul>
<p>This ensures our written assets remain completely portable and can migrate to any future engine with zero friction.</p>
<h3 id="32-sub-second-edge-performance">3.2 Sub-second Edge Performance</h3>
<ul>
<li><strong>Zero-Bloat Frontend</strong>: Apart from minimal native JavaScript for ScrollSpy TOC tracking, dark mode toggling, and code block copying, the site ships zero heavy UI framework bundles;</li>
<li><strong>Instant Global Delivery</strong>: Built HTML artifacts distribute across Cloudflare&rsquo;s Anycast edge network, achieving sub-100ms first-contentful-paint worldwide and consistent <strong>100/100 Lighthouse scores</strong>.</li>
</ul>
<hr>
<h2 id="4-conclusion-the-less-is-more-engineering-philosophy">4. Conclusion: The &ldquo;Less is More&rdquo; Engineering Philosophy</h2>
<p>Software engineering history repeatedly demonstrates that <strong>excessive complexity breeds fragility</strong>.</p>
<p>For a technical blog dedicated to knowledge retention and architectural clarity, flashy widgets quickly fade. What endures is rigorous thinking, focused reading typography, and a rock-solid infrastructure.</p>
<p>Choosing Hugo and a pure static edge architecture means returning to first principles: <strong>using the leanest tools to solve pure problems, and dedicating all energy to crafting high-value content</strong>.</p>
]]></content:encoded><category>Architecture</category><category>Hugo</category><category>Static Site</category><category>Tech Stack</category><category>Performance</category></item><item><title>From Hello World to Programming Paradigms</title><link>/en/hello-world/</link><pubDate>Tue, 01 Sep 2026 10:00:00 +0800</pubDate><author>Dukang Xu</author><guid isPermaLink="true">/en/hello-world/</guid><description>As the opening article of this technical blog, we dissect the Hello World implementations in C, Go, Rust, TypeScript, Python, and Java to explore how programming paradigms and execution mechanisms have evolved.</description><content:encoded><![CDATA[<h2 id="introduction-the-totem-of-the-first-line-of-code">Introduction: The Totem of the First Line of Code</h2>
<p>&ldquo;Hello, World!&rdquo; is far more than a simple line of screen output. It is every developer&rsquo;s inaugural greeting to the digital universe and one of the most enduring symbols in software engineering history.</p>
<p>In 1972, computer scientist Brian Kernighan at Bell Labs first used a short print statement as a beginner example in <em>A Tutorial Introduction to the Language B</em>. Later in 1978, in the seminal book <em>The C Programming Language</em> (often known as K&amp;R) co-authored with Dennis Ritchie, this convention was formally established and took the computing world by storm:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-c" data-lang="c"><span class="line"><span class="ln">1</span><span class="cl"><span class="cp">#include</span> <span class="cpf">&lt;stdio.h&gt;</span><span class="cp">
</span></span></span><span class="line"><span class="ln">2</span><span class="cl">
</span></span><span class="line"><span class="ln">3</span><span class="cl"><span class="nf">main</span><span class="p">()</span> <span class="p">{</span>
</span></span><span class="line"><span class="ln">4</span><span class="cl">    <span class="nf">printf</span><span class="p">(</span><span class="s">&#34;hello, world</span><span class="se">\n</span><span class="s">&#34;</span><span class="p">);</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl"><span class="p">}</span>
</span></span></code></pre></div><p>Over the past half century, computer hardware architectures have undergone profound transformations—from mainframes and personal PCs to cloud-native distributed systems and lightweight edge computing. Yet almost every modern programming language still preserves &ldquo;Hello World&rdquo; in the very first chapter of its documentation.</p>
<p>Why does this simple program remain timeless? Because behind a seemingly trivial print statement lies the condensed essence of a language&rsquo;s <strong>syntax structure, compilation model, memory management paradigm, and standard I/O runtime mechanism</strong>. As the first article on this blog, we explore the design philosophies behind programming language evolution through the lens of Hello World.</p>
<hr>
<h2 id="1-systems--procedural-programming-the-classic-foundation-of-c">1. Systems &amp; Procedural Programming: The Classic Foundation of C</h2>
<p>Born in the early 1970s to rewrite the UNIX operating system, C became the universal standard for systems programming thanks to its close-to-hardware expressiveness and peak efficiency.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-c" data-lang="c"><span class="line"><span class="ln">1</span><span class="cl"><span class="cp">#include</span> <span class="cpf">&lt;stdio.h&gt;</span><span class="cp">
</span></span></span><span class="line"><span class="ln">2</span><span class="cl">
</span></span><span class="line"><span class="ln">3</span><span class="cl"><span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="ln">4</span><span class="cl">    <span class="nf">printf</span><span class="p">(</span><span class="s">&#34;Hello, World!</span><span class="se">\n</span><span class="s">&#34;</span><span class="p">);</span>
</span></span><span class="line"><span class="ln">5</span><span class="cl">    <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
</span></span><span class="line"><span class="ln">6</span><span class="cl"><span class="p">}</span>
</span></span></code></pre></div><h3 id="deep-dive">Deep Dive:</h3>
<ol>
<li><strong>Preprocessor Directive (<code>#include &lt;stdio.h&gt;</code>)</strong>: C is minimalistic. Standard I/O operations are not language keywords, but library functions. The preprocessor expands header declarations directly into source code prior to compilation.</li>
<li><strong>Entry Function &amp; Exit Code (<code>int main(void)</code>)</strong>: <code>main</code> serves as the entry point. Returning integer <code>0</code> informs the OS kernel of the process exit status (<code>0</code> signifies normal completion; non-zero denotes error).</li>
<li><strong>Syscalls &amp; Buffering</strong>: <code>printf</code> writes formatted strings to a user-space buffer for <code>stdout</code>. When encountering <code>\n</code> or buffer saturation, the runtime invokes the <code>write</code> system call, prompting the kernel to deliver bytes to the terminal device.</li>
</ol>
<hr>
<h2 id="2-cloud-native-concurrency--pragmatism-the-engineering-philosophy-of-go">2. Cloud-Native Concurrency &amp; Pragmatism: The Engineering Philosophy of Go</h2>
<p>Entering the 21st century, single-core CPU clock speeds hit physical barriers, propelling multicore processors and distributed clusters to the forefront. Google created Go (spearheaded by Rob Pike and colleagues) to tackle sluggish C++ build times, tangled dependencies, and cumbersome concurrency.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="ln">1</span><span class="cl"><span class="kn">package</span><span class="w"> </span><span class="nx">main</span><span class="w">
</span></span></span><span class="line"><span class="ln">2</span><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="ln">3</span><span class="cl"><span class="kn">import</span><span class="w"> </span><span class="s">&#34;fmt&#34;</span><span class="w">
</span></span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="ln">5</span><span class="cl"><span class="kd">func</span><span class="w"> </span><span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="ln">6</span><span class="cl"><span class="w">    </span><span class="nx">fmt</span><span class="p">.</span><span class="nf">Println</span><span class="p">(</span><span class="s">&#34;Hello, World!&#34;</span><span class="p">)</span><span class="w">
</span></span></span><span class="line"><span class="ln">7</span><span class="cl"><span class="p">}</span><span class="w">
</span></span></span></code></pre></div><h3 id="deep-dive-1">Deep Dive:</h3>
<ol>
<li><strong>Mandatory Package Architecture (<code>package main</code>)</strong>: Go enforces engineering discipline at the syntax level. Any executable program must belong to package <code>main</code> and define a parameterless <code>main()</code> function.</li>
<li><strong>Explicit Imports &amp; Zero Dead Code</strong>: The Go compiler forbids unused imports and variables, eliminating bloat right at compile time.</li>
<li><strong>Sub-second Compilation</strong>: By intentionally omitting complex language features (no template metaprogramming, no macros, no header re-evaluations), Go can compile tens of thousands of lines in under a second.</li>
<li><strong>Explicit Over Implicit</strong>: Rejecting complex inheritance hierarchies and operator overloading, Go fosters uniform, highly readable code across large engineering teams.</li>
</ol>
<hr>
<h2 id="3-memory-safety--zero-cost-abstractions-the-rust-revolution">3. Memory Safety &amp; Zero-Cost Abstractions: The Rust Revolution</h2>
<p>As software scale skyrocketed, Microsoft and Google security audits revealed that over 70% of critical software vulnerabilities stem from C/C++ memory safety issues (dangling pointers, buffer overflows, use-after-free). Rust addresses this fundamental challenge through <strong>Ownership, the Borrow Checker, and Lifetimes</strong>.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-rust" data-lang="rust"><span class="line"><span class="ln">1</span><span class="cl"><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="ln">2</span><span class="cl"><span class="w">    </span><span class="fm">println!</span><span class="p">(</span><span class="s">&#34;Hello, World!&#34;</span><span class="p">);</span><span class="w">
</span></span></span><span class="line"><span class="ln">3</span><span class="cl"><span class="p">}</span><span class="w">
</span></span></span></code></pre></div><h3 id="deep-dive-2">Deep Dive:</h3>
<ol>
<li><strong>Compile-Time Macro (<code>println!</code>)</strong>: The exclamation mark indicates a macro invocation. Rust checks format strings and argument types at compile time, eliminating runtime crashes common in C-style <code>printf</code>.</li>
<li><strong>Zero-Cost Abstractions</strong>: Rust combines high-level ergonomic constructs (pattern matching, iterators) with the raw execution speed of handwritten C.</li>
<li><strong>GC-Free Memory Safety</strong>: Rust eliminates both manual <code>malloc/free</code> and runtime garbage collectors (GC). By tracking ownership lifecycles at compile time, it inserts deterministic deallocation calls (RAII) with zero runtime overhead.</li>
</ol>
<hr>
<h2 id="4-from-browser-scripting-to-edge-computing-typescript--javascript">4. From Browser Scripting to Edge Computing: TypeScript / JavaScript</h2>
<p>Originally designed by Brendan Eich in just 10 days in 1995 for basic Netscape form validation, JavaScript—supercharged by Google&rsquo;s V8 JIT engine, Node.js, and Cloudflare Workers—has evolved into a ubiquitous full-stack and edge language.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-typescript" data-lang="typescript"><span class="line"><span class="ln">1</span><span class="cl"><span class="c1">// Strongly typed TypeScript version
</span></span></span><span class="line"><span class="ln">2</span><span class="cl"><span class="kr">const</span> <span class="nx">message</span>: <span class="kt">string</span> <span class="o">=</span> <span class="s2">&#34;Hello, World!&#34;</span><span class="p">;</span>
</span></span><span class="line"><span class="ln">3</span><span class="cl"><span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">message</span><span class="p">);</span>
</span></span></code></pre></div><h3 id="deep-dive-3">Deep Dive:</h3>
<ol>
<li><strong>Gradual Type System</strong>: TypeScript acts as a typed superset of JavaScript. Rich type annotations and generics provide compile-time safety, then compile away into clean vanilla JavaScript (Type Erasure).</li>
<li><strong>Event-Driven Non-Blocking I/O</strong>: Operating on a single-threaded Event Loop with microtask and macrotask queues, JavaScript handles high-concurrency network operations with minimal thread-switching overhead.</li>
<li><strong>Lightweight V8 Isolates</strong>: In modern edge architectures (like Cloudflare Workers), requests execute in lightweight V8 Isolates rather than heavy container VMs, booting in sub-milliseconds with memory footprints under a few megabytes.</li>
</ol>
<hr>
<h2 id="5-elegant-syntax--scientific-computing-pythons-glue-philosophy">5. Elegant Syntax &amp; Scientific Computing: Python&rsquo;s Glue Philosophy</h2>
<p>Created by Guido van Rossum during Christmas 1989, Python embodies the timeless principles of <em>The Zen of Python</em>: &ldquo;Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex.&rdquo;</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="ln">1</span><span class="cl"><span class="k">def</span> <span class="nf">main</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
</span></span><span class="line"><span class="ln">2</span><span class="cl">    <span class="n">message</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">&#34;Hello, World!&#34;</span>
</span></span><span class="line"><span class="ln">3</span><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="n">message</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">4</span><span class="cl">
</span></span><span class="line"><span class="ln">5</span><span class="cl"><span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s2">&#34;__main__&#34;</span><span class="p">:</span>
</span></span><span class="line"><span class="ln">6</span><span class="cl">    <span class="n">main</span><span class="p">()</span>
</span></span></code></pre></div><h3 id="deep-dive-4">Deep Dive:</h3>
<ol>
<li><strong>Dynamic Typing &amp; Interpreted Execution</strong>: Source code compiles into bytecode (<code>.pyc</code>) executed by the CPython VM, yielding rapid developer iteration.</li>
<li><strong>Top-Level Module Execution</strong>: The <code>if __name__ == &quot;__main__&quot;:</code> idiom allows a <code>.py</code> file to run as a standalone script or be imported safely as a library without unwanted side effects.</li>
<li><strong>Rich C/C++ Ecosystem</strong>: Excellent C foreign-function interfacing enables Python to wrap high-performance compute libraries (NumPy, PyTorch), cementing its role as the lingua franca of AI and data science.</li>
</ol>
<hr>
<h2 id="6-industrial-oop--enterprise-systems-javas-sturdy-evolution">6. Industrial OOP &amp; Enterprise Systems: Java&rsquo;s Sturdy Evolution</h2>
<p>Born at Sun Microsystems with the promise of &ldquo;Write Once, Run Anywhere&rdquo;, Java reshaped enterprise application engineering.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-java" data-lang="java"><span class="line"><span class="ln">1</span><span class="cl"><span class="kd">public</span><span class="w"> </span><span class="kd">class</span> <span class="nc">HelloWorld</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="ln">2</span><span class="cl"><span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="kd">static</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">main</span><span class="p">(</span><span class="n">String</span><span class="o">[]</span><span class="w"> </span><span class="n">args</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w">
</span></span></span><span class="line"><span class="ln">3</span><span class="cl"><span class="w">        </span><span class="n">System</span><span class="p">.</span><span class="na">out</span><span class="p">.</span><span class="na">println</span><span class="p">(</span><span class="s">&#34;Hello, World!&#34;</span><span class="p">);</span><span class="w">
</span></span></span><span class="line"><span class="ln">4</span><span class="cl"><span class="w">    </span><span class="p">}</span><span class="w">
</span></span></span><span class="line"><span class="ln">5</span><span class="cl"><span class="p">}</span><span class="w">
</span></span></span></code></pre></div><h3 id="deep-dive-5">Deep Dive:</h3>
<ol>
<li><strong>Pure Object-Oriented Paradigm</strong>: Everything in Java resides within a class. Even the simplest print statement requires declaring class scopes, access modifiers, and argument signatures <code>String[] args</code>.</li>
<li><strong>Bytecode &amp; Tiered JIT Compilation</strong>: Source code compiles into platform-agnostic <code>.class</code> bytecode loaded by the JVM. The HotSpot engine detects frequent code paths and JIT-compiles them into optimized native machine instructions.</li>
<li><strong>Enterprise Robustness</strong>: Strict encapsulation (<code>public/private/protected</code>), comprehensive exception handling, and modern garbage collectors (ZGC/G1) make Java the backbone of global banking, fintech, and distributed enterprise platforms.</li>
</ol>
<hr>
<h2 id="7-comparative-feature-matrix">7. Comparative Feature Matrix</h2>
<table>
	<thead>
			<tr>
					<th style="text-align: left">Language</th>
					<th style="text-align: left">Core Paradigm</th>
					<th style="text-align: left">Type System</th>
					<th style="text-align: left">Memory Management</th>
					<th style="text-align: left">Build Output</th>
					<th style="text-align: left">Primary Use Cases</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td style="text-align: left"><strong>C</strong></td>
					<td style="text-align: left">Procedural / Imperative</td>
					<td style="text-align: left">Static / Weak</td>
					<td style="text-align: left">Manual (<code>malloc/free</code>)</td>
					<td style="text-align: left">Native Binary (ELF/Mach-O)</td>
					<td style="text-align: left">OS Kernels, Embedded, High-Performance Engines</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Go</strong></td>
					<td style="text-align: left">Concurrent / Pragmatic</td>
					<td style="text-align: left">Static / Strong</td>
					<td style="text-align: left">Runtime Garbage Collector (GC)</td>
					<td style="text-align: left">Single Executable Binary</td>
					<td style="text-align: left">Cloud-Native, Microservices, Network Proxies</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Rust</strong></td>
					<td style="text-align: left">Multi-paradigm / Zero-cost</td>
					<td style="text-align: left">Static / Strong</td>
					<td style="text-align: left">Compile-time Ownership (RAII)</td>
					<td style="text-align: left">Native Machine Code</td>
					<td style="text-align: left">Systems, Browser Engines, Blockchain, Security</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>TypeScript</strong></td>
					<td style="text-align: left">Multi-paradigm / Event-driven</td>
					<td style="text-align: left">Static Compile / Dynamic Run</td>
					<td style="text-align: left">V8 Generational GC</td>
					<td style="text-align: left">Plain JavaScript Code</td>
					<td style="text-align: left">Modern Web Frontends, Node Fullstack, Edge Workers</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Python</strong></td>
					<td style="text-align: left">OOP / Dynamic Scripting</td>
					<td style="text-align: left">Dynamic / Strong</td>
					<td style="text-align: left">Ref Count + Generational GC</td>
					<td style="text-align: left">Python VM Bytecode</td>
					<td style="text-align: left">AI, Data Science, DevOps Automation, Scripting</td>
			</tr>
			<tr>
					<td style="text-align: left"><strong>Java</strong></td>
					<td style="text-align: left">OOP / Structured Enterprise</td>
					<td style="text-align: left">Static / Strong</td>
					<td style="text-align: left">JVM Garbage Collection (G1/ZGC)</td>
					<td style="text-align: left">JVM Platform Bytecode</td>
					<td style="text-align: left">Enterprise Backend, Distributed Systems, Fintech</td>
			</tr>
	</tbody>
</table>
<hr>
<h2 id="8-conclusion-languages-evolve-passion-endures">8. Conclusion: Languages Evolve, Passion Endures</h2>
<p>From humble 1970s terminal output to today&rsquo;s cloud, mobile, and serverless edge landscapes, syntax and toolchains continuously advance. New languages emerge to fix historical pain points, while classics reinvent themselves.</p>
<p>Regardless of shifting technological tides:</p>
<ul>
<li><strong>There is no single &ldquo;best&rdquo; language, only optimal trade-offs for a given scenario</strong>;</li>
<li>Code is written for humans to read, and only incidentally for computers to execute;</li>
<li>Curiosity about computing fundamentals, a commitment to clean architecture, and the joy of crafting software remain our true guiding lights.</li>
</ul>
<p>That is the true spirit of printing <code>Hello, World!</code> as our opening chapter.</p>
]]></content:encoded><category>Programming Languages</category><category>Hello World</category><category>Software Engineering</category><category>Architecture</category></item></channel></rss>