<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>MBG</title>
 <link href="/blog/atom.xml" rel="self"/>
 <link href="https://getpoole.com/blog/"/>
 <updated>2026-01-29T00:31:31+00:00</updated>
 <id>https://getpoole.com</id>
 <author>
   <name>Zhang Maiyun</name>
   <email>me@maiyun.me</email>
 </author>

 
 <entry>
   <title>Setting up an AREDN supernode + local node with `systemd-nspawn`</title>
   <link href="https://getpoole.com/blog/2026/01/14/systemd-nspawn-supernode/"/>
   <updated>2026-01-14T00:00:00+00:00</updated>
   <id>https://getpoole.com/2026/01/14/systemd-nspawn-supernode</id>
   <content type="html">&lt;p&gt;News: If you are near the Pittsburgh area, contact me to join the &lt;a href=&quot;https://w3vc-localnode.maiyun.me&quot;&gt;local AREDN mesh&lt;/a&gt;!&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Warning&lt;/strong&gt;&lt;/p&gt;

  &lt;p&gt;Containers are officially unsupported by OpenWRT, so it will likely never be supported for AREDN either.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1 id=&quot;background&quot;&gt;Background&lt;/h1&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd-nspawn&lt;/code&gt; is a containerization tool built into pretty much all modern Linux distributions.
It compartmentalizes applications using native Linux kernel features such as namespaces.&lt;/p&gt;

&lt;p&gt;Currently, AREDN supports running on physical devices and virtual machines.
This is an experiment to see if we can configure working AREDN nodes inside lightweight containers, like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd-nspawn&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In this guide, we will set up two containers: a supernode and a local node.
The resulting network topology will look like this:&lt;/p&gt;
&lt;svg width=&quot;100%&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 867 233&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;&lt;g class=&quot;graph&quot; transform=&quot;scale(1) translate(4 229)&quot;&gt;&lt;polygon points=&quot;-4 4 -4 -229 862.85 -229 862.85 4&quot; fill=&quot;#fff&quot; /&gt;&lt;g class=&quot;cluster&quot;&gt;&lt;polygon points=&quot;8 -8 8 -217 648.6 -217 648.6 -8&quot; fill=&quot;none&quot; stroke=&quot;#000&quot; stroke-dasharray=&quot;5,2&quot; /&gt;&lt;text x=&quot;328.3&quot; y=&quot;-199.7&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14&quot; text-anchor=&quot;middle&quot; xml:space=&quot;preserve&quot;&gt;host&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;cluster&quot;&gt;&lt;polygon points=&quot;524.97 -16 524.97 -184 640.6 -184 640.6 -16&quot; fill=&quot;none&quot; stroke=&quot;red&quot; /&gt;&lt;text x=&quot;582.79&quot; y=&quot;-166.7&quot; fill=&quot;red&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14&quot; text-anchor=&quot;middle&quot; xml:space=&quot;preserve&quot;&gt;br-aredn&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;cluster&quot;&gt;&lt;polygon points=&quot;780.6 -108 780.6 -185 852.1 -185 852.1 -108&quot; fill=&quot;none&quot; stroke=&quot;#000&quot; stroke-dasharray=&quot;5,2&quot; /&gt;&lt;text x=&quot;816.35&quot; y=&quot;-167.7&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14&quot; text-anchor=&quot;middle&quot; xml:space=&quot;preserve&quot;&gt;supernode&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;cluster&quot;&gt;&lt;polygon points=&quot;780.85 -18 780.85 -95 850.85 -95 850.85 -18&quot; fill=&quot;none&quot; stroke=&quot;#000&quot; stroke-dasharray=&quot;5,2&quot; /&gt;&lt;text x=&quot;815.85&quot; y=&quot;-77.7&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14&quot; text-anchor=&quot;middle&quot; xml:space=&quot;preserve&quot;&gt;localnode&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;node&quot;&gt;&lt;ellipse cx=&quot;43.81&quot; cy=&quot;-78&quot; rx=&quot;27.81&quot; ry=&quot;18&quot; fill=&quot;none&quot; stroke=&quot;#000&quot; /&gt;&lt;text x=&quot;43.81&quot; y=&quot;-72.95&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14&quot; text-anchor=&quot;middle&quot; xml:space=&quot;preserve&quot;&gt;ens0&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;node&quot;&gt;&lt;ellipse cx=&quot;308.67&quot; cy=&quot;-78&quot; rx=&quot;60.05&quot; ry=&quot;18&quot; fill=&quot;none&quot; stroke=&quot;blue&quot; /&gt;&lt;text x=&quot;308.67&quot; y=&quot;-72.95&quot; fill=&quot;blue&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14&quot; text-anchor=&quot;middle&quot; xml:space=&quot;preserve&quot;&gt;br-aredn.wan&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;edge&quot;&gt;&lt;path d=&quot;m71.34-74.38c11.18 1.35 24.34 2.72 36.28 3.38 46.59 2.59 58.36 1.71 105 0 8.6-0.32 17.63-0.79 26.57-1.35&quot; fill=&quot;none&quot; stroke=&quot;blue&quot; stroke-dasharray=&quot;5,2&quot; /&gt;&lt;polygon points=&quot;238.69 -75.83 248.9 -73 239.15 -68.84&quot; fill=&quot;blue&quot; stroke=&quot;blue&quot; /&gt;&lt;/g&gt;&lt;g class=&quot;edge&quot;&gt;&lt;path d=&quot;m248.18-78h-164.77&quot; fill=&quot;none&quot; stroke=&quot;blue&quot; stroke-dasharray=&quot;5,2&quot; /&gt;&lt;polygon points=&quot;83.46 -74.5 73.46 -78 83.46 -81.5&quot; fill=&quot;blue&quot; stroke=&quot;blue&quot; /&gt;&lt;text x=&quot;160.12&quot; y=&quot;-81.2&quot; fill=&quot;blue&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14&quot; text-anchor=&quot;middle&quot; xml:space=&quot;preserve&quot;&gt;Forwarding + NAT&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;edge&quot;&gt;&lt;path d=&quot;m369.05-78h212.64&quot; fill=&quot;none&quot; stroke=&quot;blue&quot; stroke-dasharray=&quot;5,2&quot; /&gt;&lt;text x=&quot;450.85&quot; y=&quot;-81.2&quot; fill=&quot;blue&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14&quot; text-anchor=&quot;middle&quot; xml:space=&quot;preserve&quot;&gt;WAN (VLAN 1)&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;node&quot;&gt;&lt;ellipse cx=&quot;582.79&quot; cy=&quot;-133&quot; rx=&quot;49.82&quot; ry=&quot;18&quot; fill=&quot;none&quot; stroke=&quot;#000&quot; /&gt;&lt;text x=&quot;582.79&quot; y=&quot;-127.95&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14&quot; text-anchor=&quot;middle&quot; xml:space=&quot;preserve&quot;&gt;veth-super&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;node&quot;&gt;&lt;ellipse cx=&quot;815.85&quot; cy=&quot;-134&quot; rx=&quot;27&quot; ry=&quot;18&quot; fill=&quot;none&quot; stroke=&quot;#000&quot; /&gt;&lt;text x=&quot;815.85&quot; y=&quot;-128.95&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14&quot; text-anchor=&quot;middle&quot; xml:space=&quot;preserve&quot;&gt;eth0&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;edge&quot;&gt;&lt;g stroke=&quot;#000&quot;&gt;&lt;path d=&quot;m639.67-142.04c9.63-1.23 19.55-2.3 28.93-2.96 37.24-2.62 46.81-3.26 84 0 8.5 0.74 17.57 2.05 26.08 3.51&quot; fill=&quot;none&quot; /&gt;&lt;polygon points=&quot;640.44 -138.61 630.06 -140.74 639.5 -145.55&quot; /&gt;&lt;polygon points=&quot;779.15 -144.96 788.36 -139.72 777.89 -138.08&quot; /&gt;&lt;/g&gt;&lt;text x=&quot;710.6&quot; y=&quot;-150.41&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14&quot; text-anchor=&quot;middle&quot; xml:space=&quot;preserve&quot;&gt;veth&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;node&quot;&gt;&lt;ellipse cx=&quot;582.79&quot; cy=&quot;-42&quot; rx=&quot;47.77&quot; ry=&quot;18&quot; fill=&quot;none&quot; stroke=&quot;#000&quot; /&gt;&lt;text x=&quot;582.79&quot; y=&quot;-36.95&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14&quot; text-anchor=&quot;middle&quot; xml:space=&quot;preserve&quot;&gt;veth-local&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;node&quot;&gt;&lt;ellipse cx=&quot;815.85&quot; cy=&quot;-44&quot; rx=&quot;27&quot; ry=&quot;18&quot; fill=&quot;none&quot; stroke=&quot;#000&quot; /&gt;&lt;text x=&quot;815.85&quot; y=&quot;-38.95&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14&quot; text-anchor=&quot;middle&quot; xml:space=&quot;preserve&quot;&gt;eth0&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;edge&quot;&gt;&lt;g stroke=&quot;#000&quot;&gt;&lt;path d=&quot;m626.51-24.65c13.26 4.57 28.08 8.86 42.09 11.15 36.85 6.02 47.63 8.43 84 0 11.31-2.62 22.94-7.6 33.04-12.79&quot; fill=&quot;none&quot; /&gt;&lt;polygon points=&quot;625.43 -21.32 617.21 -28 627.8 -27.9&quot; /&gt;&lt;polygon points=&quot;783.75 -29.24 794.2 -30.95 787.1 -23.09&quot; /&gt;&lt;/g&gt;&lt;text x=&quot;710.6&quot; y=&quot;-16.7&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14&quot; text-anchor=&quot;middle&quot; xml:space=&quot;preserve&quot;&gt;veth&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;edge&quot;&gt;&lt;path d=&quot;m583.89-96.99c2.16 0.25 37.06 4.29 64.71 9.99 50.96 10.49 109.69 26.66 141.92 35.89&quot; fill=&quot;none&quot; stroke=&quot;#8b3f2f&quot; stroke-dasharray=&quot;5,2&quot; /&gt;&lt;text x=&quot;710.6&quot; y=&quot;-85.26&quot; fill=&quot;#8b3f2f&quot; font-family=&quot;Times,serif&quot; font-size=&quot;14&quot; text-anchor=&quot;middle&quot; xml:space=&quot;preserve&quot;&gt;DtD (VLAN 2)&lt;/text&gt;&lt;/g&gt;&lt;g class=&quot;edge&quot;&gt;&lt;path d=&quot;m583.89-78.01c2.17-0.18 37.32-3.14 64.71-9.99 9.14-2.28 11-4.23 20-7 37.36-11.5 80.68-22.8 110.43-30.26&quot; fill=&quot;none&quot; stroke=&quot;blue&quot; stroke-dasharray=&quot;5,2&quot; /&gt;&lt;polygon points=&quot;778.09 -128.63 788.64 -127.65 779.78 -121.84&quot; fill=&quot;blue&quot; stroke=&quot;blue&quot; /&gt;&lt;/g&gt;&lt;g class=&quot;edge&quot;&gt;&lt;path d=&quot;m583.89-78c2.21 0 37.97 0.13 64.71 9 9.63 3.2 10.31 8.01 20 11 35.83 11.05 78.73 14.03 108.77 14.56&quot; fill=&quot;none&quot; stroke=&quot;blue&quot; stroke-dasharray=&quot;5,2&quot; /&gt;&lt;polygon points=&quot;777.12 -46.95 787.09 -43.36 777.06 -39.95&quot; fill=&quot;blue&quot; stroke=&quot;blue&quot; /&gt;&lt;/g&gt;&lt;g class=&quot;edge&quot;&gt;&lt;path d=&quot;m788.61-135.44c-29.98-0.76-80.04 0.71-120.01 15.44-10.18 3.75-9.9 10.03-20 14-26.22 10.3-62.46 9.09-64.7 9&quot; fill=&quot;none&quot; stroke=&quot;#8b3f2f&quot; stroke-dasharray=&quot;5,2&quot; /&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;

&lt;p&gt;The advantages of this approach are:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Very lightweight compared to &lt;a href=&quot;https://docs.arednmesh.org/en/latest/arednHow-toGuides/vm-install.html&quot;&gt;a VM-based solution&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;Potentially higher performance — since the network stack is shared with the host OS.&lt;/li&gt;
  &lt;li&gt;Availablity of the full &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iproute2&lt;/code&gt; toolset: just use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ip netns exec &amp;lt;namespace&amp;gt; &amp;lt;command&amp;gt;&lt;/code&gt; to run commands inside the container’s network namespace.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Disadvantages:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Not beginner-friendly at all. There are many manual network configuration steps.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Warning&lt;/strong&gt;&lt;/p&gt;

  &lt;p&gt;Be aware that AREDN runs everything as root inside the container.
This means that container breakout is totally possible.&lt;/p&gt;

  &lt;p&gt;I developed this setup knowing that I can mostly trust the AREDN firmware, and that the host machine is dedicated to this purpose.&lt;/p&gt;

  &lt;p&gt;You should evaluate your own threat model. If in doubt, use a VM instead.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;A Linux host using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd&lt;/code&gt;. You might need to install the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd-container&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd-nspawn&lt;/code&gt; package.&lt;/li&gt;
  &lt;li&gt;Some time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;steps&quot;&gt;Steps&lt;/h1&gt;
&lt;p&gt;I will skip all the basic OS installation steps and assume your host machine&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;boots and runs a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd&lt;/code&gt;-based Linux distribution (most do since 2015),&lt;/li&gt;
  &lt;li&gt;runs on a kernel that supports network namespaces (likely the case),&lt;/li&gt;
  &lt;li&gt;has the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd-nspawn&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ip&lt;/code&gt; commands and other common Unix utilities installed,&lt;/li&gt;
  &lt;li&gt;has a working internet connection,&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I will also omit all &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo&lt;/code&gt;, since pretty much all steps in this guide require root privileges.&lt;/p&gt;

&lt;h2 id=&quot;prepare-the-container-filesystems&quot;&gt;Prepare the container filesystems&lt;/h2&gt;
&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Download the AREDN firmware image: choose the “x86_64 Generic” version from the firmware selection page.
 It should give you a file ending with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.img.gz&lt;/code&gt;. Unpack it with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gunzip&lt;/code&gt; to get a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.img&lt;/code&gt; file.
 I will be referring to this file as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aredn-x86-64-generic-ext4-combined.img&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Create two directories to hold the container filesystems. I used:
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; /srv/supernode /srv/localnode
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Unpack the AREDN image:
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; losetup &lt;span class=&quot;nt&quot;&gt;-P&lt;/span&gt; loop0 aredn-x86-64-generic-ext4-combined.img
 mount /dev/loop0p2 /mnt
 rsync &lt;span class=&quot;nt&quot;&gt;-aP&lt;/span&gt; /mnt/ /srv/localnode/
 rsync &lt;span class=&quot;nt&quot;&gt;-aP&lt;/span&gt; /mnt/ /srv/supernode/
 umount /mnt
 losetup &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; loop0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;Note that the filesystem is located on the second partition of the image, hence &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;loop0p2&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Work around a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd-nspawn&lt;/code&gt; limitation:
 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd-nspawn&lt;/code&gt; resets its own set of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sysctl&lt;/code&gt; values and mounts &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/proc/sys&lt;/code&gt; as read-only inside the container.&lt;/p&gt;

    &lt;p&gt;(2025-01-17) The best solution I’ve found so far is to replace &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/sbin/init&lt;/code&gt; with a wrapper:&lt;/p&gt;
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;nb&quot;&gt;mv&lt;/span&gt; /srv/supernode/sbin/init /srv/supernode/sbin/init.inner
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;Then create the wrapper &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/srv/supernode/sbin/init&lt;/code&gt;:&lt;/p&gt;
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;c&quot;&gt;#!/bin/sh&lt;/span&gt;
 &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;dir &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; /sys /proc/sys
 &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
     /bin/mount &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; remount,rw &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$dir&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
 &lt;span class=&quot;k&quot;&gt;done
 &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt; /sbin/init.inner
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;and mark it executable:&lt;/p&gt;
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;nb&quot;&gt;chmod &lt;/span&gt;0755 /srv/supernode/sbin/init
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;This will remount &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/proc/sys&lt;/code&gt; as read-write on every boot.&lt;/p&gt;

    &lt;p&gt;Note that using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/rc.local&lt;/code&gt;, or any other &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/rc.d&lt;/code&gt; script, is too late.&lt;/p&gt;

    &lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sysctl&lt;/code&gt; settings inside the containers are isolated from the host OS, so allowing write access is mostly acceptable.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;configure-network-namespaces&quot;&gt;Configure network namespaces&lt;/h2&gt;
&lt;p&gt;We will use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;network-namespace&lt;/code&gt; mode of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd-nspawn&lt;/code&gt; to give each container its own network stack.&lt;/p&gt;

&lt;p&gt;We will set up two pairs of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;veth&lt;/code&gt; interfaces to connect the host OS to the two containers.
Then, we will set up a bridge interface on the host OS between the two &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;veth&lt;/code&gt; interfaces, and add a VLAN-tagged interface on top of the bridge for the WAN connection.&lt;/p&gt;

&lt;p&gt;At the time of writing, AREDN does this by default during the first boot:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;eth0: LAN 192.168.1.1&lt;/li&gt;
  &lt;li&gt;eth0.1 (VLAN): WAN dhcp&lt;/li&gt;
  &lt;li&gt;eth0.2 (VLAN): dtdlink 192.168.2.1&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To minimize the amount of dirty work we need to do, we will try to stick to this scheme as much as possible.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Create the AREDN bridge and the WAN VLAN interface:
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ip &lt;span class=&quot;nb&quot;&gt;link &lt;/span&gt;add br-aredn &lt;span class=&quot;nb&quot;&gt;type &lt;/span&gt;bridge
 ip &lt;span class=&quot;nb&quot;&gt;link &lt;/span&gt;add &lt;span class=&quot;nb&quot;&gt;link &lt;/span&gt;br-aredn name br-aredn.wan &lt;span class=&quot;nb&quot;&gt;type &lt;/span&gt;vlan &lt;span class=&quot;nb&quot;&gt;id &lt;/span&gt;1
 ip address add 192.168.10.1/24 dev br-aredn.wan
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;The names &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;br-aredn&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;br-aredn.wan&lt;/code&gt; are arbitrary.&lt;/p&gt;

    &lt;p&gt;The IP address &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.10.1/24&lt;/code&gt; is also arbitrary but should be in a different subnet from your host’s main network. I will be assigning &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.10.2&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.10.3&lt;/code&gt; to the supernode and local node later.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Set up network namespaces for the two containers:
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ip netns add supernode
 ip netns add localnode
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;You can name them whatever you want as long as they are distinct from each other and from existing namespaces (if any).&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Create the host-to-container &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;veth&lt;/code&gt; pairs (which will also be the untagged LAN interfaces)
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ip &lt;span class=&quot;nb&quot;&gt;link &lt;/span&gt;add veth-super address 36:eb:70:b2:80:1a master br-aredn &lt;span class=&quot;nb&quot;&gt;type &lt;/span&gt;veth peer name eth0 netns supernode address 36:eb:70:b2:80:1b
 ip &lt;span class=&quot;nb&quot;&gt;link &lt;/span&gt;add veth-local address 36:eb:70:b2:80:1c master br-aredn &lt;span class=&quot;nb&quot;&gt;type &lt;/span&gt;veth peer name eth0 netns localnode address 36:eb:70:b2:80:1d
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;address xx:xx:xx:xx:xx:xx&lt;/code&gt; parts are optional and are randomly generated. You can omit them, and they only need to be unique within their own veth pair. I made them all distinct and consecutive for cognitive convenience.&lt;/p&gt;

    &lt;p&gt;The host interface names (the fourth word on each line) can be whatever.
 For the container interface names (the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;peer name&lt;/code&gt;), please stick to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;eth0&lt;/code&gt; so we don’t confuse the AREDN firmware.
 The part after &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;netns&lt;/code&gt; must match the namespace names in the previous step.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Bring up the host-side interfaces:
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ip &lt;span class=&quot;nb&quot;&gt;link set &lt;/span&gt;br-aredn up
 ip &lt;span class=&quot;nb&quot;&gt;link set &lt;/span&gt;br-aredn.wan up
 ip &lt;span class=&quot;nb&quot;&gt;link set &lt;/span&gt;veth-super up
 ip &lt;span class=&quot;nb&quot;&gt;link set &lt;/span&gt;veth-local up
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;first-boot-configuration&quot;&gt;First boot configuration&lt;/h2&gt;
&lt;p&gt;Since the AREDN firmware is not &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd&lt;/code&gt;-aware, we use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--boot&lt;/code&gt; mode so that we bring up the entire OpenWRT system.&lt;/p&gt;

