<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
  <title>码农手记 DevNotes</title>
  <link>https://tr1.lebing.top/</link>
  <description>后端开发 / Linux 运维 / 网络技术</description>
  <language>zh-cn</language>
  <item>
    <title>Nginx 与代理服务共用 443 端口的几种方案小结</title>
    <link>https://tr1.lebing.top/post/nginx-tls-fallback.html</link>
    <guid isPermaLink="true">https://tr1.lebing.top/post/nginx-tls-fallback.html</guid>
    <pubDate>2026-08-27</pubDate>
    <description>单机上既要跑网站又要跑 TLS 代理时，443 端口只有一个。本文对比「应用层 fallback 回落」与「nginx stream + ssl_preread 按 SNI 分流」两种思路，讲清各自工作在哪一层、证书由谁持有，以及如何配合伪装站点降低被探测的概率。</description>
  </item>
  <item>
    <title>手写一个可靠的 systemd service：Restart、LimitNOFILE 与日志</title>
    <link>https://tr1.lebing.top/post/systemd-service.html</link>
    <guid isPermaLink="true">https://tr1.lebing.top/post/systemd-service.html</guid>
    <pubDate>2026-08-21</pubDate>
    <description>把一个命令行程序变成开机自启、崩溃自动拉起的服务，远不止写个 ExecStart。本文整理 Restart=on-failure 与 always 的区别、LimitNOFILE 对高并发代理的影响，以及用 journalctl 排查启动失败的常用姿势。</description>
  </item>
  <item>
    <title>日志把磁盘写满了？logrotate 实战与按天保留策略</title>
    <link>https://tr1.lebing.top/post/logrotate-practice.html</link>
    <guid isPermaLink="true">https://tr1.lebing.top/post/logrotate-practice.html</guid>
    <pubDate>2026-08-15</pubDate>
    <description>Nginx/业务日志默认只增不减，跑几个月就把系统盘吃满。本文记录一次线上清理：如何按日期过滤保留最近 N 天、给 nginx 发 USR1 信号重开文件句柄、以及为自定义日志目录补上 daily + rotate + compress 的轮转配置。</description>
  </item>
  <item>
    <title>tcpdump 抓包到 Wireshark 分析：定位连接被重置的思路</title>
    <link>https://tr1.lebing.top/post/tcpdump-wireshark.html</link>
    <guid isPermaLink="true">https://tr1.lebing.top/post/tcpdump-wireshark.html</guid>
    <pubDate>2026-08-09</pubDate>
    <description>连接时通时不通、握手被 RST、还是应用层返回错误？现象相似但原因完全不同。本文用一个实际案例演示 tcpdump 常用过滤表达式、远端抓包后拉回本地用 Wireshark 看 TCP 三次握手与 RST 的时序。</description>
  </item>
  <item>
    <title>Redis 批量写入优化：从逐条 SET 到 pipeline 的 10 倍提升</title>
    <link>https://tr1.lebing.top/post/redis-pipeline.html</link>
    <guid isPermaLink="true">https://tr1.lebing.top/post/redis-pipeline.html</guid>
    <pubDate>2026-08-02</pubDate>
    <description>一次网络往返 0.x 毫秒，累积起来就是瓶颈。本文对比逐条命令、pipeline、Lua 脚本三种批量写入方式的吞吐差异，讨论 pipeline 并不是事务、以及批量大小如何取舍。</description>
  </item>
  <item>
    <title>Go 并发实战：用 errgroup 控制一组 goroutine 的退出</title>
    <link>https://tr1.lebing.top/post/go-errgroup.html</link>
    <guid isPermaLink="true">https://tr1.lebing.top/post/go-errgroup.html</guid>
    <pubDate>2026-07-26</pubDate>
    <description>启动多个 worker 时，一个失败要不要让其它全部退出？context 取消如何传播？本文结合一个抓取服务的重构，介绍 errgroup.WithContext 的用法和常见的 goroutine 泄漏坑。</description>
  </item>
  <item>
    <title>用 acme.sh 自动申请与续期 Let&#x27;s Encrypt 证书</title>
    <link>https://tr1.lebing.top/post/acme-letsencrypt.html</link>
    <guid isPermaLink="true">https://tr1.lebing.top/post/acme-letsencrypt.html</guid>
    <pubDate>2026-07-18</pubDate>
    <description>证书 90 天一过期网站就告警。本文演示 webroot 模式验证、ECC 证书签发、acme.sh 的 cron 自动续期原理，以及证书更新后如何让 nginx / 其它服务平滑 reload。</description>
  </item>
  <item>
    <title>iptables 入门：放行端口、持久化与那条容易被忽略的 REJECT</title>
    <link>https://tr1.lebing.top/post/iptables-basics.html</link>
    <guid isPermaLink="true">https://tr1.lebing.top/post/iptables-basics.html</guid>
    <pubDate>2026-07-10</pubDate>
    <description>规则顺序决定一切。很多人放行了端口却依然不通，往往是因为规则加在了一条兜底 REJECT 之后。本文梳理 filter 表 INPUT 链的匹配顺序、-I 与 -A 的区别，以及 CentOS 下 service iptables save 的持久化方式。&lt;/p&gt;</description>
  </item>
  <item>
    <title>Docker 多阶段构建：把镜像从 900MB 砍到 80MB</title>
    <link>https://tr1.lebing.top/post/docker-multi-stage.html</link>
    <guid isPermaLink="true">https://tr1.lebing.top/post/docker-multi-stage.html</guid>
    <pubDate>2026-07-02</pubDate>
    <description>编译型语言最容易踩的坑：把整个编译工具链、源码、包缓存都塞进运行镜像。用 multi-stage build，builder 阶段负责编译，final 阶段只 COPY 二进制，镜像体积能小一个数量级，攻击面也更小。</description>
  </item>
  <item>
    <title>一次 MySQL 慢查询排查：从 EXPLAIN 到联合索引</title>
    <link>https://tr1.lebing.top/post/mysql-slow-query.html</link>
    <guid isPermaLink="true">https://tr1.lebing.top/post/mysql-slow-query.html</guid>
    <pubDate>2026-06-25</pubDate>
    <description>列表页接口偶发几秒，慢查询日志里一条 LIKE &#x27;%xx%&#x27; 全表扫描。本文记录用 EXPLAIN 看 type=ALL、rows 扫描行数，最后改写成可走索引的前缀/全文方案，并补了 (status, created_at) 联合索引。</description>
  </item>
</channel>
</rss>