Case studies
#powershell#debugging#windows#electron#docker#pterodactyl#python#csharp#wpf#bash#security#cpp#git#performance#ci#nodejs#pyside6#react-native
Start here
- 01

My browser's import feature looked exactly like an info-stealer
Reading other browsers' saved logins is what credential stealers do, so antivirus flagged it. I moved the code into a separate on-demand exe and made the installer per-user.
Light Browser · 6 min read - 02

A 10 second timeout failed an 11.3 second handshake
A socket timeout that looked generous lost every frame during reconnects. I measured the server's handshake at 11.3 seconds and moved the budget to 25.
Chiti · 6 min read - 03

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.
TaskPad · 5 min read
80 posts
·6 min read

A Ruby image for Pterodactyl that reads database.yml with awk to decide on db:prepare
Running db:prepare on a Rails app with no database kills the start; skipping it on one with a database breaks the first request. The start script decides from database.yml and DATABASE_URL.
In short
- The Ruby image has to start whatever the user uploads: Rails, a Rack app, a Sinatra file, or a custom command.
- Whether to run db:prepare depends on whether the current environment names a database, so the script parses config/database.yml with awk and also honours DATABASEURL.
- I ran the awk on two sample files, and it correctly ignored a commented-out production: block.
#ruby#rails#docker#bash#pterodactyl
·5 min read

DailyBrief only worked on my disk, so I split install from per-user data
The packaged exe held my own OneDrive path and the pipeline rewrote the app's HTML page. One env var, DAILYBRIEF_DATA, now separates a read-only install from each Windows user's data.
In short
- A packaged build pointed at one hardcoded project path, and the daily pipeline also rewrote the app's own HTML page with each day's plan.
- I separated an install root (read-only, shared) from a data folder under the user's app data, chosen once in main.js and passed to every script as DAILYBRIEFDATA.
- Running a script by hand without the variable still works, because the data folder falls back to the script folder.
#electron#packaging#powershell#architecture
·6 min read

DailyBrief · Story
Georgian text turned into mojibake, and I repaired it with a reversed cp1252 table
UTF-8 read as Windows-1252 turned my Georgian task titles into Latin garbage. A Latin-1 round trip cannot undo it, so the fix is cp1252's own table reversed, with guards that never touch good text.
In short
- An older version of my PowerShell scripts read UTF-8 as Windows-1252 and saved the result back as UTF-8, so Georgian text turned into Latin-looking garbage.
- A Latin-1 round trip cannot undo it, because cp1252 maps bytes 0x80-0x9F to characters outside Latin-1, and Georgian UTF-8 is full of those bytes.
- The repair is a reverse table plus two safety checks, and it runs on read, so the files heal themselves.
#encoding#utf-8#electron#powershell#georgian
·6 min read

My video compressor picks a GPU encoder from a list, and never asks the GPU
ffmpeg -encoders lists what the build contains, not what the machine can run. Reading my own encoder selection code, I found a silent CPU fallback, two option vocabularies and a discarded error.
In short
- Hardware encoder choice is a substring check on ffmpeg -encoders, which lists what the build contains, not what the machine can run.
- A missing encoder silently falls back to libx264 or libx265, and the encoder options differ between the software and hardware paths.
- When a hardware encode fails, the only message the user gets is FFmpeg exited with code N.
#electron#ffmpeg#nvenc#error-handling
·5 min read

Pterodactyl yolks · Story
A Crystal image that built fine but could not link: the tarball's static libgc
The official Crystal tarball bundles a static libgc.a built for a newer glibc than Debian bookworm. The Dockerfile deletes it so the linker uses the system libgc instead.
In short
- The official Crystal tarball ships a static libgc.a that needs a symbol (isoc23strtol) newer than glibc in Debian bookworm.
- The Dockerfile deletes /opt/crystal/lib/crystal/libgc.a and installs libgc-dev, so the linker uses Debian's own libgc.
- One image per Crystal version, picked by a build argument, with the C library headers Crystal links against installed up front.
#docker#crystal#glibc#linker#pterodactyl
·6 min read

DailyBrief rebuilt every project card every 30 minutes, so I added a fingerprint cache
Most projects had not changed between runs, yet git log and a TODO scan ran for all of them. The hard parts were a fingerprint git status alone could not provide, and PowerShell 5.1 array quirks.
In short
- discover-projects.ps1 rebuilt every project card from scratch on each 30 minute run, including git history and a TODO scan.
- Each card now gets a fingerprint (HEAD, branch, dirty list plus the mtimes of the dirty files). If it matches the last run, the expensive fields are reused and the cheap ones are recomputed.
- Reusing a card is only safe if it serializes exactly like a fresh one, and PowerShell 5.1 made that harder than the cache itself.
#powershell#caching#git#performance
·5 min read

DailyBrief · Story
Letting an AI edit a real repo: its own branch, and git's stderr
The execute run refuses non-git folders and works on dailybrief/<taskid> so one checkout undoes it. Git's success messages on stderr almost killed it.
In short
- The execute run refuses any folder that is not a git repo, checks out dailybrief/<taskid> before the model starts, and forbids commit, push, reset and branch switching in its prompt.
- Because uncommitted work travels with a checkout, git checkout - drops everything the model did without touching what was already dirty.
- Git writes progress to stderr even on success, which PowerShell can treat as an error, so every git call goes through a wrapper that relaxes the error preference.
#powershell#git#ai-agents#safety
·5 min read

In TaskPad a star is a marker, so Markdown needed a translation layer
Markdown bullets collide with TaskPad's own markers. Import respects code fences, export maps states to Markdown and turns comments into footnotes.
In short
- TaskPad has its own line syntax with markers like !, ?, and [ ], so Markdown cannot go in or out as plain text without translation.
- Import is a line-by-line pass that respects code fences and rewrites and + bullets to -; export maps every marker, turns comment threads into footnotes and forces hard line breaks.
- Export refuses to write over the note's own file, and a plain-text export exists for places where Markdown would be noise.
#csharp#wpf#markdown#parsing