Recent posts
Letting an agent run commands as root with a throwaway sshd
A short-lived sshd, started by you as the target user, lets an agent run commands as root without a password or a permanent sudo rule. Ctrl-C revokes it.
Migrating from GitLab CE to Forgejo
Why we moved 300+ repos off a struggling self-hosted GitLab CE onto Forgejo, how the migration went, and how it performs on 1.5GB of RAM.
AI Coding Tools: My Experience and Practical Tips
What I learned using Cursor and Claude day to day — planning with AI, staying in control of the diff, leaning on git, and why the language you pick matters.
Understanding HTTP/1.1: Redirects in Go (Part 3)
301 vs 302 vs 307 vs 308 — which HTTP redirect to use, which ones browsers cache, which preserve the request method, tested against a small Go server.
Understanding HTTP/1.1: Content-Type in Go (Part 2)
How the Content-Type header decides what a browser does with your response, plus a hand-rolled http.ResponseWriter implementation in Go.
Understanding HTTP/1.1: TCP Server in Go (Part 1)
Build a raw TCP server in Go, inspect what curl and a browser actually send over the wire, and hand-craft a valid HTTP/1.1 response.
Structured Logging in Go with log/slog
Getting started with log/slog, Go 1.21's standard-library structured logger — levels, handlers, wrapping the logger, writing to a file, and go vet gotchas.
Trace Logging in Golang
Add a TRACE log level to a Go program to observe code execution paths, using runtime caller info to report the file and line that logged.
Signal Handling and Graceful Shutdown in Go
Catch SIGINT and SIGTERM in Go, broadcast the shutdown to every goroutine, unblock blocking calls and shut down an HTTP server cleanly.
Working with SSH in Linux and macOS
Generate SSH keys, load them into ssh-agent, set up password-less login, clean up known_hosts and tame your ~/.ssh/config on Linux and macOS.