<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[一嘉之盐糖]]></title><description><![CDATA[一家之言，不一定对。]]></description><link>https://jiapeng.me/</link><image><url>https://jiapeng.me/favicon.png</url><title>一嘉之盐糖</title><link>https://jiapeng.me/</link></image><generator>Ghost 3.30</generator><lastBuildDate>Tue, 13 Jan 2026 09:27:50 GMT</lastBuildDate><atom:link href="https://jiapeng.me/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[# python-keyboard 按键扫描优化]]></title><description><![CDATA[在嵌入式这个领域，很多确实是硬件问题的问题，其实可能是可以使用软件来解决的。这也确实很难，需要设计人员有未卜先知的能力。]]></description><link>https://jiapeng.me/pyhon-keyboard-improve/</link><guid isPermaLink="false">63dc97c8bfded500010467c6</guid><dc:creator><![CDATA[JiapengLi]]></dc:creator><pubDate>Fri, 03 Feb 2023 05:13:52 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>从 2020 年开始，主力键盘从宁芝静电容换成了使用 <a href="https://github.com/makerdiary/python-keyboard">python-keyboard</a> （粉笔套 + 佳达隆白轴按键）。前两年使用下来没有遇到什么问题，直到最近两个月开始，有几个常用按键开始出现误触的情况。猜测可能是<strong>机械按键老化性能下降导致抖动加剧，进而影响了键值识别</strong>。</p>
<p>打开控制台，跟踪了一下日志，发现单次按键按下被识别成了两次按下。</p>
<pre><code>key 07
7 7 \ 0x24 latency 7 | 759
key 87
7 7 / 0x24 latency 9 | 25
key 07
7 7 \ 0x24 latency 7 | 21
key 87
7 7 / 0x24 latency 9 | 25
key 0D
</code></pre>
<p>跟踪代码发现跟这个函数的实现有关：</p>
<p><a href="https://github.com/makerdiary/python-keyboard/blob/main/keyboard/matrix.py#L50">https://github.com/makerdiary/python-keyboard/blob/main/keyboard/matrix.py#L50</a></p>
<pre><code class="language-python">    def scan(self):
        &quot;&quot;&quot;
        Scan keyboard matrix and save key event into the queue.
        :return: length of the key event queue.
        &quot;&quot;&quot;
        t = time.monotonic_ns()

        # use local variables to speed up
        pressed = self.pressed
        last_mask = self.mask
        cols = self.cols

        mask = 0
        count = 0
        key_index = -1
        for row in self.rows:
            row.value = pressed  # select row
            for col in cols:
                key_index += 1
                if col.value == pressed:
                    key_mask = 1 &lt;&lt; key_index
                    if not (last_mask &amp; key_mask):
                        if t - self.t1[key_index] &lt; self._debounce_time:
                            print(&quot;debonce&quot;)
                            continue

                        self.t0[key_index] = t
                        self.put(key_index)

                    mask |= key_mask
                    count += 1
                elif last_mask and (last_mask &amp; (1 &lt;&lt; key_index)):
                    if t - self.t0[key_index] &lt; self._debounce_time:
                        print(&quot;debonce&quot;)
                        mask |= 1 &lt;&lt; key_index
                        continue

                    self.t1[key_index] = t
                    self.put(0x80 | key_index)

            row.value = not pressed
        self.mask = mask
        self.count = count

        return self.length
</code></pre>
<p>上面函数消抖部分处理有问题，按下消抖确认使用释放时的时间戳（t1）不合理。扫描部分的逻辑耦合较为严重。新的思路是把矩阵键盘上的每个按键进行独立检测（硬件上已经支持），并利用状态机重构scan函数。</p>
<pre><code class="language-python">class MatrixKey:
    def __init__(self) -&gt; None:
        self.sta = 0
        self.ts = 0
        self.ts_pressed = 0
        self.ts_released = 0

    # return value: 1 pressed, 0 released, -1 wait/idle
    def scan(self, ts, pressed, duration) -&gt; int:
        if self.sta not in [0, 2] and ts - self.ts &lt; duration:
            return -1
        self.ts = ts

        if self.sta == 0:
            if pressed:
                # press detected, to debounce
                self.sta = 1
        elif self.sta == 1:
            if not pressed:
                # too short, ignore
                self.sta = 0
            else:
                # press confirm
                self.sta = 2
                self.ts_pressed = ts
                return 1
        elif self.sta == 2:
            if not pressed:
                # release detected, to debounce
                self.sta = 3
        elif self.sta == 3:
            if pressed:
                # too short, ignore
                self.sta = 0
            else:
                # release confirm
                self.sta = 0
                self.ts_released = ts
                return 0
        return -1
    
class Matrix:    
    def __init__(self):
        ...
        self._keys = []
        for _ in range(self.keynum):
            self._keys.append(MatrixKey())        
    
    def _scan(self):
        ts = time.monotonic_ns()
        pressed = self.pressed
        cols = self.cols
        rows = self.rows
        key_index = -1
        for row in rows:
            row.value = pressed  # select row
            for col in cols:
                key_index += 1
                k = self._keys[key_index].scan(ts, col.value == pressed, self._debounce_time)
                if k == 1:
                    self.put(key_index)
                elif k == 0:
                    self.put(0x80 | key_index)
            row.value = not pressed
</code></pre>
<p>在嵌入式这个领域，很多确实是硬件问题的问题，其实可能是可以使用软件来解决的。这也确实很难，需要设计人员有未卜先知的能力。</p>
<p>代码仓库：<br>
<a href="https://github.com/JiapengLi/python-keyboard">https://github.com/JiapengLi/python-keyboard</a></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[# Ubuntu 20.04 + Rime + 双拼（自然码）]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h2 id>安装</h2>
<pre><code>sudo apt install ibus-rime librime-data-double-pinyin
</code></pre>
<h2 id>配置</h2>
<p>启用 Rime 输入法</p>
<p><img src="https://img.jiapeng.me/image-20230130120356154.png" alt="image-20230130120356154"></p>
<p><strong>~/.config/ibus/rime/default.custom.yaml</strong></p>
<pre><code class="language-yaml">patch:
  switcher:
    abbreviate_options: true
    caption: 〔切换〕
    fold_options: true
    hotkeys:
      - &quot;Control+grave&quot;          # control + `
    save_options:
      - full_shape
      - ascii_punct
      - simplification
      - extended_charset
  schema_list:
    - schema:</code></pre>]]></description><link>https://jiapeng.me/ubuntu-rime-double_pinyin-ziranma/</link><guid isPermaLink="false">63d79a5bbfded500010467ba</guid><dc:creator><![CDATA[JiapengLi]]></dc:creator><pubDate>Mon, 30 Jan 2023 10:23:07 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2 id>安装</h2>
<pre><code>sudo apt install ibus-rime librime-data-double-pinyin
</code></pre>
<h2 id>配置</h2>
<p>启用 Rime 输入法</p>
<p><img src="https://img.jiapeng.me/image-20230130120356154.png" alt="image-20230130120356154"></p>
<p><strong>~/.config/ibus/rime/default.custom.yaml</strong></p>
<pre><code class="language-yaml">patch:
  switcher:
    abbreviate_options: true
    caption: 〔切换〕
    fold_options: true
    hotkeys:
      - &quot;Control+grave&quot;          # control + `
    save_options:
      - full_shape
      - ascii_punct
      - simplification
      - extended_charset
  schema_list:
    - schema: double_pinyin
  menu:
    page_size: 9

  key_binder/bindings:
    - {accept: &quot;Control+p&quot;, send: Up, when: composing}
    - {accept: &quot;Control+n&quot;, send: Down, when: composing}
    - {accept: &quot;Control+b&quot;, send: Left, when: composing}
    - {accept: &quot;Control+f&quot;, send: Right, when: composing}
    - {accept: &quot;Control+a&quot;, send: Home, when: composing}
    - {accept: &quot;Control+e&quot;, send: End, when: composing}
    - {accept: &quot;Control+d&quot;, send: Delete, when: composing}
    - {accept: &quot;Control+k&quot;, send: &quot;Shift+Delete&quot;, when: composing}
    - {accept: &quot;Control+h&quot;, send: BackSpace, when: composing}
    - {accept: &quot;Control+g&quot;, send: Escape, when: composing}
    - {accept: &quot;Control+bracketleft&quot;, send: Escape, when: composing}
    #- {accept: &quot;Alt+v&quot;, send: Page_Up, when: composing}
    #- {accept: &quot;Control+v&quot;, send: Page_Down, when: composing}
    - {accept: ISO_Left_Tab, send: Page_Up, when: composing}
    - {accept: &quot;Shift+Tab&quot;, send: Page_Up, when: composing}
    - {accept: Tab, send: Page_Down, when: composing}
    - {accept: minus, send: Page_Up, when: has_menu}
    - {accept: equal, send: Page_Down, when: has_menu}
    - {accept: comma, send: Page_Up, when: paging}
    - {accept: period, send: Page_Down, when: has_menu}
    #- {accept: &quot;Control+Shift+1&quot;, select: .next, when: always}
    #- {accept: &quot;Control+Shift+2&quot;, toggle: ascii_mode, when: always}
    - {accept: &quot;Control+Shift+3&quot;, toggle: full_shape, when: always}
    - {accept: &quot;Control+Shift+4&quot;, toggle: simplification, when: always}
    #- {accept: &quot;Control+Shift+5&quot;, toggle: extended_charset, when: always}
    #- {accept: &quot;Control+Shift+exclam&quot;, select: .next, when: always}
    #- {accept: &quot;Control+Shift+at&quot;, toggle: ascii_mode, when: always}
    #- {accept: &quot;Control+Shift+numbersign&quot;, toggle: full_shape, when: always}
    #- {accept: &quot;Control+Shift+dollar&quot;, toggle: simplification, when: always}
    #- {accept: &quot;Control+Shift+percent&quot;, toggle: extended_charset, when: always}
    #- {accept: &quot;Shift+space&quot;, toggle: full_shape, when: always}
    # - {accept: &quot;Control+period&quot;, toggle: ascii_punct, when: always}


</code></pre>
<p><strong>~/.config/ibus/rime/build/ibus_rime.yaml</strong></p>
<pre><code>style:
  horizontal: true
</code></pre>
<p><strong>~/.config/ibus/rime/double_pinyin.custom.yaml</strong></p>
<pre><code># encoding: utf-8
patch:
  schema:
    name: 双拼（自然码）
  switches:
    - name: simplification
      reset: 1
      states: [&quot;漢字&quot;, &quot;汉字&quot;]
