Case studies
#powershell#debugging#windows#electron#docker#pterodactyl#python#csharp#wpf#bash#security#cpp#git#performance#ci#nodejs#pyside6#react-native
80 posts
·11 min read

TaskPad: a 1 MB WPF task editor that installs and updates itself
Notepad is too plain and VS Code is too heavy for a to-do list. I built TaskPad in C# as one 1 MB exe, and shipped 29 releases in about eleven hours. Here is what broke along the way.
In short
- The whole app is one exe: AvalonEdit is embedded as a resource and loaded through an AssemblyResolve handler, so there is no DLL next to it. The v1.9.4 build is 1,079,296 bytes.
- The same file is the portable app, the per-user installer (it detects "setup" in its own file name) and the updater, which swaps a running exe by renaming it to .old.
- Comments are stored as CriticMarkup inside the text file, so a note with a full discussion still opens in any editor.
#csharp#wpf#windows#desktop
·5 min read

TaskPad · Story
How TaskPad replaces its own running exe, and what the checksum covers
Windows will not let you overwrite a running exe, but it lets you rename it. That one fact is the whole TaskPad updater. I also show what the SHA-256 check does not protect against.
In short
- The updater downloads the new exe to Temp, checks a SHA-256, renames the running exe to .old, copies the new one in, and rolls back if the copy fails.
- The installer is the same file: it starts in setup mode when "setup" appears in its own file name.
- The checksum is only checked when the release notes contain a SHA-256: line, and it comes from the same release as the exe.
#csharp#wpf#updater#windows
·6 min read

Unfair · Story
A memory scanner with a web UI needs a guard and a test for it
Unfair can write into any process I can open, and its Flask UI has no login. The only protection is a localhost check, and the one test that proves it. Design notes from a one-commit repo.
In short
- The repository has a single commit, so this is a design story read from the code and tests, not a bug-fix history.
- The server binds to 127.0.0.1 and a beforerequest hook returns 403 for any other address.
- testweb.py asserts that a request from 10.0.0.5 is refused, so the guard is tested and not only documented.
#python#flask#security#windows
·6 min read

Pterodactyl yolks · Story
SQL Server built fine and could not start under Wings
A passing docker build proved nothing. A file capability on sqlservr and an eval echo on the startup string only showed up once CI booted the image the way Wings does.
In short
- sqlservr ships with the capnetbindservice file capability, and Wings drops that capability, so the kernel refuses to exec it.
- Rewriting each executable removes the capability, and a CI boot test with Wings' uid and dropped capabilities now gates publishing.
- The same test caught the startup string being expanded with eval echo, which ran the panel's console banner as code.
#docker#pterodactyl#sql-server#ci#security
·5 min read

Pterodactyl yolks · Story
A MySQL init file full of passwords, and a CI check that raced it
MySQL's first start needs a SQL file with the root and app passwords in it. I moved it out of the startup line, locked down the run directory, and fixed a test that raced the cleanup.
In short
- The init file is now referenced from the generated config (init-file=...), not appended to the startup line and echoed to the console.
- The socket and pid file moved from /tmp into a run directory created with mode 700.
- The CI step that asserts the init file is gone now waits for the removal instead of racing it.
#mysql#docker#pterodactyl#security#ci
·5 min read

Pterodactyl yolks · Story
The n8n image had no bash, so my entrypoint became POSIX sh
My first n8n entrypoint assumed bash, setsid and a package manager. The base image had none of them. Rewriting it in plain sh meant rethinking how shutdown reaches the process.
In short
- The base image n8nio/n8n has no bash and no package manager, so the apk add line and the bash entrypoint both had to go.
- The entrypoint became POSIX sh, and the passwd entry for uid 988 points at /bin/sh.
- Shutdown now uses kill -TERM -1, which is only safe because the script is PID 1 in the container.
#docker#shell#n8n#pterodactyl#posix
·5 min read

Pterodactyl yolks · Story
One missing curl flag broke my mail server setup
Stalwart's first-start setup could not open a JMAP session. I printed the response, and fifty seconds later the fix was a single letter: curl -L.
In short
- The setup script asked for the JMAP session with curl -fsS, which treats a redirect as success but does not follow it.
- A debug commit printed the response body on failure, then -L made curl follow the redirect.
- The CI checks that call the same URL needed the same flag, or they would have asserted on the wrong status code.
#curl#jmap#docker#pterodactyl#debugging
·11 min read

Chiti: Replacing 11 Sockets With One Typed Real-Time Layer
One socket for a six-role delivery and taxi app, then the real work: an 11.3 second handshake, positions the server accepted but never stored, and a token that went stale in the background.
In short
- Eleven unauthenticated Socket.IO connections became one connection per session, owned by a single module that components never touch.
- Status pings invalidate queries, position frames patch the cache, everything else goes on a small typed bus. Frames are parsed as unknown with Zod.
- Real devices taught more than design did: an 11.3 second handshake, a position the server broadcast but never stored, and a socket that stayed anonymous after a token refresh.
#react-native#socket-io#typescript#tanstack-query