&lt;p&gt;We configure the supernode first. The steps for the local node is exactly the same.&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Bring up the supernode container:
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; systemd-nspawn &lt;span class=&quot;nt&quot;&gt;--network-namespace-path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/run/netns/supernode &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; /srv/supernode &lt;span class=&quot;nt&quot;&gt;--boot&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--capability&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;CAP_NET_ADMIN
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;Add a LAN IP to the host-side untagged interface:
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ip address add 192.168.1.2/24 dev br-aredn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;At this point, we should be able to ping the supernode at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.1.1&lt;/code&gt; from the host.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Navigate to the AREDN web interface at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://192.168.1.1&lt;/code&gt; and complete the initial setup wizard.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Find out the newly-generated AREDN LAN IP address and prefix length (something like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;10.39.62.166/29&lt;/code&gt;):
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ip netns &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;supernode ip address show br-lan
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;Now we change the host LAN IP to be in the same subnet:&lt;/p&gt;
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ip address del 192.168.1.2/24 dev br-aredn
 ip address add &amp;lt;aredn-lan-ip + 1&amp;gt;/29 dev br-aredn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;

    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/29&lt;/code&gt; is the default LAN size at the time of writing. Use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ip netns exec&lt;/code&gt; command to be sure.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Navigate to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http://&amp;lt;aredn-lan-ip&amp;gt;&lt;/code&gt; and complete the rest of the setup.
 In particular, I recommend the following settings:
    &lt;ul&gt;
      &lt;li&gt;Enable WAN web and SSH access.&lt;/li&gt;
      &lt;li&gt;Disable LAN DHCP for the supernode.&lt;/li&gt;
      &lt;li&gt;Set a static IP for the WAN interface.
  I used &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.10.2&lt;/code&gt; for the supernode and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.10.3&lt;/code&gt; for the local node.
  This eliminates the need to set up a DHCP server on the host OS.&lt;/li&gt;
      &lt;li&gt;Set the LAN size to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/30&lt;/code&gt; since neither node will have any clients connected to it.&lt;/li&gt;
      &lt;li&gt;(in Advanced options) Set a unique LAN VLAN tag (I used &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;12&lt;/code&gt; for the supernode and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;13&lt;/code&gt; for the local node).&lt;/li&gt;
      &lt;li&gt;As always, you should disable WAN telnet access and SSH password login for security.&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;Note that after changing the LAN size, the LAN IP might change. We should not need it for anything.
 However, if you do, run the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ip netns exec&lt;/code&gt; command again to find out.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Repeat the above steps for the local node.
For the supernode, don’t forget to follow the &lt;a href=&quot;https://docs.arednmesh.org/en/latest/arednHow-toGuides/supernodes.html&quot;&gt;official supernode setup guide&lt;/a&gt; too.&lt;/p&gt;

&lt;p&gt;If everything goes well, both nodes should be able to see each other over the DtD link.&lt;/p&gt;

&lt;h2 id=&quot;host-routing-configuration&quot;&gt;Host routing configuration&lt;/h2&gt;
&lt;p&gt;So far, the containers can only communicate with the host OS.
We need to set up routing on the host OS so that the containers can reach the internet.&lt;/p&gt;

&lt;p&gt;I use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nftables&lt;/code&gt; for firewalling. Replace &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$wan_iface&lt;/code&gt; with your host machine’s internet-facing interface name.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-nft&quot;&gt;chain forward {
    type filter hook forward priority filter; policy drop;
    ct state { established, related } accept
    ct status dnat accept
    iifname &quot;lo&quot; accept
    iifname &quot;br-aredn.wan&quot; oifname $wan_iface accept
}