</code></pre>
<h2 id>注意事项</h2>
<ul>
<li>安装 rime 完成后，重启一下电脑</li>
<li>rime 更新完配置之后需要点击一下部署（任务栏图标）</li>
</ul>
<h2 id>参考资料</h2>
<p><a href="https://github.com/rime/home/wiki/Configuration">https://github.com/rime/home/wiki/Configuration</a></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Raspberry Pi 4B Ubuntu 22.04 Desktop]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>家里缺一台 Linux 环境的桌面电脑，用树莓派跑一下 Ubuntu 桌面系统，效果还可以（毕竟4核4G）。</p>
<p>步骤简要记录一下：</p>
<p><strong>镜像下载</strong></p>
<p><a href="https://ubuntu.com/download/raspberry-pi">https://ubuntu.com/download/raspberry-pi</a></p>
<p><strong>镜像解压</strong></p>
<pre><code># zsh, 使能 extract 插件
extract ubuntu-22.04.1-preinstalled-desktop-arm64+raspi.img.xz
</code></pre>
<p><strong>镜像烧录</strong></p>
<p>可以使用 <a href="https://ubuntu.com/tutorials/how-to-install-ubuntu-desktop-on-raspberry-pi-4#1-overview">rpi-imager</a> 替代，这里采用了个人比较熟悉的方式。</p>
<pre><code>sudo dd if=ubuntu-22.04.1-preinstalled-desktop-arm64+raspi.img of=/dev/mmcblk0 bs=200M; sudo sync; sudo sync; sudo</code></pre>]]></description><link>https://jiapeng.me/raspberry-pi-4b-ubuntu-22-04-desktop/</link><guid isPermaLink="false">63b53a42bfded500010467af</guid><dc:creator><![CDATA[JiapengLi]]></dc:creator><pubDate>Wed, 04 Jan 2023 08:35:32 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>家里缺一台 Linux 环境的桌面电脑，用树莓派跑一下 Ubuntu 桌面系统，效果还可以（毕竟4核4G）。</p>
<p>步骤简要记录一下：</p>
<p><strong>镜像下载</strong></p>
<p><a href="https://ubuntu.com/download/raspberry-pi">https://ubuntu.com/download/raspberry-pi</a></p>
<p><strong>镜像解压</strong></p>
<pre><code># zsh, 使能 extract 插件
extract ubuntu-22.04.1-preinstalled-desktop-arm64+raspi.img.xz
</code></pre>
<p><strong>镜像烧录</strong></p>
<p>可以使用 <a href="https://ubuntu.com/tutorials/how-to-install-ubuntu-desktop-on-raspberry-pi-4#1-overview">rpi-imager</a> 替代，这里采用了个人比较熟悉的方式。</p>
<pre><code>sudo dd if=ubuntu-22.04.1-preinstalled-desktop-arm64+raspi.img of=/dev/mmcblk0 bs=200M; sudo sync; sudo sync; sudo sync;
</code></pre>
<p><strong>初次启动</strong></p>
<ul>
<li>插卡到树莓派上，连接键盘、鼠标显示器，上电</li>
<li>根据指引进行初始配置，设置用户名、密码、键盘布局、配置 WIFI 等</li>
<li>建议选择英文环境</li>
<li>整个初始化配置的过程大概 5 - 10 分钟</li>
<li>开机后 SD 卡容量自动扩展</li>
</ul>
<p><strong>更新</strong></p>
<pre><code>sudo apt update
sudo apt upgrade
</code></pre>
<p><strong>一些个性化设置</strong></p>
<p>sudo 免输入密码</p>
<pre><code class="language-bash"># 注意将 USERNAME 替换成实际用户名
sudo su
cat &lt;&lt; 'EOF' &gt; /etc/sudoers.d/USERNAME
USERNAME ALL=(ALL) NOPASSWD:ALL
EOF
</code></pre>
<p>proxy</p>
<pre><code>sudo apt install shadowsocks-libev privoxy
wget https://github.com/shadowsocks/v2ray-plugin/releases/download/v1.3.2/v2ray-plugin-linux-arm64-v1.3.2.tar.gz
tar xzf v2ray-plugin-linux-arm64-v1.3.2.tar.gz
sudo mv v2ray-plugin-linux-arm64 /usr/local/bin/v2ray-plugin

# ss 按需增加配置到 /etc/shadowsocks-libev
sudo systemctl enable --now shadowsocks-libev-local@someconfig

# privoxy /etc/privoxy/config 找到 forward-socks5t 按需修改
forward-socks5t   /               127.0.0.1:1080 .
</code></pre>
<p>apt proxy，走 privoxy 8118 端口，加速</p>
<pre><code class="language-bash">sudo su
cat &lt;&lt; 'EOF' &gt; /etc/apt/apt.conf.d/proxy.conf 
Acquire {
  HTTP::proxy &quot;http://127.0.0.1:8118&quot;;
  HTTPS::proxy &quot;http://127.0.0.1:8118&quot;;
}
EOF
</code></pre>
<p>sshd</p>
<pre><code>sudo apt install openssh-server
</code></pre>
<ul>
<li>配置 ~/.ssh/authorized_keys</li>
<li>禁能密码登陆 <code>PasswordAuthentication no</code></li>
<li>禁止 root 用户登陆 <code>PermitRootLogin no</code></li>
</ul>
<p>oh-my-zsh</p>
<pre><code class="language-bash">sudo apt install curl zsh git
sh -c &quot;$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)&quot;
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

# Set `ZSH_THEME=&quot;powerlevel10k/powerlevel10k&quot;` in `~/.zshrc`
# 增加一个 `~/.zprofile` 文件，解决 `~/.profile` 不加载问题

cat &lt;&lt; 'EOF' &gt; ~/.zprofile
emulate sh
. ~/.profile
emulate zsh
EOF

# 使能 zsh
chsh -s $(which zsh)

