<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Luozx的数字花园🌳</title>
<link>https://luozx.org/categories/tools.html</link>
<atom:link href="https://luozx.org/categories/tools.xml" rel="self" type="application/rss+xml"/>
<description>把文章中提到的对象视为一种工具，关注它能解决什么问题。</description>
<generator>quarto-1.9.38</generator>
<lastBuildDate>Mon, 12 Jan 2026 14:11:00 GMT</lastBuildDate>
<item>
  <title>用记账工具回答：我现在有多少钱</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/how-i-use-percento/</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<p>我主张的观点是：记账是为最终生成的那张报表服务的<sup>1</sup>，因此想要从报表上获得什么信息就决定使用什么工具以及如何使用这个工具。换句话说，搞明白自己需要解决的问题是第一位的。</p>
<section id="我的情况" class="level1">
<h1>我的情况</h1>
<p>考虑自己个性和习惯<sup>2</sup>，加上受到<a href="https://www.xiaoyuzhoufm.com/podcast/61dd99a47b29652ff572257b">大卫翁老师</a>的熏陶，我成为了资产配置流派的爱好者，同时信奉「某处总有牛市」和「全球资产配置 <sup>3</sup>」的理念，持有了除CNY之外的其他币种和资产。在统计现在有多少钱时，需要以统一的货币来观察，因此不同货币之间的汇率转换是需要的。</p>
<p>进行资产配置的时候，有些标的是计划长期持有，有些需要经常操作，长期账户和短期账户资产之间的比例关系也是我想要知道的。</p>
<p>另外我还想要知道有多少流动资金可以随时取用，占据总资产的比例是怎样的，同时灵活资金是多币种的，如果能看到不同货币的比例，也很有用。</p>
<p>下表按照前述的两个理念，幻想出来想的资产配置：</p>
<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
重要
</div>
</div>
<div class="callout-body-container callout-body">
<p>自己现在只持有表中部分标的，想法也可能随时会发生改变，而且非常不成熟也不专业，请不要抄作业</p>
</div>
</div>
<div class="table-responsive">
<table class="table-striped table-hover caption-top table">
<thead>
<tr class="header">
<th style="text-align: center;">区域</th>
<th style="text-align: center;">自定义</th>
<th style="text-align: center;">流动性分配</th>
<th style="text-align: center;">货币</th>
<th style="text-align: center;">核心</th>
<th style="text-align: center;">卫星</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: center;">港</td>
<td style="text-align: center;">20.00%</td>
<td style="text-align: center;">5+5</td>
<td style="text-align: center;">HKD</td>
<td style="text-align: center;">700</td>
<td style="text-align: center;">268，美团，小米</td>
</tr>
<tr class="even">
<td style="text-align: center;">中</td>
<td style="text-align: center;">15.00%</td>
<td style="text-align: center;">5+5</td>
<td style="text-align: center;">CNY</td>
<td style="text-align: center;">沪深300，中证500，央企50</td>
<td style="text-align: center;"></td>
</tr>
<tr class="odd">
<td style="text-align: center;">美</td>
<td style="text-align: center;">20.00%</td>
<td style="text-align: center;">8+2</td>
<td style="text-align: center;">USD</td>
<td style="text-align: center;">BRKB，TSLA，</td>
<td style="text-align: center;">PDD，</td>
</tr>
<tr class="even">
<td style="text-align: center;">crypto</td>
<td style="text-align: center;">30.00%</td>
<td style="text-align: center;">5+5</td>
<td style="text-align: center;">USDT/C</td>
<td style="text-align: center;">BTC，BNB，ETH，</td>
<td style="text-align: center;"></td>
</tr>
<tr class="odd">
<td style="text-align: center;">日</td>
<td style="text-align: center;">10.00%</td>
<td style="text-align: center;">5+5</td>
<td style="text-align: center;">JPY/USD</td>
<td style="text-align: center;"></td>
<td style="text-align: center;"></td>
</tr>
<tr class="even">
<td style="text-align: center;">其他（印）</td>
<td style="text-align: center;">5.00%</td>
<td style="text-align: center;"></td>
<td style="text-align: center;">USD</td>
<td style="text-align: center;"></td>
<td style="text-align: center;"></td>
</tr>
<tr class="odd">
<td style="text-align: center;"></td>
<td style="text-align: center;">100.00%</td>
<td style="text-align: center;"></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"></td>
</tr>
</tbody>
</table>
</div>
<p>总的来说，我有多少钱这个问题，除了具体的数额之外，我还想观察它分配的比例关系。这样子做其实也是为了回答另外一个问题：何时卖出。</p>
<p>什么时候要把持有的标的卖掉？我找到了两种方法。一种是以资产再平衡的方式，为了能够实现这一点，观察资产之间的比例关系就很有必要。另一种是<a href="https://book.douban.com/subject/36295222/">《投资第一课》</a>这本书中所讲的：看股市温度计，卖在人声鼎沸时<sup>4</sup>。</p>
</section>
<section id="工具" class="level1">
<h1>工具</h1>
<p>记录现在还有多少钱，适合用余额法来记，这样做最轻松。选择Percento的一个原因是因为早先已经为了它的颜值付了钱，买了终身版本，不想浪费了。(其实Wealthfolio也是购买所得）所以在<a href="../../posts/what-we-want-from-bookkeeping.html">上一篇</a>文章，才会列出这几个工具，一些是自己熟悉的，一些是自己本身就拥有的，属于从菜单里选菜了。但是看到有人因为上一篇文章提到了Percento就冲动消费，买了终身版，自己实在是有些汗颜了。另外一个原因是Percento本身的设计也是从余额法出发的。除了这两个最主要的因素外，Percento还有其他特点：</p>
<p><strong>合理的资产分类</strong></p>
<p><a href="https://x.com/haojianzong">作者</a>是考取过CPA（注册会计师）的，Percento在新增资产的时候只给你五个可选类型<sup>5</sup>，用过beancount的朋友对里面的一些术语可能不会陌生。这些分类的意思也很直观，新增一项新的资产时能放入准确的分类中。</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2026/01/ac222c741b1a4b8e25ae09dab9eb7828.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="Percento 新增资产界面"><img src="https://image.luozx.org/garden/2026/01/ac222c741b1a4b8e25ae09dab9eb7828.png" class="img-fluid figure-img" alt="Percento 新增资产界面"></a></p>
<figcaption>Percento 新增资产界面</figcaption>
</figure>
</div>
<p><strong>负债率指标</strong></p>
<p>在使用Percento之前，我几乎对自己负债率没有一点想法，是Percento提醒了我。</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2026/01/a75f27cd4172edea0b89421ff04edb48.png" class="lightbox" data-gallery="quarto-lightbox-gallery-2" title="负债率指标"><img src="https://image.luozx.org/garden/2026/01/a75f27cd4172edea0b89421ff04edb48.png" class="img-fluid figure-img" alt="负债率指标"></a></p>
<figcaption>负债率指标</figcaption>
</figure>
</div>
<p>之所有负债率重要是因为它还有另一个名字：杠杆倍数。<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>杠</mi><mi>杆</mi><mi>倍</mi><mi>数</mi><mo>=</mo><mfrac><mn>1</mn><mrow><mn>1</mn><mo>−</mo><mi>负</mi><mi>债</mi><mi>率</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">杠杆倍数=\frac{1}{1-负债率}</annotation></semantics></math></p>
<p>负债率和杠杆倍数之间的关系如 图&nbsp;1 所示：</p>
<div id="cell-fig-leverage" class="cell" data-execution_count="1">
<details class="code-fold">
<summary>代码</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb1-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb1-3"></span>
<span id="cb1-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1. 准备数据</span></span>
<span id="cb1-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 负债率 d 从 0 到 0.95 (避免分母为0，且 95% 以上绘图效果较挤)</span></span>
<span id="cb1-6">d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>)</span>
<span id="cb1-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 杠杆倍数 m = 1 / (1 - d)</span></span>
<span id="cb1-8">m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> d)</span>
<span id="cb1-9"></span>
<span id="cb1-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2. 创建绘图</span></span>
<span id="cb1-11">plt.figure(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))</span>
<span id="cb1-12">plt.plot(d, m, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r'</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m = </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\f</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rac</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{1}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{1-d}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#1f77b4'</span>, linewidth<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb1-13"></span>
<span id="cb1-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 3. 标注特定的点：42% 负债率</span></span>
<span id="cb1-15">d_target <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.42</span></span>
<span id="cb1-16">m_target <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> d_target)</span>
<span id="cb1-17">plt.scatter([d_target], [m_target], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'red'</span>, zorder<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb1-18">plt.annotate(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'Point: (42%, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m_target<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x)'</span>, </span>
<span id="cb1-19">             xy<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(d_target, m_target), </span>
<span id="cb1-20">             xytext<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(d_target <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, m_target <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb1-21">             arrowprops<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(facecolor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'black'</span>, shrink<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, width<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, headwidth<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>))</span>
<span id="cb1-22"></span>
<span id="cb1-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 4. 辅助线和参考点 (例如 50%, 80%)</span></span>
<span id="cb1-24"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> ref_d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>]:</span>
<span id="cb1-25">    ref_m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref_d)</span>
<span id="cb1-26">    plt.scatter([ref_d], [ref_m], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gray'</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb1-27">    plt.text(ref_d, ref_m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(ref_d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">%, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(ref_m)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb1-28"></span>
<span id="cb1-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 5. 图表修饰</span></span>
<span id="cb1-30">plt.title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Relationship between Debt Ratio and Leverage Multiplier'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>)</span>
<span id="cb1-31">plt.xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Debt Ratio (d)'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>)</span>
<span id="cb1-32">plt.ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Leverage Multiplier (m)'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>)</span>
<span id="cb1-33">plt.grid(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, linestyle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'--'</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>)</span>
<span id="cb1-34">plt.ylim(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>)  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 限制 Y 轴范围以便观察</span></span>
<span id="cb1-35">plt.xlim(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb1-36">plt.legend()</span>
<span id="cb1-37"></span>
<span id="cb1-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 6. 显示图表</span></span>
<span id="cb1-39">plt.show()</span></code></pre></div></div>
</details>
<div class="cell-output cell-output-display">
<div id="fig-leverage" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-leverage-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<a href="index_files/figure-html/fig-leverage-output-1.png" class="lightbox" data-gallery="quarto-lightbox-gallery-3" title="图&nbsp;1: 负债率（横轴）与杠杆倍数（纵轴）关系图"><img src="https://luozx.org/posts/how-i-use-percento/index_files/figure-html/fig-leverage-output-1.png" width="567" height="381" class="figure-img"></a>
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-leverage-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
图&nbsp;1: 负债率（横轴）与杠杆倍数（纵轴）关系图
</figcaption>
</figure>
</div>
</div>
</div>
<p>杠杆倍数意味着风险系数，可以把上图的纵轴视为风险系数。负债率和风险之间不是线性增长的，对自己来说，负债率控制在50%以下是相对安全的区间，在Percento上可以通过观察负债率来控制自己的风险情况。</p>
<p><strong>漂亮的设计和简洁的首页</strong></p>
<p>首页上有我关心的大部分内容：比例，金额。如果我想了解每个类型下的比例，也会以同样简洁的方式展现出来。当时花钱购买终身版这是一个很大的原因，还有一个原因是，免得它以后涨价，就还在它比较年幼的时候以低价买入了。</p>
<p>那个时候支持的标的很少，现在大部分主流的资产都可以，而且也可以刷新汇率和标的价格，数据会通过iCloud同步，都很不错。</p>
<div class="quarto-layout-panel" data-layout-ncol="2">
<div class="quarto-layout-row">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2026/01/fa486d8589e01b46ad3bf0377bececc9.png" class="lightbox" data-gallery="quarto-lightbox-gallery-4" title="Percento首页"><img src="https://image.luozx.org/garden/2026/01/fa486d8589e01b46ad3bf0377bececc9.png" class="img-fluid figure-img" alt="Percento首页"></a></p>
<figcaption>Percento首页</figcaption>
</figure>
</div>
</div>
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2026/01/f1075dd0cca923b949be16849d015b18.png" class="lightbox" data-gallery="quarto-lightbox-gallery-5" title="投资账户的比例"><img src="https://image.luozx.org/garden/2026/01/f1075dd0cca923b949be16849d015b18.png" class="img-fluid figure-img" alt="投资账户的比例"></a></p>
<figcaption>投资账户的比例</figcaption>
</figure>
</div>
</div>
</div>
</div>
<p><strong>不足</strong></p>
<p>也可能是我自己的习惯问题，Percento在资产下只能建立一级分组，比如我在投资类别下的两个分组长期账户和短期账户，在这两个账户下只能建立资产，不能再建立新的分组，只能通过在资产前加上特定前缀来区分他们放在哪里。</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2026/01/0100e4ad3b63af1ff69c549b13068b91.png" class="lightbox" data-gallery="quarto-lightbox-gallery-6" title="投资账户"><img src="https://image.luozx.org/garden/2026/01/0100e4ad3b63af1ff69c549b13068b91.png" class="img-fluid figure-img" alt="投资账户"></a></p>
<figcaption>投资账户</figcaption>
</figure>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2026/01/9ab67f3ea95481770de19f9a1f5f2c4f.png" class="lightbox" data-gallery="quarto-lightbox-gallery-7" title="通过资产前缀定义二级分组"><img src="https://image.luozx.org/garden/2026/01/9ab67f3ea95481770de19f9a1f5f2c4f.png" class="img-fluid figure-img" alt="通过资产前缀定义二级分组"></a></p>
<figcaption>通过资产前缀定义二级分组</figcaption>
</figure>
</div>
<p>缺点就是没办法知道二级分组的总资产之间的比例。</p>
<p>另外也不提供关于不同币种之间的比例关系（流动和非流动）不过有读者朋友开发的一款App：<a href="https://apps.apple.com/app/id6752807691">iRich</a>就有这样的视图功能，很不错。</p>
</section>
<section id="总结" class="level1">
<h1>总结</h1>
<p>我希望朋友们把关注的重点放在自己所处的情景中，而不是因为某一款功能丰富的工具反过来推敲自己有哪些场景可以用。</p>
<p>我选择使用Percento是因为它满足了我最开始描述的大部分需要，我尽可能详尽地把自己的情况都写了出来，以便让你理解其中的缘由。如果你只是聚焦在一个市场，自己只持有一种货币，也许某些在线表格就能很容易的解决这个问题。</p>
<p>先找到困扰自己的问题，再想办法寻找工具解决它，永远将<mark>注意力</mark>放在自己身上:)</p>


</section>


<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">脚注</h2>

<ol>
<li id="fn1"><p><a href="../../posts/what-we-want-from-bookkeeping.html">谈记账时，我们真正想要的是什么</a>↩︎</p></li>
<li id="fn2"><p>旧文：<a href="../../posts/investing-and-personality.html">个性匹配的投资策略</a>↩︎</p></li>
<li id="fn3"><p>两个阅读材料：1.<a href="https://book.douban.com/subject/36876426/">如何配置全球资产</a> 2.<a href="https://book.douban.com/subject/37165036/">持续买入</a>↩︎</p></li>
<li id="fn4"><p>自己现在还不太会，没有心得体会，所以讲不出个屁来↩︎</p></li>
<li id="fn5"><p>在会计术语中叫作科目↩︎</p></li>
</ol>
</section><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <category>money</category>
  <guid>https://luozx.org/posts/how-i-use-percento/</guid>
  <pubDate>Mon, 12 Jan 2026 14:11:00 GMT</pubDate>
</item>
<item>
  <title>ClawCloudRun：免费的K8s资源</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/clawcloud-run.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
重要
</div>
</div>
<div class="callout-body-container callout-body">
<p>2025-12-13日起，对于免费用户，会审核账户活跃情况，一个月内未登录过ClawCloudRun控制台的用户，资源会<a href="https://question.run.claw.cloud/questions/10010000000002545">被回收</a>。 所以免费用户现在需要每月至少登陆控制台一次，才能保证自己部署的服务持续运行。</p>
</div>
</div>
<p>ClawCloudRun提供Kubernetes（K8s）集群的多租户共享模式，按照实际使用的计算资源和存储资源来付费。使用GitHub帐号注册的话，每个月有<a href="https://docs.run.claw.cloud/clawcloud-run/billing-and-usage#credits">免费5美元的额度</a>可以使用。</p>
<p>除了把K8s集群实现多组户共享外，ClawCloudRun还简化了<a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/">Deployment</a>的部署过程，提供默认的访问公开访问链接，相比原生的K8s，ClawCloudRun更容易上手。</p>
<p>免费的帐号最多有4个CPU/8GB RAM的计算资源和10GB的存储资源可以使用，部署一些小型的个人用途服务我觉得足够了。</p>
<p>其他几个有特色的功能是</p>
<ul>
<li>提供对象存储功能</li>
<li>提供App Store，按照预设模板直接可以部署一些开源服务到K8s集群中，比如WordPress，OpenList，n8n等</li>
<li>提供快速部署数据库/中间件功能</li>
<li>提供快速创建开发/测试环境的功能（<a href="https://docs.run.claw.cloud/clawcloud-run/guide/devbox">DevBox</a>）</li>
</ul>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2025/12/6df867f1ec2e757978d12bdb6c8a11c1.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="clawcloudrun dashboard"><img src="https://image.luozx.org/garden/2025/12/6df867f1ec2e757978d12bdb6c8a11c1.png" class="img-fluid figure-img" alt="clawcloudrun dashboard"></a></p>
<figcaption>clawcloudrun dashboard</figcaption>
</figure>
</div>
<p>由于原来的计算需求已经不在需要了，目前把手头上2台VPS（由Contabo和Mikyhost提供）和1台专属服务器（由Hetzner提供）都取消掉了。Hetzner的专属服务器虽然性价比很好，但也确实不便宜（每个月€39），唯一常用的服务就是<a href="../posts/follow-actions.html">wewe-rss</a>，用ClawCloudRun的免费套餐来部署，刚刚好。</p>
<p>如果你也想部署自己的wewe-rss，以下配置供你参考：</p>
<ul>
<li>Image Name: <code>cooderl/wewe-rss-sqlite</code></li>
<li>Container Port: <code>4000</code>，勾选Public Access，可配置自定义域名</li>
</ul>
<p>添加环境变量（无需额外配置<code>SERVER_ORIGIN_URL</code>）</p>
<ul>
<li><code>DATABASE_TYPE=sqlite</code></li>
<li><code>AUTH_CODE=你的密码</code></li>
</ul>
<p>添加存储，设置存储大小，挂载点（Mount Path）为：<code>/app/data</code></p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2025/12/fe2475996a055107e8f10efbe2c898e8.png" class="lightbox" data-gallery="quarto-lightbox-gallery-2" title="参考配置"><img src="https://image.luozx.org/garden/2025/12/fe2475996a055107e8f10efbe2c898e8.png" class="img-fluid figure-img" alt="参考配置"></a></p>
<figcaption>参考配置</figcaption>
</figure>
</div>
<p>ClawCloudRun的使用感受是稳定性还不是很高。所以最好还是只用它来部署一些测试/练习的服务或者组件。每个月免费的5$额度还是非常不错的！</p>
<p>wewe-rss对我来说里面的数据也不是很重要，用它订阅的公众号数量也不超过5个，所以完全可以接受重新完整安装。</p>
<p>但是使用它来部署博客服务，重要的流程编排工具，或者图床用于生产我不是很推荐。</p>



<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <guid>https://luozx.org/posts/clawcloud-run.html</guid>
  <pubDate>Wed, 03 Dec 2025 03:59:00 GMT</pubDate>
</item>
<item>
  <title>Folo 1.0版本正式推出</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/folo-1-0-release.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<p>Folo 1.0版本于11月1日<a href="https://github.com/RSSNext/Folo/releases">正式发布</a>。</p>
<p>增加了AI Chat功能，并正式启动了付费订阅计划。</p>
<p>免费版不再提供双语翻译功能，并且暂不提供用户输入自己的API Key，经过测试，即使重新安装0.9版本的Folo，仍然无法启用双语翻译功能。</p>
<p><a href="https://image.luozx.org/garden/2025/11/09d41b0d3994d078467d8d5300289352.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1"><img src="https://image.luozx.org/garden/2025/11/09d41b0d3994d078467d8d5300289352.png" class="img-fluid"></a></p>



<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <guid>https://luozx.org/posts/folo-1-0-release.html</guid>
  <pubDate>Sun, 02 Nov 2025 06:02:00 GMT</pubDate>
</item>
<item>
  <title>Komari: 个人轻量VPS监控面板</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/komari-vps-monitoring.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<section id="介绍" class="level1">
<h1>介绍</h1>
<p>Komari是我认为比较轻量，简约的服务器监控面板。提供服务器基本信息（配置，型号，虚拟化，流量）监控数据也提供服务器离线通知，远程执行命令/Web SSH功能。</p>
<p>还可以给每台VPS设置账单标签，对于个人拥有多台服务器，想要一览所有服务器的基本情况非常好用。可以在<a href="https://ss.akz.moe/">这里</a>和<a href="https://komari.cmqos.com/">这里</a>查看监控面板样式。</p>
</section>
<section id="安装部署" class="level1">
<h1>安装部署</h1>
<p><a href="https://github.com/komari-monitor/komari">Komari-monitor</a> 分为Dashboard和Agent两部分。</p>
<p>先部署Dashboard后，在控制台生成Agent自动发现密钥，再通过一键部署命令安装Agent，实现本身和其他VPS的监控。</p>
<section id="dashboard" class="level2">
<h2 class="anchored" data-anchor-id="dashboard">Dashboard</h2>
<p>Dashboard也提供一键部署命令，安装过程基本没有障碍。需要注意的是有些VPS服务商的防火墙配置。一般来讲会有2层防火墙，一层是服务商在Web端提供的防火墙规则，第二层是VPS本身的防火设置，规则放行（或者关闭）后就可以通过IP地址访问到Dashboard页面。</p>
<p>我给安装了Dashboard的服务器配置了域名，同时想要有（免费）HTTPS支持，并且不想要在域名后面携带端口号的方式进行访问。ChatGPT推荐使用<a href="https://caddyserver.com/">Caddy</a>进行反向代理。正巧之前在Simon的<a href="https://simonwillison.net/2025/Aug/24/uv-caddy-and-docker/">帖子</a>中也看到过Caddy。</p>
<p>安装Caddy并修改Caddyfile：</p>
<div class="code-with-filename">
<div class="code-with-filename-file">
<pre><strong>/etc/caddy/Caddyfile</strong></pre>
</div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" data-filename="/etc/caddy/Caddyfile" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">h.luozx.org</span> {</span>
<span id="cb1-2">        <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">reverse_proxy</span> localhost:25774 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># komari-monitor</span></span>
<span id="cb1-3"><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">}</span></span></code></pre></div></div>
</div>
<p>将访问<code>https://h.luozx.org</code>的请求都转发到komari去。我的域名托管在Cloudflare，设置DNS时需要先关闭<a href="https://developers.cloudflare.com/dns/proxy-status/">DNS proxied</a>访问成功后在开启。</p>
</section>
<section id="agent" class="level2">
<h2 class="anchored" data-anchor-id="agent">Agent</h2>
<p>登陆Dashboard管理后台，在「设置」-&gt; 「通用」-&gt; 「自动发现」生成自动发现密钥</p>
<p>按照生产推荐命令<a href="https://komari-document.pages.dev/install/agent-ad.html#%E7%94%9F%E4%BA%A7%E7%8E%AF%E5%A2%83%E6%8E%A8%E8%8D%90%E9%85%8D%E7%BD%AE">说明</a>将<code>https://your-komari-server.com</code>替换为自己的域名，<code>your-ad-key</code> 替换为在Dashboard生成的自动发现密钥。</p>
<p>在需要监控的机器（包括本机）上执行一件部署命令，在Dashboard上稍等片刻就能看到监控信息。</p>
<p><a href="https://image.luozx.org/garden/2025/09/3ffceecac46abaeee2a0e3da4f4d95fe.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1"><img src="https://image.luozx.org/garden/2025/09/3ffceecac46abaeee2a0e3da4f4d95fe.png" class="img-fluid"></a></p>


</section>
</section>

<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <category>mypick</category>
  <guid>https://luozx.org/posts/komari-vps-monitoring.html</guid>
  <pubDate>Tue, 02 Sep 2025 07:38:00 GMT</pubDate>
</item>
<item>
  <title>Follow：一年之后</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/follow-after-a-year.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<p>去年，Follow刚推出的时候，我在<a href="../posts/follow-the-app/follow-the-app.html">Follow：The App</a>中介绍了一些Follow独特的功能和它的目标 – 成为下一代内容输入的入口。(Nextgen Infomation Browser)</p>
<p>接近一年的时间里，Follow更名为Folo，推出了iOS和Android移动版本，邀请机制也消失了<sup>1</sup>。</p>
<p>尽管目前仍未推出正式版<sup>2</sup>，但Folo已然成为我每天阅读的主要入口，成为了我的内容浏览器。</p>
<section id="the-way-of-rss" class="level1">
<h1>The way of rss</h1>
<p>刚开始接触到RSS的时候，我把它当作一种消息通知手段，会把所有想要收到通知的内容，尽最大可能收录到<a href="https://netnewswire.com/">NetNewsWire</a>里。NetNewsWire是一款非常简约的RSS阅读器，提供手机端和电脑端，订阅内容通过iCloud同步，于是自己主要通过手机端来接收新内容的通知。</p>
<p>很快，没有丝毫意外的，订阅中的通知越来越频繁，未读气泡数字越来越大，打开NetNewsWire的变成了一种负担 – 打开它只是为了将内容标为已读，消除红色气泡。</p>
<p>直到我将RSS用作一种内容白名单时，才让内容消费成为一种乐趣和习惯，Folo提供的辅助功能增强了内容消费的体验，也就顺理成章地成为了我的Nextgen Infomation Browser。</p>
</section>
<section id="订阅内容的主要类型" class="level1">
<h1>订阅内容的主要类型</h1>
<p>Folo 提供了五种类型的视图，在你添加一个Feed的时候，可以选择将这个Feed归入哪一类。 <img src="https://image.luozx.org/garden/2025/08/69401a829ca9e8aad08677c0cf10cfda.png" class="img-fluid" alt="Folo提供的五种视图类型"></p>
<p>个人站点和个别公众号是我主要的订阅来源，所以大部分Feed都在文章（Articles）视图里。</p>
<p>对于自己常用的产品，工具或者服务，我会想要关注他们新版本的变化，所以会将Feed放进通知视图（Notifications），尽管他们本身也是文章类型的内容。 <img src="https://image.luozx.org/garden/2025/08/02cf213488ace84eca9d1bf52a51ef80.png" class="img-fluid" alt="订阅产品更新"></p>
<p>图片视图（Pictures）用来追踪杂志，目前只有每周的财新周刊，Folo可以很方便的提供周刊的文章概览，查看感兴趣的文章更会更方便。</p>
<p>而剩下的几类内容（社交媒体，视频，音频<sup>3</sup>）几乎不使用RSS订阅任何feed。</p>
<div class="quarto-layout-panel" data-layout-ncol="2">
<div class="quarto-layout-row">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2025/08/9dd9f34a54ca991ef789c4a4e023f7b1.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="图片视图"><img src="https://image.luozx.org/garden/2025/08/9dd9f34a54ca991ef789c4a4e023f7b1.png" class="img-fluid figure-img" alt="图片视图"></a></p>
<figcaption>图片视图</figcaption>
</figure>
</div>
</div>
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2025/08/8ec8b143c3cf8e50df72c17cb5d6f38b.png" class="lightbox" data-gallery="quarto-lightbox-gallery-2" title="周刊概览"><img src="https://image.luozx.org/garden/2025/08/8ec8b143c3cf8e50df72c17cb5d6f38b.png" class="img-fluid figure-img" alt="周刊概览"></a></p>
<figcaption>周刊概览</figcaption>
</figure>
</div>
</div>
</div>
</div>
</section>
<section id="喜爱的功能" class="level1">
<h1>喜爱的功能</h1>
<p>你可能已经从上面的图片里注意到了：Folo提供双语翻译。虽然借助AI，翻译的质量有了很大的提升，但仍不可避免有些翻译不太准确，双语对照其实很有必要。同时每篇文章还提供摘要，当然也是由AI生成的。</p>
<p>对于英文文章（尤其是长文）中文摘要是我快速了解文章大致内容的主要手段。不过摘要的质量目前的体验还属于中等偏下，仅在少数情况下比较准确。比如像PyCoder’s Weekly这种聚合类或评论类文章比较好用。</p>
<div class="quarto-layout-panel" data-layout-ncol="2">
<div class="quarto-layout-row">
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2025/08/e2cc174c26f2ba6f81d45f648e91eb96.png" class="lightbox" data-gallery="quarto-lightbox-gallery-3" title="好总结"><img src="https://image.luozx.org/garden/2025/08/e2cc174c26f2ba6f81d45f648e91eb96.png" class="img-fluid figure-img" alt="好总结"></a></p>
<figcaption>好总结</figcaption>
</figure>
</div>
</div>
<div class="quarto-layout-cell" style="flex-basis: 50.0%;justify-content: flex-start;">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2025/08/6ded0a352efa5385e53a687b2827028e.png" class="lightbox" data-gallery="quarto-lightbox-gallery-4" title="坏总结"><img src="https://image.luozx.org/garden/2025/08/6ded0a352efa5385e53a687b2827028e.png" class="img-fluid figure-img" style="width:60.0%" alt="坏总结"></a></p>
<figcaption>坏总结</figcaption>
</figure>
</div>
</div>
</div>
</div>
<p>星标（Starred）也是我最常使用的功能，我会将阅读后产生联想或者受受到启发的内容都标记为星标文章，不过星标内容不能分类也不能批注记录，所以现在的星标有一点精华书签的感觉。</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2025/08/e96ec488db51d6bc003e317af3b1078f.png" class="lightbox" data-gallery="quarto-lightbox-gallery-5" title="星标文章"><img src="https://image.luozx.org/garden/2025/08/e96ec488db51d6bc003e317af3b1078f.png" class="img-fluid figure-img" alt="星标文章"></a></p>
<figcaption>星标文章</figcaption>
</figure>
</div>
<p>新增Feed时，分类并不严格，主要和形成RSS内容白名单的机制有些关联。增加一个订阅的逻辑是：作品引导我找到了创作它的人和地方。</p>
<p>如果作者的其他作品都和引导我找到他的这个作品属于一类话题或者主题，那么就会以这个主题或话题新建一个feed分类，比如SRE和可视化。如果作者在认真经营打理创作作品的地方，可能会被我当作一个数字花园，归入Garden里。不过绝大多数的订阅，还是放在Posts(帖子)下。</p>
<div class="callout callout-style-default callout-tip callout-titled" title="快速查找文章">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">提示</span>快速查找文章
</div>
</div>
<div class="callout-body-container callout-body">
<p>使用<span class="visually-hidden"></span> 可以快速搜索文章，进行星标。</p>
</div>
</div>
<p>Folo还有一个很有用的功能是「收件」（Inbox），极少有些内容只能邮件的形式订阅，Folo的「收件箱」功能最适合不过了，同时用来当作临时邮箱也不错。</p>
</section>
<section id="rss白名单的奖励" class="level1">
<h1>RSS白名单的奖励</h1>
<p>好的内容的有一个特点：它会向你展示进入其他好内容的通道。你总是能够通过一个好的作品找到更多优秀的内容。我认为这是使用RSS白名单的一种奖励机制，不用去担心自己的订阅列表是不是太短，自己要做的只有消费好内容，剩下的留给时间去收集。</p>
<p>在V2EX里经常能看到有人发帖询问别人有什么好的订阅推荐。我之所以认为RSS内容是<a href="../posts/this-is-somthing-personal.html">一件很私人的事情</a>是因为每个人的品味(Taste)都是独特的。相同内容，我会标记为星标，也许你都不会被文章的标题所吸引。个人经历，年龄，生活的环境都在不断的影响着自己的品味，并没有好坏之分，只是一件很个人的事情罢了。</p>
<blockquote class="blockquote">
<p>Ultimately, it all comes down to taste.</p>
</blockquote>
</section>
<section id="尾声" class="level1">
<h1>尾声</h1>
<p>Folo所做的事情确实让人印象深刻，不遗余力的在增强RSS用户的使用体验。不论是内容消费者还是内容创造者，都能从Folo中受益。 目前自己很满意Folo给我带来的便捷的内容消费体验，期待Folo的正式版发布。</p>


</section>


<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">脚注</h2>

<ol>
<li id="fn1"><p>不确定是暂时还是永久↩︎</p></li>
<li id="fn2"><p>1.0版本↩︎</p></li>
<li id="fn3"><p>Folo可以订阅有声书，比如得到，能作为播放器使用↩︎</p></li>
</ol>
</section><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <guid>https://luozx.org/posts/follow-after-a-year.html</guid>
  <pubDate>Fri, 08 Aug 2025 03:34:00 GMT</pubDate>
</item>
<item>
  <title>使用Royal TSX的Key Sequence无痛切换root身份</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/royaltsx-keysequence.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<p>在生产环境中，禁用root用户登陆到服务器是很常见的安全要求。</p>
<p>严格的安全环境下，使用<code>su -</code>&nbsp;切换到root时仍会被要求输入密码来验证身份，并且还是复杂密码，每次都要重复的复制粘贴动作。对我来说一直都是个很痛苦的事情。</p>
<p>今天发现，Royal TSX<sup>1</sup>的Key Sequence功能是消除痛苦的好法子。</p>
<p><a href="https://image.luozx.org/garden/2025/08/7fbf5992f9a0bc5387f4897cf9a2ee09.png" width="40%" target="_blank">Royal TSX提供两种类型的Task</a></p>
<ul>
<li>Command Task：在登陆服务器前执行一些命令</li>
<li>Key Sequence Task：登陆服务器后执行一些命令</li>
</ul>
<p>创建一个Key Sequence Task，录入之前登录后自己人工执行的操作：（Royal TSX提供了许多内置的Key sequence） <img src="https://image.luozx.org/garden/2025/08/684d9a56d0d4ef33a8ada2231d387814.png" class="img-fluid" alt="TSXt提供了许多快捷KeySequence"></p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
注记
</div>
</div>
<div class="callout-body-container callout-body">
<p>在添加Key sequence时，注意使用Delay功能，否则可能会因为输入过快而导致命令执行失败。</p>
</div>
</div>
<p>我设置在（普通用户）登录后等待1000毫秒，然后再开始进行Key Sequence的输入，输入<code>su -</code>命令和<span class="visually-hidden"></span>后等待500毫秒，再让Royal TSX输入root密码，然后再输入<span class="visually-hidden"></span>。</p>
<p>有两种方式触发Key Sequence：</p>
<ol type="1">
<li>在连接到服务器后，手动选择对应的Key Sequence（未登陆到服务器时，Key Sequence不可选）</li>
</ol>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2025/08/206b82c44d5d1f798df08bbaf625195b.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="手动触发Key Sequence"><img src="https://image.luozx.org/garden/2025/08/206b82c44d5d1f798df08bbaf625195b.png" class="img-fluid figure-img" style="width:60.0%" alt="手动触发Key Sequence"></a></p>
<figcaption>手动触发Key Sequence</figcaption>
</figure>
</div>
<ol start="2" type="1">
<li>如果你只使用一个普通账户登陆，那么就可以考虑让Royal TSX完全自动执行Key Sequence。 在服务器属性设置，Tasks选项卡中，选择刚才创建的Key Sequence Task <img src="https://image.luozx.org/garden/2025/08/d60e597860433b7eaf7c640275b6b029.png" class="img-fluid" alt="TSX完全自动执行"></li>
</ol>




<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">脚注</h2>

<ol>
<li id="fn1"><p>你可以在<a href="../posts/royal-tsx.html">这里</a>找到更多关于Royal TSX的介绍↩︎</p></li>
</ol>
</section><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <guid>https://luozx.org/posts/royaltsx-keysequence.html</guid>
  <pubDate>Fri, 01 Aug 2025 07:47:00 GMT</pubDate>
</item>
<item>
  <title>在Linux中创建并激活交换文件(swapfile)</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/activate-swapfile-manually.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<p>以前对swap文件的理解都是在书面上的：</p>
<ul>
<li>swap文件是磁盘上的一个特殊文件类型。</li>
<li>当物理内存不足时，系统会将部分数据从内存（RAM）移动到swap文件中，起到扩展虚拟内存的作用。</li>
</ul>
<p>但是从来没有真正实际感受过swap文件的作用。</p>
<p>今天一个同样的CLI程序，在内存32GB的macOS和64GB的VPS上运行都没有问题，但是在4GB和1GB的VPS上运行时，没一会就出现Killed提示。</p>
<p>其中官方提供了解决办法，就是手动创建一个10GB的swap文件。设置之后，CLI程序在两台小内存机器上可以正常运行。</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="annotated-cell-1" data-llms-code-original="sudo fallocate -l 10G /swapfile &amp;&amp; \  # <1>
sudo chmod 600 /swapfile &amp;&amp; \
sudo mkswap /swapfile &amp;&amp; \ # <2>
sudo swapon /swapfile &amp;&amp; \ # <3>
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab" style="background: #f1f3f5;"><pre class="sourceCode bash code-annotation-code code-with-copy code-annotated"><code class="sourceCode bash"><a class="code-annotation-anchor" data-target-cell="annotated-cell-1" data-target-annotation="1" onclick="event.preventDefault();">1</a><span id="annotated-cell-1-1" class="code-annotation-target"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sudo</span> fallocate <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-l</span> 10G /swapfile <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">&amp;&amp;</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="annotated-cell-1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sudo</span> chmod 600 /swapfile <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">&amp;&amp;</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<a class="code-annotation-anchor" data-target-cell="annotated-cell-1" data-target-annotation="2" onclick="event.preventDefault();">2</a><span id="annotated-cell-1-3" class="code-annotation-target"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sudo</span> mkswap /swapfile <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">&amp;&amp;</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<a class="code-annotation-anchor" data-target-cell="annotated-cell-1" data-target-annotation="3" onclick="event.preventDefault();">3</a><span id="annotated-cell-1-4" class="code-annotation-target"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sudo</span> swapon /swapfile <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">&amp;&amp;</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="annotated-cell-1-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">echo</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'/swapfile none swap sw 0 0'</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sudo</span> tee <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-a</span> /etc/fstab</span><div class="code-annotation-gutter-bg"></div><div class="code-annotation-gutter"></div></code></pre></div></div>
<dl class="code-annotation-container-grid">
<dt data-target-cell="annotated-cell-1" data-target-annotation="1">1</dt>
<dd>
<span data-code-cell="annotated-cell-1" data-code-lines="1" data-code-annotation="1">在根目录下分配(<code>fallocate</code>)一个空间大小(<code>-l</code>,<code>--length</code>)为10GB，名叫<code>swapfile</code>的文件。</span>
</dd>
<dt data-target-cell="annotated-cell-1" data-target-annotation="2">2</dt>
<dd>
<span data-code-cell="annotated-cell-1" data-code-lines="3" data-code-annotation="2">将文件格式化为swap分区类型</span>
</dd>
<dt data-target-cell="annotated-cell-1" data-target-annotation="3">3</dt>
<dd>
<span data-code-cell="annotated-cell-1" data-code-lines="4" data-code-annotation="3">启用/激活swap文件</span>
</dd>
</dl>



<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <guid>https://luozx.org/posts/activate-swapfile-manually.html</guid>
  <pubDate>Mon, 23 Jun 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Alfred快速在iTerm2和tmux session中执行命令</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/alfred-tmux-acion.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<p><a href="https://github.com/vitorgalvao/custom-alfred-iterm-scripts">这个AppleScript</a>可以让Alfred直接在iTerm2中执行shell命令（默认是系统自带的Tminal.app）</p>
<p>通过Alfred执行的shell命令，会在新的iTerm2 Tab中执行。</p>
<p>我更习惯在tmux的session中进行新的命令验证，于是就让chatGPT帮了一个小忙：</p>
<p>在iTerm2实例和tmux-server都在运行的情况下，通过Alfred传送的命令会在新的tmux-session中执行，而不是iTerm2的Tab中：</p>
<p><a href="https://image.luozx.org/garden/2025/05/c2b4e43bbfc7eaa72d4432022ed5ec76.gif" class="lightbox" data-gallery="quarto-lightbox-gallery-1"><img src="https://image.luozx.org/garden/2025/05/c2b4e43bbfc7eaa72d4432022ed5ec76.gif" class="img-fluid"></a></p>
<p><a href="https://image.luozx.org/garden/2025/05/137ce0efc04ef55666c4c19e72853e33.png" class="lightbox" data-gallery="quarto-lightbox-gallery-2"><img src="https://image.luozx.org/garden/2025/05/137ce0efc04ef55666c4c19e72853e33.png" class="img-fluid"></a></p>
<p>将下面的代码复制到Alfred中，就可以了。</p>
<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
重要
</div>
</div>
<div class="callout-body-container callout-body">
<p>如果neovim运行在tmux的pane中，此时执行alfred会冲突。</p>
</div>
</div>
<details>
<summary>
显示代码
</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">--</span> For the latest version:</span>
<span id="cb1-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">--</span> https://github.com/vitorgalvao/custom-alfred-iterm-scripts</span>
<span id="cb1-3"></span>
<span id="cb1-4"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">property</span> open_in_new_window : false   <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--</span> Always open a new iTerm window</span>
<span id="cb1-5"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">property</span> open_in_new_tab    : true    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--</span> Re-use iTerm but open a new tab</span>
<span id="cb1-6"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">property</span> iterm_opens_quietly : false  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--</span> iTerm launches without a new window</span>
<span id="cb1-7"></span>
<span id="cb1-8"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">--</span> ⬇️  Added: detect if the current session is inside tmux</span>
<span id="cb1-9"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">on</span> in_tmux<span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb1-10">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">try</span></span>
<span id="cb1-11">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tell</span> application <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"iTerm"</span> to tell current session of current tab of current window</span>
<span id="cb1-12">      <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span> tmuxEnv to variable named <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TMUX"</span></span>
<span id="cb1-13">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> tell</span>
<span id="cb1-14">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tmuxEnv</span> is not <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb1-15">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">on</span> error</span>
<span id="cb1-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">false</span></span>
<span id="cb1-17">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> try</span>
<span id="cb1-18"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> in_tmux</span>
<span id="cb1-19"></span>
<span id="cb1-20"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">--</span> Handlers <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-------------------------------------------------------------</span></span>
<span id="cb1-21"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">on</span> new_window<span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb1-22">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tell</span> application <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"iTerm"</span> to create window with default profile</span>
<span id="cb1-23"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> new_window</span>
<span id="cb1-24"></span>
<span id="cb1-25"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">on</span> new_tab<span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb1-26">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tell</span> application <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"iTerm"</span> to tell the first window to create tab with default profile</span>
<span id="cb1-27"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> new_tab</span>
<span id="cb1-28"></span>
<span id="cb1-29"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">on</span> call_forward<span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb1-30">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tell</span> application <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"iTerm"</span> to activate</span>
<span id="cb1-31"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> call_forward</span>
<span id="cb1-32"></span>
<span id="cb1-33"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">on</span> is_running<span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb1-34">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">application</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"iTerm"</span> is running</span>
<span id="cb1-35"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> is_running</span>
<span id="cb1-36"></span>
<span id="cb1-37"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">on</span> is_processing<span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb1-38">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tell</span> application <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"iTerm"</span> to tell the first window to tell current session to return is processing</span>
<span id="cb1-39"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> is_processing</span>
<span id="cb1-40"></span>
<span id="cb1-41"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">on</span> has_windows<span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb1-42">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">not</span> is_running<span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">then</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">false</span></span>
<span id="cb1-43"></span>
<span id="cb1-44">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tell</span> application <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"iTerm"</span></span>
<span id="cb1-45">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">windows</span> is {} then return false</span>
<span id="cb1-46">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tabs</span> of current window is {} then return false</span>
<span id="cb1-47">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">sessions</span> of current tab of current window is {} then return false</span>
<span id="cb1-48"></span>
<span id="cb1-49">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span> session_text to contents of current session of current tab of current window</span>
<span id="cb1-50">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">words</span> of session_text is {} then return false</span>
<span id="cb1-51">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> tell</span>
<span id="cb1-52"></span>
<span id="cb1-53">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">true</span></span>
<span id="cb1-54"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> has_windows</span>
<span id="cb1-55"></span>
<span id="cb1-56"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">on</span> send_text<span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">custom_text</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb1-57">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">tell</span> application <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"iTerm"</span> to tell the first window to tell current session to write text custom_text</span>
<span id="cb1-58"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> send_text</span>
<span id="cb1-59"></span>
<span id="cb1-60"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">--</span> Main <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-----------------------------------------------------------------</span></span>
<span id="cb1-61"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">on</span> alfred_script<span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">query</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb1-62">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">has_windows()</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">then</span></span>
<span id="cb1-63">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">open_in_new_window</span> then</span>
<span id="cb1-64">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">new_window()</span></span>
<span id="cb1-65">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">in_tmux()</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">then</span></span>
<span id="cb1-66">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">--</span> 👉 Already inside tmux: create a new tmux window instead of a new iTerm tab</span>
<span id="cb1-67">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">send_text</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tmux new-window"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb1-68">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">delay</span> 0.1 <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--</span> brief pause so the new window becomes active</span>
<span id="cb1-69">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">open_in_new_tab</span> then</span>
<span id="cb1-70">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">new_tab()</span></span>
<span id="cb1-71">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb1-72">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">--</span> Re-use current tab</span>
<span id="cb1-73">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> if</span>
<span id="cb1-74">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb1-75">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">--</span> iTerm is closed or has no usable windows</span>
<span id="cb1-76">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is_running()</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">or</span> iterm_opens_quietly then</span>
<span id="cb1-77">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">new_window()</span></span>
<span id="cb1-78">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb1-79">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">call_forward()</span></span>
<span id="cb1-80">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> if</span>
<span id="cb1-81">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> if</span>
<span id="cb1-82"></span>
<span id="cb1-83">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">--</span> If query is <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span>1024 bytes wait until session finishes processing previous input</span>
<span id="cb1-84">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">length</span> of query <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> 1024 then</span>
<span id="cb1-85">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">repeat</span> 500 times <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--</span> 5 s timeout</span>
<span id="cb1-86">      <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">not</span> is_processing<span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">then</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">exit</span> repeat</span>
<span id="cb1-87">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">delay</span> 0.01</span>
<span id="cb1-88">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> repeat</span>
<span id="cb1-89">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> if</span>
<span id="cb1-90"></span>
<span id="cb1-91">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">--</span> Wait for a window to exist before writing, or the write may fail</span>
<span id="cb1-92">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">repeat</span> 500 times <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--</span> 5 s timeout</span>
<span id="cb1-93">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">has_windows()</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">then</span></span>
<span id="cb1-94">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">send_text</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">(</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">query</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb1-95">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">call_forward()</span></span>
<span id="cb1-96">      <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">exit</span> repeat</span>
<span id="cb1-97">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> if</span>
<span id="cb1-98">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">delay</span> 0.01</span>
<span id="cb1-99">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> repeat</span>
<span id="cb1-100"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">end</span> alfred_script</span></code></pre></div></div>
</details>



<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <guid>https://luozx.org/posts/alfred-tmux-acion.html</guid>
  <pubDate>Mon, 19 May 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>如果你也在寻找macOS上的远程工具，可以试试它。</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/royal-tsx.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<p>很长一段时间，我都在寻找macOS上合适的远程工具。 由于工作原因，我需要通过Mac远程到Windows Server上（通常Windows Server作为堡垒机和跳板机） 同时也有直接远程到Linux机器的需要。</p>
<p>以前，总要使用两种工具：</p>
<ol type="1">
<li>Microsoft Remote Desktop(现在改名为<a href="https://apps.apple.com/us/app/windows-app/id1295203466?mt=12">Windows App</a>)：登录堡垒机和跳板机</li>
<li>iTerm2等Shell：直接登录Linux服务器</li>
</ol>
<p>想要找到两类同时连接的工具很不容易（RDP和SSH）直到我了解到<a href="https://www.royalapps.com/ts/mac/features">Royal TSX</a>，使用了一段时间后，基本能覆盖我目前的的需求。</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
注记
</div>
</div>
<div class="callout-body-container callout-body">
<p>Royal TSX是付费软件，同时提供Lite免费版</p>
</div>
</div>
<div class="callout callout-style-default callout-tip callout-titled" title="新发现">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">提示</span>新发现
</div>
</div>
<div class="callout-body-container callout-body">
<p>Royal TSX 我经常用来远程Linxu和Windows。 Mac to Mac的远程，<a href="https://edovia.com/en/screens">Screens</a>的易用性和macOS的集成度高很多，支持自家的中继和Tailscail，很方便！</p>
</div>
</div>
<section id="优点" class="level1">
<h1>优点</h1>
<section id="多种连接类型" class="level2">
<h2 class="anchored" data-anchor-id="多种连接类型">多种连接类型</h2>
<p>从Mac远程Widnows（Remote Destop），远程Linux（Terminal/VNC）以及远程另一台Mac（VNC）都可以。</p>
<p><a href="https://image.luozx.org/garden/2025/04/dcc701426c46e59ab6fa1892b06827d0.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1"><img src="https://image.luozx.org/garden/2025/04/dcc701426c46e59ab6fa1892b06827d0.png" class="img-fluid"></a></p>
<p>对于安全要求严格的场景，比如需要通过DMZ的机器作为中转，访问安全级别高的内网网络，Royal TSX也支持将DMZ中的机器作为<a href="https://docs.royalapps.com/r2023/royalts/reference/gateways/securegateway.html">安全网关</a>（Secure Gateway） 作为安全网关的机器可以是Linux(Secure Gateway)，也可以是Windows(Remote Destop Gateway)。</p>
<p><a href="https://image.luozx.org/garden/2025/04/e4c9aefbbb69f15a4816badebfd598eb.png" class="lightbox" data-gallery="quarto-lightbox-gallery-2"><img src="https://image.luozx.org/garden/2025/04/e4c9aefbbb69f15a4816badebfd598eb.png" class="img-fluid"></a></p>
<p>不过除了Royal Server的安全网关支持MFA（双重验证）外，Royal TSX的安全网关还不支持，我工作的地方都需要使用到MFA，所以这个功能看起来有用但好像又没有那么有用😅</p>
<p><strong>连接RDP的问题</strong></p>
<p>RDP在默认情况下，当Royal TSX窗口大小发生改变，会强制重新连接，如果你所在的企业启用了MFA，每次窗口大小发生改变(比如从A显示器移动到B显示器) 都要重新输入MFA代码。</p>
<p>通过将Resize Mode改为Smart Sizing来避免此类问题！</p>
<p><a href="https://image.luozx.org/garden/2025/04/4462aff77fe4b21b9edefe4d4f519c94.png" class="lightbox" data-gallery="quarto-lightbox-gallery-3"><img src="https://image.luozx.org/garden/2025/04/4462aff77fe4b21b9edefe4d4f519c94.png" class="img-fluid"></a></p>
</section>
<section id="password管理登录凭证" class="level2">
<h2 class="anchored" data-anchor-id="password管理登录凭证">1Password管理登录凭证</h2>
<p>Royal TSX 支持<a href="https://www.royalapps.com/blog/dynamic-folder-integration-for-1password">从1Password中读取远程登录的凭证</a>。当你的Mac使用带TouchID的键盘时，用指纹验证登录非常方便！</p>
<p><a href="https://image.luozx.org/garden/2025/04/9d3445bd9f3a8a0ca957fe66005ae8e0.png" class="lightbox" data-gallery="quarto-lightbox-gallery-4"><img src="https://image.luozx.org/garden/2025/04/9d3445bd9f3a8a0ca957fe66005ae8e0.png" class="img-fluid"></a></p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
注记
</div>
</div>
<div class="callout-body-container callout-body">
<p>1Password也是付费应用</p>
</div>
</div>
</section>
<section id="跨设备同步连接信息" class="level2">
<h2 class="anchored" data-anchor-id="跨设备同步连接信息">跨设备同步连接信息</h2>
<p>其中一个非常实用的功能是多设备同步连接信息。Royal TSX使用基于文档（Document）的结构来保存所有数据（连接信息，登录凭证等）。 可以将这个文档放在任何网盘中进行同步，文档本身可以加密后保存，不过使用1Password保存登录凭证的话，该凭证是不会通过云盘同步的。</p>
<p>我的文档本身没有加密保存，但是额外使用<a href="https://cryptomator.org/">Cryptomator</a>来加密同步所有云盘上的内容。</p>
</section>
</section>
<section id="缺点" class="level1">
<h1>缺点</h1>
<section id="学习成本" class="level2">
<h2 class="anchored" data-anchor-id="学习成本">学习成本</h2>
<p>功能越多的软件，学习成本会越高。Royal TS系列经过多年的迭代，已经相当成熟，在我看来，一次性学习一款能长久存在的软件比多次学习生命周期短暂的软件更值得。</p>
</section>
<section id="价格" class="level2">
<h2 class="anchored" data-anchor-id="价格">价格</h2>
<p>Royal TSX 是一次性付费软件（也许大版本升级需要付费）相比Terminux每月$10的定价，Royal TSX的一次型付费价格大约是€49（价格会随地区不同而变动，所以可以选择价格合适的地区购买），不限制设备数量。 尽管界面不如Terminus，但价格还算合理。macOS和Windows的License不共享，不过Windows上远程工具众多，Royal TS系列也不是那么必要。</p>


</section>
</section>

<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <category>mypick</category>
  <guid>https://luozx.org/posts/royal-tsx.html</guid>
  <pubDate>Wed, 16 Apr 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Quarto Note</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/quartonote.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<section id="使用multi-listing时feed参数只在第一次出现时生效" class="level3">
<h3 class="anchored" data-anchor-id="使用multi-listing时feed参数只在第一次出现时生效">使用<a href="https://quarto.org/docs/websites/website-listings.html#multiple-listings">multi-listing</a>时，<code>feed</code>参数只在第一次出现时生效。</h3>
<p>例如我的首页<a href="https://github.com/0ptimista/Garden/blob/main/index.qmd">index.qmd</a>中有：</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="annotated-cell-1" data-llms-code-original="listing:
  - id: recent-posts
    contents: posts
    feed: true # <1>
  - id: featured
    contents: 
      - ./posts/buying-us-bond.qmd
      - ./posts/steps-of-buying-us-bonds.qmd
    feed: false" style="background: #f1f3f5;"><pre class="sourceCode yaml code-annotation-code code-with-copy code-annotated"><code class="sourceCode yaml"><span id="annotated-cell-1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">listing</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span></span>
<span id="annotated-cell-1-2"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">  </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">-</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">id</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> recent-posts</span></span>
<span id="annotated-cell-1-3"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">    </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">contents</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> posts</span></span>
<a class="code-annotation-anchor" data-target-cell="annotated-cell-1" data-target-annotation="1" onclick="event.preventDefault();">1</a><span id="annotated-cell-1-4" class="code-annotation-target"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">    </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">feed</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">true</span></span>
<span id="annotated-cell-1-5"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">  </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">-</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">id</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> featured</span></span>
<span id="annotated-cell-1-6"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">    </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">contents</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span></span>
<span id="annotated-cell-1-7"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">      </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">-</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> ./posts/buying-us-bond.qmd</span></span>
<span id="annotated-cell-1-8"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">      </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">-</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> ./posts/steps-of-buying-us-bonds.qmd</span></span>
<span id="annotated-cell-1-9"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">    </span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">feed</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">:</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;"> </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">false</span></span><div class="code-annotation-gutter-bg"></div><div class="code-annotation-gutter"></div></code></pre></div></div>
<dl class="code-annotation-container-grid">
<dt data-target-cell="annotated-cell-1" data-target-annotation="1">1</dt>
<dd>
<span data-code-cell="annotated-cell-1" data-code-lines="4" data-code-annotation="1"><code>feed: true</code> 必须在前，<code>quarto render</code>才会正常生成RSS feed（<code>index.xml</code>）</span>
</dd>
</dl>


</section>

<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <category>tome-of-xp</category>
  <guid>https://luozx.org/posts/quartonote.html</guid>
  <pubDate>Mon, 17 Mar 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>zsh增加git路径自动补全</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/zsh-git-completion.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<p>受到<a href="https://www.bitecode.dev/p/slashing-my-bashrc-in-half">这篇文章</a>的启发，正在将自己<a href="https://github.com/0ptimista/dotfiles/blob/2152fb08cce10ff4be5c9e929f42010a44b33915/.zshrc">旧的zsh配置</a>重新整理。 按照<a href="https://thevaluable.dev/zsh-install-configure-mouseless/">The Valubale Dev</a>的系列指南，只保留自己需要和看得懂的内容。</p>
<p>主要的变化有两个：</p>
<ol type="1">
<li>离开oh-my-zsh</li>
<li>将环境变量集中放在<code>~/.zshenv</code>中</li>
</ol>
<p>oh-my-zsh功能很丰富，但是一直以来都只是挪用别人的配置，自己并不完全了解。并且许多功能自己也不一定需要。</p>
<p>对我来说，最常用的可能就是「路径自动补全」功能。<a href="https://thevaluable.dev/zsh-install-configure-mouseless/#zsh-completion-system">基础的路径补全</a>不需要依赖任何插件。 只需要在<code>.zshrc</code>中添加以下内容：</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode zsh code-with-copy"><code class="sourceCode zsh"><span id="cb1-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">autoload</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-U</span> compinit<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">;</span> <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">compinit</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 启动TAB补全</span></span>
<span id="cb1-2"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">_comp_options</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">(</span>globdots<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">)</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 可以补全以.开头的文件</span></span>
<span id="cb1-3"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zstyle</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">':completion:*'</span> matcher-list <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m:{a-z}={A-Za-z}'</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 自动补路径全忽略大小写</span></span></code></pre></div></div>
<p>但是使用<code>git add</code>命令时，按下<span class="visually-hidden">Tab</span>} 路径不全并不生效。 Git提供了额外的<a href="https://github.com/git/git/blob/master/contrib/completion/git-completion.zsh">补全文件</a>。</p>
<p><a href="https://gist.github.com/juno/5546179" class="uri">https://gist.github.com/juno/5546179</a> 提供了详细的安装步骤。</p>
<p>注意在配置<code>fpath</code>时，务必将你安装的Git补全文件路径写对。同时删除旧的补全文件(<code>.zcomdump</code>)</p>



<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <guid>https://luozx.org/posts/zsh-git-completion.html</guid>
  <pubDate>Tue, 25 Feb 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>tmux使用catppuccin主题时状态栏问题</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/tmux-catppuccin.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<p><a href="https://github.com/catppuccin">catppuccin</a>主题覆盖了很多我自己在用的工具。(iTerm2，neovim，tmux)</p>
<p>tmux在设置了catppuccin主题后，最下面的状态栏（status bar）总是显示hostname，而不是当前window的名称。 即使更改window名称后也不会显示，很不符合自己的习惯。</p>
<p>在catppuccin的安装目录(例如我的)，找到<code>~/.tmux/plugins/catppuccin/tmux/catppuccin_options_tmux.conf</code>文件，里面有以<code>#T</code> 为值的两行内容，将<code>#T</code>改为<code>#W</code>，重新加载配置，就会显示当前window的名称。</p>
<p>不过直接更改catppuccin的文件带来的弊端就是在下次更新主题时，有可能恢复原样。</p>
<p>在<a href="https://github.com/catppuccin/tmux/discussions/317">这里</a>有人分享自己的配置和实际效果。</p>
<p>挑一份自己喜爱的，找到类似内容<code>window-status-format " #I#{?#{!=:#{window_name},Window},: #W,} "</code> 加入在<code>tmux.conf</code>就好了。</p>
<p>要理解其他人分享的配置对我来说有点吃力，我还是选择一种自己好理解的方式实现。</p>
<p>最后的效果就是这样：</p>
<p><a href="https://image.luozx.org/garden/2025/02/d2a5a0217c8c25c90354b9f2ee000b00.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1"><img src="https://image.luozx.org/garden/2025/02/d2a5a0217c8c25c90354b9f2ee000b00.png" class="img-fluid"></a></p>



<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <guid>https://luozx.org/posts/tmux-catppuccin.html</guid>
  <pubDate>Mon, 24 Feb 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>给使用wewerss.luozx.org订阅的朋友们一点提示</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/follow-actions.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
注记
</div>
</div>
<div class="callout-body-container callout-body">
<p><code>https://wewerss.luozx.org</code>于2025-11起不再保证提供稳定的服务</p>
</div>
</div>
<p><strong>2025-04-11更新：</strong> 应该是原来的IP被封掉了，无法获取全文，今天有空重新部署到了新的小机上。 RSS应该可以正常获取全文了。</p>
<hr>
<p>我使用<a href="../posts/wewerss.html">wewerss</a>订阅一些自己喜欢的微信公众号。 不久前，升级到了2.6.1版本，但是遇到了「无法获取全文」的问题。</p>
<p>之前没有什么困扰的原因是，平时都喜欢跳转原站去看，RSS大多时候当作内容更新的提醒工具在用，而不是主要的阅读工具。 其次，自己关注的公众号也不多，对于想直接阅读的内容，之前通过<a href="https://github.com/cooderl/wewe-rss/issues/290#issuecomment-2567240893">「查看全文」</a>的方式，临时预览。</p>
<p>不过最近有些内容，跳转原站去看也没有什么必要，比如<a href="https://mp.weixin.qq.com/s/7o-Oir19Wruq66KVbRR0Uw">汇总类信息</a>。 每一篇内容手动去点「查看全文」，也是有点麻烦。</p>
<p>正好，Follow提供了一些自动化手段。目前使用的版本是0.3.6</p>
<p><a href="https://image.luozx.org/garden/2025/02/192dd3e4aeac05e41d28a485fd4fa5dd.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1"><img src="https://image.luozx.org/garden/2025/02/192dd3e4aeac05e41d28a485fd4fa5dd.png" class="img-fluid"></a></p>
<p>在「Actions」里可以设置自动化规则：当RSS的链接（Feed URL）来自wewerss.luozx.org时，自动点击「查看全文」（View source content）。</p>
<p><a href="https://image.luozx.org/garden/2025/02/b45657a20a52b063f368791496ab1035.png" class="lightbox" data-gallery="quarto-lightbox-gallery-2"><img src="https://image.luozx.org/garden/2025/02/b45657a20a52b063f368791496ab1035.png" class="img-fluid"></a></p>
<p>这样设置以后，阅读起来就更轻松了。</p>



<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <guid>https://luozx.org/posts/follow-actions.html</guid>
  <pubDate>Sat, 22 Feb 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>查找子域名的工具</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/finding-subdomains.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<section id="在线工具" class="level1">
<h1>在线工具</h1>
<ul>
<li><a href="https://crt.sh">crt.sh</a></li>
<li><a href="https://cloud.projectdiscovery.io/">projectdiscovery</a></li>
</ul>
</section>
<section id="本地工具" class="level1">
<h1>本地工具</h1>
<ul>
<li><a href="https://github.com/aboul3la/Sublist3r">Sublist3r</a>(Python)</li>
</ul>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">uv</span> tool run sublist3r <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-d</span> example.com</span></code></pre></div></div>
<div class="callout callout-style-simple callout-none no-icon">
<div class="callout-body d-flex">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-body-container">
<p>uv tool <a href="https://docs.astral.sh/uv/concepts/tools/">docs</a></p>
</div>
</div>
</div>


</section>

<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <guid>https://luozx.org/posts/finding-subdomains.html</guid>
  <pubDate>Sun, 26 Jan 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>可以信赖的输入法：RIME</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/rime.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<p>输入法经常被诟病问题有：</p>
<ul>
<li>隐私：是否在用户不知情的情况下记录并上传用户的敏感内容？</li>
<li>广告：莫名奇妙的广告弹窗。</li>
</ul>
<p><a href="https://rime.im/code/">RIME</a>是开源的输入法，上述问题的风险被降到了最低。</p>
<p>不过RIME的配置比较复杂，需要一定学习成本，对于想要开箱即用的用户来说，实在是有点劝退。 但是请相信，跨越这个门槛之后，会相当轻松。</p>
<p>RIME分为核心引擎和客户端，不同的操作系统客户端名称也不同：</p>
<ul>
<li>Windows客户端：小狼毫（weasel）</li>
<li>macOS客户端：鼠须管（squirrel）</li>
<li>Linux客户端：ibus-rime</li>
</ul>
<p>RIME的文档写的很详细，不过由于是繁体，并且语言习惯也不同于大陆，所以有时候理解起来会有一点困难。 对于大部分用户来说，你不需要制作自己的输入方案，因此了解一些基本概念和逻辑，就可以使用了。</p>
<p>下面根据自己的经验，以macOS客户端鼠须管（squirrel）为例，尝试将一些关键概念解释清楚，帮助想要使用RIME的用户更好上手。</p>
<section id="安装路径和文件用途" class="level1">
<h1>安装路径和文件用途</h1>
<p>鼠须管安装的所有文件都在<code>~/Library/Rime</code>目录下。你可以在终端中输入<code>cd ~/Library/Rime</code>进入该目录。</p>
<p><a href="https://image.luozx.org/garden/2025/01/45156b4e1e92f0199b2f97dd9fd89bcb.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1"><img src="https://image.luozx.org/garden/2025/01/45156b4e1e92f0199b2f97dd9fd89bcb.png" class="img-fluid"></a></p>
<p>有几种类型的文件需要关注:</p>
<section id="以schema.yaml结尾的文件-是基础输入方案" class="level2">
<h2 class="anchored" data-anchor-id="以schema.yaml结尾的文件-是基础输入方案">以<code>schema.yaml</code>结尾的文件: 是(基础)输入方案</h2>
<p>比如<code>明月拼音</code>输入方案，对应的文件是<code>luna_pinyin.schema.yaml</code>。</p>
<p><code>小鹤双拼</code>输入方案，对应的文件是<code>double_pinyin_flypy.schema.yaml</code></p>
<section id="输入方案.custom.yaml-在基础方案上自定义的配置" class="level3">
<h3 class="anchored" data-anchor-id="输入方案.custom.yaml-在基础方案上自定义的配置"><code>输入方案.custom.yaml</code>: 在基础方案上自定义的配置</h3>
<p>比如文件<code>double_pinyin_flypy.custom.yaml</code>，就是在原有的小鹤双拼方案上添加自定义的配置。 这些自定义配置如输入<code>/fs</code>(分数)就会输出如下候选词：</p>
<div class="quarto-layout-panel" data-layout="[[],[1,8]]">
<div class="quarto-layout-row">

</div>
<div class="quarto-layout-row">
<div class="quarto-layout-cell" style="flex-basis: 11.1%;justify-content: center;">
<p><a href="https://image.luozx.org/garden/2025/01/24c8aaaabfbd620f5c1f0d63a5ba4999.png" class="lightbox" data-gallery="quarto-lightbox-gallery-2"><img src="https://image.luozx.org/garden/2025/01/24c8aaaabfbd620f5c1f0d63a5ba4999.png" class="img-fluid"></a></p>
</div>
<div class="quarto-layout-cell" style="flex-basis: 88.9%;justify-content: center;">
<p><a href="https://image.luozx.org/garden/2025/01/ffbc278bc346cfaf4eb52db4d3dd7cda.png" class="lightbox" data-gallery="quarto-lightbox-gallery-3"><img src="https://image.luozx.org/garden/2025/01/ffbc278bc346cfaf4eb52db4d3dd7cda.png" class="img-fluid"></a></p>
</div>
</div>
</div>
<div class="grid">
<div class="g-col-4">
<p>输入<code>date</code>就会输出当前日期：</p>
</div>
<div class="g-col-2">
<div class="quarto-figure quarto-figure-right">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2025/01/461d684b07ae45fc2379e01fb1d8ed50.png" class="lightbox" data-gallery="quarto-lightbox-gallery-4"><img src="https://image.luozx.org/garden/2025/01/461d684b07ae45fc2379e01fb1d8ed50.png" class="quarto-figure quarto-figure-right figure-img" height="300"></a></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="以dict.yaml结尾的文件-词库" class="level2">
<h2 class="anchored" data-anchor-id="以dict.yaml结尾的文件-词库">以<code>dict.yaml</code>结尾的文件: 词库</h2>
<p>词库文件通常被自定义输入方案(custom.yaml)引用，来扩充对应方案的词库。</p>
</section>
<section id="default.custom.yaml-设置输入法" class="level2">
<h2 class="anchored" data-anchor-id="default.custom.yaml-设置输入法"><code>default.custom.yaml</code>: 设置输入法</h2>
<p>尽管在<code>~/Library/Rime/</code>文件夹下有许多输入方案文件（schema.yaml）并不意味着它们都会被加载。 具体加载哪些输入方案，输入方案的显示顺序，是由<code>default.custom.yaml</code>文件决定的。</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2025/01/75adc40a9f4c467bf6cbae986b9c8265.png" class="lightbox" data-gallery="quarto-lightbox-gallery-5" title="default.custom.yaml"><img src="https://image.luozx.org/garden/2025/01/75adc40a9f4c467bf6cbae986b9c8265.png" class="img-fluid figure-img" alt="default.custom.yaml"></a></p>
<figcaption>default.custom.yaml</figcaption>
</figure>
</div>
<p>当我同时按下<span class="visually-hidden">Ctrl</span><span class="visually-hidden">`</span>(或者按下<span class="visually-hidden">F4</span>)键切换输入方案时，就会显示如下列表:</p>
<div class="quarto-figure quarto-figure-right">
<figure class="figure">
<p><a href="https://image.luozx.org/garden/2025/01/ba77414263d0b42454337241d27bb494.png" class="lightbox" data-gallery="quarto-lightbox-gallery-6"><img src="https://image.luozx.org/garden/2025/01/ba77414263d0b42454337241d27bb494.png" class="img-fluid quarto-figure quarto-figure-right figure-img" width="200"></a></p>
</figure>
</div>
</section>
<section id="squirrel.custom.yaml-客户端配置" class="level2">
<h2 class="anchored" data-anchor-id="squirrel.custom.yaml-客户端配置"><code>squirrel.custom.yaml</code>: 客户端配置</h2>
<p>用来设置皮肤，某些应用默认输入状态（中文或者英文）等。</p>
</section>
</section>
<section id="开始使用" class="level1">
<h1>开始使用</h1>
<p>我推荐使用其他人已经做好的配置，然后根据自己的需要进行调整。</p>
<p>自己最开始使用的方案是<a href="https://github.com/ssnhd/rime">ssnhd</a>的配置，文档写的相当详细，按照步骤进行安装，基本上开始直接使用。</p>
<p>另外一个推荐方案是<a href="https://github.com/iDvel/rime-ice">雾凇拼音</a>，它的词库经常更新。</p>
<p>由于自己已经习惯使用ssnhd的配置，但是自己想要使用雾凇拼音的词库， 所以目前的情况是使用ssnhd的配置+雾凇拼音的词库。</p>
</section>
<section id="扩充词库" class="level1">
<h1>扩充词库</h1>
<p>第一次添加词库，我是通过手动的方式，拷贝了雾凇拼音的词库文件（<code>cn_dicts</code> <code>en_dicts</code> <code>hopencc</code>）</p>
<p>如果你也想添加雾凇拼音的词库，并且不想完全使用雾凇的方案，拷贝了词库文件夹后，可以参考下面的步骤:</p>
<ol type="1">
<li><p>找到你的主输入方案的自定义配置，比如小鹤双拼的自定义配置：<code>double_pinyin_flypy.custom.yaml</code> 找到主翻译器，例如我<a href="https://github.com/0ptimista/dotfiles/blob/2152fb08cce10ff4be5c9e929f42010a44b33915/Library/Rime/double_pinyin_flypy.custom.yaml#L47">这里</a> 使用的是<code>luna_pinyin.extended</code>，然后向其中<a href="https://github.com/0ptimista/dotfiles/blob/2152fb08cce10ff4be5c9e929f42010a44b33915/Library/Rime/luna_pinyin.extended.dict.yaml#L11">添加词库列表</a></p></li>
<li><p>重新部署输入法，然后就可以使用雾凇拼音的词库了。</p></li>
</ol>
</section>
<section id="更新词库" class="level1">
<h1>更新词库</h1>
<p>雾凇拼音提供通过<a href="https://github.com/iDvel/rime-ice/tree/main?tab=readme-ov-file#%E4%B8%9C%E9%A3%8E%E7%A0%B4-plum">东风破</a>（英文：plum） 更新词库方式。</p>
<p>在Mac上按照<a href="https://github.com/rime/plum?tab=readme-ov-file#advanced-usage">指南</a>安装东风破，会安装在<code>~/plum/</code> 文件夹下。使用前需要进入这个文件夹，然后执行</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bash</span> rime-install iDvel/rime-ice:others/recipes/all_dicts</span></code></pre></div></div>
<p>更新所有词库</p>


</section>

<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <guid>https://luozx.org/posts/rime.html</guid>
  <pubDate>Mon, 20 Jan 2025 16:00:00 GMT</pubDate>
</item>
<item>
  <title>想要尝试的几个Python库</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/interested-python-libraries-2024.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<p>偶然的机会，在PyCoder’s Weekly中看到 <a href="https://tryolabs.com/blog/top-python-libraries-2024">Top Python libraries of 2024</a>这篇文章。</p>
<p>Tryolabs做这份列表已经有<a href="https://tryolabs.com/blog/collections/top-python-libraries">10年</a>之久， 能一直坚持下来，也很让人敬佩。</p>
<p>清单中大部分的库都没怎么听说过，挑选了自己可能用得到库，记录下来，以备后续尝试。</p>
<section id="posting" class="level1">
<h1><a href="https://github.com/darrenburns/posting?tab=readme-ov-file">Posting</a></h1>
<p>一个可以在终端使用的HTTP 客户端。看起来很「酷」 <img src="https://raw.githubusercontent.com/darrenburns/posting/refs/heads/main/docs/assets/home-image-ad-15aug24.svg" class="img-fluid"> 注：另一个有着类似TUI的酷酷界面的CLI工具，是<a href="https://github.com/aristocratos/btop">btop</a> <code>top</code>的升级版。</p>
</section>
<section id="marimo" class="level1">
<h1><a href="https://github.com/marimo-team/marimo">marimo</a></h1>
<p>Jupyter Notebook的漂亮版本，漂亮的Web UI就是很吸引人，当然还有很多其他功能。</p>
<div class="quarto-video"><video id="video_shortcode_videojs_video1" class="video-js vjs-default-skin vjs-big-play-centered vjs-fluid" controls="" preload="auto" data-setup="{}" title=""><source src="https://marimo.io/videos/landing/2.mp4"></video></div>
</section>
<section id="whenever" class="level1">
<h1><a href="https://github.com/ariebovenberg/whenever">whenever</a></h1>
<p>专门用来对付夏令时（DST）的问题。虽然对不使用DST的国家和地区没什么影响。 对我来说，处理时间最讨厌的是时区和格式问题，之前用<a href="https://pendulum.eustace.io/">pendulum</a>较多， 不过既然whenever能处理pendulum不能处理的问题，试用一下也是不错的。</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th></th>
<th style="text-align: center;">Whenever</th>
<th style="text-align: center;">datetime</th>
<th style="text-align: center;">Arrow</th>
<th style="text-align: center;">Pendulum</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>DST-safe</td>
<td style="text-align: center;">✅</td>
<td style="text-align: center;">❌</td>
<td style="text-align: center;">❌</td>
<td style="text-align: center;">⚠️</td>
</tr>
<tr class="even">
<td>Typed aware/naive</td>
<td style="text-align: center;">✅</td>
<td style="text-align: center;">❌</td>
<td style="text-align: center;">❌</td>
<td style="text-align: center;">❌</td>
</tr>
<tr class="odd">
<td>Fast</td>
<td style="text-align: center;">✅</td>
<td style="text-align: center;">✅</td>
<td style="text-align: center;">❌</td>
<td style="text-align: center;">❌</td>
</tr>
</tbody>
</table>
</section>
<section id="crawlee-python" class="level1">
<h1><a href="https://github.com/apify/crawlee-python">crawlee-python</a></h1>
<p>最近写了一个简单的Launchpool监控程序， 监听各交易所（目前支持Bybit和Binance）新的Launchpool活动， 然后通过Temegram频道通知出来。</p>
<p>用到Beautifulsoup和Selenium，对爬虫不是很了解，选择了以前听说过的Senlenium做为组件的一部分。 虽然能用，但是需要启动<a href="../posts/run-python-with-selenium-in-docker.html">两个容器</a> crawlee结合了<a href="https://github.com/microsoft/playwright">Playwright</a> 后面有时间就试试看。</p>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
提示
</div>
</div>
<div class="callout-body-container callout-body">
<p>如果你对那个频道有兴趣，老板二楼包间请：<a href="https://t.co/VzAj6we0Nu">💰钱来</a></p>
</div>
</div>
<p>还有两个库，可能用不到，但是留个备忘</p>
<ul>
<li><a href="https://github.com/gauge-sh/tach">tach</a></li>
<li><a href="https://github.com/igrek51/wat">wat</a></li>
</ul>
<p>清单按照「通用」和「机器学习/人工智能」两个类别来分类，可惜的是没有看到「可视化」类别。</p>
<p>和可视化沾边一点的是<a href="https://github.com/rio-labs/rio">Rio</a>，一个构建WebApp框架，但是太新了，还没有到生产就绪的阶段。</p>
<p>工作的时候用Streamlit做了一些数据报表/看板，目前打算换用<a href="https://reflex.dev/">Reflex</a> 试一试。</p>


</section>

<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <guid>https://luozx.org/posts/interested-python-libraries-2024.html</guid>
  <pubDate>Tue, 31 Dec 2024 16:00:00 GMT</pubDate>
</item>
<item>
  <title>无需插件：Neovim格式化Markdown表格（macOS）</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/formatting-markdown-table-in-neovim-on-macos.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<p>我通常用Neovim(Lazyvim)和Quarto写文章，<a href="https://github.com/quarto-dev/quarto-nvim">quarto-nvim</a> 提供了良好的集成，但今天我想格式化一个Markdown表格的时候， 并没有发现内置的集成。</p>
<p>好在Heitorpb的这篇<a href="https://heitorpb.github.io/bla/format-tables-in-vim/">博客</a>有无需插件，利用Linux内置命令就实现 格式化表格的方法。</p>
<p>在macOS上运行Heitorpb提供的命令:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">column</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-s</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'|'</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-o</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'|'</span></span></code></pre></div></div>
<p>并不能正常工作。 是因为macOS的<code>column</code> 是BSD版本，不支持<code>-o</code>选项。</p>
<p>需要额外安装<a href="https://formulae.brew.sh/formula/util-linux#default">util-linux</a></p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">brew</span> install util-linux</span></code></pre></div></div>
<p>由于macOS内置的<code>column</code> 在<code>$PATH</code>中优先级更高，如果你不想修改rc文件， 可以通过<code>brew info util-linux</code>找到<code>column</code>的绝对路径，使用绝对路径调用。</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">/opt/homebrew/opt/util-linux/bin/column</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-s</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'|'</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-o</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'|'</span></span></code></pre></div></div>



<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <guid>https://luozx.org/posts/formatting-markdown-table-in-neovim-on-macos.html</guid>
  <pubDate>Wed, 25 Dec 2024 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Python,Selenium和Docker</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/run-python-with-selenium-in-docker.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<p>分别单独运行Selenium的容器和包含Python代码的容器。 在Pyton中使用如下方式连接到Selenium容器：</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> selenium <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> webdriver</span>
<span id="cb1-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _init_driver(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>): </span>
<span id="cb1-3">        chrome_options <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Options()</span>
<span id="cb1-4">        chrome_options.add_argument(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--headless"</span>)</span>
<span id="cb1-5">        chrome_options.add_argument(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--disable-gpu"</span>)</span>
<span id="cb1-6">        chrome_options.add_argument(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--no-sandbox"</span>)</span>
<span id="cb1-7">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> webdriver.Remote(</span>
<span id="cb1-8">            command_executor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'http://selenium:4444/wd/hub'</span>,</span>
<span id="cb1-9">            options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>chrome_options</span>
<span id="cb1-10">        )</span></code></pre></div></div>
<p><code>http://selenium:4444</code>是关键，其中是Selenium容器的名称。</p>
<p>在启动Python容器之前，先启动Selenium容器：</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">docker</span> network create my-network</span>
<span id="cb2-2"></span>
<span id="cb2-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">docker</span> run <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-d</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--name</span> selenium <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--network</span> my-network <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-p</span> 4444:4444 <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-e</span> SE_NODE_MAX_SESSIONS=2 <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-e</span> SE_NODE_OVERRIDE_MAX_SESSIONS=true <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-e</span> SE_SESSION_REQUEST_TIMEOUT=300 <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-e</span> SE_SESSION_RETRY_INTERVAL=2 <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-e</span> SE_START_XVFB=false <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-e</span> DISABLE_TELEMETRY=true <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-e</span> SE_OTEL_TRACES_ENABLED=false <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-14">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-e</span> SE_ENABLE_TRACING=false <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb2-15">  selenium/standalone-chrome</span></code></pre></div></div>
<p>为了让Python容器中连接到Selenium容器，需要在同一个网络中启动Python容器：</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">docker</span> run <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-d</span>  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--name</span> my-python-service<span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb3-2"> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--network</span> my-network <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb3-3"> ghcr.io/my-python-service:latest</span></code></pre></div></div>
<p>Docker Compose:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># docker-compose.yml</span></span>
<span id="cb4-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">version:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'3.9'</span></span>
<span id="cb4-3"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">services:</span></span>
<span id="cb4-4">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">selenium:</span></span>
<span id="cb4-5">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">image:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'selenium/standalone-chrome:latest'</span></span>
<span id="cb4-6">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">container_name:</span> selenium</span>
<span id="cb4-7">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">environment:</span></span>
<span id="cb4-8">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">-</span> SE_NODE_MAX_SESSIONS=2</span>
<span id="cb4-9">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">-</span> SE_NODE_OVERRIDE_MAX_SESSIONS=true</span>
<span id="cb4-10">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">-</span> SE_SESSION_REQUEST_TIMEOUT=300</span>
<span id="cb4-11">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">-</span> SE_SESSION_RETRY_INTERVAL=2</span>
<span id="cb4-12">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">-</span> SE_START_XVFB=false</span>
<span id="cb4-13">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">-</span> DISABLE_TELEMETRY=true</span>
<span id="cb4-14">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">-</span> SE_OTEL_TRACES_ENABLED=false</span>
<span id="cb4-15">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">-</span> SE_ENABLE_TRACING=false</span>
<span id="cb4-16">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ports:</span></span>
<span id="cb4-17">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'4444:4444'</span></span>
<span id="cb4-18">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">networks:</span></span>
<span id="cb4-19">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">-</span> my-custome-network</span>
<span id="cb4-20">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">my-python-service:</span></span>
<span id="cb4-21">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">image:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'my-python-service:latest'</span></span>
<span id="cb4-22">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">container_name:</span> my-python-service</span>
<span id="cb4-23">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">depends_on:</span></span>
<span id="cb4-24">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">-</span> selenium</span>
<span id="cb4-25">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">networks:</span></span>
<span id="cb4-26">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">-</span> my-custome-network</span>
<span id="cb4-27">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">volumes:</span></span>
<span id="cb4-28">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">-</span> ./data:/app/data</span>
<span id="cb4-29">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">environment:</span></span>
<span id="cb4-30">      <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'SELENIUM_URL=http://selenium:4444/wd/hub'</span></span>
<span id="cb4-31">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">command:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'python3 src/main.py'</span></span>
<span id="cb4-32"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">networks:</span></span>
<span id="cb4-33">  <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">my-custome-network:</span></span>
<span id="cb4-34">    <span class="ex" style="color: null;
background-color: null;
font-style: inherit;">driver:</span> bridge</span></code></pre></div></div>



<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <category>tome-of-xp</category>
  <guid>https://luozx.org/posts/run-python-with-selenium-in-docker.html</guid>
  <pubDate>Thu, 28 Nov 2024 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Cloudflare R2和博客图床</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/blog-image-hosting-with-cf-r2.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<p>在博客中插入图片对我来说一直是一个很烦人的事情。 如果你看过前几篇文章的<a href="https://github.com/0ptimista/Garden/tree/main/posts/follow-the-app">源代码</a>， 都有一个<code>images</code>文件夹，里面存放着所有的和文章相关的图片。</p>
<p>如果在一些在线平台写文章，比如<a href="https://quail.ink">Quail</a>，<a href="https://ghost.org">Ghost</a>， 都会提供方便的「拷贝」「粘贴」方式。也不用考虑图片文件的名称问题，路径问题。</p>
<p>想要找到一个存图片的地方，并不是难事。 但是想要简化写文章时截图，存储，插入图片链接的流程，一直没有找到好的方式。</p>
<p><a href="https://piclist.cn">PicList</a>很大程度上加快了上述流程，也是现在一直使用的方式。</p>
<p>PicList是PicGo的改进版本，这两款工具都可以实现核心功能，下面以PicList为例，介绍一下基本流程。</p>
<section id="配置图片存储位置" class="level1">
<h1>配置图片存储位置</h1>
<p>PicList支持多种图片存储位置，我的域名托管在Cloudflare，就选择了Cloudflare R2作为图片存储。 R2是一种对象存储服务，大多数对象存储服务都提供和AWS对象存储（S3）兼容的API。</p>
<p>所以PicList对于对象存储类的配置，基本上都可以通过AWS S3来配置。</p>
<p><a href="https://image.luozx.org/garden/2024/11/d4659be5043d90eb35e89bc8806a828b.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1"><img src="https://image.luozx.org/garden/2024/11/d4659be5043d90eb35e89bc8806a828b.png" class="img-fluid"></a></p>
<p>Cloudflare R2对免费用户提供了<a href="https://developers.cloudflare.com/r2/pricing/#free-tier">每月10GB的存储空间</a>，大多数情况下足够使用。</p>
<p>创建存储桶（Bucket），生成上传图片的密钥。</p>
<p><a href="https://image.luozx.org/garden/2024/11/eb55f6cd46ec9e9fc9269381cb6bbfea.png" class="lightbox" data-gallery="quarto-lightbox-gallery-2"><img src="https://image.luozx.org/garden/2024/11/eb55f6cd46ec9e9fc9269381cb6bbfea.png" class="img-fluid"></a></p>
<p>密钥权限选择<code>读写</code>，可以给让密钥访问指定的存储桶，或者所有存储桶。</p>
<p><a href="https://image.luozx.org/garden/2024/11/ac258b59f53a512bdd4ae2ebe69a647f.png" class="lightbox" data-gallery="quarto-lightbox-gallery-3"><img src="https://image.luozx.org/garden/2024/11/ac258b59f53a512bdd4ae2ebe69a647f.png" class="img-fluid"></a></p>
<p>在PicList中配置Cloudflare R2的密钥，存储桶，和自定义端点。(Cloudflare页面上都有提供) <img src="https://image.luozx.org/garden/2024/11/43be17fb74afeaacee601fcf9c92996f.png" class="img-fluid"></p>
</section>
<section id="上传图片" class="level1">
<h1>上传图片</h1>
<p><a href="https://image.luozx.org/garden/2024/11/fb5619236b5c0842045bf80582ede029.png" class="lightbox" data-gallery="quarto-lightbox-gallery-4"><img src="https://image.luozx.org/garden/2024/11/fb5619236b5c0842045bf80582ede029.png" class="img-fluid"></a></p>
</section>
<section id="cloudflare-r2注意事项" class="level1">
<h1>Cloudflare R2注意事项</h1>
<p>R2上的图片一经删除就无法恢复，所以在删除图片时要谨慎。</p>


</section>

<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <category>tome-of-xp</category>
  <guid>https://luozx.org/posts/blog-image-hosting-with-cf-r2.html</guid>
  <pubDate>Fri, 22 Nov 2024 16:00:00 GMT</pubDate>
</item>
<item>
  <title>Kill the Newsletter!</title>
  <dc:creator>Luozx </dc:creator>
  <link>https://luozx.org/posts/newsletter-to-rss-feed.html</link>
  <description><![CDATA[ 

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVV5S5NQ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->




<p>习惯了用RSS订阅自己想接收的信息，但凡浏览到好内容，下意识的会去检查RSSHub上有没有可订阅的红色提示。</p>
<p>如果没有，还会在Follow中搜索关键字，尝试检索订阅源。（也许<a href="../posts/wewerss.html">公开的乐趣</a>中，那位朋友就是这样找到我的RSS源的）</p>
<p>最糟糕的是这种情况：通过上面两个步骤都找不到RSS订阅源，网站只提供了邮件列表订阅。</p>
<p>好在RSS存在的够久，已经让RSS爱好者解决了这个需求。 <a href="https://kill-the-newsletter.com/">Kill the Newsletter</a>就是这样一个工具。</p>
<section id="kill-the-newsletter" class="level1">
<h1>Kill the Newsletter</h1>
<p>只需要三步，你就可以通过它将邮件列表转换为一个RSS Feed</p>
<ol type="1">
<li>给你的RSS Feed起一个标题，用来标识这是一个什么网站/作者 <img src="https://image.luozx.org/garden/2024/11/f3204028d0b4a9f9ce830667a996b9eb.png" class="img-fluid"></li>
<li>使用它提供的邮箱地址，订阅你想要的邮件列表。</li>
</ol>
<p><a href="https://image.luozx.org/garden/2024/11/d123dffc566a8a88010d95821244849a.png" class="lightbox" data-gallery="quarto-lightbox-gallery-1"><img src="https://image.luozx.org/garden/2024/11/d123dffc566a8a88010d95821244849a.png" class="img-fluid"></a></p>
<p>通常情况下，你会收到一封确认邮件。就需要进行下一步</p>
<ol start="3" type="1">
<li>使用它提供的RSS Feed地址，添加到你的阅读器中，会收到邮件列表发来的确认邮件。 <img src="https://image.luozx.org/garden/2024/11/2fc81e5145efca9d84d2e1d725055e39.png" class="img-fluid"></li>
</ol>
<p>并且在内容的最底部，kill-the-newsletter会自动添加一个链接，用来设置订阅信息。</p>
</section>
<section id="follow-inbox" class="level1">
<h1>Follow Inbox</h1>
<p>Follow提供个人邮箱，用这个邮箱地址可以用来接收不提供RSS Feed的Newsletter。 <img src="https://image.luozx.org/garden/2024/11/e248b4d8031938f4646a986c2f56aafd.png" class="img-fluid"></p>
<p>下面是订阅<a href="https://realpython.com">Real Python</a>的样子，不喜欢用Feed的朋友，用这个功能也蛮不错。 <img src="https://image.luozx.org/garden/2024/11/2647357614b785d26c3aab874f815832.png" class="img-fluid"></p>
<p>关于Follow的其他功能，可以再<a href="../posts/follow-the-app/follow-the-app.html">这里</a>找到</p>


</section>

<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> 回到顶部</a><div id="quarto-appendix" class="default"><section class="quarto-appendix-contents" id="quarto-reuse"><h2 class="anchored quarto-appendix-heading">二次使用</h2><div class="quarto-appendix-contents"><div><a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a></div></div></section></div> ]]></description>
  <category>tools</category>
  <category>tome-of-xp</category>
  <guid>https://luozx.org/posts/newsletter-to-rss-feed.html</guid>
  <pubDate>Mon, 11 Nov 2024 16:00:00 GMT</pubDate>
</item>
</channel>
</rss>
