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

Putting Directus on a Pterodactyl panel: uid 1000, tini and a PUBLIC_URL
The official Directus image does not run on Wings as is. Node already owns uid 1000, the panel expands its own startup string, and PUBLIC_URL has to come from one domain field.
In short
- The official Directus image is reused as the base, because the npm package needs native builds of sharp and sqlite3 per platform, which the image already carries.
- Wings needs uid 1000 as a user named container, tini as PID 1, and a startup string it expands itself; the image reproduces all three.
- A start script turns panel variables into Directus settings, including building PUBLICURL from a domain, and a later commit renamed that variable to CMSDOMAIN.
#docker#pterodactyl#bash#directus
·5 min read

A publish step that never worked, because headless Claude has no Artifact tool
DailyBrief asked a headless CLI run to use a tool it does not have. The rewrite builds the markdown in PowerShell, serializes every argument itself and treats the model's reply as untrusted.
In short
- The old publisher told a headless claude -p run to use the Artifact tool, which a headless session does not have, so it never worked.
- The new one builds the markdown in PowerShell, serializes every tool argument itself, and gives a small model only the job of passing them on.
- Everything the model returns is treated as untrusted: the doc link is stored only if it is plausible, and the body id only if it matches an id pattern.
#claude-cli#powershell#automation#llm
·5 min read

DailyBrief's run estimate averaged two programs, so I switched to a median by kind
The pre-run cost estimate averaged the last 10 runs, including ones from before the lean runner and slow outliers. A median over same-kind lean runs fixed it, with tests.
In short
- estimateRun averaged the last 10 ok runs of a mode, mixing pre-lean runs, slow outliers, and per-project checks with whole-board checks.
- The replacement is a pure module, src/estimate.js: lean-era runs only, the median of the newest 9, and runs of the same kind when there are at least 2 of them.
- Seed defaults were re-measured per kind of check, and five node:test cases pin the behaviour.
#javascript#electron#testing#estimation
·5 min read

Zig images for Pterodactyl: four compiler versions, two tarball names
One Dockerfile builds four Zig releases for amd64 and arm64, and a start script that checks build.zig before passing flags and explains every failure in a sentence.
In short
- One Dockerfile takes ZIGVERSION as a build argument, tries the new tarball name first and falls back to the pre-0.14.1 name.
- The start script only passes -Doptimize when build.zig declares it, and refuses to guess when a build produces zero or several executables.
- CI builds four versions for amd64 and arm64 and rebuilds monthly, so base-image security updates arrive without a code change.
#docker#zig#pterodactyl#github-actions#bash
·5 min read

TaskPad setup quits the running copy over its own named pipe, not with Kill
The installer used to leave the old TaskPad running, so updates waited for a restart. Setup now sends a quit message through the single-instance pipe, so tabs and unsaved text survive.
In short
- Setup now asks the running TaskPad to quit over the named pipe the app already uses for single-instance handoff, then falls back to closing windows and, only if allowed, killing the process.
- A quit request saves the session and closes windows without prompts, so tabs and unsaved text survive the reinstall.
- The interactive installer asks before forcing; the silent installer forces after 15 seconds, because nobody is there to answer.
#csharp#wpf#named-pipes#installer#windows
·6 min read

Parallel AI checks kept overwriting my kanban board, so I added a lock and a merge
Several AI runs and the page saved the same kanban.json, and the last writer won. A shared lock file was not enough, so saves became a three-way merge.
In short
- Parallel AI checks and the user's own board saves all did read-modify-write on the same kanban.json, so the last writer dropped everyone else's changes.
- I added one lock file that both Node and PowerShell take, and a three-way merge so a page save is merged with what the scripts wrote meanwhile instead of overwriting it.
- If the lock cannot be taken, nothing is written and the user sees an error, because an unlocked write is exactly the bug being fixed.
#electron#concurrency#file-locking#powershell
·8 min read

Teaching CodeT5 to read renamed Python: a deobfuscator experiment
I fine-tuned CodeT5 to undo variable renaming in Python. The first run promised 23 hours on CPU, and my own obfuscator turned out to break the syntax it was meant to preserve.
In short
- My obfuscator replaced every word that was not on a 13-item keyword list, so in, not, as and None became variables and the "obfuscated" input was often not valid Python.
- The same training job looked like a 23 hour 41 minute job on CPU (5,625 steps at 15.19 s/it) and a roughly 30 minute job on the GPU (1,405 steps at 1.17 s/it).
- The evaluation log has 740 scored examples with mean BLEU 0.250, ROUGE-1 0.344 and ROUGE-L 0.309. Only 51 of them reach ROUGE-L 0.5.
#python#machine-learning#codet5#code-analysis
·10 min read

Desktop Grid: a click-through desktop overlay in Python and Qt
I wanted labeled zones drawn on my Windows desktop that never block a click. Qt swallowed input, so I toggled one window style on a 60 ms poll. I also built a feature in 10 commits and reverted it.
In short
- The overlay is a translucent Qt window across the virtual screen, pinned just above the wallpaper, and clicks pass through because a 60 ms poll toggles the WSEXTRANSPARENT window style.
- Desktop icons are read and moved by sending list-view messages to explorer.exe and exchanging data through memory allocated inside that process.
- Icon layouts are saved per display setup, keyed like 2560x1440@1, and restored a moment after the resolution changes.
#python#pyside6#windows#ctypes