p10k configure
</code></pre>
<p>openocd-rules</p>
<p>使得普通用户也可以操作 usb 设备</p>
<pre><code>wget https://raw.githubusercontent.com/arduino/OpenOCD/master/contrib/60-openocd.rules
sudo cp 60-openocd.rules /etc/udev/rules.d/60-openocd.rules
sudo udevadm control --reload
</code></pre>
<p><strong>Sublime Text 4</strong></p>
<p><a href="https://www.sublimetext.com/download_thanks?target=arm-deb">https://www.sublimetext.com/download_thanks?target=arm-deb</a></p>
<pre><code>wget https://download.sublimetext.com/sublime-text_build-4143_arm64.deb
dpkg -i sublime-text_build-4143_arm64.deb
</code></pre>
<p><strong>VSCode</strong></p>
<p><a href="https://code.visualstudio.com/download#">https://code.visualstudio.com/download#</a></p>
<pre><code>wget https://az764295.vo.msecnd.net/stable/e8a3071ea4344d9d48ef8a4df2c097372b0c5161/code_1.74.2-1671532382_arm64.deb
dpkg -i code_1.74.2-1671532382_arm64.deb
</code></pre>
<p><strong>python3-pip</strong></p>
<pre><code>sudo apt instal python3-pip
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Download ISO / IEC / SAE Standard for Free]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h2 id="ipfsmirror">IPFS mirror</h2>
<p><a href="https://cloudflare-ipfs.com/ipfs/bafykbzacedpku3duvucdb3nfbfrlirxqjeas4sld4phi2qti6tfrwxadnr4fa/">https://cloudflare-ipfs.com/ipfs/bafykbzacedpku3duvucdb3nfbfrlirxqjeas4sld4phi2qti6tfrwxadnr4fa/</a></p>
<h2 id="bttorrent">BT Torrent</h2>
<p><a href="http://snti.ru/snips_magnet09.htm">http://snti.ru/snips_magnet09.htm</a></p>
<p>(make it ease to use 迅雷/Xunlei/Thunder VIP to speed up )</p>
<!--kg-card-end: markdown-->]]></description><link>https://jiapeng.me/download-iso-iec-sae-standard-for-free/</link><guid isPermaLink="false">634f6807bfded50001046787</guid><dc:creator><![CDATA[JiapengLi]]></dc:creator><pubDate>Wed, 19 Oct 2022 03:11:44 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2 id="ipfsmirror">IPFS mirror</h2>
<p><a href="https://cloudflare-ipfs.com/ipfs/bafykbzacedpku3duvucdb3nfbfrlirxqjeas4sld4phi2qti6tfrwxadnr4fa/">https://cloudflare-ipfs.com/ipfs/bafykbzacedpku3duvucdb3nfbfrlirxqjeas4sld4phi2qti6tfrwxadnr4fa/</a></p>
<h2 id="bttorrent">BT Torrent</h2>
<p><a href="http://snti.ru/snips_magnet09.htm">http://snti.ru/snips_magnet09.htm</a></p>
<p>(make it ease to use 迅雷/Xunlei/Thunder VIP to speed up )</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[# iKuai + ubuntu 虚拟机 + 下一跳网关 + clash 实现旁路由（透明网关）魔法上网]]></title><description><![CDATA[墙。。。]]></description><link>https://jiapeng.me/ikuai-clash-tproxy/</link><guid isPermaLink="false">6316ef79bfded50001046779</guid><dc:creator><![CDATA[JiapengLi]]></dc:creator><pubDate>Tue, 06 Sep 2022 06:58:32 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>过去使用得方案是 iKuai + docker + gost + openvpn + 端口分流（外部线路）实现魔法上网，灵活度不足，很大程度上是因为限于国情爱快固件比较缩手缩脚。近期由于上游服务器调整，原方案无法继续使用了。折腾了一下新方案，新方案的网络拓扑图如下：</p>
<p><img src="https://img.jiapeng.me/ikuai_ubuntu_clash.jpg" alt></p>
<blockquote>
<p>图片使用 <a href="https://draw.io">https://draw.io</a> 绘制</p>
</blockquote>
<p>说明：</p>
<ul>
<li>LAN1 走默认路由表，国内线路</li>
<li>LAN2 走下一跳网关方式进行分流，魔法上网</li>
<li>AP 分为 3 个模式：
<ul>
<li>lan1 国内直连</li>
<li>vlan 100 跨境</li>
<li>vlan 200 访客模式 （限速）</li>
</ul>
</li>
</ul>
<h2 id>准备</h2>
<ul>
<li>iKuai  3.6.7 x64 Build202208301257 免费版 （8G/64G）</li>
<li>ubuntu 原生服务端镜像：ubuntu-20.04.3-live-server-amd64.iso</li>
<li>clash <a href="https://github.com/Dreamacro/clash/releases/tag/v1.11.8">v1.11.8</a></li>
<li>shadowsocks + v2ray-plugin 的服务器（可选，机场或其他自建服务器，clash 大多都支持，配置需做相应调整）</li>
</ul>
<h2 id>配置</h2>
<h3 id="ikuaiubuntu">iKuai 安装 Ubuntu 虚拟机</h3>
<ol>
<li>创建普通存储的硬盘</li>
<li>上传iso文件</li>
<li>创建虚拟机
<ul>
<li>创建磁盘文件</li>
<li>加载ubuntu server iso文件 （iso 文件上传路径）</li>
<li>开机自启</li>
</ul>
</li>
<li>启动虚拟机，打开网页 vnc 进行 ubuntu server 默认安装</li>
<li>安装完成，关机，删除挂载的 iso 文件</li>
<li>重新启动安装完毕</li>
</ol>
<p><img src="https://img.jiapeng.me/image-20220906141159448.png" alt="image-20220906141159448"></p>
<p><img src="https://img.jiapeng.me/image-20220906141310079.png" alt="image-20220906141310079"></p>
<p>更多可参考：<a href="https://www.77bx.com/79.html">https://www.77bx.com/79.html</a></p>
<h3 id="ubuntu">Ubuntu 预配置</h3>
<p><strong>禁用 systemd-resolved</strong></p>
<p>指定一个默认 DNS，223.5.5.5 是阿里云公共 DNS，也可换成其他的。极度不推荐 114 DNS，污染严重。</p>
<pre><code class="language-bash">sudo su
[ -d /etc/systemd/resolved.conf.d ] || mkdir -p /etc/systemd/resolved.conf.d
printf &quot;%s\n%s\n%s\n&quot; '[Resolve]' 'DNS=223.5.5.5' 'DNSStubListener=no' | sudo tee /etc/systemd/resolved.conf.d/10-make-dns-work.conf
systemctl restart systemd-resolved
</code></pre>
<p><strong>创建 clash 用户</strong></p>
<pre><code>sudo adduser clash
</code></pre>
<h3 id="clash">安装 clash</h3>
<p>准备安装包，目录结构如下</p>
<pre><code>&gt; tree
package
├── clash_iptables.sh
├── clash-linux-amd64
├── clash.yaml
└── install.sh
</code></pre>
<p><strong>install.sh</strong></p>
<pre><code class="language-bash">#!/bin/bash


systemctl stop clash

cp clash-linux-amd64 /usr/local/sbin/clash
chmod +x /usr/local/sbin/clash

mkdir -p /etc/clash
cp clash.yaml /etc/clash/config.yaml
cp clash_iptables.sh /etc/clash/
chmod +x /etc/clash/clash_iptables.sh

cat &lt;&lt; 'EOF' &gt; /lib/systemd/system/clash.service
[Unit]
Description=clash service
After=network.target

[Service]
Type=simple
StandardError=journal
User=clash
Group=clash
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_NET_ADMIN
AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_ADMIN
ExecStartPre=+/usr/bin/bash /etc/clash/clash_iptables.sh
ExecStart=/usr/local/sbin/clash -d /etc/clash
LimitNPROC=500
LimitNOFILE=1000000
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl restart clash
</code></pre>
<p><strong>clash.yaml</strong></p>
<pre><code class="language-yaml">mixed-port: 7890
tproxy-port: 7893
ipv6: false
allow-lan: true
mode: rule
log-level: debug
secret: ''

dns:
  enable: true
  ipv6: false
  listen: 0.0.0.0:53
  enhanced-mode: fake-ip
  fake-ip-range: 198.18.0.1/16
  default-nameserver:
    - 223.5.5.5
    - 8.8.8.8
  nameserver:
    - 223.5.5.5
    - 8.8.8.8
    - https://doh.pub/dns-query
    - https://dns.alidns.com/dns-query
    - tls://dns.rubyfish.cn:853 # DNS over TLS
    - https://1.1.1.1/dns-query # DNS over HTTPS
  fallback:
    - tls://1.1.1.1:853
    - tls://1.0.0.1:853
    - tls://8.8.8.8:853
  fallback-filter:
    geoip: true
    geoip-code: CN
    ipcidr:
      - 240.0.0.0/4
    domain:
      - '+.google.com'
      - '+.facebook.com'
      - '+.youtube.com'

proxies:
  - name: &quot;ss01&quot;
    type: ss
    server: &quot;ss01.example.com&quot;
    port: 443
    cipher: aes-256-gcm
    password: &quot;password&quot;
    plugin: v2ray-plugin
    plugin-opts:
      mode: websocket
      tls: true
      # skip-cert-verify: true
      host: ss01.example.com
      path: &quot;/customized_wss_path&quot;
      mux: true
      # headers:
      #   custom: value

proxy-groups:
  - name: &quot;auto&quot;
    type: url-test
    proxies:
      - ss01
    # tolerance: 150
    # lazy: true
    url: 'http://www.gstatic.com/generate_204'
    interval: 300
  - name: &quot;PROXY&quot;
    type: select
    proxies:
      - &quot;auto&quot;
rules:
# LAN
  - IP-CIDR,127.0.0.0/8,DIRECT
  - IP-CIDR,172.16.0.0/12,DIRECT
  - IP-CIDR,192.168.0.0/16,DIRECT
  - IP-CIDR,10.0.0.0/8,DIRECT
  - IP-CIDR,100.64.0.0/10,DIRECT

# 最终规则（除了中国区的IP之外的，全部翻墙）
  - GEOIP,CN,DIRECT
  - MATCH,PROXY
</code></pre>
<p><strong>clash_iptables.sh</strong></p>
<pre><code class="language-bash">#!/bin/bash

# 参考：
# https://www.gushiciku.cn/pl/aYvT/zh-hk

# delete possible configuration
ip rule del fwmark 666 table 666 || true
ip route del local 0.0.0.0/0 dev lo table 666 || true

iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X clash || true
iptables -t mangle -X clash_local || true

# recreate iptables
ip rule add fwmark 666 lookup 666
ip route add local 0.0.0.0/0 dev lo table 666
iptables -t mangle -N clash
iptables -t mangle -A clash -d 0.0.0.0/8 -j RETURN
iptables -t mangle -A clash -d 127.0.0.0/8 -j RETURN
iptables -t mangle -A clash -d 10.0.0.0/8 -j RETURN
iptables -t mangle -A clash -d 172.16.0.0/12 -j RETURN
iptables -t mangle -A clash -d 192.168.0.0/16 -j RETURN
iptables -t mangle -A clash -d 169.254.0.0/16 -j RETURN
iptables -t mangle -A clash -d 224.0.0.0/4 -j RETURN
iptables -t mangle -A clash -d 240.0.0.0/4 -j RETURN
iptables -t mangle -A clash -p tcp -j TPROXY --on-port 7893 --tproxy-mark 666
iptables -t mangle -A clash -p udp -j TPROXY --on-port 7893 --tproxy-mark 666
iptables -t mangle -A PREROUTING -j clash
iptables -t mangle -N clash_local
iptables -t mangle -A clash_local -d 0.0.0.0/8 -j RETURN
iptables -t mangle -A clash_local -d 127.0.0.0/8 -j RETURN
iptables -t mangle -A clash_local -d 10.0.0.0/8 -j RETURN
iptables -t mangle -A clash_local -d 172.16.0.0/12 -j RETURN
iptables -t mangle -A clash_local -d 192.168.0.0/16 -j RETURN
iptables -t mangle -A clash_local -d 169.254.0.0/16 -j RETURN
iptables -t mangle -A clash_local -d 224.0.0.0/4 -j RETURN
iptables -t mangle -A clash_local -d 240.0.0.0/4 -j RETURN
iptables -t mangle -A clash_local -p tcp -j MARK --set-mark 666
iptables -t mangle -A clash_local -p udp -j MARK --set-mark 666
iptables -t mangle -A OUTPUT -p tcp -m owner --uid-owner clash -j RETURN
iptables -t mangle -A OUTPUT -p udp -m owner --uid-owner clash -j RETURN
iptables -t mangle -A OUTPUT -j clash_local

</code></pre>
<p><strong>clash-linux-amd64</strong></p>
<p>本文采用 amd64-v1.11.8版本</p>
<p><a href="https://github.com/Dreamacro/clash/releases/download/v1.11.8/clash-linux-amd64-v1.11.8.gz">https://github.com/Dreamacro/clash/releases/download/v1.11.8/clash-linux-amd64-v1.11.8.gz</a></p>
<p>新架构或可采用 amd64-v3 版本：</p>
<p><a href="https://github.com/Dreamacro/clash/releases/download/v1.11.8/clash-linux-amd64-v1.11.8.gz">https://github.com/Dreamacro/clash/releases/download/v1.11.8/clash-linux-amd64-v1.11.8.gz</a></p>
<p>更多关于 v3 版本的介绍（指令集层面的区别）：<a href="https://github.com/golang/go/wiki/MinimumRequirements#amd64">https://github.com/golang/go/wiki/MinimumRequirements#amd64</a></p>
<p><strong>本地上传软件包至虚拟机：</strong></p>
<pre><code>scp -r package root@10.35.0.16:~
</code></pre>
<p><strong>虚拟机内执行安装程序：</strong></p>
<pre><code>cd ~/pacakge
sudo ./install.sh
</code></pre>
<h3 id="ikuai">iKuai 设置</h3>
<p>iKuai 路由器硬件配置</p>
<p>iKuai 配置最小要求 ：64位系统、4GB RAM、20GB SSD</p>
<p><img src="https://img.jiapeng.me/image-20220906133103187.png" alt="image-20220906133103187"></p>
<p><strong>分流设置， 开启下一跳网关分流</strong></p>
<p><img src="https://img.jiapeng.me/image-20220906141456292.png" alt="image-20220906141456292"></p>
<p><strong>VLAN 设置</strong></p>
<p><img src="https://img.jiapeng.me/image-20220906141922969.png" alt="image-20220906141922969"></p>
<p><strong>DHCP 配置</strong></p>
<p><img src="https://img.jiapeng.me/image-20220906144039268.png" alt="image-20220906144039268"></p>
<h2 id>一些思考</h2>
<ul>
<li>clash TPROXY 模式的支持使得全局代理变得很方便，可以突破路由器的限制实现复杂功能</li>
<li>clash 不支持 icmp 代理，将使得icmp失效，考虑如何解决</li>
<li>clash 的 fake-ip 有点儿意思，还不能完全理解，</li>
</ul>
<h2 id>参考</h2>
<p><a href="https://www.gushiciku.cn/pl/aYvT/zh-hk">https://www.gushiciku.cn/pl/aYvT/zh-hk</a></p>
<p><a href="https://gist.github.com/cloverstd/0c3da3191797e8837cf86e5791404e55">https://gist.github.com/cloverstd/0c3da3191797e8837cf86e5791404e55</a></p>
<p><a href="https://blog.newhanly.com/2020/04/28/clash/">https://blog.newhanly.com/2020/04/28/clash/</a></p>
<p><a href="https://github.com/Hackl0us/SS-Rule-Snippet">https://github.com/Hackl0us/SS-Rule-Snippet</a></p>
<p><a href="https://www.v2ex.com/t/761903">https://www.v2ex.com/t/761903</a></p>
<p><a href="https://www.bilibili.com/read/cv14088928/">https://www.bilibili.com/read/cv14088928/</a></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[# 树莓派默认用户管理机制升级]]></title><description><![CDATA[论安全性和易用性的互斥关系;)]]></description><link>https://jiapeng.me/rpi-new-default-user-policy/</link><guid isPermaLink="false">62a84d20bfded50001046767</guid><category><![CDATA[RPI]]></category><category><![CDATA[技术]]></category><dc:creator><![CDATA[JiapengLi]]></dc:creator><pubDate>Tue, 14 Jun 2022 08:57:51 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>根据 2020-04-04 树莓派发布日志显示，默认用户 pi 已被删除，强制用户在初次使用时新建用户并重新设置密码。</p>
<blockquote>
<pre><code>2022-04-04:
  * Default &quot;pi&quot; user has been removed; the first-boot wizard enforces the creation of a new user account
</code></pre>
</blockquote>
<p>原出处：<a href="https://downloads.raspberrypi.org/raspios_lite_armhf/release_notes.txt">https://downloads.raspberrypi.org/raspios_lite_armhf/release_notes.txt</a></p>
<p>这样对于不使用或不愿意使用外置显示器的用户（我）就引入了一个”先有鸡还是先有蛋“的问题（lite版用户），所幸官方已经留足了口子，给出了解决方案。</p>
<p>本文采用结合官方解决方案通过<strong>魔改官方镜像</strong>的方法实现烧录后自动创建用户同时开启ssh进行登陆操作，避免非必要的显示器连接和手动配置工作。步骤如下：</p>
<ul>
<li>下载官方镜像</li>
<li>复制镜像以供修改之用</li>
<li>losetup 挂载镜像</li>
<li>boot 目录创建 userconf 文件，设定默认用户和密码</li>
<li>boot 目录创建 ssh 文件，开启 ssh 登陆功能</li>
<li>关闭文件系统自动扩展至最大容量功能（方便制作镜像）</li>
<li>扩展默认可用空间</li>
<li>烧录验证</li>
</ul>
<p><strong>注：本文所有操作均在 Ubuntu 20.04 系统下完成</strong></p>
<p><strong>注：下文使用 losetup 使用 /dev/loop1，具体操作时请对应做替换</strong></p>
<p><strong>注：如无特殊指明，指令均在工作目录下运行，镜像、img/boot、img/rootfs 均存放在工作目录</strong></p>
<pre><code>&gt; tree
.
├── 2022-04-04-raspios-bullseye-arm64-lite.img
├── img
│   ├── boot
│   └── rootfs
├── rpi-20220404-v1.0.img
└── rpi-20220404-v1.1.img
</code></pre>
<h2 id>挂载镜像</h2>
<p>镜像下载地址：<a href="https://www.raspberrypi.com/software/operating-systems/">https://www.raspberrypi.com/software/operating-systems/</a></p>
<p>本文使用 2022-04-04 版本 ，镜像名称 <strong>2022-04-04-raspios-bullseye-arm64-lite.img</strong></p>
<pre><code>cp 2022-04-04-raspios-bullseye-arm64-lite.img rpi-20220404-v1.0.img
sudo losetup -P /dev/loop1 rpi-20220404-v1.0.img
mkdir -p img/rootfs
mkdir -p img/boot

sudo mount /dev/loop1p2 img/rootfs
sudo mount /dev/loop1p1 img/boot
</code></pre>
<p>利用上述指令将树莓派镜像挂载到本地，进行修改。</p>
<h2 id>增加默认用户</h2>
<p>创建密码对应的加密字串：</p>
<pre><code>echo 'mypassword' | openssl passwd -6 -stdin
$6$q80uN6hUy40k3gKD$Pl7qxIELx3hr3ItaDw5CV3Dic90YeEBkf/s9hlIIoNc87yHTcMcbtamn19IsVopgcuzwZVXLoHT46sek4rCL70
</code></pre>
<p>创建 userconf 文件：</p>
<pre><code>cd img/boot
sudo vi userconf
</code></pre>
<pre><code>username:$6$q80uN6hUy40k3gKD$Pl7qxIELx3hr3ItaDw5CV3Dic90YeEBkf/s9hlIIoNc87yHTcMcbtamn19IsVopgcuzwZVXLoHT46sek4rCL70
</code></pre>
<p>参考 <a href="https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022/">https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022/</a> ，搜索 userconf 关键字可快速找到对应章节。</p>
<p>注：初次上电后创建的文件将被销毁，这里使用加密后的密钥主要原因是让文件系统上不存放任何与密钥明文相关的内容（文件系统层面删除文件大部分时候无法做到销毁存储介质中的内容）。</p>
<h2 id="ssh">开启 SSH</h2>
<p>/home/pi 目录仍然存在，并作为新建用户的目录（将被重命名），开启ssh的同时创建公钥存放文件，登陆时避免输入密码。系统初次启动后 /home/pi 将被重命名为新建用户的名称。</p>
<pre><code># 开启 ssh
cd img/boot
sudo touch ssh

# 将本地 ~/.ssh/authorized_keys 拷贝至对应目录
cd ../rootfs/home/pi
mkdir .ssh
chmod 700 .ssh 
cp ~/.ssh/authorized_keys .
</code></pre>
<h2 id>修改启动参数禁止自动扩展镜像</h2>
<p>修改 /boot/cmdline.txt 文件</p>
<pre><code>console=serial0,115200 console=tty1 root=PARTUUID=c0799831-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh
</code></pre>
<p>=&gt;</p>
<pre><code>
console=serial0,115200 console=tty1 root=PARTUUID=c0799831-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet 
</code></pre>
<h2 id>修改主机名称</h2>
<pre><code>sudo vi /etc/hosts
sudo vi /etc/hostname
</code></pre>
<h2 id>手动扩充容量</h2>
<p>先将前文挂载的镜像卸载：</p>
<pre><code>sudo umount img/boot
sudo umount img/rootfs
sudo losetup -d /dev/loop1
</code></pre>
<pre><code>
# 危险操作，防止重来，先把镜像复制一份，同时操作新镜像，注意将前文
cp rpi-20220404-v1.0.img rpi-20220404-v1.1.img

dd if=/dev/zero of=2gfile bs=1 count=1 seek=2G &gt;&gt; rpi-20220404-v1.1.img
sudo losetup --find --partscan --show rpi-20220404-v1.1.img
sudo parted /dev/loop1
</code></pre>
<pre><code>&gt; fdisk -l rpi-20220404-v1.1.img 
Disk rpi-20220404-v1.1.img: 3.88 GiB, 4148166656 bytes, 8101888 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0ee3e8a8

Device                 Boot  Start     End Sectors  Size Id Type
rpi-20220404-v1.1.img1        8192  532479  524288  256M  c W95 FAT32 (LBA)
rpi-20220404-v1.1.img2      532480 3907583 3375104  1.6G 83 Linux
</code></pre>
<pre><code>&gt; sudo parted /dev/loop1 
GNU Parted 3.3
Using /dev/loop1
Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) print                                                            
Model: Loopback device (loopback)
Disk /dev/loop1: 4148MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 
Number  Start   End     Size    Type     File system  Flags
 1      4194kB  273MB   268MB   primary  fat32        lba
 2      273MB   2001MB  1728MB  primary  ext4