chain nat_post {
    type nat hook postrouting priority srcnat; policy accept;
    iifname &quot;br-aredn.wan&quot; oifname $wan_iface meta nfproto ipv4 masquerade
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Finally, these &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sysctl&lt;/code&gt; settings are needed to enable IP forwarding and make &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;babel&lt;/code&gt; happy:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;net.ipv6.conf.all.forwarding = 1
net.ipv4.conf.all.forwarding = 1
net.ipv6.conf.all.accept_redirects = 0
net.ipv4.conf.all.rp_filter = 0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Put them in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/sysctl.d/80-aredn.conf&lt;/code&gt; and run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sysctl -p /etc/sysctl.d/80-aredn.conf&lt;/code&gt; to apply them.&lt;/p&gt;

&lt;h1 id=&quot;further-steps&quot;&gt;Further steps&lt;/h1&gt;
&lt;p&gt;To bring up the containers after the initial configuration, run steps 1-4 in
&lt;a href=&quot;#configure-network-namespaces&quot;&gt;Configure network namespaces&lt;/a&gt; and the first step in
&lt;a href=&quot;#first-boot-configuration&quot;&gt;First boot configuration&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Some more things you may want to do:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd&lt;/code&gt; service script to bring the container up automatically. See &lt;a href=&quot;#systemd-unit-files&quot;&gt;appendix&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;A reverse proxy for the node web interfaces.&lt;/li&gt;
  &lt;li&gt;Add other physical interfaces to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;br-aredn&lt;/code&gt; bridge.&lt;/li&gt;
  &lt;li&gt;Firewall!&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;appendix&quot;&gt;Appendix&lt;/h1&gt;
&lt;h2 id=&quot;troubleshooting&quot;&gt;Troubleshooting&lt;/h2&gt;
&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Error &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aredn-XXXXXnode.service: Failed to spawn executor: Device or resource busy&lt;/code&gt;:&lt;/p&gt;

    &lt;p&gt;Starting multiple &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd-nspawn&lt;/code&gt; simultaneously is somehow buggy.
 To resolve the issue, add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aredn-localnode.service&lt;/code&gt; to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;After=&lt;/code&gt; list in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aredn-supernode.service&lt;/code&gt; (or vice versa).&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;WireGuard nodes fail to show up:&lt;/p&gt;

    &lt;p&gt;Add these lines to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/srv/(super|local)node/etc/rc.local&lt;/code&gt;:&lt;/p&gt;
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;ps | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;netifd&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then
     &lt;/span&gt;service network restart
 &lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;to reconfigure networking after everything starts up.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;systemd-unit-files&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd&lt;/code&gt; unit files&lt;/h2&gt;
&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/systemd/system/aredn-network-setup.service&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-systemd highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;[Unit]&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;Description&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;Configure AREDN container networking
&lt;span class=&quot;nt&quot;&gt;Wants&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;network.target
&lt;span class=&quot;nt&quot;&gt;After&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;local-fs.target network-pre.target systemd-sysctl.service systemd-modules-load.service
&lt;span class=&quot;nt&quot;&gt;Before&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;network.target shutdown.target network-online.target
&lt;span class=&quot;nt&quot;&gt;Conflicts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;shutdown.target

&lt;span class=&quot;k&quot;&gt;[Service]&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;Type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;oneshot
&lt;span class=&quot;nt&quot;&gt;RemainAfterExit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;yes
&lt;span class=&quot;nt&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip link add br-aredn type bridge
&lt;span class=&quot;nt&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip link add link br-aredn name br-aredn.wan type vlan id 1
&lt;span class=&quot;nt&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip link add link br-aredn name br-aredn.slan type vlan id 12 # supernode LAN, optional
&lt;span class=&quot;nt&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip link add link br-aredn name br-aredn.llan type vlan id 13 # localnode LAN, optional
&lt;span class=&quot;nt&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip address add 192.168.10.1/24 dev br-aredn.wan
&lt;span class=&quot;nt&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip link set br-aredn up
&lt;span class=&quot;nt&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip link set br-aredn.wan up
&lt;span class=&quot;nt&quot;&gt;ExecStop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip link set br-aredn.wan down
&lt;span class=&quot;nt&quot;&gt;ExecStop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip link set br-aredn down
&lt;span class=&quot;nt&quot;&gt;ExecStop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip link delete br-aredn.wan
&lt;span class=&quot;nt&quot;&gt;ExecStop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip link delete br-aredn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/systemd/system/aredn-supernode.service&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-systemd highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;[Unit]&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;Description&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;AREDN supernode
&lt;span class=&quot;nt&quot;&gt;Wants&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;network-online.target aredn-network-setup.service
&lt;span class=&quot;nt&quot;&gt;After&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;network-online.target aredn-network-setup.service

&lt;span class=&quot;k&quot;&gt;[Service]&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;Type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;simple
&lt;span class=&quot;nt&quot;&gt;ExecStartPre&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;-/usr/bin/ip link delete veth-super
&lt;span class=&quot;nt&quot;&gt;ExecStartPre&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;-/usr/bin/ip netns delete supernode
&lt;span class=&quot;nt&quot;&gt;ExecStartPre&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip netns add supernode
&lt;span class=&quot;nt&quot;&gt;ExecStartPre&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip link add veth-super master br-aredn type veth peer name eth0 netns supernode
&lt;span class=&quot;nt&quot;&gt;ExecStartPre&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip link set veth-super up
&lt;span class=&quot;nt&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/systemd-nspawn --network-namespace-path=/run/netns/supernode -D /srv/supernode --keep-unit --boot --kill-signal=SIGPWR --resolv-conf=no --timezone=no --link-journal=no --capability=CAP_NET_ADMIN
&lt;span class=&quot;nt&quot;&gt;ExecStopPost&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip link set veth-super down
&lt;span class=&quot;nt&quot;&gt;ExecStopPost&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip link delete veth-super
&lt;span class=&quot;nt&quot;&gt;ExecStopPost&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;/usr/bin/ip netns delete supernode
&lt;span class=&quot;nt&quot;&gt;Restart&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;on-failure

&lt;span class=&quot;k&quot;&gt;[Install]&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;WantedBy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;multi-user.target
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sed &lt;/span&gt;s/super/local/g /etc/systemd/system/aredn-supernode.service &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /etc/systemd/system/aredn-localnode.service
systemctl &lt;span class=&quot;nb&quot;&gt;enable&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--now&lt;/span&gt; aredn-supernode.service aredn-localnode.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;AREDN® is a registered trademark of Amateur Radio Emergency Data Network, Inc.&lt;/em&gt;&lt;/p&gt;

&lt;!-- Diagram Graphviz source:
```
digraph G {
    overlap = scale;
    rankdir = LR;
    ranksep = 1;

    subgraph cluster_host {
        host_wan [ label=&quot;ens0&quot; ];
        br_wan [ label=&quot;br-aredn.wan&quot;, color=blue, fontcolor=blue ];

        subgraph cluster_br_aredn {
            veth_super [ label=&quot;veth-super&quot; ];
            veth_local [ label=&quot;veth-local&quot; ];
            placeholder1 [ label=&quot;&quot;, shape=point, width=0.01, style=invis ];
            placeholder2 [ label=&quot;&quot;, shape=point, width=0.01, style=invis ];

            label = &quot;br-aredn&quot;;
            color = red;
            fontcolor = red;
        }

        label = &quot;host&quot;;
        color = black;
        style = dashed;
    }

    subgraph cluster_super {
        eth0_super [ label=&quot;eth0&quot; ];

        label = &quot;supernode&quot;;
        color = black;
        style = dashed;
    }

    subgraph cluster_local {
        eth0_local [ label=&quot;eth0&quot; ];

        label = &quot;localnode&quot;;
        color = black;
        style = dashed;
    }

    veth_super -&gt; eth0_super [ label=&quot;veth&quot;, dir=both ];
    veth_local -&gt; eth0_local [ label=&quot;veth&quot;, dir=both ];

    eth0_super -&gt; placeholder1 [ style=dashed, color=&quot;#8B3F2F&quot;, dir=none ];
    placeholder1 -&gt; eth0_local [ style=dashed, color=&quot;#8B3F2F&quot;, dir=none, fontcolor=&quot;#8B3F2F&quot;, label=&quot;DtD (VLAN 2)&quot; ];

    host_wan -&gt; br_wan [ style=dashed, color=blue ];
    br_wan -&gt; host_wan [ style=dashed, color=blue, fontcolor=blue, label=&quot;Forwarding + NAT&quot; ];
    br_wan -&gt; placeholder2 [ style=dashed, color=blue, dir=none, fontcolor=blue, label=&quot;WAN (VLAN 1)&quot; ];
    placeholder2 -&gt; eth0_super [ style=dashed, color=blue ];
    placeholder2 -&gt; eth0_local [ style=dashed, color=blue ];
}
```
--&gt;
</content>
 </entry>
 
 <entry>
   <title>Installing Arch Linux ARM on M1 UTM (Terminal)</title>
   <link href="https://getpoole.com/blog/2025/05/15/UTM-Arch/"/>
   <updated>2025-05-15T00:00:00+00:00</updated>
   <id>https://getpoole.com/2025/05/15/UTM-Arch</id>
   <content type="html">&lt;h1 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;Have a Linux box somewhere (required for creating a rootfs image)&lt;/li&gt;
  &lt;li&gt;Install UTM on your Mac&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;prepare-necessary-files&quot;&gt;Prepare necessary files&lt;/h1&gt;
&lt;p&gt;Download the ARMv8 generic &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tar.gz&lt;/code&gt; rootfs file from &lt;a href=&quot;https://archlinuxarm.org/about/downloads&quot;&gt;Arch Linux ARM&lt;/a&gt; to the Linux box.&lt;/p&gt;

&lt;p&gt;Extract the archive and obtain &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/boot/Image&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/boot/initramfs-linux.img&lt;/code&gt; files.&lt;/p&gt;

&lt;p&gt;Create an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ext4&lt;/code&gt; filesystem on a file and transfer the rootfs to it:&lt;/p&gt;
&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;fallocate &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; 2G rootfs.img
mkfs.ext4 rootfs.img
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;mount rootfs.img /mnt
&lt;span class=&quot;nb&quot;&gt;sudo tar&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-xvf&lt;/span&gt; ArchLinuxARM-aarch64-latest.tar.gz &lt;span class=&quot;nt&quot;&gt;-C&lt;/span&gt; /mnt
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;umount /mnt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then, transfer the three files to the Mac host (e.g. with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scp&lt;/code&gt;).&lt;/p&gt;

&lt;h1 id=&quot;create-utm-vm&quot;&gt;Create UTM VM&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;Open UTM and create a new VM:
    &lt;ul&gt;
      &lt;li&gt;Choose “Virtualize” and select “Linux”&lt;/li&gt;
      &lt;li&gt;“Use Apple Virtualization” is optional&lt;/li&gt;
      &lt;li&gt;Tick “Boot from kernel image”&lt;/li&gt;
      &lt;li&gt;Select the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Image&lt;/code&gt; file for “Linux kernel”&lt;/li&gt;
      &lt;li&gt;Select the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;initramfs-linux.img&lt;/code&gt; file for “Linux initial ramdisk”&lt;/li&gt;
      &lt;li&gt;Don’t select a Root FS image at this point, so that UTM can create the actual virtual hard disk for us&lt;/li&gt;
      &lt;li&gt;For terminal output, type `console=hvc0” in the “Kernel arguments” field&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Set other parameters as desired&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;further-configuration&quot;&gt;Further configuration&lt;/h1&gt;
&lt;p&gt;With the VM created, go to the settings window and click the last button on the left side labelled “New Drive”.&lt;/p&gt;

&lt;p&gt;Select “Import” and then choose the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rootfs.img&lt;/code&gt; file we created earlier.&lt;/p&gt;

&lt;h1 id=&quot;install-arch-linux&quot;&gt;Install Arch Linux&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;Start the VM: it would open two windows: the display window and the terminal window. The display window is not useful at this point, but don’t close it.&lt;/li&gt;
  &lt;li&gt;Go to the terminal window. Booting likely already failed, and there will be a rescue shell. This is expected.&lt;/li&gt;
  &lt;li&gt;The rootfs is likely &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/vdb&lt;/code&gt;. Try
    &lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mount /dev/vdb /new_root
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;If that works, enter&lt;/p&gt;
    &lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;exit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;so that the system will continue booting.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If that doesn’t work, list &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls /dev&lt;/code&gt; and try some other block devices. It could be &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/vda&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/vdc&lt;/code&gt;, etc.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Now, we should be in the Arch Linux ARM live environment. The default passowrds are &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;root:root&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;alarm:alarm&lt;/code&gt;.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;To prepare the Arch Linux ARM live environment for the installation guide, we need a few packages:
    &lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pacman-key &lt;span class=&quot;nt&quot;&gt;--init&lt;/span&gt;
pacman-key &lt;span class=&quot;nt&quot;&gt;--populate&lt;/span&gt; archlinuxarm
pacman &lt;span class=&quot;nt&quot;&gt;-Sy&lt;/span&gt; arch-install-scripts pacman glibc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;I also installed &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;btrfs-progs&lt;/code&gt; because I wanted a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;btrfs&lt;/code&gt; root.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Finally, follow &lt;a href=&quot;https://wiki.archlinux.org/title/Installation_guide&quot;&gt;the official Arch Linux installation guide&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In particular, I use&lt;/p&gt;
&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pacstrap &lt;span class=&quot;nt&quot;&gt;-K&lt;/span&gt; /mnt archlinuxarm-keyring base linux linux-firmware btrfs-progs vim git &lt;span class=&quot;nb&quot;&gt;sudo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;linux&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;linux-firmware&lt;/code&gt; are actually unnecessary for the system itself,
and can be removed afterwards. It is only needed during installation for generating the initramfs for the new kernel.&lt;/p&gt;

&lt;h1 id=&quot;inside-the-chroot&quot;&gt;Inside the chroot&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;Add QEMU drivers to the initramfs by modifying &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/mkinitcpio.conf&lt;/code&gt;:
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;MODULES=(virtio virtio_blk virtio_pci virtio_net)
BINARIES=(btrfs) # If btrfs is used
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After finishing the installation guide, copy &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/mnt/boot/Image&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/mnt/boot/initramfs-linux.img&lt;/code&gt; from the VM back to the host.
The live environment has &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sshd&lt;/code&gt; enabled by default.&lt;/p&gt;

&lt;h1 id=&quot;before-the-first-boot&quot;&gt;Before the first boot&lt;/h1&gt;
&lt;p&gt;It is necessary to copy or move &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Image&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;initramfs-linux.img&lt;/code&gt; to the UTM data directory at (normally) &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/Library/Containers/com.utmapp.UTM/Data/Documents/&amp;lt;NAME&amp;gt;.utm&lt;/code&gt; on the host
because UTM makes a copy of the files we originally selected for the kernel and initramfs files.&lt;/p&gt;

&lt;p&gt;Then, modify the kernel arguments:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;console=hvc0 root=/dev/vda
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Try starting the VM again. It should boot into the Arch Linux ARM system.&lt;/p&gt;

&lt;p&gt;I use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemd-networkd&lt;/code&gt; for networking, so I need to create &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/systemd/network/enp0s1.network&lt;/code&gt; with the following content:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[Match]
Name=enp0s1
[Network]
DHCP=yes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then, enable the service:&lt;/p&gt;
&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl &lt;span class=&quot;nb&quot;&gt;enable&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--now&lt;/span&gt; systemd-networkd systemd-resolved
&lt;span class=&quot;nb&quot;&gt;ln&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-sf&lt;/span&gt; /run/systemd/resolve/resolv.conf /etc/resolv.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;further-set-up&quot;&gt;Further set up&lt;/h1&gt;
&lt;h2 id=&quot;shared-drive-and-rosetta&quot;&gt;Shared drive and rosetta&lt;/h2&gt;
&lt;p&gt;Set up shared folders and rosetta mounts by adding these to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/fstab&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rosetta /rosetta        virtiofs        ro,nofail       0       0
share   /mnt/utm        virtiofs        rw,nofail       0       0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Set up rosetta in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/binfmt.d/rosetta.conf&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;:rosetta:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/rosetta/rosetta:PCF
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;optional-install-a-full-x64-system&quot;&gt;(Optional) Install a full x64 system&lt;/h2&gt;
&lt;p&gt;I want to install some non-free Linux-only software like ANSYS Lumerical.
They usually support Ubuntu more than Arch, so I will &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;debootstrap&lt;/code&gt; an entire
Ubuntu system that uses rosetta.&lt;/p&gt;

&lt;p&gt;First, we need to install the installers:&lt;/p&gt;
&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pacman &lt;span class=&quot;nt&quot;&gt;-S&lt;/span&gt; debootstrap binutils
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Create and bind-mount the target folder:&lt;/p&gt;
&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; /x64/dev /x64/proc /x64/sys
mount &lt;span class=&quot;nt&quot;&gt;--bind&lt;/span&gt; /dev /x64/dev
mount &lt;span class=&quot;nt&quot;&gt;--bind&lt;/span&gt; /dev/pts /x64/dev/pts
mount &lt;span class=&quot;nt&quot;&gt;--bind&lt;/span&gt; /sys /x64/sys
mount &lt;span class=&quot;nt&quot;&gt;--bind&lt;/span&gt; /run /x64/run
mount &lt;span class=&quot;nt&quot;&gt;--bind&lt;/span&gt; /proc /x64/proc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Run the Ubuntu installer:&lt;/p&gt;
&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;debootstrap &lt;span class=&quot;nt&quot;&gt;--extractor&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;ar &lt;span class=&quot;nt&quot;&gt;--arch&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;amd64 &lt;span class=&quot;nt&quot;&gt;--merged-usr&lt;/span&gt; noble /x64 https://archive.ubuntu.com/ubuntu
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Set up a resolver:&lt;/p&gt;
&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;nameserver 1.1.1.1&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; /x64/etc/resolv.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, we can &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chroot&lt;/code&gt; into the system (with a different architecture!):&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;chroot /x64
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Making a boost converter</title>
   <link href="https://getpoole.com/blog/2024/03/07/Boost-Converter/"/>
   <updated>2024-03-07T00:00:00+00:00</updated>
   <id>https://getpoole.com/2024/03/07/Boost-Converter</id>
   <content type="html">&lt;h2 id=&quot;background&quot;&gt;Background&lt;/h2&gt;
&lt;p&gt;As described in the &lt;a href=&quot;https://maiyun.me/blog/2022/11/11/Buck-Converter&quot;&gt;previous post&lt;/a&gt; in 2022, I made a simple buck converter controlled by a Raspberry Pi.
After &lt;a href=&quot;https://github.com/myzhang1029/thekit&quot;&gt;some drama&lt;/a&gt; happened with its SD card, I migrated the entire circuit to my brand new RPi Pico with some slight modifications. To make the circuit run on pure 5V, I added a cheap boost board before my circuit to generate 20V.&lt;/p&gt;

&lt;p&gt;For those around me, these things all happened during and after the Great Power Outage of 2022, in which I had to run everything on a 6V lead-acid battery.
Therefore, this buck-boost-buck topology had been bugging me from day one: it is terrible in terms of efficiency and EM interference.
I had always wanted to make my own boost converter instead. However, it scares me that “theoretically” this circuit will be capable of generating an infinite voltage. Do I need to add closed-loop feedback for it? What if I miscalculated and it fries my Pico?&lt;/p&gt;

&lt;p&gt;This week I finally ran some SPICE models and decided to get my hands dirty.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/posts/2024-03-07/Boost.png&quot; alt=&quot;Boost converter LTspice simulation circuit&quot; /&gt;
&lt;img src=&quot;/blog/assets/posts/2024-03-07/Boostgraph.png&quot; alt=&quot;Boost converter LTspice simulation waveforms&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;design&quot;&gt;Design&lt;/h2&gt;
&lt;p&gt;I am not actually designing the topology from scratch. I took the one on Wikipedia and simply chose the components based on my needs.&lt;/p&gt;

&lt;p&gt;The first problem was that I could not get anything higher than 7V with the RJK1536DPN I took off. I felt like there could be two possible reasons: either the on-resistance was too high, or the gate voltage was too low. I tried both, and it turned out that the gate voltage was the problem. Fortunately, I still had five IRL520N MOSFETs with a gate threshold voltage of 2V. It worked like a charm and gave me 9.2V without tuning anything else.&lt;/p&gt;

&lt;!--
\begin{circuitikz}[scale = 1.5]
    \draw (3, 0.5) node [nigfete, anchor=S] (nmos) {};
    \node at (3.9, 1) {IRL520N};
    \node at (nmos.G) [anchor=east, align=center] {\qty{125}{\kilo\hertz} \\ PWM \\ \qty{3.3}{\volt}};
    \draw (0, 2) to [voltage source, v=\qty{5}{\volt}] (0, 0) -| (nmos.S);
    \draw (0, 0) to [short, *-] (0, 0) node[ground]{};
    \draw (0, 2) to [L, l=\qty{30}{\micro\henry}] (3, 2) -| (nmos.D -| {(3, 0)});
    \draw (3, 2) to [sDo, *-*, l=SB140] (6, 2) to [eC, l=\qty{47}{\micro\farad}] (6, 0) node[ground]{};
    \draw (6, 2) to [short, *-*] (9, 2) to [R, l_=load] (9, 0) node[ground]{};
    \draw (9, 2) to [R, l=\qty{39}{\kilo\ohm}] (12, 2) to [R, l_=\qty{6.8}{\kilo\ohm}] (12, 0) node[ground]{};
    \draw (12, 2) to [short, *-*] (13, 2) to [R, l=\qty{1}{\kilo\ohm}] (15, 2) node[anchor=west] {ADC};
    \draw (13, 1) node [ground]{} to [sDo] (13, 2) to [sDo] (13, 3) node[anchor=south] {AVDD};
\end{circuitikz}
--&gt;
&lt;p&gt;&lt;img src=&quot;/blog/assets/posts/2024-03-07/circuit.svg&quot; alt=&quot;circuit diagram of a PWM-controlled boost converter&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I also included a voltage divider on the output to measure the voltage with the Pico’s ADC in this diagram. I have not physically implemented it yet though.&lt;/p&gt;

&lt;p&gt;The rest was pretty much just controlling the PWM signal. By trial and error on the breadboard, I found that a frequency of around 125kHz generated the highest voltage. I also swapped the inductor to one I took from another dead switch-mode power supply.&lt;/p&gt;

&lt;p&gt;The next thing that worried me was that this circuit cannot be turned off: even when the PWM duty cycle is 0, the load will still see 5V. However, my measurements showed that the light bulb only drew some microamps at this state, so I decided to leave it as it was.&lt;/p&gt;

&lt;p&gt;Finally, I cannot leave the MOSFET on constantly: at this state, we are essentially shorting the 5V supply at steady state. For now, this is done on the software side. Maybe I should add something else to the circuit to prevent this from happening.&lt;/p&gt;

&lt;h2 id=&quot;results&quot;&gt;Results&lt;/h2&gt;
&lt;p&gt;I did these measurements on my Mac’s USB port, which definitely did not try to provide a constant voltage.&lt;/p&gt;

&lt;p&gt;When switching at 60kHz, 58% duty cycle, I got 60mA@14.2V with an input of 0.415A@4.8V. That is a terrible efficiency of 43%. At 125kHz, 58% duty cycle, I got 72mA@13.12V with an input of just 0.227A@4.9V. Now the efficiency is a whopping 85%.&lt;/p&gt;

&lt;p&gt;Again I studied the relationship between the output voltage and the duty cycle on the completed circuit. This one was able to reach a higher voltage of 40V, probably because the finished circuit has much lower resistance than my rusty breadboard plus jumper wires setup.
However, the data was still weird, probably because the input voltage was not constant. I will try to do this again with a more stable power supply.
&lt;!--
[[  0.  ,   5.  ],
       [  7.  ,   6.39],
       [ 14.  ,   7.65],
       [ 21.  ,   7.78],
       [ 28.  ,   7.84],
       [ 35.  ,   7.9 ],
       [ 42.  ,   7.97],
       [ 49.  ,   8.02],
       [ 56.  ,   8.06],
       [ 63.  ,   8.1 ],
       [ 70.  ,   8.13],
       [ 77.  ,   8.16],
       [ 84.  ,   8.18],
       [ 91.  ,   8.21],
       [ 98.  ,   8.25],
       [105.  ,   8.27],
       [112.  ,   8.29],
       [119.  ,   8.31],
       [126.  ,   8.35],
       [133.  ,   8.37],
       [140.  ,   8.4 ],
       [147.  ,   8.42],
       [154.  ,   8.44],
       [161.  ,   8.47],
       [168.  ,   8.49],
       [175.  ,   8.51],
       [182.  ,   8.52],
       [189.  ,   8.55],
       [196.  ,   8.58],
       [203.  ,   8.6 ],
       [210.  ,   8.61],
       [217.  ,   8.63],
       [224.  ,   8.66],
       [231.  ,   8.69],
       [238.  ,   8.71],
       [245.  ,   8.72],
       [252.  ,   8.73],
       [259.  ,   8.77],
       [266.  ,   8.8 ],
       [273.  ,   8.81],
       [280.  ,   8.82],
       [287.  ,   8.84],
       [294.  ,   8.87],
       [301.  ,   8.9 ],
       [308.  ,   8.92],
       [315.  ,   8.92],
       [322.  ,   8.93],
       [329.  ,   8.96],
       [336.  ,   9.  ],
       [343.  ,   9.02],
       [350.  ,   9.02],
       [357.  ,   9.03],
       [364.  ,   9.05],
       [364.  ,   9.01],
       [371.  ,   9.1 ],
       [371.  ,   9.05],
       [378.  ,   9.12],
       [378.  ,   9.06],
       [385.  ,   9.12],
       [385.  ,   9.45],
       [392.  ,   9.13],
       [392.  ,   9.67],
       [399.  ,   9.15],
       [399.  ,   9.88],
       [406.  ,   9.2 ],
       [406.  ,  10.11],
       [413.  ,   9.23],
       [413.  ,  11.14],
       [420.  ,   9.24],
       [420.  ,  11.54],
       [427.  ,   9.24],
       [427.  ,  11.88],
       [434.  ,   9.25],
       [434.  ,  12.21],
       [441.  ,  12.57],
       [448.  ,  12.97],
       [455.  ,  13.37],
       [462.  ,  13.79],
       [469.  ,  14.24],
       [476.  ,  14.74],
       [483.  ,  15.26],
       [490.  ,  15.83],
       [497.  ,  16.44],
       [504.  ,  17.12],
       [511.  ,  17.87],
       [518.  ,  18.69],
       [525.  ,  19.62],
       [532.  ,  20.66],
       [539.  ,  21.83],
       [546.  ,  23.1 ],
       [553.  ,  24.38],
       [560.  ,  25.51],
       [567.  ,  26.19],
       [574.  ,  26.42],
       [581.  ,  26.47],
       [588.  ,  26.4 ],
       [595.  ,  26.34],
       [602.  ,  26.59],
       [609.  ,  27.52],
       [616.  ,  29.17],
       [623.  ,  31.46],
       [630.  ,  33.78],
       [637.  ,  35.11],
       [644.  ,  35.49],
       [651.  ,  35.55],
       [658.  ,  35.48],
       [665.  ,  35.4 ],
       [672.  ,  35.2 ],
       [679.  ,  35.04],
       [686.  ,  35.36],
       [693.  ,  37.46],
       [700.  ,  40.77]]
--&gt;
&lt;img src=&quot;/blog/assets/posts/2024-03-07/raw-resp.svg&quot; alt=&quot;Graph of the output voltage versus duty cycle&quot; /&gt;
&lt;em&gt;Note:
This time, the duty cycle is out of 1000.
The light turns on at around 21.&lt;/em&gt;&lt;/p&gt;

&lt;h2 id=&quot;reflection&quot;&gt;Reflection&lt;/h2&gt;
&lt;p&gt;I was surprised by how high the efficiency was, even just on the breadboard. I used to be surprised at the efficiencies shown in those SMPS IC datasheets, but now I feel like maybe it is just a matter of choosing the right components. Also, I am using a discrete MOSFET instead of one crammed in a tiny package, so the loss and heat dissipation are much better. In fact, the MOSFET was barely warm after running for a while (except for the time I accidentally left the gate high).&lt;/p&gt;

&lt;p&gt;A boost converter definitely comes with more responsibilities than a buck converter. In fact, the last two data points on the graph were already outside of the light bulb’s rating, voltage-wise. Maybe I should add a feedback loop. Since the circuit is always working with the same load, I am simply limiting the duty cycle to 530 out of 1000. It works for now.&lt;/p&gt;

&lt;h2 id=&quot;update-2024-03-08&quot;&gt;Update (2024-03-08)&lt;/h2&gt;
&lt;p&gt;Today, I did a more “proper” test with a regulated supply. The input voltage had a range of 5.22V to 5.28V.&lt;/p&gt;

&lt;p&gt;Two interesting results that happened in both tests:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;This circuit has some kind of a hysteresis behaviour around 42% duty cycle:
    &lt;ul&gt;
      &lt;li&gt;If I start low from an output of below 9.1V (duty cycle below 37%) and step up the duty cycle across 42%, the voltage jumps from 9V to 12V.&lt;/li&gt;
      &lt;li&gt;If it enters this 37% to 42% region when the duty cycle is already above 37%, the output voltage curve is smooth.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;There is an output dip at around 58% duty cycle.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I suspect that both of these are because of the interaction with the (very nonlinear) load.
I do not plan to test again with a constant load though… I just want to make an ASIC (haha).
&lt;!--
[(0, 5.1),
 (5, 5.5),
 (10, 7.5),
 (15, 7.71),
 (21, 7.81),
 (26, 7.85),
 (31, 7.89),
 (37, 7.95),
 (42, 7.99),
 (47, 8.02),
 (53, 8.06),
 (58, 8.08),
 (63, 8.11),
 (68, 8.14),
 (74, 8.16),
 (79, 8.18),
 (84, 8.2),
 (90, 8.22),
 (95, 8.25),
 (100, 8.27),
 (106, 8.29),
 (111, 8.31),
 (116, 8.32),
 (121, 8.34),
 (127, 8.37),
 (132, 8.39),
 (137, 8.4),
 (143, 8.42),
 (148, 8.43),
 (153, 8.45),
 (159, 8.48),
 (164, 8.49),
 (169, 8.5),
 (174, 8.51),
 (180, 8.53),
 (185, 8.55),
 (190, 8.58),
 (196, 8.59),
 (201, 8.6),
 (206, 8.61),
 (212, 8.63),
 (217, 8.66),
 (222, 8.68),
 (227, 8.69),
 (233, 8.7),
 (238, 8.71),
 (243, 8.72),
 (249, 8.74),
 (254, 8.76),
 (259, 8.76),
 (265, 8.78),
 (270, 8.79),
 (275, 8.79),
 (280, 8.81),
 (286, 8.84),
 (291, 8.86),
 (296, 8.88),
 (302, 8.89),
 (307, 8.9),
 (312, 8.91),
 (318, 8.93),
 (323, 8.97),
 (328, 8.99),
 (333, 9.0),
 (339, 9.0),
 (344, 9.01),
 (349, 9.03),
 (355, 9.05),
 (360, 9.09),
 (365, 9.11),
 (371, 9.12),
 (376, 9.12),
 (381, 9.13),
 (386, 9.14),
 (392, 9.17),
 (397, 9.22),
 (402, 9.24),
 (408, 9.24),
 (413, 9.24),
 (418, 9.25),
 (424, 12.15),
 (429, 12.39),
 (434, 12.63),
 (439, 12.89),
 (445, 13.23),
 (450, 13.53),
 (455, 13.83),
 (461, 14.24),
 (466, 14.6),
 (471, 14.97),
 (477, 15.44),
 (482, 15.85),
 (487, 16.27),
 (492, 16.72),
 (498, 17.27),
 (503, 17.78),
 (508, 18.27),
 (514, 18.94),
 (519, 19.54),
 (524, 20.21),
 (530, 21.09),
 (418, 11.9),
 (413, 11.68),
 (408, 11.47),
 (402, 11.23),
 (397, 11.04),
 (392, 10.82),
 (386, 10.55),
 (381, 9.68),
 (376, 9.53),
 (371, 9.06),
 (365, 9.05),
 (360, 9.04),
 (355, 9.03),
 (349, 8.96),
 (535, 21.93),
 (540, 22.84),
 (545, 23.86),
 (551, 25.18),
 (556, 26.31),
 (561, 27.4),
 (567, 28.36),
 (572, 28.8),
 (577, 29.03),
 (583, 29.1),
 (588, 29.08),
 (593, 29.03),
 (598, 28.98),
 (604, 29.0),
 (609, 29.28),
 (614, 29.98),
 (620, 31.51),
 (625, 33.32),
 (630, 35.25)]
--&gt;
&lt;img src=&quot;/blog/assets/posts/2024-03-07/raw-resp2.svg&quot; alt=&quot;Graph of the output voltage versus duty cycle&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I also used our lab’s nice oscilloscope to measure the gate signal and the output.
I forgot to set the mode, so although it shows a vertical division of 100mA, it actually
means 1V.&lt;/p&gt;

&lt;p&gt;What I cannot explain is the gate ringing. It is probably not the result of resonance on the gate,
because the ringing does not immediately begin after an edge: it actually always terminates at the
rising edge.
Its initial amplitude also increases with the duty cycle, instead of being constant like the rising or falling time.
This probably means it is related to the MOSFET and the load. The ringing can bring the gate voltage to below -0.5V after the duty cycle exceeds 50%, which exceeds the absolute maximum rating of the Pico’s GPIO pin. I need to try to fix this when I have time.&lt;/p&gt;

&lt;p&gt;The output ripple at 53% duty cycle was around 0.36V. The spikes of around 3.3V are a bigger worry.&lt;/p&gt;

&lt;h3 id=&quot;gate-signal-at-10-duty-cycle&quot;&gt;Gate signal at 10% duty cycle&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;/blog/assets/posts/2024-03-07/Oscilloscope/10.png&quot; alt=&quot;Gate signal at 10% duty cycle&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;gate-signal-at-15-duty-cycle&quot;&gt;Gate signal at 15% duty cycle&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;/blog/assets/posts/2024-03-07/Oscilloscope/15.png&quot; alt=&quot;Gate signal at 15% duty cycle&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;gate-signal-at-47-duty-cycle&quot;&gt;Gate signal at 47% duty cycle&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;/blog/assets/posts/2024-03-07/Oscilloscope/47.png&quot; alt=&quot;Gate signal at 47% duty cycle&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;gate-signal-at-58-duty-cycle&quot;&gt;Gate signal at 58% duty cycle&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;/blog/assets/posts/2024-03-07/Oscilloscope/58.png&quot; alt=&quot;Gate signal at 58% duty cycle&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;output-at-53-duty-cycle-ac-coupling&quot;&gt;Output at 53% duty cycle (AC coupling)&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;/blog/assets/posts/2024-03-07/Oscilloscope/53out.png&quot; alt=&quot;Output at 53% duty cycle&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Making a buck converter</title>
   <link href="https://getpoole.com/blog/2022/11/11/Buck-Converter/"/>
   <updated>2022-11-11T00:00:00+00:00</updated>
   <id>https://getpoole.com/2022/11/11/Buck-Converter</id>
   <content type="html">&lt;h2 id=&quot;background&quot;&gt;Background&lt;/h2&gt;
&lt;p&gt;I have a “smart” control system in my room. Actually, it is quite dumb: it is just a Raspberry Pi 3B+ connected to a beefy power supply.
The Pi itself is connected to a temperature probe to monitor my room temperature,
and a Ubiquiti UAP-LR I dug out from the IT dumpster powered by a homemade passive POE cable to provide tunnelled Wi-Fi. The Pi also acts as a router.&lt;/p&gt;

&lt;p&gt;Last year, I had a solid-state relay (provided by my physics teacher) in the light fixture that I could use to control the light.
Later, I moved the relay to other projects for the house. So that I still have a “smart” light,
I put up a 20V light bulb controlled by the Pi via a transistor.
I tried to dim it like an ordinary LED by outputting a PWM signal, but it did not work.
I did not understand it back then, so I replaced the transistor with a spare ESC I had, which did not help either.
Considering that this light bulb is designed to operate from 10V to 35V and there is a whole bunch of circuits inside,
this is probably reasonable: it may have its own stabilizing circuitry inside.&lt;/p&gt;

&lt;p&gt;Earlier this school year, I decided to apply my RF knowledge and do something to my little light.
I put an aluminum capacitor across it and a resistor in series with it: forming an RC filter.&lt;/p&gt;

&lt;!--
\begin{circuitikz}
\draw (-3,2) to (-3, 1) to [voltage source, l_={\qty{20}{\volt}, PWM}] (-3, -1) to (-3, -2) node[ground]{};
\draw (-3,2) to (0,2);
\draw (0,2) to [R, -*, l_=\qty{25}{\ohm}] (0,0) to [C, l_=\qty{4.7}{\micro\farad}] (0,-2) node[ground]{};
\node at (1.5,1) {\color{red} Waste power!};
\draw (0,0) to (2,0) to [led] (2, -2) node[ground]{};
\end{circuitikz}
--&gt;
&lt;p&gt;&lt;img src=&quot;/blog/assets/posts/2022-11-11/circuit-old.svg&quot; alt=&quot;circuit diagram of a PWM-controlled light with a RC low pass filter&quot; /&gt;&lt;/p&gt;

&lt;p&gt;It turns out that the resistor can get quite hot, although I already used four bigger resistors in parallel.
The voltage drop across the resistors was also significant, leaving the light never completely on.
Well, at least the system is dimming now.&lt;/p&gt;

&lt;p&gt;Then one day, when I was adjusting another power supply, I realized I was making a buck converter unknowingly!
Realizing that, I moved on to design a real buck converter so as to make my place look nicer.&lt;/p&gt;

&lt;h2 id=&quot;design&quot;&gt;Design&lt;/h2&gt;
&lt;p&gt;Most of the simple buck circuits online put the switch on the positive side of the circuit.
It may make sense in other common use cases, but definitely not here.
My Pi and the 20V power supply share the same reference, so I would either need a driver circuit or fry my Pi.&lt;/p&gt;

&lt;p&gt;Well, IB students are critical thinkers. We won’t be puzzled by this: I designed my own circuit with a common ground.&lt;/p&gt;

&lt;!--
\begin{circuitikz}
\draw (-2, 2) to [sV, -*, l_={\qty{3.3}{\volt}, PWM}] (-2, 0) to (-3, 0)
   to (-3, -0.2) node[ground]{}
 (-2, 0) to (-0.5, 0) node [nigfete, anchor=S, rotate=-90, scale=1.5] (nmos) {}
 (nmos.G) to (nmos.G |- {(0, 2)}) to (-2, 2)
 (nmos.D -| {(3, 0)}) coordinate (DAn) to [diode, *-*, l_=1N4007] (3,-3) coordinate (DCath)
   to (-2, -3) to [voltage source, v=\qty{20}{\volt}] (-2, 0)
 (DCath) to [L, l_=\(3\times\qty{22}{\micro\henry}\)] (6, -3)
 (DAn) to (8, 0) to [R, l_=load] (8, -3) to (6, -3)
   to [eC, *-*, l=\qty{14.7}{\micro\farad}] (6, 0) to (nmos.D);
\node at (2, 1.5) {RJK1536DPN};
\end{circuitikz}
--&gt;
&lt;p&gt;&lt;img src=&quot;/blog/assets/posts/2022-11-11/circuit-buck.svg&quot; alt=&quot;Circuit of a buck converter&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The N-channel MOSFET in the circuit, RJK1536DPN, was taken from a dead EV charger in the dumpster as well.
Initially, I tried to work out all the parameters with the loop rule and the junction rule.
Well, I did make some progress, but I ended up using an LTSpice simulation to iterate the design faster.
Now I understand the advantage of the “conventional” design: in my version,
the load has a floating reference. However, this should not matter for my little light bulb.&lt;/p&gt;

&lt;h2 id=&quot;reflection&quot;&gt;Reflection&lt;/h2&gt;
&lt;p&gt;There is still a glitch with this design. When the duty cycle is more than 41%, the voltage does not seem to change much.
That’s probably because the light does not consume enough charge from the capacitor.
In other words, I want it to operate in continuous mode, where the output voltage is proportional to the duty cycle.
However, the load is too light, so the converter is in discontinuous mode.
It is just a light anyways, I do not mind if the rise/fall time is larger, so I will probably adjust the inductors and capacitors.
In the meantime, I will compensate for the nonlinearity on the software side.&lt;/p&gt;

&lt;p&gt;Nonetheless, this is my first buck converter made by hand, and I am glad to see it work.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/posts/2022-11-11/buck-light.jpg&quot; alt=&quot;Image of my buck converter&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;update-2022-11-23&quot;&gt;Update (2022-11-23)&lt;/h2&gt;
&lt;p&gt;I found some extra time during the power outage and experimented with the
response curve of my creation. At 100kHz’s switching frequency and 19.90V’s
input, here is the result:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/blog/assets/posts/2022-11-11/raw-resp.svg&quot; alt=&quot;Graph of the output voltage versus duty cycle&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note:
The circuit seems to resonate at the ducy cycle of 420000.
After the duty cycle is below 80000, the load light turns off.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I guess one thing I can do is to fit a curve on the operation region and find
a way to give linear output stepping.
&lt;!-- Raw data:
 (Dcycle, (min, max)),
 (1000000, (19.43, 19.5)),
 (980000, (17.67, 18.39)),
 (960000, (17.03, 17.09)),
 (940000, (16.71, 16.72)),
 (920000, (16.61, 16.64)),
 (900000, (16.62, 16.63)),
 (880000, (16.64, 16.67)),
 (860000, (16.68, 16.7)),
 (840000, (16.72, 16.74)),
 (820000, (16.73, 16.75)),
 (800000, (16.76, 16.78)),
 (780000, (16.79, 16.82)),
 (760000, (16.83, 16.86)),
 (740000, (16.86, 16.88)),
 (720000, (16.88, 16.91)),
 (700000, (16.87, 16.89)),
 (680000, (15.91, 16.72)),
 (660000, (15.67, 15.76)),
 (640000, (15.44, 15.48)),
 (620000, (14.99, 15.05)),
 (600000, (14.47, 14.51)),
 (580000, (14.03, 14.08)),
 (560000, (13.81, 13.86)),
 (540000, (13.7, 13.8)),
 (520000, (9.1, 13.59)),
 (500000, (12.77, 12.9)),
 (480000, (11.2, 11.65)),
 (460000, (10.3, 10.65)),
 (440000, (9.27, 9.28)),
 (420000, (9.14, 9.22)),
 (400000, (9.09, 9.1)),
 (380000, (9.0, 9.02)),
 (360000, (8.97, 8.99)),
 (340000, (8.84, 8.86)),
 (320000, (8.78, 8.8)),
 (300000, (8.74, 8.75)),
 (280000, (8.67, 8.0)),
 (260000, (8.58, 8.59)),
 (240000, (8.55, 8.56)),
 (220000, (8.45, 8.46)),
 (200000, (8.39, 8.4)),
 (180000, (8.39, 8.4)),
 (160000, (8.25, 8.26)),
 (140000, (8.22, 8.23)),
 (120000, (8.11, 8.12)),
 (100000, (8.05, 8.06)),
 (80000, (7.84, 7.85)),
 (60000, (5.03, 5.04)),
 (40000, (1.161, 2.595)),
 (20000, (0.569, 0.729)),
--&gt;&lt;/p&gt;

&lt;h2 id=&quot;update-2022-11-30&quot;&gt;Update (2022-11-30)&lt;/h2&gt;
&lt;p&gt;Here is the new dimmer:&lt;/p&gt;
&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;intensity_to_dcycle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;perceived_intensity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# Logarithmic dimming
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;real_intensity&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;**&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;perceived_intensity&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;101&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# Linearly scale to voltage
&lt;/span&gt;    &lt;span class=&quot;n&quot;&gt;voltage&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;real_intensity&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;19.2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;7.845&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;7.845&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# Piecewise fit
&lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;7.845&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;voltage&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;9.275&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;281970&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;7.664&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;voltage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;9.275&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;voltage&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;13.75&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;26520&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;6.959&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;voltage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;13.75&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;voltage&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;16.88&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;49485&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;2.529&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;voltage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;16.88&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;voltage&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;19.2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;min&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;21692&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;26.90&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;voltage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)),&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1000000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# Out of range
&lt;/span&gt;    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Leaving Hotmail.com</title>
   <link href="https://getpoole.com/blog/2022/11/02/Goodbye-Outlook/"/>
   <updated>2022-11-02T00:00:00+00:00</updated>
   <id>https://getpoole.com/2022/11/02/Goodbye-Outlook</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://hotmail.com&quot;&gt;Hotmail.com&lt;/a&gt;, or really, Outlook.com, is one of the email providers I have used for the longest time.
In fact, if I remembered correctly, this is my tenth year using it.
Back then, it was a pretty sound choice: I was already using 163.com as my main email,
and Hotmail was quite a credible alternative — considering that Google was already exiting China.&lt;/p&gt;

&lt;p&gt;Over those years, Microsoft was not that bad at all. Windows remains &lt;em&gt;the&lt;/em&gt; &lt;a href=&quot;https://en.wikipedia.org/wiki/Usage_share_of_operating_systems#Desktop_and_laptop_computers&quot;&gt;most widely&lt;/a&gt; used operating system on desktops and laptops,
&lt;a href=&quot;https://www.bing.com&quot;&gt;Bing.com&lt;/a&gt;, another Microsoft service, has been one of the only &lt;em&gt;usable&lt;/em&gt; search engines in Mainland China: after Google exited,
Baidu.com essentially became an advertisement board. More impactfully, after Microsoft &lt;a href=&quot;https://blogs.microsoft.com/blog/2018/06/04/microsoft-github-empowering-developers/&quot;&gt;acquired&lt;/a&gt; GitHub in June 2018,
it has become an inseparable part of my online presence.
I eventually made the shift to change my primary email to Hotmail in March 2020,
because at that time, NetEase (163) emails had way too many promotional emails.&lt;/p&gt;

&lt;p&gt;People do not notice problems before getting close to each other.&lt;/p&gt;

&lt;p&gt;As students, we wish each other Happy Birthdays. Soon after switching over to Outlook calendars, I noticed that the birthdays were shown &lt;a href=&quot;https://discussions.apple.com/thread/253035094&quot;&gt;off-by-one-day&lt;/a&gt; on Apple devices.
Then, when I switched over to Linux, using Thunderbird as my email client, I noticed that Outlook calendars do not use a standard protocol,
and are, therefore, difficult to synchronize.&lt;/p&gt;

&lt;p&gt;The spam filter did not become an issue, until I saw my school application, my scholarship application, and even my visa application,
ending up in the junk folder. The server very “nicely” deletes any “junk” emails permanently after ten days,
meaning that I have to check that folder very often: see it or miss it.
What is even worse, there is &lt;a href=&quot;https://answers.microsoft.com/en-us/outlook_com/forum/all/how-can-i-disable-spam-filters-for-my-hotmail/5d295a6e-38ad-4996-9eed-346c0fc3c405&quot;&gt;no way&lt;/a&gt; to turn it off.
Most guides online only tell you how to turn it off on Outlook clients, but Outlook.com will continue filtering important emails happily.&lt;/p&gt;

&lt;p&gt;I ended up creating a Power Automate flow to automatically move junk to inbox.&lt;/p&gt;

&lt;pre&gt;
When a new email arrives (V2) in &quot;Junk&quot;, move it to &quot;INBOX&quot;.
&lt;/pre&gt;

&lt;p&gt;Ironic, isn’t it? Despite that, at the time of writing,
it seems that Outlook still has a way to populate my junk folder with legitimate emails.&lt;/p&gt;

&lt;p&gt;That is not it either. My own domain, with a dedicated IP from Oracle Cloud, can send emails to Gmails, other domains, and even Outlook for Business domains,
but not hotmail.com nor outlook.com. Why would you block me from sending emails to myself?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sorry, but not all users need a spam filter.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sometimes, people &lt;em&gt;need&lt;/em&gt; the ability to control their own destinies. As ESPs, they have too much power over what users see.&lt;/p&gt;

&lt;p&gt;This time, it is a road blocker.&lt;/p&gt;

&lt;p&gt;Sorry, Outlook. I am moving to my own email. Please treat well those without the ability to set one up.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>On caring - Nate Soares</title>
   <link href="https://getpoole.com/blog/2022/04/03/On-Caring/"/>
   <updated>2022-04-03T00:00:00+00:00</updated>
   <id>https://getpoole.com/2022/04/03/On-Caring</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://mindingourway.com/on-caring/&quot;&gt;Original Post&lt;/a&gt; published on 04 Oct. 2014.
None of the original text has been changed and this is simply a copy of
the original post for convenience.&lt;/p&gt;

&lt;h1 id=&quot;1&quot;&gt;1&lt;/h1&gt;

&lt;p&gt;I’m not very good at &lt;em&gt;feeling&lt;/em&gt; the size of large numbers. Once you start
tossing around numbers larger than 1000 (or maybe even 100), the numbers
just seem “big”.&lt;/p&gt;

&lt;p&gt;Consider Sirius, the brightest star in the night sky. If you told me
that Sirius is as big as a million earths, I would feel like that’s a
lot of Earths. If, instead, you told me that you could fit a &lt;em&gt;billion&lt;/em&gt;
Earths inside Sirius… I would still just feel like that’s a lot of
Earths.&lt;/p&gt;

&lt;p&gt;The feelings are almost identical. &lt;em&gt;In context&lt;/em&gt;, my brain grudgingly
admits that a billion is a lot larger than a million, and puts forth a
token effort to feel like a billion-Earth-sized star is bigger than a
million-Earth-sized star. But out of context — if I wasn’t anchored at
“a million” when I heard “a billion” — both these numbers just feel
vaguely large.&lt;/p&gt;

&lt;p&gt;I feel a &lt;em&gt;little&lt;/em&gt; respect for the bigness of numbers, if you pick really
really large numbers. If you say “one followed by a hundred zeroes”,
then this feels &lt;em&gt;a lot&lt;/em&gt; bigger than a billion. But it certainly doesn’t
feel (in my gut) like it’s 10 000 000 000 000 000 000 000 000 000 000
000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
000 000 times bigger than a billion. Not in the way that four apples
&lt;em&gt;internally feels&lt;/em&gt; like twice as many as two apples. My brain can’t even
begin to wrap itself around this sort of magnitude differential.&lt;/p&gt;

&lt;p&gt;This phenomena is related to &lt;a href=&quot;http://lesswrong.com/lw/hw/scope_insensitivity/&quot;&gt;scope
insensitivity&lt;/a&gt;, and
it’s important to me because I live in a world where sometimes the
things I care about are really really numerous.&lt;/p&gt;

&lt;p&gt;For example, &lt;a href=&quot;http://www.globalissues.org/article/26/poverty-facts-and-stats&quot;&gt;billions of people live in
squalor&lt;/a&gt;,
with hundreds of millions of them deprived of basic needs and/or dying
from disease. And though most of them are out of my sight, I still care
about them.&lt;/p&gt;

&lt;p&gt;The loss of a human life with all is joys and all its sorrows is tragic
no matter what the cause, and the tragedy is not reduced simply because
I was far away, or because I did not know of it, or because I did not
know how to help, or because I was not personally responsible.&lt;/p&gt;

&lt;p&gt;Knowing this, I care about every single individual on this planet. The
problem is, my brain is &lt;em&gt;simply incapable&lt;/em&gt; of taking the amount of
caring I feel for a single person and scaling it up by a billion times.
I lack the internal capacity to feel that much. My care-o-meter simply
doesn’t go up that far.&lt;/p&gt;

&lt;p&gt;And this is a problem.&lt;/p&gt;

&lt;h1 id=&quot;2&quot;&gt;2&lt;/h1&gt;

&lt;p&gt;It’s a common trope that courage isn’t about being fearless, it’s about
being afraid but &lt;em&gt;doing the right thing anyway&lt;/em&gt;. In the same sense,
caring about the world isn’t about having a gut feeling that corresponds
to the amount of suffering in the world, it’s about &lt;em&gt;doing the right
thing anyway&lt;/em&gt;. Even without the feeling.&lt;/p&gt;

&lt;p&gt;My internal care-o-meter was calibrated to deal with &lt;a href=&quot;http://en.wikipedia.org/wiki/Dunbar%27s_number&quot;&gt;about a hundred
and fifty people&lt;/a&gt;, and
it &lt;em&gt;simply can’t express&lt;/em&gt; the amount of caring that I have for billions
of sufferers. The internal care-o-meter just doesn’t go up that high.&lt;/p&gt;

&lt;p&gt;Humanity is playing for unimaginably high stakes. At the very least,
there are billions of people suffering today. At the worst, there are
quadrillions (or more) potential humans, transhumans, or posthumans
whose existence depends upon what we do here and now. All the intricate
civilizations that the future could hold, the experience and art and
beauty that is possible in the future, depends upon the present.&lt;/p&gt;

&lt;p&gt;When you’re faced with stakes like these, your internal caring
heuristics — calibrated on numbers like “ten” or “twenty” — completely
fail to grasp the gravity of the situation.&lt;/p&gt;

&lt;p&gt;Saving a person’s life feels &lt;em&gt;great&lt;/em&gt;, and &lt;a href=&quot;http://lesswrong.com/lw/hx/one_life_against_the_world/&quot;&gt;it would probably feel just
about as good to save one life as it would feel to save the
world&lt;/a&gt;. It
surely wouldn’t be &lt;em&gt;many billion times&lt;/em&gt; more of a high to save the
world, because your hardware can’t express a feeling a billion times
bigger than the feeling of saving a person’s life. But even though the
altruistic high from saving someone’s life would be shockingly similar
to the altruistic high from saving the world, always remember that
&lt;em&gt;behind&lt;/em&gt; those similar feelings there is a whole world of difference.&lt;/p&gt;

&lt;p&gt;Our internal care-feelings are woefully inadequate for deciding how to
act in a world with big problems.&lt;/p&gt;

&lt;h1 id=&quot;3&quot;&gt;3&lt;/h1&gt;

&lt;p&gt;There’s a mental shift that happened to me when I first started
internalizing scope insensitivity. It is a little difficult to
articulate, so I’m going to start with a few stories.&lt;/p&gt;

&lt;p&gt;Consider Alice, a software engineer at Amazon in Seattle. Once a month
or so, those college students with show up on street corners with
clipboards, looking ever more disillusioned as they struggle to convince
people to donate to &lt;a href=&quot;http://www.doctorswithoutborders.org/&quot;&gt;Doctors Without
Borders&lt;/a&gt;. Usually, Alice avoids
eye contact and goes about her day, but this month they finally manage
to corner her. They explain Doctors Without Borders, and she actually
has to admit that it sounds like a pretty good cause. She ends up
handing them $20 through a combination of guilt, social pressure, and
altruism, and then rushes back to work. (Next month, when they show up
again, she avoids eye contact.)&lt;/p&gt;

&lt;p&gt;Now consider Bob, who has been given the &lt;a href=&quot;http://en.wikipedia.org/wiki/Ice_Bucket_Challenge&quot;&gt;Ice Bucket
Challenge&lt;/a&gt; by a
friend on facebook. He feels too busy to do the ice bucket challenge,
and instead just donates $100 to &lt;a href=&quot;http://www.alsa.org/&quot;&gt;ALSA&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now consider Christine, who is in the college sorority ΑΔΠ. ΑΔΠ is
engaged in a competition with ΠΒΦ (another sorority) to see who can
raise the most money for the National Breast Cancer Foundation in a
week. Christine has a competitive spirit and gets engaged in
fund-raising, and gives a few hundred dollars herself over the course of
the week (especially at times when ΑΔΠ is especially behind).&lt;/p&gt;

&lt;p&gt;All three of these people are donating money to charitable
organizations… and that’s great. But notice that there’s something
similar in these three stories: these donations are largely motivated by
a &lt;em&gt;social context&lt;/em&gt;. Alice feels obligation and social pressure. Bob
feels social pressure and maybe a bit of camaraderie. Christine feels
camaraderie and competitiveness. These are all fine motivations, but
notice that these motivations are related to the &lt;em&gt;social setting&lt;/em&gt;, and
only tangentially to the &lt;em&gt;content&lt;/em&gt; of the charitable donation.&lt;/p&gt;

&lt;p&gt;If you took any of Alice or Bob or Christine and asked them why they
aren’t donating &lt;em&gt;all&lt;/em&gt; of their time and money to these causes that they
apparently believe are worthwhile, they’d look at you funny and they’d
probably think you were being rude (with good reason!). If you pressed,
they might tell you that money is a little tight right now, or that they
would donate more if they were a better person.&lt;/p&gt;

&lt;p&gt;But the question would still feel kind of &lt;em&gt;wrong&lt;/em&gt;. Giving all your money
away is just not what you do with money. We can all &lt;em&gt;say out loud&lt;/em&gt; that
people who give all their possessions away are really great, but behind
closed doors we all know that such people are crazy. (Good crazy,
perhaps, but crazy all the same.)&lt;/p&gt;

&lt;p&gt;This is a mindset that I inhabited for a while. There’s an alternative
mindset that can hit you like a freight train when you start
internalizing scope insensitivity.&lt;/p&gt;

&lt;h1 id=&quot;4&quot;&gt;4&lt;/h1&gt;

&lt;p&gt;Consider Daniel, a college student shortly after the &lt;a href=&quot;http://en.wikipedia.org/wiki/Deepwater_Horizon_oil_spill&quot;&gt;Deepwater
Horizon&lt;/a&gt; BP
oil spill. He encounters one of those college students with the
clipboards on the street corners, soliciting donations to the &lt;a href=&quot;http://www.worldwildlife.org/&quot;&gt;World
Wildlife Foundation&lt;/a&gt;. They’re trying to
save as many oiled birds as possible. Normally, Daniel would simply
dismiss the charity as Not The Most Important Thing, or Not Worth His
Time Right Now, or Somebody Else’s Problem, but this time Daniel has
been thinking about how his brain is bad at numbers and decides to do a
quick sanity check.&lt;/p&gt;

&lt;p&gt;He pictures himself walking along the beach after the oil spill, and
encountering a group of people cleaning birds as fast as they can. They
simply don’t have the resources to clean all the available birds. A
pathetic young bird flops towards his feet, slick with oil, eyes barely
able to open. He kneels down to pick it up and help it onto the table.
One of the bird-cleaners informs him that they won’t have time to get to
that bird themselves, but he could pull on some gloves and could
probably save the bird with three minutes of washing.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://4.bp.blogspot.com/_Bv2wRceCYKA/S-whZ1sSJ3I/AAAAAAAABjo/cgXz7Npz_W0/s320/Dawn_IBRRC_2010.05.07_MG_7082_240.jpg&quot; alt=&quot;blog.bird-rescue.org&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Daniel decides that he &lt;em&gt;would&lt;/em&gt; spend three minutes of his time to save
the bird, and that he would &lt;em&gt;also&lt;/em&gt; be happy to pay at least $3 to have
someone else spend a few minutes cleaning the bird. He introspects and
finds that this is not just because he imagined a bird right in front of
him: he feels that it is &lt;em&gt;worth&lt;/em&gt; at least three minutes of his time (or
$3) to save an oiled bird in some vague platonic sense.&lt;/p&gt;

&lt;p&gt;And, because he’s been thinking about scope insensitivity, he &lt;em&gt;expects&lt;/em&gt;
his brain to misreport how much he actually cares about large numbers of
birds: the internal feeling of caring can’t be expected to line up with
the actual importance of the situation. So instead of just &lt;em&gt;asking his
gut&lt;/em&gt; how much he cares about de-oiling lots of birds, he shuts up and
multiplies.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://dailydeadbirds.com/&quot;&gt;Thousands and thousands&lt;/a&gt; of birds were
oiled by the BP spill alone. After shutting up and multiplying, Daniel
realizes (with growing horror) that the amount he &lt;em&gt;acutally&lt;/em&gt; cares about
oiled birds is lower bounded by two months of hard work and/or fifty
thousand dollars. And that’s not even counting wildlife threatened by
&lt;a href=&quot;http://en.wikipedia.org/wiki/List_of_oil_spills&quot;&gt;other oil spills&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And if he cares that much about &lt;em&gt;de-oiling birds&lt;/em&gt;, then how much does he
actually care about factory farming, nevermind hunger, or poverty, or
sickness? How much does he actually care about wars that ravage nations?
About neglected, deprived children? About the future of humanity? He
&lt;em&gt;actually&lt;/em&gt; cares about these things to the tune of much more money than
he has, and much more time than he has.&lt;/p&gt;

&lt;p&gt;For the first time, Daniel sees a glimpse of of how much he actually
cares, and how poor a state the world is in.&lt;/p&gt;

&lt;p&gt;This has the strange effect that Daniel’s reasoning goes full-circle,
and he realizes that he actually &lt;em&gt;can’t&lt;/em&gt; care about oiled birds to the
tune of 3 minutes or $3: not because the birds aren’t &lt;em&gt;worth&lt;/em&gt; the time
and money (and, in fact, he thinks that the economy produces things
priced at $3 which are worth less than the bird’s survival), but because
he can’t spend &lt;em&gt;his&lt;/em&gt; time or money on saving the birds. The opportunity
cost suddenly seems far too high: there is &lt;em&gt;too much else to do!&lt;/em&gt; People
are sick and starving and dying! The very future of our civilization is
at stake!&lt;/p&gt;

&lt;p&gt;Daniel doesn’t wind up giving $50k to the WWF, and he also doesn’t
donate to ALSA or NBCF. But if you ask &lt;em&gt;Daniel&lt;/em&gt; why he’s not donating
all his money, he won’t look at you funny or think you’re rude. He’s
left the place where you don’t care far behind, and has realized that
&lt;em&gt;his mind was lying to him the whole time&lt;/em&gt; about the gravity of the real
problems.&lt;/p&gt;

&lt;p&gt;Now he realizes that he &lt;em&gt;can’t possibly do enough&lt;/em&gt;. After adjusting for
his scope insensitivity (and the fact that his brain lies about the size
of large numbers), even the “less important” causes like the WWF
suddenly seem worthy of dedicating a life to. Wildlife destruction and
ALS and breast cancer are suddenly all problems that he would &lt;em&gt;move
mountains&lt;/em&gt; to solve — except he’s finally understood that there are just
too many mountains, and ALS isn’t the bottleneck, and AHHH HOW DID ALL
THESE MOUNTAINS GET HERE?&lt;/p&gt;

&lt;p&gt;In the original mindstate, the reason he didn’t drop everything to work
on ALS was because it just didn’t seem… pressing enough. Or tractable
enough. Or important enough. Kind of. These are sort of the reason, but
the real reason is more that the concept of “dropping everything to
address ALS” never even &lt;em&gt;crossed his mind&lt;/em&gt; as a real possibility. The
idea was too much of a break from the standard narrative. It wasn’t his
problem.&lt;/p&gt;

&lt;p&gt;In the new mindstate, &lt;em&gt;everything&lt;/em&gt; is his problem. The only reason he’s
not dropping everything to work on ALS is because there are far too many
things to do first.&lt;/p&gt;

&lt;p&gt;Alice and Bob and Christine usually aren’t spending time solving all the
world’s problems because they forget to see them. If you remind them —
put them in a social context where they remember how much they care
(hopefully without guilt or pressure) — then they’ll likely donate a
little money.&lt;/p&gt;

&lt;p&gt;By contrast, Daniel and others who have undergone the mental shift
aren’t spending time solving all the world’s problems because there are
&lt;em&gt;just too many problems&lt;/em&gt;. (Daniel hopefully goes on to discover
movements like &lt;a href=&quot;http://effectivealtruism.org/&quot;&gt;effective altruism&lt;/a&gt; and
starts contributing towards fixing the world’s most pressing problems.)&lt;/p&gt;

&lt;h1 id=&quot;5&quot;&gt;5&lt;/h1&gt;

&lt;p&gt;I’m not trying to preach here about how to be a good person. You don’t
need to share my viewpoint to be a good person (obviously).&lt;/p&gt;

&lt;p&gt;Rather, I’m trying to point at a shift in perspective. Many of us go
through life understanding that we &lt;em&gt;should&lt;/em&gt; care about people suffering
far away from us, but failing to. I think that this attitude is tied, at
least in part, to the fact that most of us implicitly trust our internal
care-o-meters.&lt;/p&gt;

&lt;p&gt;The “care feeling” isn’t usually strong enough to compel us to
frantically save everyone dying. So while we acknowledge that it would
be &lt;em&gt;virtuous&lt;/em&gt; to do more for the world, we think that we &lt;em&gt;can’t&lt;/em&gt;,
because we weren’t gifted with that virtuous extra-caring that prominent
altruists must have.&lt;/p&gt;

&lt;p&gt;But this is an error — prominent altruists aren’t the people who have a
larger care-o-meter, they’re the people who have &lt;em&gt;learned not to trust
their care-o-meters&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Our care-o-meters are broken. They don’t work on large numbers. Nobody
has one capable of faithfully representing the scope of the world’s
problems. But the fact that you can’t &lt;em&gt;feel&lt;/em&gt; the caring doesn’t mean
that you can’t &lt;em&gt;do&lt;/em&gt; the caring.&lt;/p&gt;

&lt;p&gt;You don’t get to feel the appropriate amount of “care”, in your body.
Sorry — the world’s problems are just too large, and your body is not
built to respond appropriately to problems of this magnitude. But if you
choose to do so, you can still &lt;em&gt;act&lt;/em&gt; like the world’s problems are as
big as they are. You can stop trusting the internal feelings to guide
your actions and switch over to manual control.&lt;/p&gt;

&lt;h1 id=&quot;6&quot;&gt;6&lt;/h1&gt;

&lt;p&gt;This, of course, leads us to the question of “what the hell do you
then?”&lt;/p&gt;

&lt;p&gt;And I don’t really know yet. (Though I’ll plug the &lt;a href=&quot;http://givingwhatwecan.org&quot;&gt;Giving What We Can
pledge&lt;/a&gt;, &lt;a href=&quot;http://givewell.org&quot;&gt;GiveWell&lt;/a&gt;,
&lt;a href=&quot;http://intelligence.org&quot;&gt;MIRI&lt;/a&gt;, and &lt;a href=&quot;http://www.fhi.ox.ac.uk&quot;&gt;The Future of Humanity
Institute&lt;/a&gt; as a good start).&lt;/p&gt;

&lt;p&gt;I think that at least part of it comes from a certain sort of desperate
perspective. It’s not enough to think you &lt;em&gt;should&lt;/em&gt; change the world —
you also need the sort of desperation that comes from realizing that you
would dedicate your entire life to solving the world’s 100th biggest
problem if you could, but you can’t, because there are 99 bigger
problems you have to address first.&lt;/p&gt;

&lt;p&gt;I’m not trying to guilt you into giving more money away — becoming a
philanthropist is &lt;em&gt;really really hard&lt;/em&gt;. (If you’re &lt;em&gt;already&lt;/em&gt; a
philanthropist, then you have my acclaim and my affection.) First it
requires you to have money, which is uncommon, and then it requires you
to &lt;em&gt;throw that money at distant invisible problems&lt;/em&gt;, which is not an
easy sell to a human brain.
&lt;a href=&quot;http://en.wikipedia.org/wiki/Akrasia&quot;&gt;Akrasia&lt;/a&gt; is a formidable enemy.
And most importantly, guilt doesn’t seem like a good long-term
motivator: if you want to join the ranks of people saving the world, I
would rather you join them proudly. There are many trials and
tribulations ahead, and we’d do better to face them with our heads held
high.&lt;/p&gt;

&lt;h1 id=&quot;7&quot;&gt;7&lt;/h1&gt;

&lt;p&gt;Courage isn’t about being fearless, it’s about being able to do the
right thing even if you’re afraid.&lt;/p&gt;

&lt;p&gt;And similarly, addressing the major problems of our time isn’t about
feeling a strong compulsion to do so. It’s about doing it anyway, even
when internal compulsion utterly fails to capture the scope of the
problems we face.&lt;/p&gt;

&lt;p&gt;It’s easy to look at especially virtuous people — Gandhi, Mother
Theresa, Nelson Mandela — and conclude that they must have cared more
than we do. But I don’t think that’s the case.&lt;/p&gt;

&lt;p&gt;Nobody gets to comprehend the scope of these problems. The closest we
can get is doing the multiplication: finding something we care about,
putting a number on it, and multiplying. And then trusting the numbers
more than we trust our feelings.&lt;/p&gt;

&lt;p&gt;Because our feelings lie to us.&lt;/p&gt;

&lt;p&gt;When you do the multiplication, you realize that addressing global
poverty and building a brighter future deserve more resources than
currently exist. There is not enough money, time, or effort in the world
to do what we need to do.&lt;/p&gt;

&lt;p&gt;There is only you, and me, and everyone else who is trying anyway.&lt;/p&gt;

&lt;h1 id=&quot;8&quot;&gt;8&lt;/h1&gt;

&lt;p&gt;You can’t actually feel the weight of the world. The human mind is not
capable of that feat.&lt;/p&gt;

&lt;p&gt;But sometimes, you can catch a glimpse.&lt;/p&gt;

&lt;p&gt;© Nate Soares.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Typing Mathematical Symbols on Apple devices</title>
   <link href="https://getpoole.com/blog/2021/09/13/Typing-Mathematical-Symbols-on-Apple-devices/"/>
   <updated>2021-09-13T00:00:00+00:00</updated>
   <id>https://getpoole.com/2021/09/13/Typing-Mathematical-Symbols-on-Apple-devices</id>
   <content type="html">&lt;p&gt;Now we can easily type mathematic symbols on macOS and iOS devices! Great for explaining scientific or mathematic problems on line without writing &lt;svg width=&quot;91pt&quot; height=&quot;33pt&quot; version=&quot;1.1&quot; viewBox=&quot;0 0 91 33&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; id=&quot;ltx-svg&quot;&gt;&lt;defs&gt;&lt;symbol id=&quot;ltx-e&quot; overflow=&quot;visible&quot;&gt;&lt;path d=&quot;m20.875-9.25h-0.90625c-0.39062 3.6562-0.89062 8.1406-7.2031 8.1406h-2.9375c-1.6875 0-1.7656-0.25-1.7656-1.4375v-19.109c0-1.2188 0-1.7188 3.4062-1.7188h1.1875v-1.1094c-1.2812 0.09375-4.5469 0.09375-6.0156 0.09375-1.4062 0-4.2031 0-5.4531-0.09375v1.1094h0.85938c2.7656 0 2.8281 0.39062 2.8281 1.6875v18.891c0 1.2969-0.0625 1.6875-2.8281 1.6875h-0.85938v1.1094h18.672z&quot;&gt;&lt;/path&gt;&lt;/symbol&gt;&lt;symbol id=&quot;ltx-d&quot; overflow=&quot;visible&quot;&gt;&lt;path d=&quot;m24.562-16.203-0.6875-8.0781h-21.906l-0.67188 8.0781h0.89062c0.5-5.7812 1.0469-6.9688 6.4531-6.9688 0.64062 0 1.5781 0 1.9375 0.078125 0.75 0.14062 0.75 0.53125 0.75 1.3594v18.906c0 1.2188 0 1.7188-3.7656 1.7188h-1.4375v1.1094c1.4844-0.10938 5.1406-0.10938 6.7812-0.10938 1.6562 0 5.3438 0 6.8125 0.10938v-1.1094h-1.4375c-3.7656 0-3.7656-0.5-3.7656-1.7188v-18.906c0-0.71875 0-1.2188 0.65625-1.3594 0.39062-0.078125 1.3594-0.078125 2.0469-0.078125 5.4062 0 5.9531 1.1875 6.4531 6.9688z&quot;&gt;&lt;/path&gt;&lt;/symbol&gt;&lt;symbol id=&quot;ltx-c&quot; overflow=&quot;visible&quot;&gt;&lt;path d=&quot;m23.375-9.25h-0.89062c-0.89062 5.5156-1.7188 8.1406-7.8906 8.1406h-4.7656c-1.6875 0-1.7656-0.25-1.7656-1.4375v-9.5781h3.2344c3.4844 0 3.875 1.1562 3.875 4.2031h0.89062v-9.5h-0.89062c0 3.0781-0.39062 4.1875-3.875 4.1875h-3.2344v-8.6094c0-1.1719 0.078125-1.4219 1.7656-1.4219h4.625c5.4844 0 6.4531 1.9688 7.0312 6.9531h0.89062l-1-8.0781h-20.188v1.125h0.85938c2.7656 0 2.8281 0.39062 2.8281 1.6719v18.797c0 1.2969-0.0625 1.6875-2.8281 1.6875h-0.85938v1.1094h20.688z&quot;&gt;&lt;/path&gt;&lt;/symbol&gt;&lt;symbol id=&quot;ltx-b&quot; overflow=&quot;visible&quot;&gt;&lt;path d=&quot;m26.031 0v-1.1094h-0.67188c-1.875 0-2.625-0.1875-3.375-1.2969l-7.5625-11.438 4.9062-7.2031c0.78125-1.1562 2.0156-2.2969 5.2031-2.3281v-1.1094l-3.9844 0.09375c-1.4375 0-3.1562 0-4.5938-0.09375v1.1094c1.4375 0.03125 2.2344 0.8125 2.2344 1.6406 0 0.35938-0.078125 0.4375-0.32812 0.82812l-4.0938 6.0625-4.625-6.9219c-0.0625-0.10938-0.25-0.39062-0.25-0.53125 0-0.4375 0.79688-1.0469 2.3281-1.0781v-1.1094c-1.25 0.09375-3.875 0.09375-5.2344 0.09375l-4.6562-0.09375v1.1094h0.6875c1.9688 0 2.6406 0.25 3.3281 1.25l6.5938 9.9688-5.875 8.6719c-0.5 0.71875-1.5781 2.375-5.2031 2.375v1.1094l3.9844-0.10938c1.3281 0 3.2969 0 4.5938 0.10938v-1.1094c-1.6562-0.03125-2.2656-1-2.2656-1.6562 0-0.3125 0.10938-0.46875 0.35938-0.85938l5.0938-7.5312 5.6562 8.5781c0.078125 0.14062 0.1875 0.28125 0.1875 0.39062 0 0.4375-0.79688 1.0469-2.3281 1.0781v1.1094c1.25-0.10938 3.875-0.10938 5.2344-0.10938z&quot;&gt;&lt;/path&gt;&lt;/symbol&gt;&lt;symbol id=&quot;ltx-a&quot; overflow=&quot;visible&quot;&gt;&lt;path d=&quot;m20.016 0v-0.90625h-0.5c-1.6875 0-1.8594-0.25-2.1406-0.95312l-6.0938-15.469c-0.15625-0.40625-0.23438-0.57812-0.70312-0.57812-0.48438 0-0.5625 0.17188-0.70312 0.57812l-5.8125 14.688c-0.25 0.625-0.67188 1.7344-2.9375 1.7344v0.90625c0.85938-0.078125 1.7344-0.09375 2.5938-0.09375 1 0 2.8594 0.09375 3.0156 0.09375v-0.90625c-1.1094 0-1.8125-0.5-1.8125-1.2031 0-0.20312 0.03125-0.25 0.125-0.5l1.2031-3.0938h7.1406l1.4531 3.6719c0.046875 0.125 0.125 0.29688 0.125 0.42188 0 0.70312-1.3594 0.70312-2.0312 0.70312v0.90625l3.7344-0.09375c1.1875 0 3.0625 0.0625 3.3438 0.09375zm-6.9844-6.6094h-6.4219l3.2031-8.1562z&quot;&gt;&lt;/path&gt;&lt;/symbol&gt;&lt;/defs&gt;&lt;g&gt;&lt;use x=&quot;-1.0924&quot; y=&quot;24.6774&quot; xlink:href=&quot;#ltx-e&quot;&gt;&lt;/use&gt;&lt;use x=&quot;8.4116&quot; y=&quot;18.2946&quot; xlink:href=&quot;#ltx-a&quot;&gt;&lt;/use&gt;&lt;use x=&quot;24.1976&quot; y=&quot;24.6774&quot; xlink:href=&quot;#ltx-d&quot;&gt;&lt;/use&gt;&lt;use x=&quot;44.1128&quot; y=&quot;32.4066&quot; xlink:href=&quot;#ltx-c&quot;&gt;&lt;/use&gt;&lt;use x=&quot;64.0532&quot; y=&quot;24.6774&quot; xlink:href=&quot;#ltx-b&quot;&gt;&lt;/use&gt;&lt;/g&gt;&lt;/svg&gt;!.&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/myzhang1029/d7ec4a2d8c745d6dd771fc10662347b8.js&quot;&gt; &lt;/script&gt;

&lt;style&gt;
    .gist-data {
        max-height: 250px;
        overflow-y: visible;
    }
    
    #ltx-svg {
        display: inline-block;
        height: 1em;
    }
&lt;style&gt;
&lt;/style&gt;
</content>
 </entry>
 
 <entry>
   <title>Welcome Back, My Blog</title>
   <link href="https://getpoole.com/blog/2021/08/25/Welcome-Back,-My-Blog/"/>
   <updated>2021-08-25T00:00:00+00:00</updated>
   <id>https://getpoole.com/2021/08/25/Welcome-Back,-My-Blog</id>
   <content type="html">&lt;p&gt;Welcome back. The first thing that you will NOT notice is that the password is gone. Well - no one should have noticed this, because no one can see whether this is a blog or not with that password.&lt;/p&gt;

&lt;p&gt;This blog is without doubt one of my longest-kept continuous journals. Well, I do keep a diary. But that was a year after this blog… Anyway.&lt;/p&gt;

&lt;p&gt;To whom it may concern, I’ve said that the password was added to protect privacy - and that remains correct - All previous sensitive posts have been not only removed but also erased. You know, the internet may not have memory, but we as humans obviously do.&lt;/p&gt;

&lt;p&gt;During this four years’ journey with this blog and the three years with my diary, I have learned to appreciate my own history by looking back at it. Never will I try to erase my history, yet I will not prevent others from erasing theirs from me - that’s a fundamental human right. That’s why my diary will never be open to the public, and that’s also why this blog is open so that people can come and understand me:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;I’m here: always here to listen to you, and keep what I’ve heard as is.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;I’m also here: to tell my own stories, and convey the very self of mine.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>Password Added</title>
   <link href="https://getpoole.com/blog/2020/10/10/Password-Added/"/>
   <updated>2020-10-10T00:00:00+00:00</updated>
   <id>https://getpoole.com/2020/10/10/Password-Added</id>
   <content type="html">&lt;p&gt;Recently some concerns have raised about Google indexing this blog. Therefore, a  password is added, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;robots.txt&lt;/code&gt; is set to explicitly prohibit blogs from being indexed.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Password tips - Michael Kjörling</title>
   <link href="https://getpoole.com/blog/2020/03/09/Password-Tips/"/>
   <updated>2020-03-09T00:00:00+00:00</updated>
   <id>https://getpoole.com/2020/03/09/Password-Tips</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://michael.kjorling.se/computers/passwords&quot;&gt;Original Post&lt;/a&gt;
None of the original text has been changed and this is simply a copy of
the original post for convenience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Passwords Are Important..&lt;/strong&gt; Basically your entire online life, and a lot of
your offline life, is protected in some way by passwords. In many cases,
&lt;em&gt;other&lt;/em&gt; peoples’ lives are protected by your passwords; this applies,
for example, if you have access to personal information on others
through your professional position.&lt;/p&gt;

&lt;p&gt;Yet passwords often get the short end of the stick. Lots of people use
simple passwords; it is common for people to use a single password or a
small number of different passwords; and most passwords that people use
aren’t very imaginative, let alone random. Lists like “the top 1000
passwords on the Internet” show up every once in a while, and
invariably, a large fraction of accounts can be broken into using those
relatively few passwords. &lt;em&gt;There are relatively easy ways to not be one
of the easy targets.&lt;/em&gt;&lt;/p&gt;

&lt;h1 id=&quot;terminology-entropy&quot;&gt;Terminology: entropy&lt;/h1&gt;

&lt;p&gt;An important word to know with regards to passwords is &lt;em&gt;entropy&lt;/em&gt;.
Without going into mathematics, “entropy” in the context of passwords is
simply a measure of &lt;em&gt;how difficult a given password would be to guess.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The entropy of a password can barely be defined, but the entropy of a
method of generating passwords can be defined. The entropy is &lt;em&gt;an
expression of how many different passwords can be generated by the
method of generating passwords&lt;/em&gt;, often expressed in terms of bits.
Adding one bit doubles the number of possible passwords.&lt;/p&gt;

&lt;p&gt;Many attacks on passwords can broadly be broken into two categories.
There are social attacks, which rely on tricking you into divulging your
password, where the password itself does not help much; and
technological attacks, where the strength of the password can matter a
great deal. Adding a few extra characters to your password, chosen at
random, greatly increases the entropy of your password and thus its
resistance to attacks.&lt;/p&gt;

&lt;h1 id=&quot;how-not-to-do-it&quot;&gt;How not to do it&lt;/h1&gt;

&lt;p&gt;The first &lt;strong&gt;myth&lt;/strong&gt; to be done away with is that &lt;strong&gt;passwords should be possible
to remember.&lt;/strong&gt; For the very most part, memorable passwords tend to have
low enough entropy that a computer these days can find them easily. We
need something better.&lt;/p&gt;

&lt;p&gt;The second &lt;strong&gt;myth&lt;/strong&gt; that needs to be displaced is that &lt;strong&gt;attackers use the
same web form to log in as you do.&lt;/strong&gt; That just is not the case in many
attacks. Rather, attackers often get their hands on account databases;
huge lists of usernames, email addresses, password hints, (hopefully)
well-protected versions of the passwords, and/or other paraphernalia.
They then use huge numbers of computers to attack these directly. In
this case, depending on the exact methods used by whoever had their
password database leaked, a single computer can potentially easily check
millions of candidate passwords per second (some multiple of 2²⁰/sec). A
network of systems can quite quickly bring this number into the billions
of passwords per second (some multiple of 2³⁰/sec). The NSA is claimed
to have been, in 2013, able to try on the order of a trillion passwords
per second (2⁴⁰/sec); realistically, they are unlikely to do worse
today. Properly protected passwords can bring these rates down to dozens
per second per computer or even less; 2⁵/sec instead of 2²⁰/sec or so.&lt;/p&gt;

&lt;p&gt;The third &lt;strong&gt;myth&lt;/strong&gt; that has become obsolete is that you should &lt;strong&gt;never write
passwords down.&lt;/strong&gt; Actually, that is still about half true: &lt;strong&gt;what you
shouldn’t do is write passwords down in a way such that an attacker can
get at them.&lt;/strong&gt; For passwords that can reasonably be believed to be secure
against modern attackers, writing them down is almost a requirement, but
you have to pay attention to &lt;em&gt;the manner in which&lt;/em&gt; you write them down.&lt;/p&gt;

&lt;h1 id=&quot;how-to-do-it&quot;&gt;How to do it&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;So how &lt;em&gt;should&lt;/em&gt; we be selecting and handling passwords these days?&lt;/strong&gt; In
short, I recommend that you:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Do not share your passwords with anyone&lt;/li&gt;
  &lt;li&gt;Use a password manager&lt;/li&gt;
  &lt;li&gt;Use unique passwords everywhere&lt;/li&gt;
  &lt;li&gt;Use random passwords everywhere (for both accounts where you don’t
need to memorize the password, as well as those where you do need to
memorize the password)&lt;/li&gt;
  &lt;li&gt;Back up your password database, religiously&lt;/li&gt;
  &lt;li&gt;Decide on and stick to a reasonable minimum password entropy&lt;/li&gt;
  &lt;li&gt;Do not change your passwords needlessly&lt;/li&gt;
  &lt;li&gt;Do not use “secret questions” for password recovery&lt;/li&gt;
  &lt;li&gt;Consider using password-quality usernames&lt;/li&gt;
  &lt;li&gt;Turn on any available last lines of defense&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I go into more detail about each of these points below.&lt;/p&gt;

&lt;h1 id=&quot;do-not-share-your-passwords-with-anyone&quot;&gt;Do not share your passwords with anyone&lt;/h1&gt;

&lt;p&gt;It’s really about as simple as that. There is virtually &lt;em&gt;never&lt;/em&gt; any
reason whatsoever to share your password with someone else, or divulge
it anywhere but during the login process to the account it is
protecting.&lt;/p&gt;

&lt;p&gt;Social engineering attacks are called such because they focus not on the
technological systems, but on the individual humans involved. And they
are surprisingly effective; very often, they are far more effective than
attacking the technology. Attackers using this technique can be very
confidence-inspiring and sound very legitimate, so just because what
they say sounds legitimate does not mean that they have your best
interests at heart.&lt;/p&gt;

&lt;p&gt;If you find yourself in the situation of thinking about sharing your
password with someone, even someone you trust, consider if there is no
other way to accomplish the same goal. Virtually always, there is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A security-oriented professional should never, ever ask you for your
password or other sensitive information.&lt;/strong&gt; If they do, ask yourself why
they need to know this information, why they need to get it from you,
and if there is some other way to accomplish that same end.&lt;/p&gt;

&lt;p&gt;For example: Why would your bank e-mail you and ask you to confirm your
contact information in order to keep your account active? Why would they
call you and ask you what your card number with them is? How could
Microsoft afford the manpower to call their literally millions and
millions of customers and help them, individually, to remove a virus
from their (your) computer? And so on.&lt;/p&gt;

&lt;p&gt;If a notice, particularly one that arrives as an e-mail, &lt;em&gt;looks&lt;/em&gt;
legitimate, then locate an older invoice, account statement or similar
from the party involved and contact them using the contact information
you already have for them. If it is legitimate, they will very likely be
happy to help you out, but now you have contacted them on a point of
contact that you already trust; if it’s not, then you just potentially
saved your account with them from being hijacked, and possibly even
saved yourself from an attempt at real-world identity theft or monetary
theft.&lt;/p&gt;

&lt;p&gt;The simple rule is to &lt;strong&gt;never, ever divulge your password to anyone else.&lt;/strong&gt;
If you want someone to help you do something to your account, &lt;em&gt;log in
yourself while they look away&lt;/em&gt; and then let them sit down at the
computer while you stand beside them looking on.&lt;/p&gt;

&lt;h1 id=&quot;use-a-password-manager&quot;&gt;Use a password manager&lt;/h1&gt;

&lt;p&gt;A password manager is a special-purpose database program that is
specifically designed to simply and securely store and retrieve
passwords and other relevant details for user accounts. They often
include password generators, and can include other convenience features
such as auto-type, web browser integration, search, and subcategories to
help organize your password collection. There are password managers
offered as cloud services, as well as software running locally on a
computer under your control.&lt;/p&gt;

&lt;p&gt;Find one that you like and start using it. I personally do not trust
storing passwords with an external entity (such as a cloud service
provider) but even that, with a good master password, is &lt;em&gt;probably&lt;/em&gt;
safer against most realistic attackers for the vast majority of people
than you trying to make up and remember potentially hundreds of
different passwords, or reusing passwords. Just have an idea what you
will do if you receive a notice that the database has been breached, and
if you do receive such a notice, implement it &lt;em&gt;immediately&lt;/em&gt;. This most
likely involves changing every single password that you have stored in
that database, because the confidentiality of those passwords can no
longer be guaranteed.&lt;/p&gt;

&lt;p&gt;If you have reason to believe that you might be of special interest to a
determined adversary, then you should probably pay even closer attention
to the above, as well as adjust it according to your personal threat
model.&lt;/p&gt;

&lt;p&gt;Whether you use an online or local solution, make sure you back up the
password database regularly.&lt;/p&gt;

&lt;h1 id=&quot;use-unique-passwords-everywhere&quot;&gt;Use unique passwords everywhere&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Never&lt;/em&gt; use the same password for more than one account. I don’t care
how clever you think your password scheme is or how much you love that
password you came up with; just &lt;em&gt;don’t&lt;/em&gt;. If the confidentiality of one
of the passwords is somehow breached, then any other accounts where you
have used the same password are suddenly at much higher risk of
compromise.&lt;/p&gt;

&lt;p&gt;Similarly, never use an obvious pattern for passwords to different
services, &lt;em&gt;unless&lt;/em&gt; those passwords have sufficient underlying
cryptographic strength to withstand a reasonable attacker’s efforts
anyway. (For example, it’s not a problem to use similar-length passwords
generated from a similar character set everywhere &lt;em&gt;if and only if&lt;/em&gt; a
password of that length generated from that character set would be
secure anyway. If you use the password &lt;em&gt;helloworld1&lt;/em&gt; for some service,
it is probably not a good idea to use the password &lt;em&gt;helloworld2&lt;/em&gt;
somewhere else, but if you use &lt;em&gt;aif2eeth1oh&lt;/em&gt; for one service then using
&lt;em&gt;yek1xiekool&lt;/em&gt; for another is probably fine.)&lt;/p&gt;

&lt;p&gt;The easiest approach is to simply &lt;strong&gt;use a truly unique password for each
and every account&lt;/strong&gt; or other place that requires a password. That way,
should that password somehow be compromised, you only need to change
that single password and deal with that single account compromise.&lt;/p&gt;

&lt;h1 id=&quot;use-random-passwords-everywhere&quot;&gt;Use random passwords everywhere&lt;/h1&gt;

&lt;p&gt;Don’t try to come up with a password yourself. Use a properly generated,
random password of sufficient strength for the thing, account or asset
that you are trying to protect.&lt;/p&gt;

&lt;h2 id=&quot;passwords-that-you-dont-have-to-remember&quot;&gt;Passwords that you don’t have to remember&lt;/h2&gt;

&lt;p&gt;Frankly, this is the vast majority of passwords. Password managers can
generate and keep track of virtually any number of passwords, and they
can use character sets that are difficult to type (because most places
where you need a password allow copying and pasting passwords during
entry).&lt;/p&gt;

&lt;p&gt;For these accounts, simply use your password manager’s feature to
generate a long, random password with a large character set and use
that. If you are unsure of which characters to use, you can start with
the 32/Z85 character set:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&amp;amp;&amp;lt;&amp;gt;()[]{}@%$#
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This character set should be safe in most situations you are likely to
encounter, and consists of digits, letters (lower- and uppercase), and
special characters, but no whitespace, for a total of 85 different
characters. A random password of appropriate length generated out of
this set should be sufficient to satisfy any reasonable password
requirements while providing reasonable cryptographic strength (log₂(85)
or about 6.4 bits per character). For example, a 14-character password
using the 32/Z85 set where characters are selected in a truly random
fashion will provide about 90 bits of security, which should be
sufficient to protect against all but the most determined of
adversaries. To match the theoretical strength of 128-bit AES, you need
a 20-character password selected out of an 85-character set.&lt;/p&gt;

&lt;h2 id=&quot;passwords-that-you-have-to-remember&quot;&gt;Passwords that you have to remember&lt;/h2&gt;

&lt;p&gt;Unfortunately, there are a few passwords that we simply, realistically,
&lt;em&gt;have&lt;/em&gt; to be able to memorize. System login passwords and password
manager master passwords are the main candidates that lend themselves
poorly to being stored in a password manager.&lt;/p&gt;

&lt;p&gt;For these, I recommend the Diceware method of generating passwords.
(Diceware-style passwords are also known as XKCD-style passwords after
the Password Strength comic, XKCD #936, posted by Randall Munroe in
2011; you may see references to both, but they are essentially the same
thing.) A Diceware password is made up of words, selected out of a
dictionary of 7,776 different words, selected by throwing physical dice.
The number 7,776 represents the possible outcomes of throwing a single
six-sided dice five times (6⁵ = 7,776), and each word is indexed in the
word list by five digits from 1 through 6 (corresponding to the outcome
of the dice throws). Each word added to the password contributes
approximately 12.9 bits of cryptographic strength to the password.
Because this method uses direct, physical randomness, we can directly
estimate the cryptographic strength of a Diceware password; for example,
a five-word password generated from this 7,776-entry dictionary provides
about 64 bits of security, or a nine-word password provides about 116
bits.&lt;/p&gt;

&lt;p&gt;With the standard Diceware dictionary, a separator is required, which
works well if the system requires special characters in the password
(just pick one that it likes as the word separator). Alternatively, the
Electronic Frontier Foundation (EFF) has published a total of three
alternative word lists, one “long” and two “short” lists, which are
designed such that a separator is not required, although one can
obviously still be used if desired. The “short” lists have fewer but
shorter words, providing log₂(6⁴) = 10.3 bits per word instead of 12.9
bits per word. Hence, for approximately 64 bits of security with the
short list, six words are needed giving about 62 bits of security,
instead of five words from the long list for 64 bits of security.&lt;/p&gt;

&lt;p&gt;The fact that Diceware passwords are made up of words is largely
immaterial to their security. You could use the output of the dice
directly, and the search space would be the same, but turning the
numbers into words make the resulting passwords far easier to remember.&lt;/p&gt;

&lt;p&gt;The most important part of generating Diceware-style passwords is that
you must trust the randomness of the dice, and not try to improve on it
or select words that are somehow more memorable to you. If you are
unhappy with how it turned out, throw away the result and start all
over. Anything less reduces the effective security of these passwords in
a potentially unpredictable manner. This applies also to any generated
password which makes sense in a linguistic sense; while this is
unlikely, if the password reads as something you could say, then start
all over.&lt;/p&gt;

&lt;p&gt;Whichever word list you choose to use, &lt;em&gt;properly generated&lt;/em&gt; Diceware
passwords have a very strong advantage over actual phrases because it is
actually possible to estimate their cryptographic strength while also
being reasonably easy to memorize. Memorizing a six- or seven-word
Diceware passphrase is perfectly reasonable; for most people, memorizing
a 14-character 32/Z85 password is not.&lt;/p&gt;

&lt;p&gt;If you can, something like a Yubikey configured to emit a static
password can be used to greatly reduce the risk of someone
shoulder-surfing your password. This static password can be used either
as a prefix or a suffix to the password that you type. Yubikeys are not
appropriate in all situations, and there are ways in which Yubikey
static passwords can fail to significantly enhance the overall security,
but if a Yubikey can work in your situation, strongly consider
purchasing one and using it to enhance the security of the overall
system. Do write down the password it emits and store the note in a
secure location in case something happens to the Yubikey. Some cloud
service providers allow you to use a Yubikey in one-time password mode
to improve the security of the login process; do not confuse static
password mode with one-time password mode.&lt;/p&gt;

&lt;h1 id=&quot;back-up-your-password-database-religiously&quot;&gt;Back up your password database, religiously&lt;/h1&gt;

&lt;p&gt;If you follow the advice elsewhere on this page, your passwords will be
extremely difficult to crack. The vast majority of them will also, for
all intents and purposes, be impossible to remember. If the password
manager database becomes lost, corrupted, unavailable or otherwise can’t
be read by normal means, you will be in major trouble.&lt;/p&gt;

&lt;p&gt;To protect against losing access to all of your accounts, you have to
make regular backups of the file(s) that contain your password database.
If the password manager is doing its job properly, the files on disk
will be strongly encrypted with a key ultimately protected by your
master password, and thus be relatively safe to simply back up as-is
without any additional protection. Copy them to some other media
regularly (the exact interval depends on how often you make changes to
your password database and how important you feel those changes are),
and keep a few old revisions in case one of them becomes corrupted for
some reason. Make sure you don’t forget the corresponding master
password.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Do make sure to regularly test the copies.&lt;/em&gt; Nobody makes backups
because it’s such fun to make backups; people make backups in order to
be able to restore a working copy of the file in question. Determine how
to test the restorability of these copies, and test restoring them every
once in a while. &lt;em&gt;Never fully trust a backup that you haven’t restored
yourself.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you are using local software on your own computer to store and manage
the passwords, make sure to keep a copy of the installation file or
archive for the version you are using, including any license keys or
similar, together with the backed up password database. That way, should
the need arise, you have everything on hand that is needed to get back
to where you were on a completely new computer with an otherwise blank
operating system installation.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Using a cloud service does not absolve you of the responsibility of
making backups.&lt;/em&gt; In fact, unless you are specifically paying the
provider to make backups and have successfully restored older versions
of your data, &lt;em&gt;assume that anything you store online is not being backed
up at all&lt;/em&gt; and act accordingly. Locate some way to export or download
the full list of accounts in a format that you can later import back
into the solution, try it out, and download a copy of your database
whenever you have made sufficient changes that recovering them manually
would be difficult. Consider whether you can import the data into some
other password manager, for example in case your preferred provider
shuts down service for any reason. (This is less of a concern, but not
completely eliminated, if you run a local software solution on your own
computer.) Consider whether such an export needs any additional
protection; if in doubt, contact your service provider. Again, keep a
few old revisions in case one copy somehow becomes corrupt.&lt;/p&gt;

&lt;h1 id=&quot;decide-on-and-stick-to-a-reasonable-minimum-password-entropy&quot;&gt;Decide on and stick to a reasonable minimum password entropy&lt;/h1&gt;

&lt;p&gt;I recommend not going below about 50 bits of security for most account
passwords. This corresponds to maybe a few weeks of computing for a
cybercrime-group level of attacker, which should be plenty enough to
entice them to move on to easier targets, and provides a non-negligible
hurdle for higher-funded attackers as well.&lt;/p&gt;

&lt;p&gt;With Diceware-style passwords, this corresponds to a total of 20 dice
throws, in turn corresponding to &lt;strong&gt;four words out of the ordinary-size
dictionaries.&lt;/strong&gt; With the 32/Z85 character set (or any other 85-character
set) and &lt;strong&gt;random selection, this corresponds to 8 characters.&lt;/strong&gt; With only
lowercase letters and digits (a-z, 0-9), selected at random, it
corresponds to &lt;strong&gt;10 characters.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Keep in mind that this is what I suggest as a &lt;em&gt;minimum&lt;/em&gt; and that, within
reason, more is almost always better if you can wing it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For high-value secrets,&lt;/strong&gt; such as your password database, you should use a
significantly stronger password. I suggest aiming for no less than
80-100 bits of security there, depending on your level of paranoia.
Remember, if your password manager master password is broken, every
password within it is compromised, so choose and treat the master
password accordingly. 80-100 bits of entropy means 31-39 dice throws or
&lt;strong&gt;7-8 words for a diceware-style password, or 13-16 characters&lt;/strong&gt; selected at
random out of a set of 85, or &lt;strong&gt;16-19 characters selected at random out of
a-z, 0-9.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Keep in mind that some ordinary passwords may also be protecting
high-value assets. For example, if someone is able to gain access to
your e-mail account, they can often issue password reset requests on
various services and gain access to your other accounts that way. Take
this into consideration when you decide whether a minimum-security
password is sufficient for a particular account, or if a longer password
is called for.&lt;/p&gt;

&lt;p&gt;Going beyond 256 bits of password entropy is almost never worth it, even
with a safety fudging factor. Hence, &lt;strong&gt;20 diceware words, 40 characters
out of a set of 85, or 50 characters out of a-z 0-9, is the most you
should realistically ever need.&lt;/strong&gt;&lt;/p&gt;

&lt;h1 id=&quot;do-not-change-your-passwords-needlessly&quot;&gt;Do not change your passwords needlessly&lt;/h1&gt;

&lt;p&gt;Some systems require you to change your passwords regularly, and if
there is a forced policy in place that requires that you change your
password, this obviously does not apply because it cannot apply.&lt;/p&gt;

&lt;p&gt;However, most systems don’t require regular password changes. For those,
&lt;strong&gt;unless you have reason to believe that your password may have been
compromised&lt;/strong&gt; or otherwise might have become known to a third party, don’t
change your password.&lt;/p&gt;

&lt;p&gt;If you follow the advice elsewhere on this page, your passwords will be
plenty strong enough to resist almost any attacker for a very long
period of time &lt;em&gt;unless&lt;/em&gt; your own system is compromised.&lt;/p&gt;

&lt;p&gt;If you follow the advice I give here, then&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;changing your password regularly does not make it significantly more
difficult for an attacker to figure it out, and&lt;/li&gt;
  &lt;li&gt;if your own system is compromised, changing your password does not
improve the security of your account unless you deal with the system
compromise first&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;You should by all means change your password if you have any reason to
believe that it has been compromised in any way.&lt;/strong&gt; In fact, in such a
situation, I would be the first to argue that you &lt;em&gt;must&lt;/em&gt; change your
password as quickly as possible, along with any answers to secret
questions. (In such a situation, it might very well be better to
&lt;em&gt;immediately&lt;/em&gt; change to some simple password at the first indication of
a breach, then change it again to a stronger one, &lt;em&gt;just to lock an
unauthorized person out of your account&lt;/em&gt; while you generate a new,
strong password.) However, changing them every X weeks or months is
pretty much completely pointless in most situations, particularly if you
follow otherwise good password hygiene.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Make your passwords strong to begin with, and keep them to yourself.
then, unless the password is actually compromised, there should be very
little reason to change them.&lt;/strong&gt;&lt;/p&gt;

&lt;h1 id=&quot;do-not-use-secret-questions-for-password-recovery&quot;&gt;Do not use “secret questions” for password recovery&lt;/h1&gt;

&lt;p&gt;Many sites offer “secret questions” for password recovery. In effect,
these form a &lt;em&gt;secondary password&lt;/em&gt; which can be used to gain access to
your account in case you forget your actual password.&lt;/p&gt;

&lt;p&gt;Worse still, these are often limited to a small set of possible
questions, with one answer given for each, and the stock questions tend
to be about information that can be quite easy to get. Even if a
potential attacker doesn’t immediately have access to the information,
any reasonable search space is usually far smaller than that of a proper
length, random password.&lt;/p&gt;

&lt;p&gt;Instead of filling these in truthfully, I recommend that you &lt;em&gt;disable
this altogether&lt;/em&gt; if that is possible. If you can’t do that (if the
system forces you to pick such “security questions” and provide
answers), then at least &lt;em&gt;provide reasonably long, but bogus, answers&lt;/em&gt;.
Treat them as the passwords they are, and give garbage “answers” that
have absolutely no bearing on the question and are no easier to guess
than your actual password.&lt;/p&gt;

&lt;p&gt;For example, if you absolutely have to provide an answer to a “secret
question”, and one option for the question is “in what town did you grow
up?”, don’t answer it with anything remotely resembling the name of a
real town, let alone the one where you actually grew up. Instead, here
is a better answer that you could provide:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;SsK}:aEjfkQ=koj-2t}$2$wxa:&amp;gt;#rTxg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you are required to provide answers which look like words, turn to
Diceware. For example, you could use (providing about 64 bits of
security against someone who knows that you have a Diceware answer):&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;wow-witty-rap-bunny-pay
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Of course, now that I have suggested these particular ones, don’t use
&lt;em&gt;those&lt;/em&gt;, but rather something similar. At the risk of repeating myself,
&lt;em&gt;treat the answer(s) to these security questions as the passwords they
are&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Write down the question(s) and answer(s) in the notes field in your
password database, or as separate entries in the unlikely case that your
password manager provides no separate notes field. That way, if they
ever turn out to actually be needed, you will have them on hand, but
they will be no easier to get to than your actual account password.&lt;/p&gt;

&lt;h1 id=&quot;consider-using-password-quality-usernames&quot;&gt;Consider using password-quality usernames&lt;/h1&gt;

&lt;p&gt;Not all services require your username to be public or memorable. Some
even make a point of that your username is &lt;em&gt;not&lt;/em&gt; publicly available
information. If the one you are registering with falls into such a
category, such as an online store or financial institution where you log
in with something other than an e-mail address and which you can choose
yourself, consider creating a password-quality username to use along
with your high-quality password.&lt;/p&gt;

&lt;p&gt;This is not for everyone, and it is not for every place where a password
is needed. But where it applies, having a username that is not related
to you in any way beyond being used for your account can make breaking
into the account far more difficult because now an attacker has to guess
&lt;em&gt;both&lt;/em&gt; your username &lt;em&gt;and&lt;/em&gt; its corresponding password.&lt;/p&gt;

&lt;p&gt;By using a username made up of (for example) 3-4 Diceware words, the
length of the username remains reasonable yet the username is far harder
for anyone to guess. Since you are using a password manager anyway,
there is little to keep you from using different usernames for different
services.&lt;/p&gt;

&lt;p&gt;A password-quality username is not at all a replacement for a
high-quality password, particularly because usernames are rarely
protected even remotely as well as passwords. However, in situations
where it applies, a password-quality username can be a great complement
to slow an attacker down.&lt;/p&gt;

&lt;h1 id=&quot;turn-on-any-available-last-lines-of-defense&quot;&gt;Turn on any available last lines of defense&lt;/h1&gt;

&lt;h2 id=&quot;use-two-factor-authentication-if-available&quot;&gt;Use two-factor authentication, if available&lt;/h2&gt;

&lt;p&gt;Two-factor authentication relies on something more than just a password
to provide additional security. This can be an access code delivered
over SMS, or generated by a physical token in your possession, or some
other method. This makes it much harder for someone to log in to your
account should they be able to guess your password, &lt;em&gt;significantly&lt;/em&gt;
improving the security.&lt;/p&gt;

&lt;p&gt;Two-factor authentication doesn’t solve everything, and different
methods have different security properties, but most turn what would
have been an undetected attack against a static string (your password)
into a significantly more overt attack against something that is far
more likely to be detected. Using two-factor authentication will not
stop a truly determined attacker, but it will make their job far more
difficult.&lt;/p&gt;

&lt;h2 id=&quot;turn-on-login-notifications-if-available&quot;&gt;Turn on login notifications, if available&lt;/h2&gt;

&lt;p&gt;If the service offers some form of notifications on login, turn those
on. Make sure those notifications are delivered to some place &lt;em&gt;other&lt;/em&gt;
than the service or system that they are about. That way, should someone
be able to guess your password, at least you will notice the login that
you didn’t do and can hopefully take corrective action before the damage
is too severe.&lt;/p&gt;

&lt;p&gt;Keep in mind that particularly login notifications &lt;em&gt;really&lt;/em&gt; form a last
line of defense, kind of like a home security alarm system, in that they
do not &lt;em&gt;prevent&lt;/em&gt; the breach, but rather only &lt;em&gt;notifies&lt;/em&gt; you of the
breach &lt;em&gt;after the fact&lt;/em&gt;. If this goes off, then everything else has
already failed to protect you and your assets and the attacker has
gained access to your account; proceed accordingly.&lt;/p&gt;

&lt;p&gt;© Michael Kjörling.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>运动会总记</title>
   <link href="https://getpoole.com/blog/2019/11/15/%E8%BF%90%E5%8A%A8%E4%BC%9A%E6%80%BB%E8%AE%B0/"/>
   <updated>2019-11-15T00:00:00+00:00</updated>
   <id>https://getpoole.com/2019/11/15/运动会总记</id>
   <content type="html">&lt;p&gt;是啊，2019年11月15日，又一届校运会闭幕了。也许要承接去年的同一篇Post，又抑或是要新作一篇文。无论如何。&lt;br /&gt;
自去年起，大部分文字早已诉诸于日记本了，太多曾经“梁山”“祝家庄”上思考的意味，也归于了那一本绿色的小册子。这Blog，也似乎不再有存在的必要。但无论如何，让它留着吧。也许哪一天，我就要捡起你。&lt;br /&gt;
本文的具体内容，请见日记本。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Test Write-a-post</title>
   <link href="https://getpoole.com/blog/2019/06/29/Test-Write-a-post/"/>
   <updated>2019-06-29T00:00:00+00:00</updated>
   <id>https://getpoole.com/2019/06/29/Test-Write-a-post</id>
   <content type="html">&lt;h1 id=&quot;test-write-a-post&quot;&gt;Test write-a-post&lt;/h1&gt;
&lt;p&gt;测试write-a-post&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>GitHub API test</title>
   <link href="https://getpoole.com/blog/2019/06/23/Test-Github-API/"/>
   <updated>2019-06-23T00:00:00+00:00</updated>
   <id>https://getpoole.com/2019/06/23/Test-Github-API</id>
   <content type="html">&lt;p&gt;# This is the first post created by a GitHub API PUT request!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>英语剧漫记</title>
   <link href="https://getpoole.com/blog/2019/02/28/English-Drama/"/>
   <updated>2019-02-28T00:00:00+00:00</updated>
   <id>https://getpoole.com/2019/02/28/English-Drama</id>
   <content type="html">&lt;p&gt;英语剧是云大附中的传统迎新项目，每个元旦前几乎都会举办。表演者是初二年级，面向全校观众。今年，初二的我应班级要求负责了13，14班英语剧——Zootopia的音频剪辑工作。我学到了许多知识，也有了许多心得。&lt;br /&gt;
这项工作是我从未做过的，一切从新。范老师告诉我可以试试Adobe的软件，略加搜索，是Audition。可惜这款极佳的软件价值不菲，试用期却只有七天。我只好另找了开源免费的Audacity暂承担录音工作，待后期处理开始，再启用Audition的试用期。&lt;br /&gt;
录音是超级无聊但好玩的。&lt;br /&gt;
时间只有两个中午，是非常紧张的，作为录音师，你必须一刻不停地坐在电脑前，大气不出，在录音、播放、停止、删除几个键间来回挥动你手上的鼠标，并耐心地听着每一位演员的台词，看着老师的指示，作为英语班级第一，甚至还要担心演员们的发音（？）。&lt;br /&gt;
但是这又是十分有趣的事。剧中有一个角色，树懒闪电。在录这个角色时，可搞笑到了我们。这一幕持续近4分钟，期间搞笑片段无穷，我们却只能硬憋着笑，强忍着录完，最后因为有翻书声，这一段还差点重录，幸亏降噪功能给力才作罢。&lt;br /&gt;
还有，由于隔音教室紧张，老师让我和凯麟提前去那里霸教室，由于我们两个班的数学老师都是尹老师，我们便以“老尹语录”“你爹你妈买(mě)车，只买四个轱辘”一句作为暗号，以“确定”前来人员的身份。每每使用，总引来教室里一阵爆笑。&lt;br /&gt;
后期处理工作也是艰难但收获满满的。&lt;br /&gt;
Audition黑色的界面中，各种新奇功能应有尽有，但是——你要从头学。每一个术语，像“噪声样本”(即Noise Sample)，“频谱频率图”(即Spectrogram)都是未为我所知的；此外，我还学到了音乐的淡出，这是一个好玩的功能，还分为“线性淡出”“对数淡出”“余弦淡出”三种，用来复杂而有趣。同时，也感谢信息技术老师教给我的Adobe的界面设计思想，让我能够以软件设计者的方式思考，从而找到各个功能。&lt;br /&gt;
在工作中，我学到了不少。首先，最震撼了我的，是“喷麦”的处理。我本以为这是一个不可能的事，因为在我的印象中，这些声音是同时存在的，删一则均无。然则前文所及频谱频率图，却可以将它们分开，虽然如果操作不当，可能伴有失真。&lt;br /&gt;
此外，我还学到了，一处噪声样本不能再用于别处，用于一个人的噪声样本不能用于另一个人。在降噪刚开始时，我在刘畅的词处随意捕捉了一处噪声样本，便轻率地用于全部降噪。本想着这样就可以了，却没想到沙子辰的声音就全被降没了。再者，录音用了两中午，一下午，不同时间的噪声亦不同，混用亦不行。这也告诉我，学习不可能一蹴而就，只能一步步兢兢业业地向前。&lt;br /&gt;
最后，我还知道了，舞台要尽量杜绝空场；搜索背景音乐可以搜“…bgm”；还可以搜到没有词的背景音乐。&lt;br /&gt;
不过，之后重听录音，发现工作中也充满了我的失误。&lt;br /&gt;
作为“副导演”，我没有认真记录各演员的走场时间，所以第一稿有许多过于宽裕或紧凑的地方，甚至终稿也如此，在录音过程中，有很多吐字不清晰的地方，我也没有及时叫停重录。导致了英语剧的瑕疵。&lt;br /&gt;
在降噪过程中，正如前文所说，我滥用降噪功能，导致了沙子辰等部分人的词声音过小。又有几处“喷麦”，我企图偷懒，导致了几处失真。&lt;br /&gt;
最后，应14班的架子鼓手要求，我将最后的Try Everything一舞的音乐音乐音量调大，却没有确认调整的范围就应用了，结果最后音量忽大忽小，影响了最后演出的效果。&lt;br /&gt;
我们的工作中也是充满了合作的。凯麟同学自掏腰包为我们购买了无损的Michael Giacchino的原电影背景音乐，效果很好；申林灵和雷岚君两位同学牺牲了自己的休息时间，为我们创作出了两段极富感染力的舞蹈；沈曈为我们整理撰写了英语剧稿，其中虽有少量错漏，其也是不可替代的；最后范老师为我们的付出，最是不可计数的。&lt;br /&gt;
总而言之，在英语剧背景音乐的剪辑过程中，我收获良多。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>运动会漫记</title>
   <link href="https://getpoole.com/blog/2018/11/16/Sports-Meet/"/>
   <updated>2018-11-16T00:00:00+00:00</updated>
   <id>https://getpoole.com/2018/11/16/Sports-Meet</id>
   <content type="html">&lt;p&gt;2018年11月16日，又一届校运动会闭幕了。运动会，在我的心里，不知有什么特殊的意义。
自从进了小学，就有了运动会。小学时的运动会，我总只是啦啦队，从没有什么项目。参加得最多的，是集体项目和开闭幕式的方阵。集体项目总是在学校里举行，且那时又不要求每天都到场，所以我在体育场便满是清闲，总之，很少为集体做什么贡献。再说方阵，我参加过三次方阵，而每次都会有不同的口号，比如一年级是“我运动，我健康，我快乐”。还有，我曾于六年级时当过小记者，于是进了场地，也写了几十篇稿，可是一篇也没有被念。这些兴许就是六年中关于运动会最深的回忆了。
小学六年很快过去，这些也就成了回忆。进了云大附中，又是一番情景。初中强制我们每天到场，为运动员加油，所以我们每天都去看台晒太阳。中午午餐便是约着伙伴们解决，初一和加拿大的同学们吃了一餐；初二又和同学们跑远甩了两趟。又因为那次期中考考的不错，同学们都让我当班委，所以运动会从此我就加上了查人的任务。还有，初中的集体项目也移到了体育场进行。
话说查人呀，还真不是一件容易的事。每天都要早去。组里的每个同学要上厕所，买水，或是其他事情都要向组长汇报，尽管如此，每一次老师让我们点人，总还是有几个人“不明失踪”。无论如何，我总是有了事做。
初二，（依然是组长的）我又突发奇想，准备查清体育场内各机构的布局和厕所的分布情况，于是我便携着黄崟霏绕了三圈。其中有什么“信鸽协会”“老协”什么的甚是开人眼界；还有两个厕所只有男厕，没有女厕？真是奇特。
总之，运动会代表着自由，代表着发现，代表着领导，也代表着“更高，更快，更远”的奥运精神。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>忆昔昆石线</title>
   <link href="https://getpoole.com/blog/2018/10/22/Railway/"/>
   <updated>2018-10-22T00:00:00+00:00</updated>
   <id>https://getpoole.com/2018/10/22/Railway</id>
   <content type="html">&lt;p&gt;在书桌前，偶然听到一声汽笛声，我连忙抬头望向窗外。转眼，跨越了百年历史的，昆明境内米轨昆石线已完全停运快一年了。&lt;br /&gt;
还记得那是2012年，是我才上小学时。我怀着无限的好奇第一次踏上了这一列每日两趟的蓝色火车。车票的形状是我早已记不清了
的，只知道，与当时通行的红色车票很不同。从市区到石咀，坐上一会儿就到了。沿途经过了马街，跨过了昆明，充溢着浓浓的昆明
市井气。到了站，我又兴奋地追火车，观看火车连接。我还好奇地问妈妈，火车这么长，是怎么掉头的。自己一研究，才明白了人字
形的设计。这些事为我带来了对于铁路，这个最古老的交通工具之一的最初的兴趣。那真是一份十分新奇的体验。&lt;br /&gt;
后来班上组办的篮球班移到了每周六，在师大。于是，我每周又要和这班火车打交道了。那些早上，我的同学们都专注地拍着球，心
中却总在等着什么。忽然，课上到一半，一声汽笛声呜呜地传来——火车来啦！火车来啦！我们都欢呼起来，齐刷刷地看向轨道。又是
两声汽笛声，火车到了。那慢慢的火车却总能吸引我们的眼光，直到火车开过，才又回到课中。&lt;br /&gt;
2013年，连续两个多星期，我又在铁轨上行驶——这回是步行，不是坐车。那次，我突发奇想，这一条静卧了亘古的铁轨，究竟有多长？
又有几根枕木在默默支撑？于是，我每个周末都和妈妈一起数枕木。从昆明北站，到海源中路，又是半个昆明。一根根枕木被我尽数
踏遍，一个个道口被我依次记着。这条铁轨乃是十九世纪，英法入侵时期所建，向东南两次穿过高铁线，经过了九大高原湖泊之五的
滇池，阳宗海，抚仙湖，星云湖，杞麓湖，异龙湖。直通河口，是当年抗战时期的“大动脉”——滇越铁路的终点，既承载了历史的风雨
云烟，又记录了我童年的喜怒哀乐。&lt;br /&gt;
如今搬家到了铁路边，每日踏轨上学，却不见了曾经漫步在铁轨上的“东方红”柴油机车。心中不禁怅惘了几分。她去哪了？她还会回来吗？&lt;br /&gt;
以前走路穿越铁轨，总在想，道口处信号灯下的“红灯停车，灭灯停用”八个黑底白字，是什么意思。直到如今，才知道，这一声陪伴了
我的火车汽笛，这一条绵延的米宽铁轨，也有离开我的时候。虽然新闻上说，她还会再开，只是为了新的地铁让路。但是，还是有太多的东西，
只要放任失去了，就再也没有了；只有无尽的回忆，会永远萦绕在心头。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>窗外</title>
   <link href="https://getpoole.com/blog/2018/09/16/Rain2nd/"/>
   <updated>2018-09-16T00:00:00+00:00</updated>
   <id>https://getpoole.com/2018/09/16/Rain2nd</id>
   <content type="html">&lt;p&gt;雨季入夜，书桌前，我伏案苦读。忽然，风云突变，我不觉抬起头来，凝视着窗外。&lt;br /&gt;
天暗下来了。那平日早就稀薄的白云，不知何时，却被那普鲁士军事统治下般的乌云大军，赶出了它们极力想要掩护的蓝天。那乌云迈着大步，配合着早就吹起的大风，连太阳也被吓跑了。昏暗的窗外，一棵棵几人合抱粗的古树如同一株被践踏的小草一般左右摇曳，甚至开始嘎嘎作响，不禁令人疑惑：这景象是婀娜多姿？抑或是不堪重负？&lt;br /&gt;
忽然，一片亮光进入了尚未缩小的瞳孔——未等人们反应过来，“夸拉”——便是一片充满了空气的炸雷。顿时，婴儿的哭声，汽车的蜂鸣声不绝于耳，没有准备的我的耳朵里于是开始了嗡嗡作响——雷公威严，我不禁打了几个寒战。&lt;br /&gt;
那令万物惊心动魄的好戏却早已开始上演。不知何时，耳边开始充满一种淅淅沥沥的声音。打了这雷，人们方才略一思量——原来雨早已加入了这大战。雨打湿了窗，也冷却了我受惊的心。雨越下越大。窗外的雨声、风声配合紧密，试图用那响声将我催眠。却没料到半路雷声又怒吼着杀了回马枪——“噼啪噼啪”——“我才是老大！”此时这雷却是如那元日放响的爆竹一般炸耳了。&lt;br /&gt;
夜渐深了。雷声渐稀，雨却越密了。此时的雨，则成了医疗兵，安抚着受那大风摧残的树木；安慰着被那雷电点燃的大气，这兴许是“好雨知时节”的新解吧。雨声虽大，却不吵，反而哗啦哗啦地冲跑了其他的杂音——也许正适合睡觉。雷电也还不时闪几下，却是大势已去，再不能如方才般兴风作浪，扰人清梦了。&lt;br /&gt;
我凝视着窗外，谛听着窗外。如此神奇的窗外，带来大自然的神力的窗外。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>春城爱雨</title>
   <link href="https://getpoole.com/blog/2018/08/27/Love-Rain/"/>
   <updated>2018-08-27T00:00:00+00:00</updated>
   <id>https://getpoole.com/2018/08/27/Love-Rain</id>
   <content type="html">&lt;p&gt;至爱。昆明的雨季。这爱的是雨，是雷，还是雨季，我是分不清了的。&lt;br /&gt;
天暗下来了。那平日早就稀薄的白云，不知何时，却被那普鲁士军事统治下般的乌云大军，赶出了国土。黑云配合着早就吹起的大风，昏暗的窗外，一棵棵几人合抱粗的古树被吹得狂摇起来，甚至嘎嘎作响，不禁令人疑惑：这景象是婀娜多姿？抑或是不堪重负？&lt;br /&gt;
赏着，忽然看见一片亮光——未等人们反应过来，“夸拉”——便是一片炸雷充满了空气。顿时，婴儿的哭声，汽车的蜂鸣声不绝于耳，我没有准备，耳朵里于是开始了嗡嗡作响——也当然是心有余悸。&lt;br /&gt;
那令万物惊心动魄的好戏却早已开始上演。不知何时，耳边开始充满了一种淅淅沥沥的声音。打了这雷，人们方才略一思量——原来雨早已到来了。雨越下越大。雨声，风声配合紧密，使环境里充满了均匀噪声，似乎正是宜人，却不如那雷声引人注意——“噼啪噼啪”——这雷却是如那春日放响的炸耳鞭炮一般了。&lt;br /&gt;
夜渐深了。雷声渐稀，雨却越密了。雨声虽大，却不吵，反而哗啦哗啦地冲跑了其他的杂音——正适合睡觉。雷电也不时闪几下，却是大势已去，再不能如方才般打扰人了。&lt;br /&gt;
至爱雨声入梦，不觉，天亮了。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>前进吧，附小人</title>
   <link href="https://getpoole.com/blog/2018/08/04/YNSDFX/"/>
   <updated>2018-08-04T00:00:00+00:00</updated>
   <id>https://getpoole.com/2018/08/04/YNSDFX</id>
   <content type="html">&lt;p&gt;唱完国歌，总还是浮现出“在这里，四季如春”的歌词。&lt;br /&gt;
也许，&lt;br /&gt;
这就是周群校长对我们所有的附小人，无论何时加入，何时离开，的期望吧——“不忘初心，方得始终。”&lt;br /&gt;
会记得，我们曾说过，要有爱没有恨。&lt;br /&gt;
会记得，我们要活泼精神，相敬相亲；&lt;br /&gt;
要读书认真，头脑清新。&lt;br /&gt;
无论漂泊何方，都一定记住您的教诲——&lt;br /&gt;
良习修美德，好好做个人。&lt;br /&gt;
同时，也记住你们，我亲爱的同学们——&lt;br /&gt;
愿我们一日同学，终身是友！&lt;br /&gt;
要记住你们，我敬爱的老师们——&lt;br /&gt;
必然是一日为师，终身为父！&lt;br /&gt;
云南师大附小，以她博大的胸怀、悠久的历史，永远引领着一代代附小人，为社会带来生机！&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>A long bus ride</title>
   <link href="https://getpoole.com/blog/2018/07/14/Long-bus-ride/"/>
   <updated>2018-07-14T00:00:00+00:00</updated>
   <id>https://getpoole.com/2018/07/14/Long-bus-ride</id>
   <content type="html">&lt;p&gt;今天坐了一次耗时1小时45分的公交车，东莞L6路，共坐了36个站，路上共上了51个人，其中刷卡25人，现金25人，二维码1人&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>小诗两首</title>
   <link href="https://getpoole.com/blog/2018/06/29/Chinese-Poem/"/>
   <updated>2018-06-29T00:00:00+00:00</updated>
   <id>https://getpoole.com/2018/06/29/Chinese-Poem</id>
   <content type="html">&lt;h1 id=&quot;体育期末考&quot;&gt;体育期末考&lt;/h1&gt;
&lt;p&gt;那天体育——期末考&lt;br /&gt;
下点小雨——真好跑&lt;br /&gt;
成绩进步——几十秒&lt;br /&gt;
天公作美——就是好&lt;br /&gt;
几天以后——笔头考&lt;br /&gt;
七科并进——真辛劳&lt;br /&gt;
学习不仅——期末考&lt;br /&gt;
小考大考——都不少&lt;br /&gt;
两年以后——考中考&lt;br /&gt;
无论如何——都要好&lt;br /&gt;
五年以后——是高考&lt;br /&gt;
一个转折——人人搞&lt;br /&gt;
人生路上——几多考&lt;br /&gt;
是坏是好——无人晓&lt;br /&gt;
只愿明日——复明日&lt;br /&gt;
咿唉——不要成蹉跎&lt;/p&gt;
&lt;h1 id=&quot;厕所&quot;&gt;厕所&lt;/h1&gt;
&lt;p&gt;莫言如厕便无难&lt;br /&gt;
赚得急者错喜欢&lt;br /&gt;
箭头只会往前指&lt;br /&gt;
厕所还在万山前&lt;br /&gt;
找到厕所依旧烦&lt;br /&gt;
过道里面长龙排&lt;br /&gt;
你喜我欢还不够&lt;br /&gt;
依旧堵在人群间&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>语义化版本 2.0.0</title>
   <link href="https://getpoole.com/blog/2017/11/18/SemVer-Copy/"/>
   <updated>2017-11-18T00:00:00+00:00</updated>
   <id>https://getpoole.com/2017/11/18/SemVer-Copy</id>
   <content type="html">&lt;p&gt;语义化版本 2.0.0
By Wayou Liu
===&lt;/p&gt;

&lt;h2 id=&quot;摘要&quot;&gt;摘要&lt;/h2&gt;

&lt;p&gt;版本格式：主版本号.次版本号.修订号，版本号递增规则如下：&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;主版本号：当你做了不兼容的 API 修改，&lt;/li&gt;
  &lt;li&gt;次版本号：当你做了向下兼容的功能性新增，&lt;/li&gt;
  &lt;li&gt;修订号：当你做了向下兼容的问题修正。&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;先行版本号及版本编译信息可以加到“主版本号.次版本号.修订号”的后面，作为延伸。&lt;/p&gt;

&lt;h2 id=&quot;简介&quot;&gt;简介&lt;/h2&gt;

&lt;p&gt;在软件管理的领域里存在着被称作“依赖地狱”的死亡之谷，系统规模越大，加入的套件越多，你就越有可能在未来的某一天发现自己已深陷绝望之中。&lt;/p&gt;

&lt;p&gt;在依赖高的系统中发布新版本套件可能很快会成为恶梦。如果依赖关系过高，可能面临版本控制被锁死的风险（必须对每一个相依套件改版才能完成某次升级）。而如果依赖关系过于松散，又将无法避免版本的混乱（假设兼容于未来的多个版本已超出了合理数量）。当你专案的进展因为版本相依被锁死或版本混乱变得不够简便和可靠，就意味着你正处于依赖地狱之中。&lt;/p&gt;

&lt;p&gt;作为这个问题的解决方案之一，我提议用一组简单的规则及条件来约束版本号的配置和增长。这些规则是根据（但不局限于）已经被各种封闭、开放源码软件所广泛使用的惯例所设计。为了让这套理论运作，你必须先有定义好的公共 API。这可以透过文件定义或代码强制要求来实现。无论如何，这套 API 的清楚明了是十分重要的。一旦你定义了公共 API，你就可以透过修改相应的版本号来向大家说明你的修改。考虑使用这样的版本号格式：X.Y.Z（主版本号.次版本号.修订号）修复问题但不影响 API 时，递增修订号；API 保持向下兼容的新增及修改时，递增次版本号；进行不向下兼容的修改时，递增主版本号。&lt;/p&gt;

&lt;p&gt;我称这套系统为“语义化的版本控制”，在这套约定下，版本号及其更新方式包含了相邻版本间的底层代码和修改内容的信息。&lt;/p&gt;

&lt;h2 id=&quot;语义化版本控制规范semver&quot;&gt;语义化版本控制规范（SemVer）&lt;/h2&gt;

&lt;p&gt;以下关键词 MUST、MUST NOT、REQUIRED、SHALL、SHALL NOT、SHOULD、SHOULD NOT、 RECOMMENDED、MAY、OPTIONAL 依照 RFC 2119 的叙述解读。（译注：为了保持语句顺畅， 以下文件遇到的关键词将依照整句语义进行翻译，在此先不进行个别翻译。）&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;使用语义化版本控制的软件“必须 MUST ”定义公共 API。该 API 可以在代码中被定义或出现于严谨的文件内。无论何种形式都应该力求精确且完整。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;标准的版本号“必须 MUST ”采用 XYZ 的格式，其中 X、Y 和 Z 为非负的整数，且“禁止 MUST NOT”在数字前方补零。X 是主版本号、Y 是次版本号、而 Z 为修订号。每个元素“必须 MUST ”以数值来递增。例如：1.9.1 -&amp;gt; 1.10.0 -&amp;gt; 1.11.0。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;标记版本号的软件发行后，“禁止 MUST NOT ”改变该版本软件的内容。任何修改都“必须 MUST ”以新版本发行。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;主版本号为零（0.y.z）的软件处于开发初始阶段，一切都可能随时被改变。这样的公共 API 不应该被视为稳定版。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;1.0.0 的版本号用于界定公共 API 的形成。这一版本之后所有的版本号更新都基于公共 API 及其修改内容。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;修订号 Z（x.y.Z &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;|&lt;/code&gt; x &amp;gt; 0）“必须 MUST ”在只做了向下兼容的修正时才递增。这里的修正指的是针对不正确结果而进行的内部修改。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;次版本号 Y（x.Y.z &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;|&lt;/code&gt; x &amp;gt; 0）“必须 MUST ”在有向下兼容的新功能出现时递增。在任何公共 API 的功能被标记为弃用时也“必须 MUST ”递增。也“可以 MAY ”在内部程序有大量新功能或改进被加入时递增，其中“可以 MAY ”包括修订级别的改变。每当次版本号递增时，修订号“必须 MUST ”归零。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;主版本号 X（X.y.z &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;|&lt;/code&gt; X &amp;gt; 0）“必须 MUST ”在有任何不兼容的修改被加入公共 API 时递增。其中“可以 MAY ”包括次版本号及修订级别的改变。每当主版本号递增时，次版本号和修订号“必须 MUST ”归零。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;先行版本号“可以 MAY ”被标注在修订版之后，先加上一个连接号再加上一连串以句点分隔的标识符号来修饰。标识符号“必须 MUST ”由 ASCII 码的英数字和连接号 [0-9A-Za-z-] 组成，且“禁止 MUST NOT ”留白。数字型的标识符号“禁止 MUST NOT ”在前方补零。先行版的优先级低于相关联的标准版本。被标上先行版本号则表示这个版本并非稳定而且可能无法达到兼容的需求。范例：1.0.0-alpha、1.0.0-alpha.1、1.0.0-0.3.7、1.0.0-x.7.z.92。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;版本编译信息“可以 MAY ”被标注在修订版或先行版本号之后，先加上一个加号再加上一连串以句点分隔的标识符号来修饰。标识符号“必须 MUST ”由 ASCII 的英数字和连接号 [0-9A-Za-z-] 组成，且“禁止 MUST NOT ”留白。当判断版本的优先层级时，版本编译信息“可 SHOULD ”被忽略。因此当两个版本只有在版本编译信息有差别时，属于相同的优先层级。范例：1.0.0-alpha+001、1.0.0+20130313144700、1.0.0-beta+exp.sha.5114f85。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;版本的优先层级指的是不同版本在排序时如何比较。判断优先层级时，“必须 MUST ”把版本依序拆分为主版本号、次版本号、修订号及先行版本号后进行比较（版本编译信息不在这份比较的列表中）。由左到右依序比较每个标识符号，第一个差异值用来决定优先层级：主版本号、次版本号及修订号以数值比较，例如：1.0.0 &amp;lt; 2.0.0 &amp;lt; 2.1.0 &amp;lt; 2.1.1。当主版本号、次版本号及修订号都相同时，改以优先层级比较低的先行版本号决定。例如：1.0.0-alpha &amp;lt; 1.0.0。有相同主版本号、次版本号及修订号的两个先行版本号，其优先层级“必须 MUST ”透过由左到右的每个被句点分隔的标识符号来比较，直到找到一个差异值后决定：只有数字的标识符号以数值高低比较，有字母或连接号时则逐字以 ASCII 的排序来比较。数字的标识符号比非数字的标识符号优先层级低。若开头的标识符号都相同时，栏位比较多的先行版本号优先层级比较高。范例：1.0.0-alpha &amp;lt; 1.0.0-alpha.1 &amp;lt; 1.0.0-alpha.beta &amp;lt; 1.0.0-beta &amp;lt; 1.0.0-beta.2 &amp;lt; 1.0.0-beta.11 &amp;lt; 1.0.0- rc.1 &amp;lt; 1.0.0。&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;为什么要使用语义化的版本控制&quot;&gt;为什么要使用语义化的版本控制？&lt;/h2&gt;

&lt;p&gt;这并不是一个新的或者革命性的想法。实际上，你可能已经在做一些近似的事情了。问题在于只是“近似”还不够。如果没有某个正式的规范可循，版本号对于依赖的管理并无实质意义。将上述的想法命名并给予清楚的定义，让你对软件使用者传达意向变得容易。一旦这些意向变得清楚，弹性（但又不会太弹性）的依赖规范就能达成。&lt;/p&gt;

&lt;p&gt;举个简单的例子就可以展示语义化的版本控制如何让依赖地狱成为过去。假设有个名为“救火车”的函式库，它需要另一个名为“梯子”并已经有使用语义化版本控制的套件。当救火车创建时，梯子的版本号为 3.1.0。因为救火车使用了一些版本 3.1.0 所新增的功能， 你可以放心地指定相依于梯子的版本号大等于 3.1.0 但小于 4.0.0。这样，当梯子版本 3.1.1 和 3.2.0 发布时，你可以将直接它们纳入你的套件管理系统，因为它们能与原有相依的软件兼容。&lt;/p&gt;

&lt;p&gt;作为一位负责任的开发者，你理当确保每次套件升级的运作与版本号的表述一致。现实世界是复杂的，我们除了提高警觉外能做的不多。你所能做的就是让语义化的版本控制为你提供一个健全的方式来发行以及升级套件，而无需推出新的相依套件，节省你的时间及烦恼。&lt;/p&gt;

&lt;p&gt;如果你对此认同，希望立即开始使用语义化版本控制，你只需声明你的函式库正在使用它并遵循这些规则就可以了。请在你的 README 文件中保留此页连结，让别人也知道这些规则并从中受益。&lt;/p&gt;

&lt;h2 id=&quot;faq&quot;&gt;FAQ&lt;/h2&gt;

&lt;h3 id=&quot;在-0yz-初始开发阶段我该如何进行版本控制&quot;&gt;在 0.y.z 初始开发阶段，我该如何进行版本控制？&lt;/h3&gt;

&lt;p&gt;最简单的做法是以 0.1.0 作为你的初始化开发版本，并在后续的每次发行时递增次版本号。&lt;/p&gt;

&lt;h3 id=&quot;如何判断发布-100-版本的时机&quot;&gt;如何判断发布 1.0.0 版本的时机？&lt;/h3&gt;

&lt;p&gt;当你的软件被用于正式环境，它应该已经达到了 1.0.0 版。如果你已经有个稳定的 API 被使用者依赖，也会是 1.0.0 版。如果你很担心向下兼容的问题，也应该算是 1.0.0 版了。&lt;/p&gt;

&lt;h3 id=&quot;这不会阻碍快速开发和迭代吗&quot;&gt;这不会阻碍快速开发和迭代吗？&lt;/h3&gt;

&lt;p&gt;主版本号为零的时候就是为了做快速开发。如果你每天都在改变 API，那么你应该仍在主版本号为零的阶段（0.y.z），或是正在下个主版本的独立开发分支中。&lt;/p&gt;

&lt;h3 id=&quot;对于公共-api若即使是最小但不向下兼容的改变都需要产生新的主版本号岂不是很快就达到-4200-版&quot;&gt;对于公共 API，若即使是最小但不向下兼容的改变都需要产生新的主版本号，岂不是很快就达到 42.0.0 版？&lt;/h3&gt;

&lt;p&gt;这是开发的责任感和前瞻性的问题。不兼容的改变不应该轻易被加入到有许多依赖代码的软件中。升级所付出的代价可能是巨大的。要递增主版本号来发行不兼容的改版，意味着你必须为这些改变所带来的影响深思熟虑，并且评估所涉及的成本及效益比。&lt;/p&gt;

&lt;h3 id=&quot;为整个公共-api-写文件太费事了&quot;&gt;为整个公共 API 写文件太费事了！&lt;/h3&gt;

&lt;p&gt;为供他人使用的软件编写适当的文件，是你作为一名专业开发者应尽的职责。保持专案高效一个非常重要的部份是掌控软件的复杂度，如果没有人知道如何使用你的软件或不知道哪些函数的调用是可靠的，要掌控复杂度会是困难的。长远来看，使用语义化版本控制以及对于公共 API 有良好规范的坚持，可以让每个人及每件事都运行顺畅。&lt;/p&gt;

&lt;h3 id=&quot;万一不小心把一个不兼容的改版当成了次版本号发行了该怎么办&quot;&gt;万一不小心把一个不兼容的改版当成了次版本号发行了该怎么办？&lt;/h3&gt;

&lt;p&gt;一旦发现自己破坏了语义化版本控制的规范，就要修正这个问题，并发行一个新的次版本号来更正这个问题并且恢复向下兼容。即使是这种情况，也不能去修改已发行的版本。可以的话，将有问题的版本号记录到文件中，告诉使用者问题所在，让他们能够意识到这是有问题的版本。&lt;/p&gt;

&lt;h3 id=&quot;如果我更新了自己的依赖但没有改变公共-api-该怎么办&quot;&gt;如果我更新了自己的依赖但没有改变公共 API 该怎么办？&lt;/h3&gt;

&lt;p&gt;由于没有影响到公共 API，这可以被认定是兼容的。若某个软件和你的套件有共同依赖，则它会有自己的依赖规范，作者也会告知可能的冲突。要判断改版是属于修订等级或是次版等级，是依据你更新的依赖关系是为了修复问题或是加入新功能。对于后者，我经常会预期伴随着更多的代码，这显然会是一个次版本号级别的递增。&lt;/p&gt;

&lt;h3 id=&quot;如果我变更了公共-api-但无意中未遵循版本号的改动怎么办呢意即在修订等级的发布中误将重大且不兼容的改变加到代码之中&quot;&gt;如果我变更了公共 API 但无意中未遵循版本号的改动怎么办呢？（意即在修订等级的发布中，误将重大且不兼容的改变加到代码之中）&lt;/h3&gt;

&lt;p&gt;自行做最佳的判断。如果你有庞大的使用者群在依照公共 API 的意图而变更行为后会大受影响，那么最好做一次主版本的发布，即使严格来说这个修复仅是修订等级的发布。记住， 语义化的版本控制就是透过版本号的改变来传达意义。若这些改变对你的使用者是重要的，那就透过版本号来向他们说明。&lt;/p&gt;

&lt;h3 id=&quot;我该如何处理即将弃用的功能&quot;&gt;我该如何处理即将弃用的功能？&lt;/h3&gt;

&lt;p&gt;弃用现存的功能是软件开发中的家常便饭，也通常是向前发展所必须的。当你弃用部份公共 API 时，你应该做两件事：（1）更新你的文件让使用者知道这个改变，（2）在适当的时机将弃用的功能透过新的次版本号发布。在新的主版本完全移除弃用功能前，至少要有一个次版本包含这个弃用信息，这样使用者才能平顺地转移到新版 API。&lt;/p&gt;

&lt;h3 id=&quot;语义化版本对于版本的字串长度是否有限制呢&quot;&gt;语义化版本对于版本的字串长度是否有限制呢？&lt;/h3&gt;

&lt;p&gt;没有，请自行做适当的判断。举例来说，长到 255 个字元的版本已过度夸张。再者，特定的系统对于字串长度可能会有他们自己的限制。&lt;/p&gt;

&lt;h2 id=&quot;关于&quot;&gt;关于&lt;/h2&gt;

&lt;p&gt;语义化版本控制的规范是由 Gravatars 创办者兼 GitHub 共同创办者 &lt;a href=&quot;http://tom.preston-werner.com&quot;&gt;Tom Preston-Werner&lt;/a&gt; 所建立。&lt;/p&gt;

&lt;p&gt;如果您有任何建议，请到 &lt;a href=&quot;https://github.com/mojombo/semver/issues&quot;&gt;GitHub 上提出您的问题&lt;/a&gt;。&lt;/p&gt;

&lt;h2 id=&quot;授权&quot;&gt;授权&lt;/h2&gt;

&lt;p&gt;创用 CC 姓名标示 3.0 Unported 授权条款 http://creativecommons.org/licenses/by/3.0/&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>A Chinese test</title>
   <link href="https://getpoole.com/blog/2017/10/28/Chinese-test/"/>
   <updated>2017-10-28T00:00:00+00:00</updated>
   <id>https://getpoole.com/2017/10/28/Chinese-test</id>
   <content type="html">&lt;h1 id=&quot;this-is-a-chinese-test&quot;&gt;This is a Chinese test&lt;/h1&gt;
&lt;p&gt;中文&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Test</title>
   <link href="https://getpoole.com/blog/2017/10/15/hello-world/"/>
   <updated>2017-10-15T00:00:00+00:00</updated>
   <id>https://getpoole.com/2017/10/15/hello-world</id>
   <content type="html">&lt;h1 id=&quot;hello-world&quot;&gt;Hello World!&lt;/h1&gt;

</content>
 </entry>
 

</feed>
