<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ElvishのBlog]]></title><description><![CDATA[尘隅]]></description><link>https://elvish.me</link><image><url>https://elvish.me/favicon.svg</url><title>ElvishのBlog</title><link>https://elvish.me</link></image><generator>Yohaku (https://github.com/Innei/Yohaku)</generator><lastBuildDate>Fri, 30 Oct 2026 19:28:19 GMT</lastBuildDate><atom:link href="https://elvish.me/feed" rel="self" type="application/rss+xml"/><pubDate>Fri, 30 Oct 2026 19:28:19 GMT</pubDate><language><![CDATA[zh-CN]]></language><item><title><![CDATA[自建 Vanity Name Servers]]></title><description><![CDATA[<p>往原址览之：<a href="https://elvish.me/posts/tinkering/vanity-ns">https://elvish.me/posts/tinkering/vanity-ns</a></p>]]></description><link>https://elvish.me/posts/tinkering/vanity-ns</link><guid isPermaLink="true">https://elvish.me/posts/tinkering/vanity-ns</guid><dc:creator><![CDATA[Elvish]]></dc:creator><pubDate>Sun, 18 Oct 2026 05:22:15 GMT</pubDate></item><item><title><![CDATA[Calabiyau Carnival 2026]]></title><description><![CDATA[<p>往原址览之：<a href="https://elvish.me/notes/3">https://elvish.me/notes/3</a></p>]]></description><link>https://elvish.me/notes/3</link><guid isPermaLink="true">https://elvish.me/notes/3</guid><dc:creator><![CDATA[Elvish]]></dc:creator><pubDate>Fri, 07 Aug 2026 02:37:15 GMT</pubDate></item><item><title><![CDATA[华为AX3 Pro路由器设备在线状态监控]]></title><description><![CDATA[<p>往原址览之：<a href="https://elvish.me/posts/tinkering/huawei-router-ha">https://elvish.me/posts/tinkering/huawei-router-ha</a></p>]]></description><link>https://elvish.me/posts/tinkering/huawei-router-ha</link><guid isPermaLink="true">https://elvish.me/posts/tinkering/huawei-router-ha</guid><dc:creator><![CDATA[Elvish]]></dc:creator><pubDate>Wed, 05 Aug 2026 12:46:15 GMT</pubDate></item><item><title><![CDATA[YohakuCompanion for Windows]]></title><description><![CDATA[<p>往原址览之：<a href="https://elvish.me/posts/coding/yohaku-companion-windows">https://elvish.me/posts/coding/yohaku-companion-windows</a></p>]]></description><link>https://elvish.me/posts/coding/yohaku-companion-windows</link><guid isPermaLink="true">https://elvish.me/posts/coding/yohaku-companion-windows</guid><dc:creator><![CDATA[Elvish]]></dc:creator><pubDate>Sun, 19 Jul 2026 09:54:17 GMT</pubDate></item><item><title><![CDATA[如何制作一个单svg动画签名]]></title><description><![CDATA[<p>往原址览之：<a href="https://elvish.me/posts/tinkering/animated-signature-svg">https://elvish.me/posts/tinkering/animated-signature-svg</a></p>]]></description><link>https://elvish.me/posts/tinkering/animated-signature-svg</link><guid isPermaLink="true">https://elvish.me/posts/tinkering/animated-signature-svg</guid><dc:creator><![CDATA[Elvish]]></dc:creator><pubDate>Fri, 26 Jun 2026 11:30:02 GMT</pubDate></item><item><title><![CDATA[在docker中使用ArchiSteamFarm自动挂卡]]></title><description><![CDATA[<p>往原址览之：<a href="https://elvish.me/posts/tinkering/archisteamfarm-docker">https://elvish.me/posts/tinkering/archisteamfarm-docker</a></p>]]></description><link>https://elvish.me/posts/tinkering/archisteamfarm-docker</link><guid isPermaLink="true">https://elvish.me/posts/tinkering/archisteamfarm-docker</guid><dc:creator><![CDATA[Elvish]]></dc:creator><pubDate>Sun, 21 Jun 2026 08:50:34 GMT</pubDate></item><item><title><![CDATA[SSH登录Gotify通知脚本]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://elvish.me/posts/coding/ssh-login-gotify-script">https://elvish.me/posts/coding/ssh-login-gotify-script</a></blockquote><div><h1 id="">前言</h1><p>参考：</p><p><a href="https://community.hetzner.com/tutorials/ssh-notification-with-ntfy">https://community.hetzner.com/tutorials/ssh-notification-with-ntfy</a></p><h2 id="">功能</h2><ol start="1"><li><p>登录通知：当用户通过SSH登录时，向Gotify发送通知，包含</p><ul><li>登录用户</li><li>IP</li><li>主机名</li><li>地理位置</li><li>时间</li></ul></li><li><p>排除项：排除来自局域网和服务器自己公网ip的连接</p></li></ol><p>通知示例：</p><blockquote><p>用户 elvish 从 114.51.14.11 登录到 Ubuntu-24.04-server<br/>时间: 2026-01-01 10:00:00 CST<br/>🌍 位置: Shanghai, Shanghai, CN 🇨🇳</p></blockquote>
<h2 id="">说明</h2><ol start="1"><li>地理位置服务使用ipinfo.io的API通过ip地址反推，有速率限制</li><li>脚本会在每次SSH登录时执行，包括非交互式登录（如SCP、SFTP等）</li></ol><h1 id="">使用说明</h1><h3 id="1-">1. 创建脚本：</h3><pre class="language-bash lang-bash"><code class="language-bash lang-bash">sudo nano /usr/local/bin/ssh-login-notify.sh
</code></pre><p>粘贴以下内容：</p><pre class="language-shell lang-shell"><code class="language-shell lang-shell">
#!/bin/bash

