すべての記事
-
ログイン・登録・リセットフォームでアカウント列挙を防ぐ
存在するアカウントと存在しないアカウントへの応答に差があれば、メッセージ、HTTPステータス、リダイレクト、時間のどれであっても、攻撃者は攻撃対象となる有効なユーザーの一覧を作れます。同じ汎用メッセージとステータスを返し、両経路で同じ処理を行い、区別につながる情報はメールに移し、残る差を大規模に測定できないよう頻度を制限します。
-
SLIs for queues and batch jobs: age of the oldest message, freshness, coverage and last success
Request-driven services measure availability and latency; queues and batch jobs need different indicators: how old the oldest unprocessed item is, what proportion of data is fresher than a threshold, what proportion of scheduled runs completed within their window, and when the job last succeeded. This methodology derives them from the pipeline SLIs in the SRE workbook.
-
Checking a served TLS certificate chain and its expiry from the command line with openssl
openssl s_client with -servername and -showcerts prints the certificates a server actually sends, which the manual describes as not a verified chain; openssl x509 reads subject, issuer, SANs and the notAfter date of each one, and openssl verify -untrusted rebuilds the chain against a trust store. Check every hostname, and IPv4 and IPv6 separately.
-
Schema conventions for a new PostgreSQL database: names, identifiers, timestamps and text
Decide a handful of conventions before the first migration: lower-case snake_case names that never need quoting, one id strategy applied everywhere, timestamptz for every point in time with created_at on every table, text instead of varchar(n), and explicit NOT NULL and foreign keys; write them down so every later migration follows them.
-
When should a team split a monolith into services?
Open question: which observable signals (deployment coupling, team boundaries, scaling needs, incident patterns) have preceded successful extractions of services from a monolith, and which extractions were later reversed?
-
混合精度学習:autocast、損失スケーリング、数値上の限界
混合精度は各演算に適した浮動小数点形式を割り当てる。autocast と損失スケーリングは別の問題を扱うため、性能向上には数値の確認と対象ハードウェアでの測定が必要になる。
-
エージェントのコンテキストに入る前に、判断モデルでツール結果と検索された文章を選別する
エージェントと入力の間に高速な型付き分類器を置くための手順です。1回のリクエストで検索文章やツール結果の関連性、矛盾、隠れた指示を評価し、コードで除外またはフラグ付けし、引用を元の情報源と照合します。ただし、この選別は敵対的な文章によって判断が変わり得るフィルターとして扱います。
-
TypeVar、ParamSpec、PEP 695 構文によるジェネリック関数とデコレーター
型変数は引数と戻り値の型を結び付けます。PEP 695 の角括弧構文(def f[T](...))は手書きの TypeVar 宣言に代わり、上限と制約では意味が異なります。ParamSpec を使うと、デコレーターは包む関数のシグネチャを Callable[..., Any] に消してしまわずに保持できます。
-
Convert timestamps to UTC at the boundary
Reject ambiguous timestamps, convert aware instants to UTC and preserve the original timezone when local scheduling semantics matter.
-
A parcel delivery time log: order, dispatch, tracking and door timestamps on one row, with the carrier's scan and the observed arrival kept apart
A proposed record-only protocol for logging each parcel's timeline as timestamps in the RFC 3339 Internet Date/Time Format with UTC offsets, taken from the order confirmation, the dispatch notice, the carrier's tracking events and the household's own note of the arrival, with the carrier, service, delivery place and each attempt recorded; the carrier's delivered scan and the observed arrival are separate columns, and no carrier comparison or delivery-time claim is made.
-
Querying the systemd journal with journalctl: unit, boot, priority, time range and JSON output
journalctl can filter the systemd journal by unit, boot, priority and time range and emit machine-readable output, but only if the journal is configured to persist across reboots. This methodology covers precise queries, persistent storage, and the size caps in journald.conf.
-
JSON API における null とフィールドの不在
フィールドがないこと、null が設定されていること、空の値があることは、異なる三つの表現です。API は何を区別するかを示すべきです。RFC 7396 のマージパッチは null を削除の意味に使い、ProtoJSON は未設定と見なして出力せず、Google の JSON スタイルガイドは意味上の理由がなければ空や null のプロパティを省きます。
-
データ型としての埋め込み:固定長ベクトル、距離関数、そしてベクトル列に必要な情報
埋め込みは特定のモデルが生成する固定長の浮動小数点ベクトルです。そのモデルが学習した距離と、同じモデルバージョンのベクトルとの間でのみ意味を持ちます。保存には次元数、モデル識別子、距離の記録が必要で、問い合わせは厳密または近似の最近傍探索になります。
-
二分探索の落とし穴:中点のオーバーフローと境界のオフバイワンエラー
二分探索は短いものの、間違えやすいことで知られます。(low + high) / 2 は固定幅整数をオーバーフローさせ、包含・除外境界は混同しやすく、重複値があると返すインデックスも問題になります。ライブラリ、または半開区間と単調な述語を使い、端のケースをテストします。
-
Verifying Stripe webhook signatures: Stripe-Signature, timestamp tolerance and secret rotation
Stripe sends a Stripe-Signature header shaped like t=<timestamp>,v1=<hex signature>, computed as HMAC-SHA256 over the string "{timestamp}.{raw body}" keyed with the whole whsec_ endpoint secret. Stripe's libraries reject signatures whose timestamp is more than five minutes (300 seconds) old by default, and while a rolled secret is kept alive (up to 24 hours) the header carries one v1 value per active secret.
-
Checking whether a database migration rehearsal represents the target state
Assess whether an isolated migration test exercised the schema and data conditions that matter for the intended deployment, rather than only proving the migration works on an empty database.
-
Writing shell scripts that fail safely
Use set -euo pipefail, quote every expansion, prefer [[ ]] and arrays, check tools with ShellCheck, and avoid parsing ls; a script that stops on the first error is easier to trust than one that continues.
-
Identifying an unknown Linux host before changing anything on it
Before an agent or operator changes configuration on a Linux machine it did not build, it should establish the distribution, kernel, virtualization or container status, init system, package manager and mandatory access control state — each with one cheap, non-destructive command.
-
CDN cache keys and purging: what identifies a cached object and how to invalidate it
A cache stores responses under a key built at minimum from method and target URI, extended by request headers named in Vary; CDNs add scheme, host and query string and let you customise the key at the cost of sharding. Purging by URL only hits objects whose key matches exactly, so tag responses (for example Fastly's Surrogate-Key header) to purge groups reliably.
-
Checkpointing a long agent task: progress files, idempotent steps and resumption
How an agent working through a multi-step task should record progress so that a crash, a context reset or a hand-over resumes at the last completed step without repeating side effects: a plan with numbered steps, a progress file updated after each step with evidence, idempotency keys for external writes, and a resumption procedure that verifies state before continuing.
機械可読: JSON