(parted) rm 2    

(parted) mkpart primary 273 4148

(parted) print                                                            
Model: Loopback device (loopback)
Disk /dev/loop1: 4148MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 
Number  Start   End     Size    Type     File system  Flags
 1      4194kB  273MB   268MB   primary  fat32        lba
 2      273MB   4148MB  3876MB  primary               lba

(parted) quit                                                             
Information: You may need to update /etc/fstab.
</code></pre>
<p>操作完成功，卸载 loop 文件</p>
<pre><code>sudo sync
sudo umount img/boot
sudo umount img/rootfs
sudo losetup -d /dev/loop1
</code></pre>
<p>本章节参考：<a href="https://powersj.io/posts/raspbian-edit-image/">https://powersj.io/posts/raspbian-edit-image/</a></p>
<h2 id>总结</h2>
<ul>
<li>此次官方镜像的改动增加了初次运行的复杂度，提升了一些安全性</li>
<li>不难推测，大部分用户应该是不会修改默认密码的，人性使然</li>
<li>利用 losetup 魔改镜像可以免去使用 SD卡备份方式制作镜像的麻烦</li>
</ul>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[# 搭建反向代理服务器]]></title><description><![CDATA[无善无恶心之体，有善有恶意之动，知善知恶是良知，为善去恶是格物。]]></description><link>https://jiapeng.me/build-ssh-reverse-server/</link><guid isPermaLink="false">6295827ebfded50001046757</guid><category><![CDATA[技术]]></category><dc:creator><![CDATA[JiapengLi]]></dc:creator><pubDate>Tue, 31 May 2022 02:50:53 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>可能是实现内网穿透，并且在远端暴露端口的最简单的方案。</p>
<h2 id>步骤</h2>
<ol>
<li>搭建服务器（如 ubuntu 20.04）</li>
<li>添加代理用户</li>
<li>为用户添加 authorized_keys</li>
<li>关闭用户shell</li>
<li>修改 sshd 配置，开启代理功能</li>
</ol>
<h2 id>详细配置</h2>
<p>新增一个用户：（根据提示设置密码等，无需自定义配置可以一路回车）</p>
<pre><code>sudo adduser dbg
</code></pre>
<p>为用户添加 authorized_keys，以 dbg 用户为例</p>
<pre><code>su dbg
mkdir ~/.ssh/
chmod 700 ~/.ssh
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
</code></pre>
<p>把公钥填入 authorized_keys，推荐使用 ed25519 格式的密钥对（短、安全、快）。</p>
<pre><code>root@VM-32-57-ubuntu:~# cat /home/dbg/.ssh/authorized_keys 

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA.................................... root@VM-32-57-ubuntu
</code></pre>
<p>编辑 /etc/ssh/sshd_config 在末尾增加如下配置，为 dbg 用户添加反向穿透功能，可根据需要决定是否启用密码登陆。</p>
<pre><code>Match User dbg
	GatewayPorts yes
	PasswordAuthentication yes
</code></pre>
<p>编辑 /etc/passwd 文件，</p>
<pre><code>dbg:x:1001:1001:,,,:/home/dbg:/bin/true
</code></pre>
<h2 id="ssh">SSH 反向登陆</h2>
<p>其中 $KEY 用路径替换，$USER / $SERVER 分别为服务器端对应的用户名和服务器地址。</p>
<pre><code>ssh -i &quot;$KEY&quot; \
-o &quot;ExitOnForwardFailure yes&quot; \
-o &quot;ServerAliveInterval 20&quot; \
-o &quot;ServerAliveCountMax 3&quot; \
-o &quot;StrictHostKeyChecking no&quot; \
-g -N -R *:0:localhost:22 &quot;$USER&quot;@&quot;$SERVER&quot;
</code></pre>
<p>上面使用了远端0端口（ <code>*:0:localhost:22</code>），让服务器自行选择端口，这样可以规避线路不稳定断连导致服务端口占用冲突的问题。</p>
<h2 id>延伸应用</h2>
<p>既然可以将本地 22 端口映射出去，当然也可以映射其他端口。理论上可以暴露任意服务出去。</p>
<p>不过也别太乐观，SSH tunnel 安全性极高，副作用就是有传输上的性能损耗，不适合大流量应用使用。</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[# Ubuntu Host 下 VirtualBox 搭建]]></title><description><![CDATA[快速把一件事做到及格水平完结它，比「追求质量不断延期」好一百倍，比「害怕失败，总觉得准备不充分而迟迟无法开始」好一万倍。—— 推特章工
https://twitter.com/435Hz/status/1524561244212051968]]></description><link>https://jiapeng.me/ubuntu-host-deploly-virtualbox-ubuntu-guest/</link><guid isPermaLink="false">6281c0bbbfded50001046740</guid><category><![CDATA[Ubuntu]]></category><dc:creator><![CDATA[JiapengLi]]></dc:creator><pubDate>Mon, 16 May 2022 03:32:02 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><blockquote>
<p>快速把一件事做到及格水平完结它，比「追求质量不断延期」好一百倍，比「害怕失败，总觉得准备不充分而迟迟无法开始」好一万倍。—— 推特章工<br>
<a href="https://twitter.com/435Hz/status/1524561244212051968">https://twitter.com/435Hz/status/1524561244212051968</a></p>
</blockquote>
<p>装了很久的vbox遇到了无法无法创建网卡的问题，进行解决，并记录一下配置过程。<br>
<em>遇到一个打开 Vbox 的菜单无法截图的问题，暂未解决，故所有菜单相关操作没有图片。</em></p>
<h2 id>安装</h2>
<pre><code>sudo apt-get remove --purge virtualbox

sudo apt update
sudo apt-get install virtualbox virtualbox—ext–pack
</code></pre>
<h2 id>导入虚拟机</h2>
<p>点击 Tools，点击 Add。选择文件进行导入。</p>
<p><img src="https://img.jiapeng.me/image-20220516103707552.png" alt="image-20220516103707552"></p>
<p><img src="https://img.jiapeng.me/image-20220516103806136.png" alt="image-20220516103806136"></p>
<h2 id>网络配置</h2>
<p>File -&gt; Host Network Manager 添加网卡，可以选择是否开启 DHCP 功能。</p>
<p><img src="https://img.jiapeng.me/image-20220516105047484.png" alt="image-20220516105047484"></p>
<p>宿主机上可以看到 vbox 对应的网卡</p>
<p><img src="https://img.jiapeng.me/image-20220516105431196.png" alt="image-20220516105431196"></p>
<p>开启 Adapter2 并启用网卡。</p>
<p><img src="https://img.jiapeng.me/image-20220516105234733.png" alt="image-20220516105234733"></p>
<p>虚拟机上配置并启用对应的网卡</p>
<p><img src="https://img.jiapeng.me/image-20220516105607588.png" alt="image-20220516105607588"></p>
<h2 id>虚拟机与主机共享文件夹</h2>
<p>VBox 软件中挂载相应的文件</p>
<p><img src="https://img.jiapeng.me/image-20220516105722248.png" alt="image-20220516105722248"></p>
<p>Guest 下安装 VBox Guest Addition 包</p>
<pre><code>sudo mkdir /media/cdrom
sudo mount /dev/cdrom /media/cdrom
cd /media/cdrom
sudo ./VBoxLinuxAdditions.run

</code></pre>
<pre><code>## 将用户添加到 vboxsf 分组，进行 vboxsf 访问
sudo adduser ${username} vboxsf
</code></pre>
<p><img src="https://img.jiapeng.me/image-20220516110949715.png" alt="image-20220516110949715"></p>
<h2 id>参考资料</h2>
<p><a href="https://www.techrepublic.com/article/how-to-install-virtualbox-guest-additions-on-a-gui-less-ubuntu-server-host/">https://www.techrepublic.com/article/how-to-install-virtualbox-guest-additions-on-a-gui-less-ubuntu-server-host/</a></p>
<p><a href="https://maheshhika.com/2012/09/28/virtual-box-verr_pdm_media_locked/">https://maheshhika.com/2012/09/28/virtual-box-verr_pdm_media_locked/</a></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[# Streamr 质押赚取 $DATA]]></title><description><![CDATA[<!--kg-card-begin: markdown--><blockquote>
<p>入坑需谨慎，本文不构成任何投资建议</p>
</blockquote>
<h2 id>操作步骤</h2>
<p><a href="https://streamr.network/">Streamr 网络</a>质押 mining 具体步骤：</p>
<ol>
<li>申请 EVM 兼容链钱包，推荐 <a href="https://metamask.io/">Metamask</a>。<a href="https://academy.binance.com/en/articles/how-to-use-metamask">参考教程</a></li>
<li><a href="https://academy.binance.com/en/articles/how-to-add-polygon-to-metamask">将 MetaMask 钱包切换至 Polygon 链</a></li>
<li>向钱包内转入 Matic，可以由交易所转入，注意转账时需选择 Polygon 链。得益于 Polygon 链的超低费用，可以转入 10 Matic 或更少均可，来作为 Gas 费。</li>
<li>向钱包内转入 DATA，单账户支持最大 10000 DATA 质押</li>
<li>部署 Streamr Miner 程序，自动生成 Miner 公钥</li>
<li>将私钥导入到 Streamr</li></ol>]]></description><link>https://jiapeng.me/streamr-stake-mining/</link><guid isPermaLink="false">6267659ebfded50001046733</guid><dc:creator><![CDATA[JiapengLi]]></dc:creator><pubDate>Tue, 26 Apr 2022 03:24:15 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><blockquote>
<p>入坑需谨慎，本文不构成任何投资建议</p>
</blockquote>
<h2 id>操作步骤</h2>
<p><a href="https://streamr.network/">Streamr 网络</a>质押 mining 具体步骤：</p>
<ol>
<li>申请 EVM 兼容链钱包，推荐 <a href="https://metamask.io/">Metamask</a>。<a href="https://academy.binance.com/en/articles/how-to-use-metamask">参考教程</a></li>
<li><a href="https://academy.binance.com/en/articles/how-to-add-polygon-to-metamask">将 MetaMask 钱包切换至 Polygon 链</a></li>
<li>向钱包内转入 Matic，可以由交易所转入，注意转账时需选择 Polygon 链。得益于 Polygon 链的超低费用，可以转入 10 Matic 或更少均可，来作为 Gas 费。</li>
<li>向钱包内转入 DATA，单账户支持最大 10000 DATA 质押</li>
<li>部署 Streamr Miner 程序，自动生成 Miner 公钥</li>
<li>将私钥导入到 Streamr Miner</li>
<li>启动 miner 开始 mining</li>
</ol>
<h2 id>前期准备</h2>
<p>正式开始安装质押程序前需做如下准备：</p>
<ul>
<li>Ubuntu 20.04 LTS 系统用于安装矿机程序</li>
<li>Metamask 钱包<strong>私钥</strong>（存入一定数量的 MATIC、DATA）</li>
</ul>
<h2 id>安装部署</h2>
<p>如下所有操作均在 <code>root</code> 用户下完成。操作前请使用 <code>sudo su</code> 切换至 <code>root</code> 用户。</p>
<ul>
<li>安装 docker 及 docker-compose</li>
</ul>
<pre><code class="language-bash">## docker
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository &quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable&quot;
apt-cache policy docker-ce
sudo apt install docker-ce

