Case studies
#powershell#debugging#windows#electron#docker#pterodactyl#python#csharp#wpf#bash#security#cpp#git#performance#ci#nodejs#pyside6#react-native
43 posts
Clear filters·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
·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
·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

Pterodactyl yolks · Story
Vaultwarden on a game-server panel: hashing the admin token at every start
A panel variable should be something a person can type. The Vaultwarden image hashes the admin password with argon2 on each boot, and unsets the token when the field is empty.
In short
- The panel variable VWADMINPASSWORD is hashed with the argon2 CLI at each start and exported as ADMINTOKEN; an empty variable unsets the token and disables /admin.
- The image is the official Vaultwarden one, re-based to run as an unprivileged container user, with all state under /home/container/data and the port taken from the panel's allocation.
- The script also warns when a saved config.json exists, because settings saved on the admin page override the panel's variables, and it turns a bare domain into an https:// one.
#docker#bash#vaultwarden#pterodactyl#argon2
·5 min read

DailyBrief · Story
I made the wheel pan a kanban board, then cut it down to Ctrl+wheel two months later
A careful wheel handler that scrolled a column first and the board second still felt wrong. I replaced 21 lines with 10 and paid for it with Ctrl+wheel zoom over the board.
In short
- On 25 Aug (dfd8ecd) a plain wheel over the board panned it sideways once the column under the cursor had nothing left to scroll. On 26 Oct (8cf68ae) I replaced that with Ctrl+wheel only.
- The old handler needed a loop up the DOM tree to ask each element whether it could still scroll. The new one has no such guesswork; the commit diff is 10 lines added and 21 removed.
- Ctrl+wheel was already the zoom gesture, so the handler calls preventDefault() and the window loses wheel zoom while the cursor is over the board. I kept that trade and documented it in the zoom hint.
#electron#javascript#ux#scrolling
·5 min read

DiskDesk · Story
Two things my DiskDesk release workflow got wrong in its first hour
gh release create fails when the release already exists, and $env:ProgramFiles(x86) does not mean what it looks like in PowerShell. Two small CI fixes, 14 seconds apart.
In short
- The workflow ended with gh release create, which assumes the release does not exist yet; a tag pushed by hand or a rerun breaks that assumption.
- The Inno Setup path used $env:ProgramFiles(x86) in PowerShell, whose parentheses are not part of the variable name, so it needed braces.
- The fix is two small edits, but the version guard and the workflowdispatch split around them are what keep a release honest.
#github-actions#powershell#ci#windows
·5 min read

DailyBrief · Story
My workspace on G: was invisible to DailyBrief, and the fix exposed a 3 minute scan
Every scan root was hardcoded under the user profile, so a workspace on another drive never showed up. Making folders configurable meant fixing a walk that entered every node_modules first.
In short
- The scan roots were a hardcoded list of folders under %USERPROFILE%, so a workspace on another drive was invisible to every script.
- Get-ChildItem -Recurse entered every nodemodules and .git folder and filtered the results afterwards; the source comment in core/walk.ps1 puts that at three minutes per monitor run on G:\Desktop.
- A shared roots.ps1 now feeds every script, a pruned walk never enters dependency folders, and removing a folder no longer triggers a full rescan.
#powershell#filesystem#performance#electron
·5 min read

Desktop Grid · Story
Why a Desktop Grid zone looked right while dragging and re-inflated after the drop
Deleted icons stayed in a pinned zone's kept list forever, and the icon-hugging border kept stretching toward their old spots. A 5-tick grace period fixed it.
In short
- A pinned zone keeps a list of icon positions, and a deleted or renamed icon stayed in that list forever.
- The border draws itself around every kept position, so a ghost icon far from the zone re-inflated the border after each drop.
- Entries missing for 5 consecutive enforcement ticks, about 10 seconds, are now forgotten, and auto-fit zones re-fit when that happens.
#python#pyside6#windows#debugging