全部文章
-
Designing an on-call rotation and its handover
An on-call rotation needs a primary and a backup, a bounded share of each engineer's time, shift lengths and swap rules that people can plan around, a pager budget that triggers corrective work when exceeded, and a written handover at every shift change; the Google SRE book and PagerDuty's public response documentation describe the constraints.
-
Bezeichner benennen: nach Rolle, im Fachvokabular, so lang wie die Reichweite
Ein Name sagt, was ein Ding im Fachgebiet ist oder tut – nicht, welchen Typ es hat oder wie es implementiert ist. Die Länge wächst mit der Reichweite, ein Begriff hat genau ein Wort, Wahrheitswerte lesen sich als Aussage, Sammlungen stehen im Plural. Sprachkonventionen (PEP 8, Effective Go) gehen dem Geschmack vor, und Umbenennen ist billig, solange es mit Werkzeug und in eigenem Commit geschieht.
-
测试依赖时间与随机性的代码
注入时钟和随机源,不要直接调用 time.time() 或 random;测试就能传入固定值,使代码保持确定性和可复现性。
-
不可信数据的反序列化:pickle 与 Java 序列化
原生对象序列化格式会指示接收方构造任意对象,而构造对象会执行代码;Python 的 pickle 文档明确说明该模块不安全。绝不要对来自不可信输入的这些格式进行反序列化;若遗留接口迫使你这样做,应限制流中可指定的类,并为载荷签名。
-
日志轮转与保留期限限制
每一层的日志都必须限制大小和保存时间,包括应用、容器运行时、代理和系统日志。保留期限应根据调试与法律需求选择,而不是“一切都保存”。
-
Updating FreeBSD: freebsd-update for the base system, pkg upgrade for packages, and pkg audit for known vulnerabilities
FreeBSD splits patching into two independent tools: freebsd-update fetch/install for the base system (with upgrade -r for a major release change), and pkg upgrade for installed packages. pkgbase — installing the base system itself as pkg(8) packages — is documented as experimental on FreeBSD 14 and a technology preview for FreeBSD 15.0, not yet the default path.
-
The Linux boot chain for troubleshooting: firmware, bootloader, kernel, initramfs and systemd
A Linux boot passes through firmware, a boot loader, the kernel, an initramfs and finally the system manager, each stage handing control to the next. Knowing what each stage does and where it logs lets an administrator narrow down a failed boot to one stage before touching anything.
-
Access logs for personal data: recording who read which record
An access log for personal data records reads, not only writes: actor, subject, object, reason and time, emitted at the application read path and reconciled with database-level statement logging for paths that bypass it; it must answer subject-centric questions such as who looked at this person's record in the last year.
-
一天内熟悉陌生代码库:以书面地图为产出的探索流程
为进入代码库的第一天设定时间限制:阅读前先构建并运行测试,用 git shortlog 和 git log 阅读历史、找到活跃区域,将一个请求或命令从头跟到尾,并写成一页地图,包含入口、数据模型、不变量和开放问题。产出是地图,而不是记忆。
-
开放重定向:验证 next 参数可以将用户送往何处
如果重定向目标来自请求,攻击者就能创建位于你的域名、最终却进入其网站的链接。应仅重定向到相对路径或允许列表中的源,或在服务器端将短标识符映射为目标。检查 URL 主机比看起来更难:Python 文档提醒,urlsplit 不会验证输入。
-
RICE 与 ICE 评分:数字的含义及其适用边界
RICE 将覆盖量、影响和置信度相乘,再除以投入;ICE 去掉覆盖因素,保留影响、置信度和实施容易程度。两者都能使优先级论据明确且可比较,但当输入只是披着数字外衣的猜测,或忽略依赖关系和战略时,两者都会失效。
-
Do prompt-injection test suites predict how an agent behaves against injections written after the suite?
Agents are often evaluated against fixed collections of injection attempts. It is unclear how well a good score transfers to new phrasings, new carriers and adaptive attackers, and what a test suite would need to contain to be predictive.
-
Distinguishing denied access from a broken negative-test fixture
Prevent an agent from treating any error as proof that an access-control test passed. The proposed method uses matched controls to identify whether the application actually reached the intended authorization decision.
-
Schema migrations run with a short lock_timeout and automatic retry cause fewer deploy-time incidents than migrations without one
Hypothesis: because most ALTER TABLE forms take an ACCESS EXCLUSIVE lock that queues behind any long transaction while blocking every later query, migrations executed with a lock_timeout of a few seconds and a bounded retry loop produce fewer and shorter deploy-time outages than the same migrations run with the default unlimited wait, at the cost of a few migrations that need a manual rerun.
-
JCL and batch basics: JOB/EXEC/DD statements, return codes, submitting from USS, and reading output
A JCL job is a JOB statement, one or more EXEC steps each naming a program, and DD statements binding files/datasets to that program's I/O; each step ends with a return code where 0 is clean and higher values signal warnings or errors, and a job can be submitted from the USS shell with submit and its output read through SDSF or the z/OSMF jobs REST API.
-
Rolling out a service worker safely: scope, versioned caches, the waiting worker and a kill switch
A service worker that caches HTML can pin users to old code after a deploy. Register it with an explicit scope, fetch the script fresh on every update check, version caches per build and delete old ones on activate, choose per-resource strategies, decide how the waiting worker takes over, and ship a tested kill switch before the first release.
-
使用 partial_fit 进行增量学习:稳定特征、类别列表与可靠评估
增量估计器通过小批量数据更新模型,无须将完整数据集载入内存。可靠的流程还需要保持特征含义、定义完整类别集合,并在利用结果学习之前评估预测。
-
AddressSanitizer 问题分析:先修复第一次无效访问,再相信后续行为
将 AddressSanitizer 报告转化为最小的所有权或边界回归用例,不把一次无报错运行当作证明。
-
从 Python 安全运行外部命令
使用 subprocess.run、参数列表和 shell=False,设置超时,明确捕获输出,检查返回码,绝不使用不可信字符串拼出命令行。
-
把提取练习作为学习流程:关闭来源,给出答案,再检查
一种用回忆代替重读的学习流程:每学完一个单元,关闭来源,写出能够复现的内容,对照来源、标记缺口,并安排稍后的回忆尝试。2021 年一篇系统综述汇总的课堂与实验室研究报告了这种方法在不同教育层次和形式下的益处。
机器可读: JSON