HEHANG / KNOWLEDGE
随笔
技术实践、工具与个人记录。按主题深入,也可以沿时间慢慢读。
从这里开始Start here
系列阅读Reading series
全部文章All articles 14
- 本地优先应用的 SQLite 备份:复制文件之外,还要验证恢复本地优先应用的 SQLite 备份:复制文件之外,还要验证恢复
用 Python 标准库生成一致性备份,在临时示例数据库里检查完整性与数据,说明 WAL、只读连接和恢复演练的边界。用 Python 标准库生成一致性备份,在临时示例数据库里检查完整性与数据,说明 WAL、只读连接和恢复演练的边界。
- 静态站发布后,怎样确认内容、缓存和安全头都已生效静态站发布后,怎样确认内容、缓存和安全头都已生效
把构建成功与线上生效分开验证:检查代表性页面、机器入口、缓存和错误响应,保留可执行的回滚路径。把构建成功与线上生效分开验证:检查代表性页面、机器入口、缓存和错误响应,保留可执行的回滚路径。
- 网站打不开时,按 DNS、连接、TLS、HTTP 四层排查网站打不开时,按 DNS、连接、TLS、HTTP 四层排查
用少量只读命令区分域名解析、连接、证书和应用错误,保留可比较的证据,避免把所有故障都归结为网络不通。用少量只读命令区分域名解析、连接、证书和应用错误,保留可比较的证据,避免把所有故障都归结为网络不通。
- 41 座城市之后After 41 Cities
2010 年 8 月 11 日,上海。第一次一个人出远门,紧张得提前两小时到了车站。现在想想,那时候的自己真有意思。August 11, 2010, Shanghai.First solo trip far from home, so nervous I arrived at the station two hours early. Looking back, my younger self was quite something.
- 建站记:hehang.me 是怎么搭起来的Building hehang.me: How This Site Came Together
想有个地方放自己的东西:走过的路、写过的代码、写下的文字。试过 Notion,试过 GitHub Pages,总觉得差点意思。Notion 是别人的,GitHub Pages 太 geek。I wanted a place for my own things: roads walked, code written, words recorded.Tried Notion, tried GitHub Pages — always felt slightly off. Notion belongs to someone else; GitHub P…
- 本地优先的代价:DayLens 的数据是怎么存的The Cost of Local-First: How DayLens Stores Data
做 DayLens 的时候,第一个决定就是:数据不出本机。不是因为有什么惊天秘密,而是觉得:我的时间花在哪了,这种数据没必要告诉任何云服务。The first decision for DayLens: data never leaves the machine.Not because of earth-shattering secrets, but because where I spend my time is nobody's cloud business.
- DayLens:把"今天做了什么"翻译成人话DayLens: Translating "What Did I Do Today" Into Human Language
每天晚上,我都会想:今天到底干了什么?时间花在哪了?写代码用了几小时?刷手机又用了几小时?凭感觉估,永远不准。Every evening, I wonder: what did I actually do today?Where did the time go? How many hours coding? How many scrolling my phone? Guessing by feel is never accurate.
- 给 IP 检测加上 AI:场景咨询是怎么做的Adding AI to IP Detection: How Scenario Advice Works
多源数据聚合之后,信息是全了,但普通用户看不懂。ASN 是什么?BGP 走了哪条路?原生 IP 和广播 IP 有什么区别?这些概念对大多数人是黑话。After multi-source aggregation, the information was complete — but ordinary users couldn't read it.What's an ASN? Which BGP route? What's the difference between native and broadcas…
- IP Insight 开发手记:多源检测是怎么拼起来的IP Insight Dev Notes: How Multi-Source Detection Comes Together
第一版很糙:一个窗口,一个按钮,一个结果区。点击检测后,用 Promise.all 同时请求三个 API,哪个先回来先显示。代码不到 200 行。The first version was rough: one window, one button, one result area.Click detect, fire three APIs with Promise.all, display whichever returns first. Under 200 lines of code.
- IP Insight:从一个想法到完整 IP 分析工具IP Insight: From an Idea to a Complete IP Analysis Tool
事情的起因很简单:我想知道自己的网络出口到底在哪。用代理、换节点是常态,但每次都要打开好几个网站查 IP:一个看归属地,一个看流媒体解锁,一个看 ASN。信息散在各处,拼起来很麻烦。It started with a simple need: I wanted to know where my network exit really was.Using proxies and switching nodes is routine, but each time I had to open several websites: one for…
- del-weibo:一键和过去的微博告别del-weibo: Saying Goodbye to Old Weibo Posts, in One Click
人长大了,想清理一下年轻时发的微博。一条条删?几千条删到天荒地老。根据项目记录推测,作者(或者作者的朋友)有过这种需求,于是写了个脚本一次搞定。Tampermonkey(油猴)用户脚本,基于微博网页版官方接口:You grow up and want to clean up the Weibo posts from your younger days. Delete them one by one? Thousands of posts until the end of time. Inferred: the author (or a friend) had th…
- Navicat 中文助手:让英文报错说人话Navicat Chinese Helper: Making English Errors Speak Human
在 Navicat 里执行 SQL 报错,信息面板里蹦出一行英文:1146 - Table 'wh0524.t_user' doesn't exist。老手扫一眼就懂,新手得先翻译再理解。根据项目记录推测,作者自己写 SQL 时被英文报错烦到了,决定做个小工具让它"说人话"。思路很巧:外挂式独立小程序。不截图识别(OCR 又慢又不准),不联网,直接读取 Na…You run SQL in Navicat, it errors, and the info panel spits out: 1146 - Table 'wh0524.t_user' doesn't exist. Veterans get it at a glance; newcomers must translate first, understand…
- DayLens 每日镜:把电脑活动翻译成"今天做了什么"DayLens: Translating PC Activity into "What I Actually Did Today"
每天下班的时候,你能说出自己今天到底做了什么吗?不是"很忙",而是具体做了什么。根据项目记录推测,作者想要一个诚实的记录者:不评判、不打扰,只是把电脑上的活动翻译成一句话——"今天真正做过的事"。DayLens 的定位很克制:本地优先、默认完全离线。它记录前台软件使用时长、文件变化、浏览器访问概况、软件安装变化、微信接收文件,然后把成千上万条底层记录合并成容…When you finish work each day, can you say what you actually did? Not "I was busy" — specifically what. Inferred: the author wanted an honest recorder: no judgment, no interruption…
- 网鉴 · IP Insight:把出口 IP 放在显微镜下IP Insight: Putting Your Exit IP Under a Microscope
用代理、VPN 或者软路由的人,都有过这种时刻:想确认自己现在的出口 IP 到底是什么、在哪里、干不干净。单个检测网站只能给一个侧面,换几个网站又得手动一个个点开看。根据项目记录推测,作者想要的是一眼看清——打开一个软件,所有检测自动跑完,一份报告直接摆在面前。README 里写得很直白:把公网 IP 放到多个独立检测源下同时"体检"。自动打开检测网站、等待…Anyone using a proxy, VPN, or soft router has had this moment: wanting to confirm what their exit IP really is, where it is, and whether it's clean. One detection site only shows o…