## docker-compose
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.4.1/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
</code></pre>
<ul>
<li>创建工作目录</li>
</ul>
<pre><code>mkdir -p /opt/streamr/docker
</code></pre>
<ul>
<li>准备docker-compose文件，存入 <code>/opt/streamr/docker-compose.yaml</code></li>
</ul>
<pre><code class="language-yaml">version: &quot;3&quot;
services:
  streamr-miner:
    restart: always
    image: streamr/broker-node:latest
    container_name: streamr
    init: true
    privileged: true
    network_mode: host
    ports:
      - 7170:7170
      - 7171:7171
      - 1883:1883
    volumes:
      - '/opt/streamr/docker:/root/.streamr'
    ulimits:
      nofile:
        soft: 64000
        hard: 64000
</code></pre>
<ul>
<li>执行初始化程序，导入密钥，进行配置。参考实际执行结果。</li>
</ul>
<pre><code>docker run -it -v $(cd /opt/streamr/docker; pwd):/root/.streamr streamr/broker-node:latest bin/config-wizard
</code></pre>
<p><img src="https://img.jiapeng.me/image-20220426101446817.png" alt="image-20220426101446817"></p>
<ul>
<li>删除运行 config-wizard 产生的 docker container</li>
</ul>
<pre><code>## 查询 Container ID
docker ps -a

## 删除，${ID} 用实际 ID 替换
docker rm ${ID}
</code></pre>
<ul>
<li>运行 docker-compose（注意：/opt/streamr/docker-compose.yaml 需存在）</li>
</ul>
<pre><code>cd /opt/streamr/docker
docker compose up -d
</code></pre>
<p><img src="https://img.jiapeng.me/image-20220426101922323.png" alt="image-20220426101922323"></p>
<ul>
<li><strong>添加防火墙规则，放行端口</strong> (有些版本的Ubuntu默认开启了ufw防火墙，需要手动添加规则打开端口，或者根据自身安全需求关闭防火墙)</li>
</ul>
<pre><code>sudo ufw allow from any to any port 1883 proto tcp
sudo ufw allow from any to any port 7170 proto tcp
sudo ufw allow from any to any port 7171 proto tcp

root@jpv25:~# sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere                  
1883/tcp                   ALLOW       Anywhere                  
7170/tcp                   ALLOW       Anywhere                  
7171/tcp                   ALLOW       Anywhere                  
22 (v6)                    ALLOW       Anywhere (v6)             
1883/tcp (v6)              ALLOW       Anywhere (v6)             
7170/tcp (v6)              ALLOW       Anywhere (v6)             
7171/tcp (v6)              ALLOW       Anywhere (v6)             

</code></pre>
<ul>
<li>部署完成</li>
</ul>
<h2 id>参考资料</h2>
<ul>
<li>
<p><a href="https://brubeckscan.app/">https://brubeckscan.app/</a> <strong>节点数据监控</strong></p>
</li>
<li>
<p><strong><a href="https://medium.com/streamrblog/streamr-network-staking-how-to-mine-rewards-in-the-brubeck-mainnet-47e0a3aa2b25">https://medium.com/streamrblog/streamr-network-staking-how-to-mine-rewards-in-the-brubeck-mainnet-47e0a3aa2b25</a></strong></p>
</li>
<li>
<p><a href="https://streamr.network/">https://streamr.network/</a></p>
</li>
<li>
<p><a href="https://streamr.network/docs/streamr-network/installing-broker-node">https://streamr.network/docs/streamr-network/installing-broker-node</a></p>
</li>
</ul>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[# 修改树莓派镜像]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h2 id>准备镜像</h2>
<h3 id="1">1. 下载镜像</h3>
<p><a href="https://downloads.raspberrypi.org/raspios_lite_arm64/images">https://downloads.raspberrypi.org/raspios_lite_arm64/images</a></p>
<ul>
<li>解压镜像</li>
</ul>
<h3 id="2">2. 镜像挂在到本地，修改镜像参数</h3>
<pre><code>losetup -f // 查找空闲loop
losetup -P /dev/loop?? rpios.img
mkdir -p img/rootfs
mkdir -p img/boot
mount /dev/loop??p2 img/rootfs
mount /dev/loop??p1 img/boot

# ?? 替换查到的空闲 loop
</code></pre>
<h3 id="3">3. 修改启动参数禁止自动扩展镜像</h3>
<pre><code>console=serial0,</code></pre>]]></description><link>https://jiapeng.me/rpi-image-mod/</link><guid isPermaLink="false">60b2eb2dbfded50001046704</guid><category><![CDATA[技术]]></category><category><![CDATA[DietPi]]></category><category><![CDATA[RPI]]></category><dc:creator><![CDATA[JiapengLi]]></dc:creator><pubDate>Sun, 30 May 2021 01:33:32 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2 id>准备镜像</h2>
<h3 id="1">1. 下载镜像</h3>
<p><a href="https://downloads.raspberrypi.org/raspios_lite_arm64/images">https://downloads.raspberrypi.org/raspios_lite_arm64/images</a></p>
<ul>
<li>解压镜像</li>
</ul>
<h3 id="2">2. 镜像挂在到本地，修改镜像参数</h3>
<pre><code>losetup -f // 查找空闲loop
losetup -P /dev/loop?? rpios.img
mkdir -p img/rootfs
mkdir -p img/boot
mount /dev/loop??p2 img/rootfs
mount /dev/loop??p1 img/boot

# ?? 替换查到的空闲 loop
</code></pre>
<h3 id="3">3. 修改启动参数禁止自动扩展镜像</h3>
<pre><code>console=serial0,115200 console=tty1 root=PARTUUID=c0799831-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh
 
console=serial0,115200 console=tty1 root=PARTUUID=c0799831-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet 
</code></pre>
<h3 id="4ssh">4. 增加 ssh 文件</h3>
<p><code>/boot/</code> 目录下增加 <code>ssh</code> 使能 ssh 登陆。</p>
<p>把本地 .ssh 目录复制到 <code>/home/pi/</code>，主要是使用 <code>authorized_keys</code> 文件解决免密登陆。（注意用户权限）</p>
<h3 id="5spi">5. 使能 SPI</h3>
<p>修改 config.txt 增加</p>
<pre><code>dtparam=spi=on
dtoverlay=spi0-1cs
</code></pre>
<h3 id="6wifi">6. 开启 WIFI 支持</h3>
<p><code>/etc/wpa_supplicant/wpa_supplicant.conf </code> 增加 WIFI 配置。</p>
<pre><code>
network={
    ssid=&quot;testing&quot;
    psk=&quot;testingPassword&quot;
}
</code></pre>
<p>开启WIFI 不能直接生效，需要看一下其他办法。</p>
<pre><code>Wi-Fi is currently blocked by rfkill.
Use raspi-config to set the country before use.
</code></pre>
<h2 id>上电启动</h2>
<h3 id="1sd">1. 将镜像烧录到 SD 卡</h3>
<p>指定 bs 大小可以加速烧录。</p>
<pre><code>sudo dd if=./rpi.img of=/dev/mmcblk0 bs=200MB
sudo sync
sudo sync
</code></pre>
<h3 id="2">2. 上电</h3>
<p>上电启动后执行 <code>apt update</code> 更新软件源。</p>
<h3 id="3">3. 其他配置</h3>
<p>参考：/dietpi-first-try/</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Helium gateway-rs 编译]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h2 id="1">1. 环境搭建</h2>
<pre><code># rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# cargo
cargo install cross
cargo install cargo-make

# 增加平台
rustup target add armv7-unknown-linux-musleabihf
rustup target add arm-unknown-linux-gnueabihf
# Supports Pi 0/1
rustup target add arm-unknown-linux-gnueabihf
# Supports Pi 2/3/4
rustup target add armv7-unknown-linux-gnueabihf
</code></pre>
<h2 id="2">2. 编译</h2>]]></description><link>https://jiapeng.me/helium-gateway-rs-compile/</link><guid isPermaLink="false">609b6ae1bfded500010466f5</guid><category><![CDATA[helium]]></category><category><![CDATA[交叉编译]]></category><category><![CDATA[技术]]></category><dc:creator><![CDATA[JiapengLi]]></dc:creator><pubDate>Wed, 12 May 2021 05:43:49 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2 id="1">1. 环境搭建</h2>
<pre><code># rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# cargo
cargo install cross
cargo install cargo-make

