Blogg
Notater om utvikling, hjemmelab og teknologi

It Wasn't the Load Balancer: Stale MySQL Stats After a Migration
86 tables told MySQL they were empty, two days after 25 GB had been loaded into them. One query to find stale InnoDB statistics, and the second slowdown that same night that had nothing to do with them.

I Wrote a Linter for Text That Sounds Like AI
Most people can spot AI text within a sentence or two now, and once they've spotted it they stop reading properly. So I built a checker that catches the tells before anything leaves my machine, calibrated on my own writing, and it learns from the edits I make.

Setting Firefox Bookmark Keywords From an Extension, Without an API for It
Firefox extensions can't set bookmark keywords. There's no API, and there hasn't been one for ten years. I needed it for my container add-on anyway, so Passport signs in to your Mozilla account and writes the keyword through Firefox Sync instead.

Two Checks Between an LLM and Your Warehouse
An apostrophe in a SQL comment was enough to hide a subquery that read 584,332 raw rows. The two checks a model-written query now has to pass before it runs, and why neither is enough on its own.

Put the Tenant Column in the First Migration
One extra column per table on day one, against a backfill across fourteen populated tables later. What went into the first migration, and the seven lookups that still assume one brand.

When Two Tools Disagree, Show Both Numbers
Analytics and Search Console never agree, and the dashboard I built for an agency shows both instead of picking one. The first time someone checked it against the ad platform, the gap turned out to be partly my own join bug.

A Staging Database That Rebuilds Itself From Production Every Night
A Python script, a systemd timer and four checks that restore production into staging every night. The one that mattered most was counting the tables, because pg_restore exits 0 on an empty dump.

OpenTelemetry Into a Stack You Own
Four machines, one self-hosted SigNoz on a 7.5 GB box. The collector setup and naming scheme that keep it usable, and the two defaults that quietly deleted my logs and buried the box in its own profiling data.

Your Server Logs Are the Only Place You Can See AI Crawlers
Analytics can't see AI assistants reading a site, because they never run JavaScript. What a client's access logs showed instead, how I sort the three kinds of AI fetch, and what the log still can't tell you.

Getting Self-Hosted Mail to Actually Deliver
Notes from a bulk-mail server I built for a client, with fourteen sending IPs. The setup that has to be right, the config, and why a first send that passed every check still went to spam.

Idempotency Is the Integration Feature You Actually Need
Webhooks arrive twice and people click twice. How I make a second delivery harmless: a key derived from the content, a partial unique index, and the endpoint I forgot to give one.

Why I Reach for a Modular Monolith First
Why I start client backends as one deployable with hard boundaries inside, using a marketplace I'm building as the example, and the few reasons I'd split it.

ZFS, Proxmox, and the Art of Not Losing Data
An SMR drive in a ZFS stripe, 59 corrupted files that SMART never noticed, and why I rebuilt the pool and downloaded 30TB again instead of backing it up.

From Docker Compose to Infrastructure as Code with OpenTofu
My homelab runs from two Git repos: OpenTofu for the VMs, DNS and tunnels, and a small deploy script for 15 Compose stacks. How each one works, and the two and a half months one of them was quietly wrong.

Building a Self-Hosted Identity Layer with Authentik
Forward auth, OIDC and LDAP from one Authentik install, the Traefik config that ties it together, and three things that bit me along the way.

Building an AI Agent Mesh in My Homelab
Nine Claude Code workers as separate Linux users on one VM, talking A2A over localhost. How it's wired, the shared-login bug that looked like broken credentials, and why memory was the limit all along.

What Happens When You Give AI Agents Root Access to Your Homelab
An AI agent with sudo on its own VM and SSH to the rest of my homelab. The 34 hooks that keep it in line, the mistakes they didn't catch, and why I took the coding work away from the workers in September.

Automating Media Management with the Arr Stack
How my Sonarr and Radarr setup is wired, what a quality sync tool did to it halfway through a 30TB re-download, and the two bugs that only showed up under load.

Why I Self-Host Everything
One Proxmox box, five VMs and 59 containers, deployed with a git push. What I run at home, why, and the backups I should have set up sooner.