USER_NAME=$PAM_USER
HOST_NAME=$(hostname)
TIME_NOW=$(TZ=Asia/Shanghai date &quot;+%Y-%m-%d %H:%M:%S %Z&quot;)
GOTIFY_URL=&quot;http://127.0.0.1:8118&quot;  # &lt;- 更改此处的地址和token
GOTIFY_TOKEN=&quot;&lt;GOTIFY_TOKEN&gt;&quot;

# 获取IP地址 - 修复SFTP连接显示问题
if [ -n &quot;$SSH_CONNECTION&quot; ]; then
  IP_ADDRESS=$(echo $SSH_CONNECTION | awk &#x27;{print $1}&#x27;)
else
  # 回退到who命令，但过滤掉无效的输出
  IP_ADDRESS=$(who | awk &#x27;{print $5}&#x27; | grep -Eo &#x27;([0-9]{1,3}\.){3}[0-9]{1,3}&#x27; | head -n 1)
fi

[ -z &quot;$IP_ADDRESS&quot; ] &amp;&amp; IP_ADDRESS=&quot;unknown&quot;

# 获取服务器的公网IP地址
get_server_public_ip() {
  # 尝试通过不同方式获取公网IP
  local public_ip=&quot;&quot;
  
  # 方法1: 使用dig查询DNS
  public_ip=$(dig +short myip.opendns.com @resolver1.opendns.com 2&gt;/dev/null)
  
  # 方法2: 使用curl查询外部服务
  if [ -z &quot;$public_ip&quot; ]; then
    public_ip=$(curl -s http://ifconfig.me 2&gt;/dev/null)
  fi
  
  # 方法3: 使用hostname命令
  if [ -z &quot;$public_ip&quot; ]; then
    public_ip=$(hostname -I | awk &#x27;{print $1}&#x27; 2&gt;/dev/null)
  fi
  
  echo &quot;$public_ip&quot;
}

# 检查是否为局域网、回环地址或服务器自身公网IP
is_local_or_self_ip() {
  local ip=$1
  # 回环地址
  if [[ $ip == &quot;127.0.0.1&quot; || $ip == &quot;::1&quot; || $ip == &quot;localhost&quot; ]]; then
    return 0
  fi
  
  # 私有IP地址范围
  if [[ $ip =~ ^10\. ]] || \
     [[ $ip =~ ^172\.(1[6-9]|2[0-9]|3[0-1])\. ]] || \
     [[ $ip =~ ^192\.168\. ]] || \
     [[ $ip =~ ^169\.254\. ]]; then
    return 0
  fi
  
  # 获取服务器公网IP
  local server_public_ip=$(get_server_public_ip)
  
  # 检查是否为服务器自身公网IP
  if [[ &quot;$ip&quot; == &quot;$server_public_ip&quot; ]]; then
    return 0
  fi
  
  # 不是本地IP或自身公网IP
  return 1
}

# 如果是局域网、回环地址或服务器自身公网IP，直接退出
if is_local_or_self_ip &quot;$IP_ADDRESS&quot;; then
  exit 0
fi

# 如果是会话关闭，退出
if [[ $PAM_TYPE == &#x27;close_session&#x27; ]]; then
  exit 0
fi

# 获取地理位置信息（可选）
GEO_INFO=&quot;&quot;
if [[ &quot;$IP_ADDRESS&quot; != &quot;unknown&quot; &amp;&amp; &quot;$IP_ADDRESS&quot; != &quot;127.0.0.1&quot; &amp;&amp; &quot;$IP_ADDRESS&quot; != ::1 ]]; then
  GEO_JSON=$(curl -s &quot;https://ipinfo.io/$IP_ADDRESS/json&quot;)
  CITY=$(echo &quot;$GEO_JSON&quot; | jq -r &#x27;.city&#x27;)
  REGION=$(echo &quot;$GEO_JSON&quot; | jq -r &#x27;.region&#x27;)
  COUNTRY=$(echo &quot;$GEO_JSON&quot; | jq -r &#x27;.country&#x27;)
  ORG=$(echo &quot;$GEO_JSON&quot; | jq -r &#x27;.org&#x27;)
  
  # 将国家代码转换为国旗表情符号的函数
  flag() {
    local code=&quot;${1^^}&quot;
    local first=$(( $(printf &quot;%d&quot; &quot;&#x27;${code:0:1}&quot;) - 65 + 0x1F1E6 ))
    local second=$(( $(printf &quot;%d&quot; &quot;&#x27;${code:1:1}&quot;) - 65 + 0x1F1E6 ))
    printf &#x27;%b&#x27; &quot;$(printf &#x27;\\U%08X\\U%08X&#x27; &quot;$first&quot; &quot;$second&quot;)&quot;
  }
  
  # 使用Unicode编码的表情符号
  EARTH_ICON=$(printf &#x27;\U1F30D&#x27;)
  GEO_INFO=&quot;$EARTH_ICON 位置: $CITY, $REGION, $COUNTRY $(flag $COUNTRY)&quot;
fi

# 构建消息内容
TITLE=&quot;SSH登录提醒 - $HOST_NAME&quot;
MESSAGE=&quot;用户 $USER_NAME 从 $IP_ADDRESS 登录到 $HOST_NAME
时间: $TIME_NOW
$GEO_INFO&quot;

# 发送到Gotify
if [ -n &quot;$SSH_CONNECTION&quot; ] || [ -n &quot;$SFTP_CONNECTION&quot; ]; then
  curl -s -o /dev/null \
    -X POST \
    -F &quot;title=${TITLE}&quot; \
    -F &quot;message=${MESSAGE}&quot; \
    -F &quot;priority=5&quot; \
    &quot;${GOTIFY_URL}/message?token=${GOTIFY_TOKEN}&quot;
fi


</code></pre>
<h3 id="2-">2. 设置执行权限：</h3><pre class="language-bash lang-bash"><code class="language-bash lang-bash">sudo chmod +x /usr/local/bin/ssh-login-notify.sh
</code></pre>
<h3 id="3-">3. 安装依赖（如果尚未安装）：</h3><pre class="language-bash lang-bash"><code class="language-bash lang-bash">sudo apt update &amp;&amp; sudo apt install jq dnsutils curl -y
</code></pre>
<h3 id="4-pam">4. 配置PAM：</h3><p>编辑SSH的PAM配置文件：</p><pre class="language-bash lang-bash"><code class="language-bash lang-bash">sudo nano /etc/pam.d/sshd
</code></pre>
<p>在文件末尾添加：</p><pre class=""><code class="">session optional pam_exec.so /usr/local/bin/ssh-login-notify.sh
</code></pre>
<h3 id="5-ssh">5. 重启SSH服务：</h3><pre class="language-bash lang-bash"><code class="language-bash lang-bash">sudo systemctl restart sshd
</code></pre></div><p style="text-align:right"><a href="https://elvish.me/posts/coding/ssh-login-gotify-script#comments">览毕，何不一言？</a></p></div>]]></description><link>https://elvish.me/posts/coding/ssh-login-gotify-script</link><guid isPermaLink="true">https://elvish.me/posts/coding/ssh-login-gotify-script</guid><dc:creator><![CDATA[Elvish]]></dc:creator><pubDate>Fri, 15 May 2026 12:38:22 GMT</pubDate></item><item><title><![CDATA[Porkbun付款后订单未完成解决方案]]></title><description><![CDATA[<link rel="preload" as="image" href="https://assets.elvish.me/images/2026/05/13/ozps42qt6uc214uy29.webp"/><link rel="preload" as="image" href="https://assets.elvish.me/images/2026/05/13/s9qa86vto96w4esz95.webp"/><link rel="preload" as="image" href="https://assets.elvish.me/images/2026/05/13/t0kolk3w33tpmjtkpf.webp"/><link rel="preload" as="image" href="https://assets.elvish.me/images/2026/05/13/9id89dcizmz3c6qsko.webp"/><div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://elvish.me/posts/experience/porkbun-order-not-completed-after-payment-solution">https://elvish.me/posts/experience/porkbun-order-not-completed-after-payment-solution</a></blockquote><div><h1 id="">问题状况</h1><p>在Porkbun使用支付宝付款并<strong>完成扣款</strong>后，域名显示未支付并仍在购物车里</p><p><img alt="账单显示 Paid $0.00" height="675" src="https://assets.elvish.me/images/2026/05/13/ozps42qt6uc214uy29.webp" width="1800"/></p><p>网上搜了一下，也有人遇到这样的问题，但是没有给出解决方案</p><p><a href="https://www.nodeseek.com/post-275039-1">https://www.nodeseek.com/post-275039-1</a></p><p><a href="https://www.reddit.com/r/PorkBun/comments/1i7k98w/ive_paid_for_my_transfer_but_its_still_in_the_cart/">https://www.reddit.com/r/PorkBun/comments/1i7k98w/ive_paid_for_my_transfer_but_its_still_in_the_cart/</a></p><p><a href="https://www.rua.ink/807.html">https://www.rua.ink/807.html</a></p><h1 id="">联系客服</h1><p>Porkbun 网站的在线客服简直是灾难</p><p>虽然网页右下角有个 HELP 按钮，但在手机端点不到，而且本质上也是个邮件表单。</p><p>于是直接给客服发邮件，详细列出了订单号、支付宝交易号等信息。</p><pre class="language-txt lang-txt"><code class="language-txt lang-txt">Subject: Payment Completed but Domain Still in Cart

Dear Porkbun Support Team,

I am writing to report an issue with my recent domain registration attempt. Today, I tried to register the domain example.com and completed the payment via Alipay. The payment was successfully deducted from my account, but the domain remains in my shopping cart and has not been registered.

Here are the details for your reference:

· Domain: example.com
· Porkbun Invoice/Order #: XXXXXXX
· Alipay Transaction ID: XXXXXXXXXXXXXXXX
· Merchant Order ID: src_XXXXXXXXXXXXXXXX
· Issue: The invoice in my Porkbun account shows a payment of $0, but the payment was successfully processed via Alipay.

I confirmed that the payment was deducted from my Alipay account, and I have also seen similar reports from other users on Reddit experiencing the same issue with payments via Alipay. I believe this is a technical error on your platform, and I would appreciate your assistance in resolving it promptly.

Could you please investigate this issue and complete the registration for the domain example.com as soon as possible? If additional verification is required from my end, please let me know.

Thank you for your attention to this matter. I look forward to your prompt response.

Best regards,
Elvish
</code></pre>
<p>美国客服效率还行，3 小时后回复了</p><p>但内容完全是标准化的“废话文学”：建议我关掉广告拦截器、VPN，或者换个浏览器重试。</p><p>这显然没用，因为问题在于钱扣了但系统没入账，而不是我的问题。</p><p>我猜测是<strong>Stripe与他们的系统的问题</strong>，商家后台应该有详细的交易记录。</p><p>于是我撰写了一封邮件，详细指出:</p><ol start="1"><li>请去 Stripe 后台 查询<strong>订单号</strong></li><li>附上了 支付宝<strong>交易详情截图</strong></li><li>附上了 <strong>电子回单</strong>（原版和翻译为英文的版本），证明我确实付了钱</li></ol><pre class="language-txt lang-txt"><code class="language-txt lang-txt">Dear NAME,

Thank you for your reply. I would like to clarify that the payment for the domain has already been successfully deducted from my Alipay account.

I notice that you use the Stripe platform to process Alipay payments. Could you please check the status of the specific order src_XXXXXXXXXXXXXXXX in your Stripe merchant dashboard?

I have taken a screenshot of the successful transaction from my Alipay account and also downloaded the official electronic transaction receipt. The original document (protected by a digital signature) is in Chinese. I have attached both the original Chinese receipt and an English translation to this email for your review.

If any other documentation is needed from my side to verify this payment, I am happy to provide it.

If there is an ongoing issue with this specific payment method on your end, I would appreciate it if you could initiate a refund for this transaction (src_XXXXXXXXXXXXXXXX) via your Stripe backend. Once the refund is confirmed, I am willing to complete the purchase for the domain using an alternative method, such as PayPal.

I look forward to your assistance in resolving this matter promptly.

Best regards,

</code></pre>
<p><img src="https://assets.elvish.me/images/2026/05/13/s9qa86vto96w4esz95.webp"/></p><p>一个小时过后，另外一名客服回复道:</p><blockquote><p>It looks like the payment was received, but the order failed. I&#x27;ve added the funds as account credit to your account.</p></blockquote>
<p>承认收到了钱，但订单挂了。</p><p>作为补偿，他们直接把钱充值到了我的 Porkbun 账户余额里。</p><h1 id="">重新下单</h1><p>登录账户一看，余额确实增加了。</p><p><img alt="账户余额已到账" src="https://assets.elvish.me/images/2026/05/13/t0kolk3w33tpmjtkpf.webp"/></p><p>接下来就简单了，再次下单，支付方式选择 Account Credit</p><p><img src="https://assets.elvish.me/images/2026/05/13/9id89dcizmz3c6qsko.webp"/></p><p>这下没出问题了</p><h1 id="">总结</h1><p>在国外一些平台消费，如果有条件，建议<strong>优先使用 PayPal 或 信用卡</strong></p><p>支付宝/Stripe 接口偶尔会出现回调失败的问题，处理起来比较费时费力</p><p>如果遇到类似情况，最好在附件中添加支付宝的交易详情截图和电子回单，尽量一封邮件证明清楚并解决问题</p><pre class="language-txt lang-txt"><code class="language-txt lang-txt">## Urgent: Payment Verified but Order Incomplete - Order #【你的订单号】 &amp; Stripe Charge src_【商家订单号】

Dear Porkbun Support Team,

I am writing to report a payment issue. The payment for my domain 【域名】 was successfully deducted from my Alipay account, but the domain remains in my cart and the invoice (#【你的订单号】) shows as unpaid.

I understand you use Stripe. Could you please check the status of the specific Stripe charge src_【商家订单号】 in your merchant dashboard?

For verification, I have attached:
1. A screenshot of the successful Alipay transaction.
2. The official Alipay e-receipt (original in Chinese + English translation).

If this payment cannot be applied to my order, please refund this charge (src_【商家订单号】) via your Stripe backend. I am then willing to repay immediately via PayPal or another method.

I look forward to your prompt resolution. Thank you.

Best regards,
【你的名字】

【在邮件里附上支付宝扣款截图和中英文电子流水回单】
</code></pre></div><p style="text-align:right"><a href="https://elvish.me/posts/experience/porkbun-order-not-completed-after-payment-solution#comments">览毕，何不一言？</a></p></div>]]></description><link>https://elvish.me/posts/experience/porkbun-order-not-completed-after-payment-solution</link><guid isPermaLink="true">https://elvish.me/posts/experience/porkbun-order-not-completed-after-payment-solution</guid><dc:creator><![CDATA[Elvish]]></dc:creator><pubDate>Wed, 13 May 2026 09:06:41 GMT</pubDate></item><item><title><![CDATA[制作自己的安卓开机动画]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://elvish.me/posts/tinkering/make-custom-boot-animation">https://elvish.me/posts/tinkering/make-custom-boot-animation</a></blockquote><div><h2 id="">引入</h2><p>前几天看见有人把《明日方舟：终末地》的LOGO改成了开机动画</p><p><a href="https://www.bilibili.com/video/BV1jPNKzkEvE">https://www.bilibili.com/video/BV1jPNKzkEvE</a></p><p>正好之前也自己改过一个COD里 <em>ATLAS</em> 的的开机动画，用了快一年了，正好换新换换口味，顺便复习一下制作的步骤</p><h2 id="">制作步骤</h2><h3 id="1">1.剪切视频</h3><p>原动画作者在 <a href="https://www.bilibili.com/video/BV1F5kPBUEFE">视频</a> 下面给出了网盘的视频源文件</p><p>下周后根据需要剪辑，剪掉两头多余的部分和中间同一画面停留过长的地方。</p><h3 id="2">2.视频切分为帧</h3><p>使用 <code>ffmpeg</code> 将视频切分为每帧一张图片，根据实际情况调整帧率</p><pre class="language-bash lang-bash"><code class="language-bash lang-bash">ffmpeg -i input.mp4 -vf &quot;fps=30&quot; %0d.png
</code></pre>
<h3 id="3">3.整理文件名</h3><p>对于这个只有一段的动画，将图片放到<code>part0</code>文件夹中</p><p>在图片目录打开PowerShell粘贴下方代码块中的内容进行规范命名。</p><pre class="language-powershell lang-powershell"><code class="language-powershell lang-powershell">Get-ChildItem -Filter *.png | ForEach-Object {
    if ($_.BaseName -match &#x27;^\d+$&#x27;) {
        $num = [int]$_.BaseName
        $newName = &quot;{0:D3}{1}&quot; -f $num, $_.Extension
        if ($_.Name -ne $newName) {
            Rename-Item -Path $_.FullName -NewName $newName
            Write-Host &quot;已重命名: $($_.Name) -&gt; $newName&quot; -ForegroundColor Green
        }
    }
}
</code></pre>
<h3 id="4">4.新建配置文件</h3><p>在<code>part0</code>同级目录新建<code>desc.txt</code></p><pre class="language-txt lang-txt"><code class="language-txt lang-txt">1080 1440 30
c 1 0 part0 000000
</code></pre>
<p>::: note
参数解析：</p><h4 id="">第一行：全局基础属性</h4><pre class="language-text lang-text"><code class="language-text lang-text">1080 1440 30

</code></pre><p>这行定义了动画的全局基础显示属性，格式为：<span>[WIDTH] [HEIGHT]</span> [FPS]</p><ul><li><strong>1080 (WIDTH)</strong>：动画的<strong>宽度</strong>，单位是像素。与图片分辨率一致即可。</li><li><strong>1440 (HEIGHT)</strong>：动画的<strong>高度</strong>，单位是像素。</li><li><strong>30 (FPS)</strong>：动画的<strong>帧率</strong>，代表每秒播放 30 张图片。</li></ul><h4 id="">第二行：动画段落播放控制</h4><p>格式均为：<span>[TYPE] [COUNT]</span> <span>[PAUSE] [PATH]</span> <span>[BACKGROUND_COLOR] [CLOCK]</span></p><pre class="language-text lang-text"><code class="language-text lang-text">c 1 0 part0 000000 -1

</code></pre><ul><li><strong>c (TYPE)</strong>：代表 &quot;complete&quot;（完整播放）。**即使系统在后台已经加载完毕，这一段也必须强制完整播完，不允许打断。另外可选： p：代表 &quot;play&quot;（可打断播放）。只要系统加载完毕准备好进入锁屏/桌面，无论这一段有没有播完，都会立刻被系统强制打断并结束开机画面。</li><li><strong>1 (COUNT)</strong>：播放次数。1 代表这一段动画（part0 文件夹里的图片）只播放 1 次。</li><li><strong>0 (PAUSE)</strong>：播放结束后的暂停时间，单位是<strong>帧数</strong>。停顿为 0（播完立刻进入下一阶段）</li><li><strong>part0 (PATH)</strong>：该段动画读取对应压缩包里的 part0 文件夹。</li><li><strong>#000000 (BACKGROUND)</strong>：这一段播放时的屏幕背景颜色，这里是纯黑色。</li><li><strong>-1 (CLOCK)</strong>：时钟显示的 Y 坐标（通常用于手表系统）。-1 代表隐藏/不显示时钟。</li></ul><p>:::</p><h3 id="5bootanimationzip">5.打包为bootanimation.zip</h3><p><code>part0</code>和<code>desc.txt</code>打包为一个<code>.zip</code>文件</p><p>压缩时选择<strong>压缩程度</strong>：<mark class="rounded-md"><span class="px-1"><strong>仅储存</strong></span></mark></p>
<p>最终结构：</p><pre class=""><code class="">bootanimation.zip
├── part0
│   ├── 001.png
│   ├── 002.png
│   ├── 003.png
│   └── ...
└── desc.txt

</code></pre>
<p>这是我制作的版本，可以 <a href="https://rua.ee/be">下载</a> 参考：</p>
<h2 id="">刷入手机</h2><p>由于我手机刷了第三方类原生的<em>Rising OS</em>系统，可以直接在设置中选择自定义的bootanimation.zip作为开机动画</p><p>对于一般已获取root的手机，可以构建一个简单的magisk模块刷入，覆盖系统原有的bootanimation即可</p></div><p style="text-align:right"><a href="https://elvish.me/posts/tinkering/make-custom-boot-animation#comments">览毕，何不一言？</a></p></div>]]></description><link>https://elvish.me/posts/tinkering/make-custom-boot-animation</link><guid isPermaLink="true">https://elvish.me/posts/tinkering/make-custom-boot-animation</guid><dc:creator><![CDATA[Elvish]]></dc:creator><pubDate>Sat, 02 May 2026 11:22:45 GMT</pubDate></item><item><title><![CDATA[华为路由器定时重新拨号刷新公网IP]]></title><description><![CDATA[<div><blockquote>此渲染由 Yohaku API 生成，或存排版之虞，最佳体验请往：<a href="https://elvish.me/posts/tinkering/huawei-router-scheduled-redial-refresh-ip">https://elvish.me/posts/tinkering/huawei-router-scheduled-redial-refresh-ip</a></blockquote><div><h2 id="">引入</h2><p>由于家宽公网 IPv4 每隔24~48小时，就会被运营商强制断线重连，导致CDN在回源时可能找不到源站。</p><p>尝试通过缩短A记录的TTL来缓解此现象，但是大陆的网络环境，各地运营商DNS层层缓存，这样没有作用</p><p>只能退而求其次，尽量控制<strong>让IP变动的时候在晚上</strong>，减少影响</p><p>本来可以通过软路由的定时任务来轻松解决的，但是我用于拨号的华为路由器没有这样的功能</p><p>因此，Vibe coding了一个脚本，适用于<mark class="rounded-md"><span class="px-1">华为AX3 Pro路由器</span></mark>的自动重新拨号</p><p>::: note
这个脚本仅在 AX3 Pro 进行过测试，其他型号的同种控制台应该也能使用。可能需要修改脚本中的div id
:::</p><h2 id="">分析</h2><p>本希望通过抓包登录和重启路由器的接口，但华为路由器采用了SCRAM (Salted Challenge Response Authentication Mechanism，加盐挑战响应认证机制) 或类似的安全握手协议，而不是直接发送明文密码。</p><p>因此每次登录时 <code>firstnonce</code>、<code>csrf_token</code> 和计算出来的 <code>clientproof</code> 都是动态变化的</p><p>如果希望通过脚本完成加盐挑战响应，需要解析来自路由器网页的js，比较麻烦</p><p>也尝试了通过抓包重启光猫也能达到目的（请求体是简单的明文），但是重启光猫时会导致座机也重启，晚上会发出声响</p><p>最后决定使用 <code>Playwright</code> 无头浏览器自动化点击来重新拨号</p><h3 id="1">1.安装依赖</h3><pre class="language-bash lang-bash"><code class="language-bash lang-bash">pip install playwright 
playwright install chromium 
playwright install-deps
</code></pre>
<h3 id="2">2.创建脚本</h3><p>在第 15 行填入登录密码</p><pre class="language-python lang-python"><code class="language-python lang-python">from playwright.sync_api import sync_playwright
import time

def reboot_router():
    with sync_playwright() as p:
        browser = p.chromium.launch(headless=True)
        page = browser.new_page()

        try:
            print(&quot;Opening router dashboard...&quot;)
            page.goto(&quot;http://192.168.3.1/&quot;)

            page.wait_for_load_state(&#x27;networkidle&#x27;)

            print(&quot;Logging in with password...&quot;)
            page.fill(&#x27;#userpassword_ctrl&#x27;, &#x27;&lt;PASSWORD&gt;&#x27;) # &lt;--把此处改为你的登录密码
            page.click(&#x27;#loginbtn&#x27;)

            time.sleep(3)

            print(&quot;Logged in，executing reconnecting action...&quot;)
            page.click(&#x27;#internet&#x27;)
            page.click(&#x27;#internet_reconnect&#x27;)
            print(&quot;Success.The network is about to reconnect...&quot;)
            time.sleep(2)

        except Exception as e:
            print(f&quot;An error occurred: {e}&quot;)
        finally:
            browser.close()

if __name__ == &quot;__main__&quot;:
    reboot_router()
</code></pre>
<h3 id="3">3.设置定时任务</h3><h5 id="cronjob"><strong>通过cronjob设置</strong></h5><pre class=""><code class="">crontab -e

# 添加脚本路径，设置每天凌晨3点执行
0 3 * * * /bin/bash -c &quot;cd /path/to/script &amp;&amp; source venv/bin/activate &amp;&amp; python main.py &gt;&gt; reboot.log 2&gt;&amp;1&quot;
</code></pre>
<h5 id="1panel"><strong>在1panel中设置</strong></h5><p>导航到 <code>计划任务-创建</code></p><ul><li>执行周期: 如<code>每天</code> <code>3 小时</code> <code>0 分钟</code></li><li>解释器: <code>python3</code></li><li>脚本内容: <code>路径选择</code>，并填入脚本路径</li></ul></div><p style="text-align:right"><a href="https://elvish.me/posts/tinkering/huawei-router-scheduled-redial-refresh-ip#comments">览毕，何不一言？</a></p></div>]]></description><link>https://elvish.me/posts/tinkering/huawei-router-scheduled-redial-refresh-ip</link><guid isPermaLink="true">https://elvish.me/posts/tinkering/huawei-router-scheduled-redial-refresh-ip</guid><dc:creator><![CDATA[Elvish]]></dc:creator><pubDate>Fri, 01 May 2026 14:57:05 GMT</pubDate></item></channel></rss>