# 增加平台
rustup target add armv7-unknown-linux-musleabihf
rustup target add arm-unknown-linux-gnueabihf
# Supports Pi 0/1
rustup target add arm-unknown-linux-gnueabihf
# Supports Pi 2/3/4
rustup target add armv7-unknown-linux-gnueabihf
</code></pre>
<h2 id="2">2. 编译</h2>
<p>查看 rustc 支持的目标平台：</p>
<pre><code>&gt; rustc --print target-list | pr -tw120 --output-tabs=' 1' --columns 3

aarch64-apple-darwin                    i586-unknown-linux-gnu                  riscv64gc-unknown-none-elf
aarch64-apple-ios                       i586-unknown-linux-musl                 riscv64imac-unknown-none-elf
aarch64-apple-ios-macabi                i686-apple-darwin                       s390x-unknown-linux-gnu
aarch64-apple-ios-sim                   i686-linux-android                      s390x-unknown-linux-musl
aarch64-apple-tvos                      i686-pc-windows-gnu                     sparc-unknown-linux-gnu
aarch64-fuchsia                         i686-pc-windows-msvc                    sparc64-unknown-linux-gnu
aarch64-linux-android                   i686-unknown-freebsd                    sparc64-unknown-netbsd
aarch64-pc-windows-msvc                 i686-unknown-haiku                      sparc64-unknown-openbsd
aarch64-unknown-freebsd                 i686-unknown-linux-gnu                  sparcv9-sun-solaris
aarch64-unknown-hermit                  i686-unknown-linux-musl                 thumbv4t-none-eabi
aarch64-unknown-linux-gnu               i686-unknown-netbsd                     thumbv6m-none-eabi
aarch64-unknown-linux-gnu_ilp32         i686-unknown-openbsd                    thumbv7a-pc-windows-msvc
aarch64-unknown-linux-musl              i686-unknown-uefi                       thumbv7a-uwp-windows-msvc
aarch64-unknown-netbsd                  i686-uwp-windows-gnu                    thumbv7em-none-eabi
aarch64-unknown-none                    i686-uwp-windows-msvc                   thumbv7em-none-eabihf
aarch64-unknown-none-softfloat          i686-wrs-vxworks                        thumbv7m-none-eabi
aarch64-unknown-openbsd                 mips-unknown-linux-gnu                  thumbv7neon-linux-androideabi
aarch64-unknown-redox                   mips-unknown-linux-musl                 thumbv7neon-unknown-linux-gnueabihf
aarch64-uwp-windows-msvc                mips-unknown-linux-uclibc               thumbv7neon-unknown-linux-musleabihf
aarch64-wrs-vxworks                     mips64-unknown-linux-gnuabi64           thumbv8m.base-none-eabi
aarch64_be-unknown-linux-gnu            mips64-unknown-linux-muslabi64          thumbv8m.main-none-eabi
aarch64_be-unknown-linux-gnu_ilp32      mips64el-unknown-linux-gnuabi64         thumbv8m.main-none-eabihf
arm-linux-androideabi                   mips64el-unknown-linux-muslabi64        wasm32-unknown-emscripten
arm-unknown-linux-gnueabi               mipsel-sony-psp                         wasm32-unknown-unknown
arm-unknown-linux-gnueabihf             mipsel-unknown-linux-gnu                wasm32-wasi
arm-unknown-linux-musleabi              mipsel-unknown-linux-musl               x86_64-apple-darwin
arm-unknown-linux-musleabihf            mipsel-unknown-linux-uclibc             x86_64-apple-ios
armebv7r-none-eabi                      mipsel-unknown-none                     x86_64-apple-ios-macabi
armebv7r-none-eabihf                    mipsisa32r6-unknown-linux-gnu           x86_64-apple-tvos
armv4t-unknown-linux-gnueabi            mipsisa32r6el-unknown-linux-gnu         x86_64-fortanix-unknown-sgx
armv5te-unknown-linux-gnueabi           mipsisa64r6-unknown-linux-gnuabi64      x86_64-fuchsia
armv5te-unknown-linux-musleabi          mipsisa64r6el-unknown-linux-gnuabi64    x86_64-linux-android
armv5te-unknown-linux-uclibceabi        msp430-none-elf                         x86_64-pc-solaris
armv6-unknown-freebsd                   nvptx64-nvidia-cuda                     x86_64-pc-windows-gnu
armv6-unknown-netbsd-eabihf             powerpc-unknown-linux-gnu               x86_64-pc-windows-msvc
armv7-apple-ios                         powerpc-unknown-linux-gnuspe            x86_64-sun-solaris
armv7-linux-androideabi                 powerpc-unknown-linux-musl              x86_64-unknown-dragonfly
armv7-unknown-freebsd                   powerpc-unknown-netbsd                  x86_64-unknown-freebsd
armv7-unknown-linux-gnueabi             powerpc-unknown-openbsd                 x86_64-unknown-haiku
armv7-unknown-linux-gnueabihf           powerpc-wrs-vxworks                     x86_64-unknown-hermit
armv7-unknown-linux-musleabi            powerpc-wrs-vxworks-spe                 x86_64-unknown-illumos
armv7-unknown-linux-musleabihf          powerpc64-unknown-freebsd               x86_64-unknown-l4re-uclibc
armv7-unknown-netbsd-eabihf             powerpc64-unknown-linux-gnu             x86_64-unknown-linux-gnu
armv7-wrs-vxworks-eabihf                powerpc64-unknown-linux-musl            x86_64-unknown-linux-gnux32
armv7a-none-eabi                        powerpc64-wrs-vxworks                   x86_64-unknown-linux-musl
armv7a-none-eabihf                      powerpc64le-unknown-linux-gnu           x86_64-unknown-netbsd
armv7r-none-eabi                        powerpc64le-unknown-linux-musl          x86_64-unknown-none-hermitkernel
armv7r-none-eabihf                      riscv32gc-unknown-linux-gnu             x86_64-unknown-none-linuxkernel
armv7s-apple-ios                        riscv32gc-unknown-linux-musl            x86_64-unknown-openbsd
asmjs-unknown-emscripten                riscv32i-unknown-none-elf               x86_64-unknown-redox
avr-unknown-gnu-atmega328               riscv32imac-unknown-none-elf            x86_64-unknown-uefi
hexagon-unknown-linux-musl              riscv32imc-unknown-none-elf             x86_64-uwp-windows-gnu
i386-apple-ios                          riscv64gc-unknown-linux-gnu             x86_64-uwp-windows-msvc
i586-pc-windows-msvc                    riscv64gc-unknown-linux-musl            x86_64-wrs-vxworks


</code></pre>
<h3 id="gatewayrs">gateway-rs 使用到的平台</h3>
<pre><code>CROSS_TARGET = &quot;arm-unknown-linux-gnueabihf&quot;				# raspberry pi 0 / 1
CROSS_TARGET = &quot;armv7-unknown-linux-gnueabihf&quot;				# raspberry pi 2 / 3 / 4
CROSS_TARGET = &quot;armv7-unknown-linux-musleabihf&quot;				# kerlink 
CROSS_TARGET = &quot;mipsel-unknown-linux-musl&quot;					# ramips
CROSS_TARGET = &quot;mips-unknown-linux-musl&quot;
CROSS_TARGET = &quot;armv5te-unknown-linux-musleabi&quot;
</code></pre>
<h3 id>编译未通过</h3>
<p>随便选择一个 target，尝试编译，但是报错，由于缺少工具链。参考 <a href="https://github.com/japaric/rust-cross">https://github.com/japaric/rust-cross</a> 解决。</p>
<pre><code class="language-bash">&gt; cargo build --target  armv7-unknown-linux-musleabihf --release
</code></pre>
<p><img src="https://img.juzuq.com/image-20210511083744831.png" alt="image-20210511083744831"></p>
<h2 id="3">3. 配置交叉编译工具链</h2>
<h3 id>交叉编译工具链是一个麻烦事儿</h3>
<h3 id>命名规范</h3>
<p>交叉编译工具链的命名规则为：arch [-vendor] [-os] [-(gnu)eabi]</p>
<ul>
<li>arch - 体系架构，如ARM，MIPS</li>
<li>verdor - 工具链提供商</li>
<li>os - 目标操作系统</li>
<li>eabi - 嵌入式应用二进制接口</li>
</ul>
<p>根据对操作系统的支持与否，ARM GCC可分为支持和不支持操作系统，如：</p>
<ul>
<li>arm-none-eabi：这个是没有操作系统的（bare metal），自然不可能支持那些跟操作系统关系密切的函数，比如fork。他使用的是newlib这个专用于嵌入式系统的C库。</li>
<li>arm-none-linux-eabi：用于Linux的，使用Glibc</li>
</ul>
<p>参考：<a href="https://blog.csdn.net/weixin_43997099/article/details/109087458">https://blog.csdn.net/weixin_43997099/article/details/109087458</a></p>
<h4 id="gccarmlinuxgnueabigccarmlinuxgnueabihf">gcc-arm-linux-gnueabi 以及 gcc-arm-linux-gnueabihf 的区别</h4>
<blockquote>
<p>gcc-arm-linux-gnueabi is the cross-toolchain package for the armel architecture. This toolchain implies the EABI generated by gcc's -mfloat-abi=soft or -mfloat-abi=softfp options.</p>
<p>gcc-arm-linux-gnueabihf is the cross-toolchain package for the armhf architecture. This toolchain implies the EABI generated by the gcc -mfloat-abi=hard option.</p>
</blockquote>
<p><code>hf</code> 将开启硬件浮点指令，可能有厂家会从成本角度考虑阉割硬件浮点数预算的支持，这样就必须使用软件浮点数。</p>
<h3 id>树莓派工具链</h3>
<blockquote>
<p><code>git clone --depth 1 https://github.com/raspberrypi/tools.git rpitools</code></p>
</blockquote>
<p><code>~/tool/rpitools/arm-bcm2708/arm-linux-gnueabihf/bin</code></p>
<p><img src="https://img.juzuq.com/image-20210511102911719.png" alt="image-20210511102911719"></p>
<h2 id="4dietpigatewayrs">4. 为 DietPi 系统编译 gateway-rs</h2>
<h3 id>工具链</h3>
<p>下载 rpi 官方的工具链，并添加环境变量。</p>
<pre><code>PATH=...:...:/home/jp/tool/rpitools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/
</code></pre>
<h3 id="cargolinker">修改 cargo 配置文件指定 linker 及其配置</h3>
<p>仓库 <code>.cargo/config.toml </code> 路径下面有相关的配置文件。可以根据 target 准备编译选项和链接配置参数。增加如下配置：</p>
<pre><code class="language-toml">...

# Pi 2/3/4
[target.armv7-unknown-linux-gnueabihf]
linker = &quot;arm-linux-gnueabihf-gcc&quot;
rustflags  = [
    &quot;-C&quot;, &quot;target-feature=+crt-static&quot;,
    &quot;-C&quot;, &quot;link-args=-static&quot;,
]

...
</code></pre>
<h3 id>编译并运行</h3>
<pre><code>&gt; cargo build --target armv7-unknown-linux-gnueabihf --release
   Compiling libc v0.2.94
   Compiling proc-macro2 v1.0.26
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.72
   Compiling cfg-if v1.0.0
   Compiling autocfg v1.0.1
   Compiling version_check v0.9.3
   Compiling getrandom v0.2.2
...
...
...
   Compiling tonic v0.4.3
   Compiling gateway-rs v1.0.0-alpha.8 (/home/jp/helium/gateway-rs)
    Finished release [optimized] target(s) in 1m 35s
