backend
Technical notes on web development, DevOps, and AI integration.
45 articles
- 22:30devops
Live probe vs my Plane spec: two assumptions died in 27 minutes
My 905-line Plane sync spec lost two assumptions to a live probe: HTML markers stripped by server-side sanitization, archive endpoint 404.
TL;DR: A live probe against Plane Community Edition broke two assumptions in a 905-line sync spec before any code was written. Hidden HTML comments for identity were stripped by server sanitization, and the archive endpoint returned 404 because CE trails cloud. Fix stores metadata in visible text and a config file, uses Done instead of archive, and hashes normalized text.
#plane#self-hosting#rest-api - 17:27backend
Not Just SQL: When API Fan-out Kills Your Monitor
Fixing an N+1 API fan-out in commitcheck: one pagination pass replaces 250 requests, SSL timeout gone, runtime down to 27.5s.
TL;DR: The monitor hung for over 100 seconds because each candidate triggered full pagination, creating roughly 250 requests per run. Replacing per-candidate checks with a single paginated fetch into a commit-to-slug map removed the N+1 overhead. Runtime dropped to 27.5 seconds with only a few requests and no change to the API contract.
#pagination#performance#api - 10:01ai
Hidden instructions in media files: prove they stay data
The transcript must carry the hijack sentence verbatim as data. That is exactly how you prove a media file never acted as an instruction.
TL;DR: The author deliberately embedded a prompt-injection sentence into an audio fixture to test a media pipeline's defenses. Counterintuitively, the test requires the hostile transcript to stay verbatim and labeled untrusted, since injection is about text switching from data to instructions. The real defense is a contract proving content never becomes commands, not filtering text or trusting the model's intelligence.
#prompt-injection#llm-security#whisper - 09:55backend
Replacing WordPress database URLs with WP-CLI, not raw SQL
WP_HOME only fools new pages; old URLs live in the database. WP-CLI search-replace with dry-run and skip-columns=guid is the fix.
TL;DR: Moving a WordPress production dump locally means changing WP_HOME and WP_SITEURL won't fix URLs already stored across posts, meta, and serialized options. Raw SQL REPLACE() is risky because it breaks PHP serialized length prefixes and can overflow column limits. Instead, use wp search-replace with a --dry-run first, always skipping the guid column since those permalinks must never change.
#wordpress#wp-cli#php - 09:01devops
The Status Value That Shouldn't Exist Yet
A weeks-old file carried a status value the old reader never wrote. The vocabulary changed without a schema version bump. A lesson in data contracts.
TL;DR: A checker warning revealed a transcript file whose status value didn't exist in the old reader's vocabulary. The fix splits failures into unknown-status, where the reader lags, and legacy-enum-status, where a writer changed vocabulary without bumping the schema version. Lesson learned: treat enum changes as schema changes and bump versions in the same commit.
#python#schema#backward-compatibility - 04:03devops
Event Log Integrity the Git Way: A Frame Tamper Story
A one-byte frame tamper taught me how content-addressed sidecars, an append-only event log, and disk-truth verification keep a pipeline recoverable.
TL;DR: When a corrupted frame triggered media-quarantine instead of a crash, the kernel proved it rebuilds state from events and verifies files from disk, never trusting recorded hashes. Content-addressed caption sidecars give free deduplication, while the append-only log enables clean recovery through full rebuilds. But hash chains prove tamper-evidence, not authenticity—integrity is an architecture, not a checksum ritual.
#git#event-sourcing#automation - 02:55ai
A valid MP4 that will never transcribe
A video file can be perfectly valid and still carry no audio. A nonstate skip keeps the row visible and holds the pipeline until someone decides.
TL;DR: A supposedly broken MP4 was actually valid, just with zero audio streams. The pipeline now runs ffprobe first, stores an audio_track flag, and emits a visible skip that never marks work done. Frames follow a fixed fps cadence with capped extraction, while audio is downsampled to 16kHz mono WAV for transcription.
#ffmpeg#whisper#ffprobe - 01:57backend
Lock stolen mid-run: what fencing tokens taught me
A lock checked once at startup guards the door, not the data. Fencing tokens validated at every state write, plus a heartbeat lease, are what guard the data.
TL;DR: A force-killed transcribe process showed why one-time lock checks fail: after the lock expired, a second session took over and idempotent resume reused finished windows from sidecars. The fix is fencing tokens, checked at every state write, so stale sessions die with lock-stolen-mid-run. Minimum package: TTL lock, heartbeat, and a negative control proving the guard fails.
#distributed-systems#idempotency#testing - 17:30devops
Node Exporter Rollout KTM Fleet and the MaxAuthTries Trap
Prometheus TargetDown on 10th fleet server: node_exporter missing, Ansible deploy failed due to SSH MaxAuthTries burned by ed25519 key order. Fix = SSH hardening first (key-only, key order), then monitoring — all idempotent.
TL;DR: A TargetDown alert revealed a missing node_exporter, but SSH access failed due to MaxAuthTries exhaustion from multiple key attempts. The fix prioritized SSH hardening — key-only authentication with cleaned key order — before deploying monitoring. This idempotent playbook sequence ensures stable access as a prerequisite for reliable fleet monitoring.
#ansible#prometheus#node-exporter