</code></pre>
<p>上传 (使用 tar / pipe / ssh 方式进行)</p>
<pre><code>&gt; tar cf - ./target/armv7-unknown-linux-gnueabihf/release/helium_gateway | ssh root@192.168.0.21 &quot;tar xf - -C ~&quot;
</code></pre>
<p>运行</p>
<pre><code>root@DietPi:~/target/armv7-unknown-linux-gnueabihf/release# ./helium_gateway -h
helium_gateway 1.0.0-alpha.8
Helium Light Gateway

USAGE:
    helium_gateway [FLAGS] [OPTIONS] &lt;SUBCOMMAND&gt;

FLAGS:
        --daemon     Daemonize the application
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -c &lt;config&gt;        Configuration folder to use. default.toml will be loaded first and any custom settings in
                       settings.toml merged in [default: /etc/helium_gateway]

SUBCOMMANDS:
    help      Prints this message or the help of the given subcommand(s)
    key       Commands on gateway keys
    server    Run the gateway service
    update    Commands for gateway updates
</code></pre>
<blockquote>
<p>注意：dietpi 一定需要增加静态编译的选项，否则编译后的镜像无法使用（可能是 dietpi 比较精简删掉了一些动态库，测试用的dietpi 版本 7.）</p>
<pre><code>&gt; ssh root@192.168.0.21
root@192.168.0.21's password: 
 ─────────────────────────────────────────────────────
 DietPi v7.1.2 : 06:35 - Wed 05/12/21
 ─────────────────────────────────────────────────────
 - Device model : RPi 3 Model B (aarch64)
 - CPU temp : 48'C : 118'F (Optimal temperature)
 - LAN IP : 192.168.0.21 (eth0)
 - MOTD : Did you know that you can run &quot;dietpi-banner&quot; to change its content?
 ─────────────────────────────────────────────────────

 DietPi Team     : MichaIng (lead), Daniel Knight (founder), Joulinar (support)
 Image by        : DietPi Core Team (pre-image: Raspberry Pi OS Lite (64-bit))
 Web             : https://dietpi.com | https://twitter.com/DietPi_
 Patreon Legends : Camry2731
 Contribute      : https://dietpi.com/contribute.html
 DietPi Hosting  : Powered by https://myvirtualserver.com

 dietpi-launcher : All the DietPi programs in one place.
 dietpi-config   : Feature rich configuration tool for your device.
 dietpi-software : Select optimized software for installation.
 htop            : Resource monitor.
 cpu             : Shows CPU information and stats.
</code></pre>
</blockquote>
<h2 id>小贴士</h2>
<h3 id="pr">pr</h3>
<p>为了解决终端内容复制到 md 后格式混乱的问题（TAB 默认宽度不一样），help 文档不是很友好，就稍微阅读了一下 pr 的源码。</p>
<p>默认使用 TAB （8）进行排版， <code>--output-tabs=' 1'</code>（1前面有个空格） 选项可以强制使用空格输出。</p>
<p>pr 工具隶属于 <a href="https://www.gnu.org/software/coreutils/#source">gnu core utilities</a>。</p>
<p><img src="https://img.juzuq.com/image-20210511083639483.png" alt="image-20210511083639483"></p>
<h3 id="windows">一个 windows 工具链下载站</h3>
<p><a href="https://gnutoolchains.com/raspberry/">https://gnutoolchains.com/raspberry/</a></p>
<h3 id="musl">神秘的 musl</h3>
<p>官方网站：<a href="https://www.musl-libc.org/">https://www.musl-libc.org/</a> / <a href="https://musl.libc.org/">https://musl.libc.org/</a></p>
<blockquote>
<p><strong>musl</strong> is an implementation of the C standard library built on top of the Linux system call API, including interfaces defined in the base language standard, POSIX, and widely agreed-upon extensions. <strong>musl</strong> is <em>ightweight</em>, <em>fast</em>, <em>simple</em>, <em>free</em>, and strives to be <em>correct</em> in the sense of standards-conformance and safety.</p>
</blockquote>
<p>标有 musl 字样的 target 表示的应该是有 musl libc 依赖的 gcc。而标有 gnu 字样的应该是以来 glibc 的库。 （仅为猜测）</p>
<h3 id="cargo">限制 cargo 编译时的任务数</h3>
<pre><code>$ export CARGO_BUILD_JOBS = 1
$ cargo build
</code></pre>
<h2 id>参考文档</h2>
<ul>
<li><a href="https://www.reddit.com/r/rust/comments/97xfar/help_crosscompiling_for_armv7_cortexa9/">https://www.reddit.com/r/rust/comments/97xfar/help_crosscompiling_for_armv7_cortexa9/</a></li>
<li>交叉编译树莓派：<a href="https://chacin.dev/blog/cross-compiling-rust-for-the-raspberry-pi/">https://chacin.dev/blog/cross-compiling-rust-for-the-raspberry-pi/</a></li>
</ul>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[DietPi 试用]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h2 id>烧录镜像</h2>
<p>下载镜像。<a href="https://dietpi.com/">https://dietpi.com/</a></p>
<p><img src="https://img.juzuq.com/image-20210511145703254.png" alt="image-20210511145703254"></p>
<pre><code>sudo dd if=./DietPi_RPi-ARMv8-Buster.img of=/dev/mmcblk0 bs=200MB
sudo sync
sudo sync
</code></pre>
<p>注意：如果不指定 bs 参数，写入速度非常慢。</p>
<h2 id>配置</h2>
<ul>
<li>
<p>使用串口进行登陆，不是很友好。也可能是跟我使用的 extraputty 工具有关系。</p>
</li>
<li>
<p>首次启动比较慢，要等 3 - 5分钟左右。（我的设备是 raspberry pi 3 model B)</p>
</li>
</ul>
<p>用户名密码： <code>root / dietpi</code></p>
<p>默认安装了 htop。从下图中可以看到，进程不多，很精简。</p>]]></description><link>https://jiapeng.me/dietpi-first-try/</link><guid isPermaLink="false">609b5903bfded500010466e1</guid><category><![CDATA[技术]]></category><category><![CDATA[交叉编译]]></category><category><![CDATA[DietPi]]></category><dc:creator><![CDATA[JiapengLi]]></dc:creator><pubDate>Wed, 12 May 2021 04:29:38 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2 id>烧录镜像</h2>
<p>下载镜像。<a href="https://dietpi.com/">https://dietpi.com/</a></p>
<p><img src="https://img.juzuq.com/image-20210511145703254.png" alt="image-20210511145703254"></p>
<pre><code>sudo dd if=./DietPi_RPi-ARMv8-Buster.img of=/dev/mmcblk0 bs=200MB
sudo sync
sudo sync
</code></pre>
<p>注意：如果不指定 bs 参数，写入速度非常慢。</p>
<h2 id>配置</h2>
<ul>
<li>
<p>使用串口进行登陆，不是很友好。也可能是跟我使用的 extraputty 工具有关系。</p>
</li>
<li>
<p>首次启动比较慢，要等 3 - 5分钟左右。（我的设备是 raspberry pi 3 model B)</p>
</li>
</ul>
<p>用户名密码： <code>root / dietpi</code></p>
<p>默认安装了 htop。从下图中可以看到，进程不多，很精简。</p>
<p><img src="https://img.juzuq.com/image-20210511142302563.png" alt="image-20210511142302563"></p>
<h2 id>基础软件</h2>
<p>默认未提供 vim  / git 等软件支持。（rpi 跑 apt 有些吃力，每次安装读软件列表搞半天）</p>
<pre><code>apt install vim git
</code></pre>
<h2 id>魔法上网</h2>
<p>安装经常断流。来吧，开魔法！</p>
<p>安装 privoxy：</p>
<pre><code>apt install privoxy
</code></pre>
<p>安装 shadowsocks：</p>
<pre><code>apt install shadowsocks-libev
</code></pre>
<p>安装 v2ray-plugin：</p>
<p>宿主机开魔法下载v2ray-plugin。<a href="https://github.com/shadowsocks/v2ray-plugin/releases/download/v1.3.1/v2ray-plugin-linux-arm64-v1.3.1.tar.gz">https://github.com/shadowsocks/v2ray-plugin/releases/download/v1.3.1/v2ray-plugin-linux-arm64-v1.3.1.tar.gz</a></p>
<p>利用 dropbear 上传文件。</p>
<pre><code># diepi 默认不支持 scp，使用 ssh 代替，如下命令在 host 主机执行

cat v2ray-plugin-linux-arm64-v1.3.1.tar.gz | ssh root@192.168.0.64 &quot;cat &gt; v2ray.tar.gz&quot;
</code></pre>
<p>dietpi 下执行：</p>
<pre><code>tar xzf v2ray.tar.gz 
mv ./v2ray-plugin_linux_arm64 /usr/bin/v2ray-plugin
</code></pre>
<p>配置 shadowsoks，创建 /etc/shadowsocks-libev/xxx.json，配置需要参考服务端完成。</p>
<pre><code class="language-json">{
&quot;server&quot;:&quot;url.com&quot;,
&quot;mode&quot;:&quot;tcp_and_udp&quot;,
&quot;server_port&quot;: 443,
&quot;local_address&quot;:&quot;0.0.0.0&quot;,
&quot;local_port&quot;:1080,
&quot;password&quot;:&quot;password&quot;,
&quot;method&quot;:&quot;aes-256-gcm&quot;,
&quot;plugin&quot;:&quot;v2ray-plugin&quot;,
&quot;plugin_opts&quot;:&quot;tls;tls;mux=10;fast-open;host=url.com;path=/s&quot;,
&quot;plugin_args&quot;: &quot;&quot;,
&quot;timeout&quot;:60,
&quot;fast_open&quot;:true
}

</code></pre>
<p>按下图修改 privoxy，开启 http 代理：</p>
<p><img src="https://img.juzuq.com/image-20210511152528422.png" alt="image-20210511152528422"></p>
<h3 id>配置全局代理</h3>
<p>编辑 <code>~/.profile</code>，追加如下内容。</p>
<pre><code># Proxy
#PROXY_SERVER=http://192.168.0.10:1080
PROXY_SERVER=http://127.0.0.1:8118

export https_proxy=$PROXY_SERVER
export http_proxy=$PROXY_SERVER
git config --global http.proxy $PROXY_SERVER
git config --global https.proxy $PROXY_SERVER

# for APT package management 
cat &lt;&lt; EOF &gt; /tmp/proxy.conf
Acquire {
  HTTP::proxy &quot;$PROXY_SERVER&quot;;
  HTTPS::proxy &quot;$PROXY_SERVER&quot;;
}
EOF
sudo mv /tmp/proxy.conf /etc/apt/apt.conf.d/proxy.conf
sudo chown root:root /etc/apt/apt.conf.d/proxy.conf
</code></pre>
<p>这样在终端中执行诸如 curl 等软件都会自动通过代理网络走，节约生命。部分不支持利用全局变量进行代理的，可能需要手动指定代理端口。</p>
<h2 id>其他</h2>
<h3 id>查看本地监听的端口服务</h3>
<p>netstat 已不建议使用。可以使用 ss 代替。</p>
<pre><code>ss -atulpn
</code></pre>
<p><img src="https://img.juzuq.com/image-20210511173323599.png" alt="image-20210511173323599"></p>
<h3 id="vimruntime">搭建 vim runtime 环境</h3>
<pre><code>git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime &amp;&amp; sh ~/.vim_runtime/install_awesome_vimrc.sh
</code></pre>
<h3 id="dd">查看 dd 进度</h3>
<pre><code>pkill -USR1 -x dd
</code></pre>
<h3 id="dietpiraspbianlite">dietpi 和 raspbian lite 的对比</h3>
<p><a href="https://docs.google.com/spreadsheets/d/1mDHGZC-H6tU6_O8kuLTG8d4A8Nt7lV1Q7MXTR_6qw30/edit#gid=0"><img src="https://img.juzuq.com/image-20210511174938593.png" alt="image-20210511174938593"></a></p>
<p><em>点击图片查看原链接</em></p>
<h3 id="sshtarpipescp">SSH / tar / pipe 互相拷贝文件 (不使用 scp)</h3>
<pre><code>ssh taget &quot;tar czpf - /some/important/data&quot; | tar xzpf - -C /new/root/directory
tar cpf - /some/important/data | ssh target &quot;tar xpf - -C /some/directory/&quot; 
</code></pre>
<h3 id>交叉编译工具链</h3>
<p><a href="https://github.com/raspberrypi/tools.git">rpi 官网工具链</a>编译出来的程序需要使用静态编译的方式方能适配 dietpi。否则无法运行并报如下错误提示：</p>
<pre><code>root@DietPi:~# ./util/test/test_hw 
-bash: ./util/test/test_hw: No such file or directory
</code></pre>
<p>测试程序采用了 automake 进行构建，可以增加静态编译的选项使其可以工作，修改很简单。编译结果比动态链接增大了 100% （900K - 1.8M）。</p>
<p>参考：<a href="https://stackoverflow.com/questions/13997415/how-can-an-autotools-user-specify-a-combination-of-static-dynamic-linking">https://stackoverflow.com/questions/13997415/how-can-an-autotools-user-specify-a-combination-of-static-dynamic-linking</a></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[客观与主观]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>多少年来一直坚信做事应该客观，近来在吴军老师的专栏里接受了“主观地阐述问题包含的信息量才大”这个个观点。虽然这句话不适用于全部场景，因为其本身也是主观的。突然又想到那句<code>GNU is Not Unix</code>。但是其中的深层含义结合身边的事和人进行了一些思考。试着去改变一下，重新审视客观和主观，对主观的看法常怀一颗包容的心，去芜存菁。</p>
<blockquote>
<p>吴军老师的《信息论40讲》真的是常读常新。</p>
</blockquote>
<!--kg-card-end: markdown-->]]></description><link>https://jiapeng.me/objective-and-subjective/</link><guid isPermaLink="false">5f40cbf6bfded50001046265</guid><category><![CDATA[生活]]></category><dc:creator><![CDATA[JiapengLi]]></dc:creator><pubDate>Mon, 10 May 2021 08:25:06 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>多少年来一直坚信做事应该客观，近来在吴军老师的专栏里接受了“主观地阐述问题包含的信息量才大”这个个观点。虽然这句话不适用于全部场景，因为其本身也是主观的。突然又想到那句<code>GNU is Not Unix</code>。但是其中的深层含义结合身边的事和人进行了一些思考。试着去改变一下，重新审视客观和主观，对主观的看法常怀一颗包容的心，去芜存菁。</p>
<blockquote>
<p>吴军老师的《信息论40讲》真的是常读常新。</p>
</blockquote>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Helium 部署 Validator]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h2 id="1testnet">1. 生成 testnet 钱包</h2>
<pre><code>helium-wallet create basic --network testnet -o /path/to/save/wallet.key
</code></pre>
<pre><code>helium-wallet -f /path/to/save/wallet.key info

&gt; ~/helium/helium-wallet-rs/target/debug/helium-wallet create basic --network testnet -o testnet.key
Password: [hidden]
+-----------------------------------------------------+---------+--------+------------+
| Address                                             | Sharded | Verify | PwHash     |
+-----------------------------------------------------+---------+--------+------------+</code></pre>]]></description><link>https://jiapeng.me/helium-deploy-validator/</link><guid isPermaLink="false">6095ec65bfded5000104667f</guid><category><![CDATA[helium]]></category><category><![CDATA[技术]]></category><dc:creator><![CDATA[JiapengLi]]></dc:creator><pubDate>Sat, 08 May 2021 01:42:39 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2 id="1testnet">1. 生成 testnet 钱包</h2>
<pre><code>helium-wallet create basic --network testnet -o /path/to/save/wallet.key
</code></pre>
<pre><code>helium-wallet -f /path/to/save/wallet.key info

&gt; ~/helium/helium-wallet-rs/target/debug/helium-wallet create basic --network testnet -o testnet.key
Password: [hidden]
+-----------------------------------------------------+---------+--------+------------+
| Address                                             | Sharded | Verify | PwHash     |
+-----------------------------------------------------+---------+--------+------------+
| 1aCjBMAWymv9x7kXTvKVsTe7tBkSyWoR5uzkQ49SG1tKtYwYG6n | false   | true   | Argon2id13 |
+-----------------------------------------------------+---------+--------+------------+
</code></pre>
<h2 id="2tnt">2. 获取 TNT (测试币)</h2>
<p><a href="https://faucet.helium.wtf/">https://faucet.helium.wtf/</a>  填入钱包地址获取假币。等待 10 分钟左右，假币到帐了。可以发掘查询。</p>
<pre><code>&gt; ~/helium/helium-wallet-rs/target/debug/helium-wallet -f testnet.key balance                       
+-----------------------------------------------------+----------------+--------------+-----------------+
| Address                                             | Balance        | Data Credits | Security Tokens |
+-----------------------------------------------------+----------------+--------------+-----------------+
| 1aCjBMAWymv9x7kXTvKVsTe7tBkSyWoR5uzkQ49SG1tKtYwYG6n | 10005.00000000 | 0            | 0.00000000      |
+-----------------------------------------------------+----------------+--------------+-----------------+
</code></pre>
<h2 id="3dockervalidator">3. 利用 docker 部署 validator</h2>
<pre><code>docker run -d --init \
--restart always \
--publish 2154:2154/tcp \
--name validator \
--mount type=bind,source=$HOME/helium/validator_data,target=/var/data \
quay.io/team-helium/validator:latest-val-amd64
</code></pre>
<p>加入自动升级守护：</p>
<pre><code>docker run -d \
--restart always \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
--cleanup \
--interval 1800
</code></pre>
<p>可以看到 2154 端口需要对外开放。并且支持 p2p 通信。</p>
<h2 id="410000hntvalidator">4. 质押 10000 HNT 使得 validator 生效</h2>
<p>查看 validator 地址：</p>
<pre><code>sudo docker exec validator miner peer addr                                     
/p2p/1YPws85sTKu9rf5gBo9JYCUE1muDDrBhVkjUphDnskkk55RruVf

</code></pre>
<p>质押并缴费：</p>
<pre><code>helium-wallet -f /path/to/save/wallet.key validators stake 1YPws85sTKu9rf5gBo9JYCUE1muDDrBhVkjUphDnskkk55RruVf 10000 --commit
Password: [hidden]
+-----------+-----------------------------------------------------+
| Key       | Value                                               |
+-----------+-----------------------------------------------------+
| Validator | 1YPws85sTKu9rf5gBo9JYCUE1muDDrBhVkjUphDnskkk55RruVf |
+-----------+-----------------------------------------------------+
| Fee       | 35000                                               |
+-----------+-----------------------------------------------------+
| Hash      | 594qDbvczOFIW1vQSOeRWXwTdF1SMqqAyQ2ZGV_ibHk         |
+-----------+-----------------------------------------------------+


</code></pre>
<p><img src="https://img.juzuq.com/image-20210507162741611.png" alt="image-20210507162741611"></p>
<h2 id="5validator">5. 查看 validator 部署结果</h2>
<p><img src="https://img.juzuq.com/image-20210507161446381.png" alt="image-20210507161446381"></p>
<p><img src="https://img.juzuq.com/image-20210507162143465.png" alt="image-20210507162143465"></p>
<p>validator 监听的端口会增多：</p>
<p><img src="https://img.juzuq.com/image-20210508083618927.png" alt="image-20210508083618927"></p>
<p>一晚上挖到几十个 TNT (测试币)</p>
<p><img src="https://img.juzuq.com/image-20210508094038775.png" alt="image-20210508094038775"></p>
<h2 id>其他</h2>
<ul>
<li>validator 的部署与挖矿功能解耦隔离，这样很方便做部署切换，validator 的生效与否决定权在钱包侧的 HNT 质押</li>
<li>validator 的 stake</li>
</ul>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Helium 获取 app 钱包关联的 cli 钱包密钥文件]]></title><description><![CDATA[<!--kg-card-begin: markdown--><blockquote>
<p>现在是 skin in the game 了。</p>
</blockquote>
<p>根据 helium APP 上的 12 个主机词可以用来获取其关联的 cli 钱包，以解锁更多功能。</p>
<h2 id="heliumwalletrs">编译 helium-wallet-rs</h2>
<pre><code>git clone https://github.com/helium/helium-wallet-rs
cd helium-wallet-rs
curl https://sh.rustup.rs -sSf | sh
## recommended option 1
source $HOME/.cargo/env
sudo apt install build-essential pkg-config cmake clang
cd helium-wallet-rs
cargo</code></pre>]]></description><link>https://jiapeng.me/helium-cli-wallet/</link><guid isPermaLink="false">6094d8a7bfded50001046633</guid><category><![CDATA[helium]]></category><category><![CDATA[技术]]></category><dc:creator><![CDATA[JiapengLi]]></dc:creator><pubDate>Fri, 07 May 2021 06:50:39 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><blockquote>
<p>现在是 skin in the game 了。</p>
</blockquote>
<p>根据 helium APP 上的 12 个主机词可以用来获取其关联的 cli 钱包，以解锁更多功能。</p>
<h2 id="heliumwalletrs">编译 helium-wallet-rs</h2>
<pre><code>git clone https://github.com/helium/helium-wallet-rs
cd helium-wallet-rs
curl https://sh.rustup.rs -sSf | sh
## recommended option 1
source $HOME/.cargo/env
sudo apt install build-essential pkg-config cmake clang
cd helium-wallet-rs
cargo build --release
</code></pre>
<p>钱包命令位于 <code>target/release/helium-wallet</code></p>
<h2 id>利用助记符还原</h2>
<blockquote>
<p>示例中的助记符获取自 <a href="https://github.com/helium/helium-wallet-rs/blob/master/src/mnemonic/mod.rs#L72">https://github.com/helium/helium-wallet-rs/blob/master/src/mnemonic/mod.rs#L72</a></p>
</blockquote>
<pre><code>catch poet clog intact scare jacket throw palm illegal buyer allow figure
</code></pre>
<pre><code>&gt; ~/helium/helium-wallet-rs/target/debug/helium-wallet create basic --seed 

Password: [hidden]

+-----------------------------------------------------+---------+--------+------------+
| Address                                             | Sharded | Verify | PwHash     |
+-----------------------------------------------------+---------+--------+------------+
| 14VZN1zLxw7vmGSUNDRCNWvBK8FteHFvDEqmjmRvRmqHP7v72Vw | false   | true   | Argon2id13 |
+-----------------------------------------------------+---------+--------+------------+

</code></pre>
<h2 id="cli">cli 钱包指令</h2>
<h3 id="info">info</h3>
<pre><code>
~/helium                                                                                                                                                                                             14:49:22
&gt; ~/helium/helium-wallet-rs/target/debug/helium-wallet -f wallet.key info 
+--------------------+-----------------------------------------------------+
| Key                | Value                                               |
+--------------------+-----------------------------------------------------+
| Address            | 14VZN1zLxw7vmGSUNDRCNWvBK8FteHFvDEqmjmRvRmqHP7v72Vw |
+--------------------+-----------------------------------------------------+
| Network            | mainnet                                             |
+--------------------+-----------------------------------------------------+
| Type               | ed25519                                             |
+--------------------+-----------------------------------------------------+
| Sharded            | false                                               |
+--------------------+-----------------------------------------------------+
| PwHash             | Argon2id13                                          |
+--------------------+-----------------------------------------------------+
| Balance            | 0.00000000                                          |
+--------------------+-----------------------------------------------------+
| DC Balance         | 0                                                   |
+--------------------+-----------------------------------------------------+
| Securities Balance | 0.00000000                                          |
+--------------------+-----------------------------------------------------+

</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>