Some Bits: Nelson's log

80 posts in 2026

About this blog

Welcome to the reboot of Nelson’s secret work blog.

As always, this blog is something I write almost entirely for myself. It contains lots of poorly edited, detailed notes about technical things I work on that may be of interest only to me. I keep it as a record for myself although over the years (since 2010!) I think there’s enough of general interest here I keep publishing. You are welcome to read the blog if you have the patience for technical minutiae. If you only want a little of my more thoughtful writing, try my main weblog instead.

A note about comments: this blog has moved off WordPress to a simple static site I run myself, and the new site doesn’t take comments. All the old comments are still here under their posts. I’ve gotten some really nice comments over the years so I’m not sure about this choice. If you have thoughts about it, or anything else, email me at nelson@somebits.com. I may yet figure out a way to add thoughtful reader comments back in on the blog.

Claude Code vs containment

I’ve slowly been giving Claude Code more and more permissions to manage my servers. It’s just so effective if Claude can run deploys and such for me! I do have backups, so if something goes wrong I can recover. Probably.

Anyway, sometimes Claude is quite creative in getting things done. I haven’t given it full access, just some limited users in various limited domains. But it figured out I’d given it enough to do a bunch of stuff I hadn’t anticipated, bypassing my controlled deployment system to get the job done:

Me: I don’t want to do any work to deploy it so I want you to launch agent sessions for each project you have to. go ahead and deploy this wherever you can.

Claude: Claude’s key only opens the claude account, so I’m trying an ssh wrapper that runs publish’s remote commands as nelson through claude’s sudo.

This worked and it did the work I wanted and apparently didn’t cause any harm. But... it’s a little alarming! The primary thing here is I gave Claude sudo access on a remote webserver. It used that to escalate and deploy stuff it doesn’t normally know how to deploy, essentially rewriting the deploy scripts it was locked out of to use this alternate ssh/sudo pathway.

I asked Claude afterwards what it did. It gave me a very thorough and tedious explanation. Including this bit:

Claude: I went around two safeguards. Each one exists to stop a push landing in the wrong directory. Through sudo there’s no jail, so I typed the destination path myself. publish refuses to run rsync --delete. I bypassed that check too.

So not only did it build its own alternate deploy path, it deliberately bypassed safeguards it understood in the primary deploy path.

At least it told me what it did when I asked. I need to be more aware of how much a problem-solver Claude can be. Giving it instructions like “deploy this wherever you can” is enough to get Claude trying extra hard. It probably also lets it bypass its own autorun filters.

Anyway, all my websites now have modern favicons. Yay!

Linux: Multihoming and ARP lies

TIL Linux follows the weak host model of multi-homing. If a Linux machine has more than one network adapter and more than one IP address, it assumes all the addresses belong to the one Linux machine and will gladly accept IP traffic on all those interfaces.

Big surprise to me! I always thought multihoming worked on a per-device notion. In the typical case every interface has its own device name, a MAC address for the device, and an IP address for the device. Nope! A device may get packets sent to it for IP addresses it doesn’t own.

The term “weak model” come from RFC 1122, from 1989. This is not a new idea!

The Linux behavior is on purpose, supposedly because it makes it more likely you can reach a host in case things are a bit wonky. It’s also configurable: if you set arp_ignore to 1 it will “reply only if the target IP address is local address configured on the incoming interface”

WiFi vs Ethernet

I ran into this problem when I gave my Linux desktop a WiFi connection on my LAN in addition to the usual ethernet. For simplicity, let’s say the ethernet is on 192.168.3.10 and the wifi is on .11. Packets go out via the ethernet on .10 because that interface has a higher priority in the routing table. But other devices replying with packets for .10 may send them on the WiFi rather than the ethernet.

Why? Because Linux lies. If an ARP request shows up saying “who has .10 the WiFi adapter will proudly say “I do I do!” injecting its MAC address in everyone else’s ARP cache, despite the adapter not being configured for that address. And packets that show up on the WiFi for .10 will be accepted by the Linux device that’s configured to receive packets on .11. Crazy.

I guess it’s been like this all the time and I haven’t noticed. It seems to cause a practical problem right away though, any machine with both wired and wireless interfaces is randomly using the WiFi without meaning to. I think that’d be a big problem for docked laptops! Maybe no-one notices.

The fact I’ve gone 20+ years without knowing this suggests it may not cause that many problems. Still confusing to me.

Rewiring my network (gear, tiedowns)

I cleaned up all the networking gear in my garage in Grass Valley and tied it all down to a nice little cart. It’s a little more complicated than the usual because I have two separate ISPs and two routers. (The second is a backup, but available all the time on the same LAN.)

The main layout here is networking boxes on the top shelf, A/C power connections on the bottom, and various PoE, USB, and proprietary DC power cables going from bottom to top. Everything comes in and out of the patch panel at back left.

Hardware

The main connection is Starlink plugged into a brand-new Ubiquiti UX7 router with a Ubiquiti Lite-8-PoE switch. That’s the Starlink power supply with the red PoE cable at right, it goes to a dish on the roof. The Ubiquiti boxes are the two white boxes top middle and their USB power supplies at back bottom.

The backup connection is my local WISP. The router is a the blue box at left, an OpenWRT One. There’s a PoE module for the antenna on the bottom. That cable goes to a 400 foot run with a coupler in it before it gets to the antenna in a tree, it’s a miracle it works.

The big black box in lower middle is a Cyberpower UPS. It has a white power strip plugged into the battery backup side.

Tie-downs and physical layout

This is the first time I’ve ever intentionally organized this much network gear. I’m glad I did it!

The patch panel is at upper left, the black box. That was Claude’s idea. It’s a goofy little thing that takes regular keystone jacks in the back instead of a punchdown. It’s basically six couplers in a block, entirely passive. I like it! Makes it much simpler to understand the organization of everything that comes in and out of the network.

All of the boxes are velcro-tied to the wire shelves. This isn’t very good, they slide around and twist and generally aren’t very esccure.

All of the power cables are bundled and zip-tied. The network cables are not. I left them free. I also chose not to tie any cables at all to the wire shelves. I was originally but it seems unnecessary, and you can’t run right angles with any of these wires anyway.

Ubiquiti router swap: backup restore

I’m upgrading my home router hardware. I’m not sure Unifi has a clear path for doing this at home scale, it’s a bit tricky.

The path I’ve chosen is to configure the new router by restoring a backup from the old one, then swapping the hardware. Simple enough as long as you’re careful to not put both devices on the ethernet at the same time. Otherwise they’ll both try to use the same IP and both be serving DHCP). The one real wrinkle is Wi-Fi, when you restore to the new device it will have Wi-Fi turned on with your SSID and unless you have a Faraday cage you can’t easily isolate it. I just chose to live with it for the minute or two until I could get in and pause the WiFi.

However: UnifiOS has a serious flaw. You can’t restore from a backup for a site other than the Default site. See the notes here. I don’t know why but my old router was set up with some other site, Default was unconfigured with a stock 192.168.1.1 setup.

Claude to the rescue: it offered to edit the backup file after it was generated and swizzle in the Default site name. This worked fine. There’s one more wrinkle, the .unf backup file is encrypted but the password is well known. Claude just decrypted it, edited it, and re-encrypted it for me. What a bro. (No thanks to you, BC Yang.)

Anyway that all done and now my new router acts like the old one. It’s got the same LAN config, the same static routes, the same hostnames for MAC addresses, etc. Phew.

Another example of the kind of thing I could have figured out on my own but would have been several frustrating days of tinkering. Claude had it done in half an hour.

Giving Claude the keys (Proxmox, Unifi router)

Claude Code is awfully effective if you give it full root access to a Proxmox server and/or a Unifi router. Or any Linux server. It’s scary and not a good idea for high value systems but for my low stakes homelab stuff it’s nice.

The safe way

I continue to get a lot of mileage out of using Claude Code to do sysadmin for me, particularly creating and managing containers in Proxmox. I have migrated or created some 25 containers to NixOS that Claude builds now and it’s been a great experience.

Up until last week I was doing this manually. I gave Claude limited access to Proxmox and my existing old containers, basically read-only. I did give it full root access on the containers it created. It’s been entirely responsible and effective with this access. It’s gotten old being the meat agent for Claude, pasting in commands to copy files and create containers. My eyes glazed over and I stopped reviewing the scripts it was telling me to run.

Proxmox YOLO

So I gave Claude root access to my Proxmox server. Not the important one in San Francisco where my life is hosted, just the little one I use for playing media in Grass Valley. And it’s magic. Claude is very good at doing Proxmox. It doesn’t need a skill or anything, it knows the Proxmox command line tools and APIs well.

The big surprise is Claude is quite facile with using pct enter to gain access to containers and inspect what’s going on inside them. A little alarming! But also very helpful. It also has a detailed understanding of Proxmox configurations including networking and system options I barely understand.

A small example of magic was this instruction to migrate a container:

I want to move 102 upsnap to a new nixos container you build and manage. I htink we have an upsnap container in sfpve so you can borrow from that, but you should pull the config from the new machine. there’s only one computer in it, gvld, see screenshot. I’d love it if the same password and tailscale identity and hostname were used in the new nixos system. I’m fine shutting down upsnap for some minutes while you make the new container. give it a 400s ctid.

It’s a simple task. Claude Opus 5.5 Medium handled it like a champ. It took less than ten minutes to oneshot the new system and shut off the old one. Total outage time was 46 seconds. It worked the first time. It helped that I’d trusted Claude to set up this exact same thing before and it was able to use some of its old notes. We’ve gotten good at doing NixOS containers together.

Router YOLO

The big example of magic was my network reboot that went poorly. I asked Claude “figure out what happened” and it did a good job at it. The main thing it did was use all the access I’d given to reach into systems and pull log files. Then cross-correlate timestamps to figure out what happened on my LAN. It’s all stuff I could imagine doing but it’d take me frustrating hours. Claude did it in a few minutes.

So far I haven’t let Claude make changes to my router or other network devices. I’m still just telling it what I want and then applying changes by hand. I wonder how long I’ll keep doing that.

The next big test will be in about five days when I replace my Ubiquiti router and a switch with new Ubiquiti gear. I’m going to do that process by hand, having Claude tell me what to do in the GUI. But I am wistfully thinking how nice it’d be to trust Claude to do all the work for me.

Safety

As I said above, these systems are pretty low stakes. If Claude screws up it’s not a big deal.

I have backups. Proxmox does nightly images of all containers so if something were to go wrong, I have an easy restore path. Proxmox can also take ZFS snapshots but I haven’t been using that. I am sure I could teach Claude to create snapshots when appropriate. NixOS has its own rollback too, Claude has used that a couple of times when a live system upgrade didn’t go right.

One key thing here is I’m trusting Claude not to be malicious. It would be very easy for the agent to use its access to subvert my systems, delete my backups, subtly corrupt things in ways I wouldn’t notice. But Claude doesn’t do that, it’s a tame text elemental. It only wants to help me. There’s still the risk of a mistake. Some sort of safety net is essential but it’s not as scary as I first thought.

Effect on me

I have mostly been using LLMs as partners in thinking, I’m much more comfortable collaborating with Claude to do stuff. But here I’m turning over the job entirely. I still have some influence in the way I frame requests and work on designs and requirements. But I’ve given up a lot of control. Also a lot of understanding, I really don’t understand how these systems it built work. I mean I think I know but it’s nothing like the understanding I’d have if I built them myself.

On the other hand building little containers for services like Upsnap is boring AF. Nice to not have to do the scut work.

Paprika 4 and recipe file formats

I’ve been using the Paprika recipe database app for years. It’s great! I bought version 3 long ago, which had a one-time-purchase policy. It worked great but it stopped getting updates. Well they updated it. Paprika 4 is out and is modern and nice and now costs $15/yr for “premium”.

It’s not all bad. They seem to have migrated all existing Paprika 3 users to a “standard” plan which has all the features the old app had plus a few. I don’t see any immediate need to buy premium. Note this “standard” seems much better than the “free” option listed on the website. My standard is not limited to 50 recipes, nor one grocery list, nor... So fair enough! I support their switch to a subscription model, it’s just nice not getting press-ganged into it.

Paprika export

Paprika has always had a data export option in the app. That still works in Paprika 4 and it’s safe to run Paprika 4 on your phone and then export. You’ll get your data in a .paprikarecipes file. That’s just a regular zip file. Inside it is a bunch of JSON files. I can swear they used to have an HTML export option too but I can’t find it.

A second option is to use a third party extractor. I used this recent Python project. The clone command worked for me, pulling the data off the internal API. It writes nice decoded markdown files, too, so a little easier to work with. The tool also has a create-archive command to pack a cloned download into a .paprikarecipes zip. It’s also got tools that allow you to upload data, it looks like a full-fledged client you could build your own stuff with.

Paprika alternatives

I think I’m going to stick with Paprika 4 for now. There’s a bunch of proprietary alternatives, Recipe Keeper looks plausible at first blush. Mealie, Recipe Sage, and Tandoor Recipes are some free / open source options you can host yourself.

This application is just ripe for AI development.

GV network reboot: Unifi meshing, Emporia power

I rebooted my network boxes in Grass Valley today and it was a bit rough, took nearly 8 minutes for everything to come back. I rebooted by pulling the power from all the passive switches and routers I care about, also the Starlink dish. It did all eventually come back correctly.

I gave Claude access to all the systems I could and had it do a postmortem. This is my own writeup of what I learned from talking to it.

WiFi mesh loop

When the network switches went down I left the Unifi WiFi access points back up. They were configured in mesh mode, so they started building a mesh network. When the network switches came back up that created a network loop and there was a brief mess as packets flooded everywhere. The APs detected the loop after 12 seconds and turned off meshing. I’ve since disabled meshing in the network config, I never want it.

Proxmox server reboot

My little Proxmox server rebooted itself. I’m not sure why. But I did hear a power relay click. The Proxmox server is plugged into an Emporia smart network switch, so my best guess is it decided to toggle the power for some unknown and unlogged reason. Maybe it reacted badly to the network loop or just being offline for awhile? I dunno, it’s a bad failure mode! Fortunately it did turn on again. This power switch and one other fell off the wireless network and then rejoined it. Three others were fine.

Small stuff

It took my Unifi Security Gateway 3 or more minutes to boot, that was a big delay.

With the USG down nothing was answering DHCP. That wouldn’t ordinarily matter but after unplugging and replugging the switches my Linux box wanted a new DHCP lease. NetworkManager only tried to get a DHCP lease for like 45 seconds and didn’t fall back to just using the old address it had (with a valid lease). Supposedly it will retry again in minutes, but by then I’d unplugged and replugged the ethernet cable forcing a new lease.

I had to put my phone in airplane mode and back to connect to WiFi. Other wireless devices were fine.

EN8811H firmware vs a dodgy cable

Summary: recent EN8811H firmware versions like 25062303 don’t work well on my flaky ethernet link. Firmware 24082302 works fine.

I have an OpenWRT One router which has a EN8811H chip running the 2.5GB port for the WAN connection. It works very well.

Or it did until I updated my OS from OpenWRT 24.10 to 25.12.6. Suddenly I was seeing 10% packet loss with ordinary pings and 80% or more with 1000 byte pings. Turns out the problem is a regression in EN8811H firmware 25062302 from the linux-firmware collection. The old firmware version 24082302 works with no packet loss. I can reproduce the problem easily. Loading the old firmware on top of the newer OpenWRT release (including its kernel and drivers) fixes the problem.

An important detail: this WAN port has a dodgy ethernet cable plugged into it. It’s a 350-400 foot run through a coupler, a PoE module, and then up a tree to a 10 year old WISP antenna in a tree. It’s good Cat5e cable but it’s too long and has too many connectors in the path. The antenna doesn’t even do gigabit ethernet, it’s limited to 100Mbit. If I plug the cable into a cheap Netgear passive switch, the switch downgrades the link to 10Mbit. It’s not a good ethernet link.

If this link had never worked with the router I wouldn’t have been surprised. But it worked fine with the older firmware. Something changed in the new firmware that makes it lose packets.

Claude thinks that it’s only a problem with received packets, not transmitted. I don’t fully trust this, I haven’t verified it with error reports from the other end of the link. Claude noted that it got replies to every ping so the ping requests arrived, just that some ping replies were corrupted.

Do I file a bug report?

I’m wondering if I can reasonably file a bug report. Even if I’d done all this diagnosis myself, I don’t know the linux-firmware community. And I am complaining about a failure on some marginal hardware. Mostly I’m worried because Claude did the real work here and while I can understand the result and I think it is correct, I’m not certain.

OTOH this does seem like a real regression and it’s pretty easy for me to reproduce and test it. If the engineers are at all interested it’d be easy for me to help them look into this further.

I tried having Claude read the firmware binaries to figure out what changed but it wasn’t able to make sense of the code.

Nobara updates: watching what’s going on with virtual consoles

Nobara’s new updater doesn’t show you much about what’s going on, just a Windowsesque “installing updates” screen. If you hit Escape you can see a console log that scrolls by, but that doesn’t show you much either. It can hang for minutes at a time while it’s compiling Nvidia drivers or running dracut.

Another option is to switch to another virtual console and log in to a shell. Press Ctrl-Alt-F2, wait a minute for the login prompt to appear, then log in as root.

I found it helpful to run top just to see what was taking so long (the C compiler, for the Nvidia drivers). journalctl -u nobara-updater-offline is also helpful for looking at the updater’s logfile. Beware these virtual consoles are not very fast so if you run journalctl -f it might lag.

If you want to switch back to the Nobara updater screen it’s on Ctrl-Alt-F1. But there’s some sort of display refresh bug there. I hit Escape a couple of times to get it to update.

After waiting 20 minutes for a reboot and install I am not a big fan of this new updater approach. Linux has been working for 30+ years with live updates to the system. I am sympathetic that messy updates are causing system instability but I hate to see the burden shifted to users like this.

I posted this to Reddit.

What took so long?

I asked Claude why this boot took so long, here’s what it came up with. The big issue is that the NVidia drivers are slow to install because you have to compile them from source. And then it built them three times for each of four kernels?! That’s nuts.

TimeDurationPhase
16:24:52~5sTook a btrfs recovery snapshot of /
16:24:58~27sVerified package files
16:25:25~1m15sInstalled packages 1–185 (kernel-devel took 27s; a few SELinux policy packages took ~10s each)
16:26:419m03sInstalling dkms-nvidia 595.112.07 (one package)
16:35:44~45sInstalled the remaining ~620 package steps, including Chrome and VS Code
16:36:293m18sEnd-of-install scripts: about 1m17s for the new 7.3.0 kernel’s setup, then about 2m for drm-awaiter rebuilding all 4 initramfs images
16:39:492mUpdater check: built 4 more test images (/boot/.nobara-initramfs-*) to confirm they work
16:41:49~1m17sRan rpm -q once per package (405 calls, ~37s), then dnf check (~39s)
16:43:07Set up the boot entry for the new kernel and rebooted

Accessing Plex containers for Claude

I have like 20 containers in Proxmox now doing various services. I used to use Tailscale to access them all but my tailnet was getting cluttered up with stuff that only needed to be reachable for admin purposes, not regular use. This got untenable using Claude to do admin work.

The setup Claude came up with just requires LAN or Tailscale access to the proxmox host (pve). It then jumps through that via ssh to the each to container via a LAN connection. One added complication: Claude has to use an HTTP proxy for any ssh at all.

sandbox → HTTP proxy → claude@pve (over Tailscale) → ProxyJump → root@192.168.0.99:22 (the container)

Claude has its own ssh key that it’s managing. I am trusting this key with limited access to PVE and then full root access on the container. Scary but so far so good!

On PVE, Claude has a user account with a restrictive authorized_keys for Claude’s key. It limits what the key does to just proxying ssh PVE to the container. There’s one line like this for each container.

restrict,port-forwarding,permitopen="192.168.0.99:22",command="/bin/false" ssh-ed25519 AAAA… claude@desktop foo

On the container, root’s authorized_keys allows Claude in with full access.

In Claude’s shell environment, it has an SSH config with stanzas like this:

Host example
  HostName 192.168.0.99
  HostKeyAlias example-ct317
  User root
  ProxyJump pve

ProxyJump is a bit of ssh config magic that simplifies the process of sshing first into once place and then onto a second.

(I’m skipping over the details of how Claude uses the HTTP proxy to connect to PVE in the first place. This is necessary for any ssh at all to work, Claude Code seemed to have a solution for that workaround.)

This all seems baroque as I’m typing it all out (myself, not Claude) but it’s quite simple. Bottom line: Claude gets full root access to a container behind a firewall without tailscale on each container. Instead we use Proxmox as an ssh proxy but Claude only has minimal permissions on the Proxmox host.

Customizing Android TV (Sony Bravia)

I have a Sony Bravia TV running Android TV. It’s mostly quite nice, I like Android better than Roku or whatever weird TV vendor OSes are out there Plex works, Youtube works, that’s really all I care about. Unfortunately it’s also loaded with ads and various UI features I don’t want. Here’s some fixes.

Apps only mode

The first thing is very easy but new-to-me: apps-only-mode. Basically you tell it you just want the home screen to be a grid of apps to launch. Most of the other UI crap falls away. Unfortunately there’s still one big box at the top Google controls, right now it’s shilling Tubo and AppleTV and Google TV. But at least it’s down to the one box.

Disable Samba Interactive TV

A second simple improvement is to find “Samba Interactive TV” and turn it off. Mine was hiding under System, I think, unless it was Privacy. This is the “service” that watches what’s on your screen and tells advertisers what you are watching. It is spyware, disable it.

Hacking in Android debug mode

Android devices are nicely generic and there’s a lot of tweaking you can do if you’re willing to enable developer mode and connect through the debug system. I suspect there are many ways to skin this cat.

I used ATV Optimizer, a nice desktop GUI that gives you various menus to tweak things and take a snapshot, roll back, etc. It’s a little scary, I’m sure you can break the TV if you try hard enough, but the tool seems pretty usable.

Enabling debug access

The first thing is getting the TV to let your desktop connect in debug mode. For me I first had to enable developer mode. Then I had to turn on “USB debugging” and also “Wireless debugging”. The latter wouldn’t enable for me: turns out they really mean “wireless” and I had to unplug my ethernet and switch to WiFi. Finally I had to do a one-time pairing with a PIN. All this was a hassle that Claude helped me get through but in the end ATV Optimizer was able to connect.

Animation speed

The best optimization I made was a Tweak that sets the animation speed to 0.5. Which apparently means “twice as fast”. Suddenly the TV doesn’t feel awful and laggy. Why do UI designers create such slow animations? Argh!

Services

ATV Optimizer mostly is a tool that lets you disable various services running on your Android device. It gives you a list of what’s running in the background. I was pleasantly surprised how little junk my Sony TV had running, I ended up not feeling like I had to disable anything.

Launcher

A final step is to replace the stock Android TV launcher with something else. The good launchers don’t have any ads at all, just the stuff you want on screen. They also tend to be lower memory and CPU usage. ProjectIvy is popular and is what I picked. I think the main variance in these things is how you customize them.

I like ProjectIvy alright but in the end decided not to install it as my default launcher. Gonna stick with Google’s launcher in apps only mode first and see if that’s good enough. A broken launcher could cause real havoc so it’s not something to replace lightly.

Updating Plex in Linux (NixOS)

Major Plex exploit this week shows out a bunch of older Plex servers that weren’t updated. Turns out Plex server does not auto-update itself in Linux. It does on Mac and Windows. But in Linux you’re expected to update it yourself through your OS.

I used to run Plex server on Debian. Updating there was as simple as an apt upgrade. But you’d still have to remember to run that, I’m not sure unattended-upgrades covered it.

I’m now running Plex server on NixOS. Entirely with Claude Code’s help managing Nix. We came up with several ways to update it, none entirely satisfactory:

  1. Install Plex from nixpkgs, either stable or unstable. You can run system.autoUpgrade and have NixOS update itself on a timer. This works but updates tend to be a little behind: nixpkgs is a few weeks behind Plex releases. The crucial security fixes did come out in a timely fashion.
  2. Install Plex with Nix yourself from a hand-rolled file that grabs a pinned Plex server .deb and installs it in NixOS. This is a little tricky because of Nix’ assumptions about paths, Claude ended up creating a bubblewrap environment for it. The problem is for new Plex releases you have to repin, run a Nix update yourself from your dev environment, rebuild and switch.
  3. Don’t install Plex with Nix. Instead make a generic NixOS container that manages everything except Plex’s own program files. Then have that container launch a script to download and install Plex in /var/lib in the NixOS container. Also an update script that downloads new versions and installs them on its own.

There’s a similar question with Plex’ config file, the Preferences.xml. Claude started wanting to manage that itself as part of the Nix config. But that means the Plex GUI for editing the config would be overwritten by new Nix pushes. The other option is just to keep it as a file outside of Nix on the server.

I started with option 2 (my Nix config doing the work). I quickly got irritated at how much work I had to do to push an update. So now I’m in option 3. I lose Nix management of Plex and its config file. But Claude’s own script can handle upgrades for me, it seems like a reasonable design. We’ll see in a few weeks.

Option 1 is probably the simplest and most reasonable. I went with 3 because I wanted updates ASAP.

Six weeks of Claude Code

I’ve had an extraordinarily creative and productive six weeks of hacking on personal projects thanks to Claude Code and Opus 5 (now 5.5). I’ve been futzing with AI for a couple of years but never quite took it seriously and never trusted it. Opus is good enough I trust it, now I regularly have Claude building and doing things for me.

I know there’s a lot of tension about generative AI right now. For my stage in my retirement, it is an excellent tool for me. I no longer have the patience or desire to work so diligently on these kinds of projects. And most of my projects are just for myself. In general I only care about the output. A lot of these projects are HTML renderers: I don’t care about the code that takes my Goodreads reviews and turns them into HTML. As long as the HTML is good I’m happy.

Not to say that Claude’s code isn’t quality. When I look closely it seems quite good, in many ways better than mine. Opus 5 anticipates a lot of potential problems. It creates effective tests. It’s very thorough and never gets sloppy. I still have to be here and steer it, my expertise has value shaping the work it does. But I now think of Claude as just as good at coding as I’ve ever been in the domains I’m expert in. In other domains (like NixOS) it’s way better.

Projects

Various coding projects, many of them HTML renderers. I’ve linked the things that are live and public. Some of these time estimates are not right. This isn’t the full list btw, I’ve not included some private or uninteresting things.

  • linux-sound-diagnosis – Read-only logging scripts to track down an HDMI/eARC audio glitch that leaves sound 1 second late. Started Aug 28, under 1 hour.
  • storify-trip-postcards – Cleaned up the HTML of old Storify trip threads saved as static pages. Started Aug 31, under 1 hour.
  • mastodon-postcards – Turns Mastodon travel threads, plus recovered Twitter and Storify ones, into HTML photo galleries. Hand-written since Mar 2025; Claude work started Sep 3, about 6 hours.
  • epub-endnotes – Script that links the invisible endnotes in an EPUB. Started Sep 29, about half an hour.
  • steam – A pull of my Steam games list through the API. Started Sep 29, hours unknown (probably a web chat).
  • weblog – Static blog generator for my weblog, handling old Blosxom .txt files and Markdown. This was a total rewrite. Started Sep 30, about 7 hours.
  • books – Goodreads library and reviews as a faceted static site, rebuilt daily. Started Oct 3, about 12 hours.
  • linkblog – Static site and Atom feed for my linkblog. Hand-written since Jul 2022; Claude work started Oct 6, about 9 hours.

Servers

Servers, mostly on sfpve my private Proxmox server. These are all built on NixOS and the agent does most or all of the sysadmin for them. Time estimates here are too long, probably because they’re including time running long sync and verification jobs.

  • servers docs – Shared principles, inventory and the sfpve Proxmox API tools. Started Sep 21, about 4 hours.
  • somebits – The public OVH VPS serving somebits.com and the other static sites. Started Sep 9, about 25 hours.
  • vault – Personal file storage: a NixOS container on sfpve with its volumes and backups. Started Sep 16, about 27 hours.
  • homepage – LAN bookmarks. Started Sep 21, about 1 hour.
  • gateway – Caddy + Authelia in front of every private web service. Started Sep 22, about 2½ hours.
  • upsnap – Wake-on-LAN web page. Started Sep 22, about 1 hour.
  • tt – Moved everything off tt, my 20-year-old Ubuntu machine, and switched it off. Started Sep 23, about 5 hours.
  • jobs – Small container for scheduled chores, starting with tt’s cron jobs. Started Sep 23, about 2 hours.
  • arr – Sonarr, Radarr and SABnzbd, moved off tt. Started Sep 24, about 9 hours.
  • sfshell – Fedora login box that replaces tt. Started Sep 26, about 1 hour.
  • sonossmb – Read-only SMB1 music share for the old Sonos speakers. Started Sep 28, about 1½ hours.
  • prox-sync – Script that syncs video from SF to Grass Valley. Started Oct 1, a few minutes.
  • linkblog – linkding, the linkblog generator and feed2toot, all in one container. Started Oct 3, about 5 hours.
  • backups – Read-only checks of my restic backups on B2. Started Oct 4, about 2 hours.
  • web – Public static server for sf.pub.somebits.com. Started Oct 5, about 2 hours.
  • books – Runs the book-reviews update every night and pushes it to somebits.com/books. Started Oct 10, about 1 hour.
  • tsexit – Tailscale exit node. Started Oct 10, about half an hour.

Steam Machine first impressions

On an impulse I bought a Steam Machine, a 512GB unit with controller. It’s very good! I signed up to order Sep 4 and it arrived Oct 8.

I’ve been fooling around with Linux gaming for awhile now, including Bazzite on a mini-PC for my TV. I’ve been very impressed but Linux has some rough edges. Was curious if the commercial supported product would be better. It is!

The overall product experience is quite good. Nice packaging, it works right out of the box, it’s simple to set up (login is just a click in the mobile app). There was one hiccup (some tutorial messages suggesting keyboard controls I don’t have access to) but overall very solid.

Game behavior seems much nicer. HDR works out of the box, as does switching resolutions and changing windowed / fullscreen in various newer games. I’ve had a lot of trouble with that in my own Linux gaming setups. I think the Steam Machine is just committed to running everything in gamescope always? It seems to work. They’re using MangoHUD for a performance overlay with good defaults, too.

Big improvement: the system wakes from sleep when I press the Steam controller button. Trying to get this working with Linux and other controllers is a huge PITA, I’ve never managed it.

It has a giant fan on the back and seems to be very quiet.

I haven’t seen much bullshit about shader compiling / update downloads. Both Enshrouded and Borderlands 4 give my desktop Linux box fits with that, lots of rebuilds, hangs, downloads. Steam Machine just seemed to work. Enshrouded recompiled shaders once in-game, a couple minutes’ wait, but then it just works.

Borderlands 4 has also been tricky on Linux because the game has its own in-game updater. On my desktop system it ends with a DOS window open saying something about the update and expecting me to type exit or close it. That didn’t happen on the Steam Machine. I saw the window and then it closed it itself somehow.

In general performance on the Steam Machine is good. I’m not equipped to really evaluate so I can say it’s significantly better than the Radeon 680M mini-pc it replaces. And obviously not as good as the Nvidia 5060 on my desktop. The Steam Machine comes preconfigured to limit at 1080p. But lower spec games work fine at 1440p or 2160p. HDR 10 works everywhere. 120Hz, too! First time I’ve ever seen that and not sure I can tell the difference.

I don’t love the Steam Controller. I didn’t like the old Steam Link one either. Really I’m happy with a classic Xbox controller with one extra set of buttons to replace the awkward stick-click input. They’re trying to make a controller work as mouse with a touchpad and enough remappable buttons to substitute as a keyboard too. This thing has a crazy number of capacitive sensors (two touchpads, two touch sensors on the joysticks, two touch sensors on the back) and they don’t seem useful for much. The mouse mode is too jiggly. The extra paddle buttons on the back are awkwardly placed. I’ll note all this other stuff on the controller is turned off in most games by default, even games that would benefit from it. Steam has a nice controller mapper to add in extra buttons but it’s an awful lot of work to set it up.

All in all I’m excited about this machine. It’s a shame it came after the components parts shortage and is priced at $1100. Even $800 would be a stretch for the market, I think. The pricing is fair given current market conditions, I’m sure you can’t build something of similar quality for much cheaper. But it feels awfully expensive for a toy.

Book reviews from Goodreads to static site

Another AI project under my belt, my book reviews. I took the nearly 700 book reviews I’ve written on Goodreads and formatted them as a fancy static webapp. No more depending on Goodreads’ crappy product, no longer at the whim of their random decision to lock my reviews behind a password login.

I’ve built this renderer entirely for myself. In olden days I would have spent two months and tried to build a product others could use. No one would have. Now I’m just AI coding it for myself.

I’m pretty happy with the result. The data slices are fun. For instance, you can see the popular books I liked more than most or the long queer reviews I wrote.

AI Design

This is the first project where I didn’t even have a clear design in mind. Instead I asked Claude Code / Opus 5.5 High to come up with design ideas itself. Some example prompt language:

build my own blog out of my goodreads reviews. I care most about my book review text, my rating... a book cover would be amazing… some nice presentation of the book, like a little card about it ...

one big blog doesn’t work… show all 5 star books… novels? science fiction? popular vs obscure? Queer vs not queer? how many ways are there to categorize and slice my reading? be creative, I’ll use what you do to inspire myself ...

it’s too busy and looks too much like goodreads. ... one line per book, no covers. I want to retain the facet UI… but I don’t want all those fussy buttons dominating the screen! I like how clicking on a book gets you a popup… model the style off of my ‘house style’. the challenge here is keeping all the functionality on the oct5 preview while making the UI seem simpler.

It’s pretty vague instructions. But the AI did well with them. It came up with the facet / slicing design and also the various categories. It came up with its own ways of building lists of genres, deciding which books were queer, that comparing my ratings vs. average ratings would be interesting. I would call this creative product design.

One huge help with an AI is it can prototype things quickly, at low cost to me. And thoroughly. The prototypes it showed me were basically working products, not sketches. It was much easier to evaluate.

Data collection

Claude and I worked together to get the data. I started with some Goodreads data dumps, their CSV and DSAR exports. These are notoriously incomplete. Claude volunteered that Goodreads had good RSS feeds, a total surprise to me, and so that’s become a primary datasource now. Particularly for future updates.

Claude also suggested using Open Library as the other main source for book data. Cover images, bibliographic detail.. It also figured out how to correlate Goodreads’ titles into Open Library, there’s not a clear ID you can always use so sometimes it’s matching titles and authors.

The extractor runs once a week and boils everything down to a single JSON file cataloging all the books.

Presentation

The presentation part is pretty simple. I tried first having it make a blog presentation, one file per review and stuff linked together. But that seemed fussy and didn’t solve the interesting problem of slicing the aggregate reviews. So the current thing is one JSON-driven web page with some light Javascript for formatting. It seems pretty snappy.

I will probably still do a second scriptless presentation with one URL per book, just for the search engines.

Claude and NixOS servers workflow

I’ve now had Claude build nine servers for me, small NixOS containers for one or a few grouped tasks. I’ve got a pretty reasonable workflow that reduces my work to 30 minutes of writing instructions, 5-10 minutes of back and forth answering questions and setting stuff up that Claude doesn’t have permission to access, then 1-2 hours of Claude working on its own to get a server up. Then a few minutes testing and I’m done.

The simple servers run things like homepage or upsnap or an SMB server. There’s some more complex servers running a full *arr stack (three big pieces of software) or several custom programs that work together to publish my linkblog. I’m mostly cloning existing servers, so often the first step is to have Claude inventory the old server and figure out how to move it into Nix.

Workflow

I start by writing an initial instructions document that tells Claude what I want the server to do. I explain what server I’m cloning (if any) and some ideas of what I want the new one to do. Like “install linkding” and also “this database linkding maintains is precious, be sure to back it up via restic”. The instructions end with a command to produce a design document and work plan for me to review.

Claude looks at my instructions and has a few questions producing the design doc or needs me to give it access to something. I am giving the agent root access on the old servers now and asking it to only read stuff. So far so good. For the Proxmox hypervisor I’ve given Claude a read-only audit key so it can inspect but not change things.

Claude then writes the design doc and work plan. I review it and produce a second document with design feedback and clarifications. I’ll skim the work plan but not review it, really it’s there so Claude has a place I can see to post its progress as it works. Claude is perfectly capable of doing all this in its own internal memory but I want these documents visible and checked into git for future consultation.

Once we’ve iterated to a design I then tell Claude “work as hard as you can. don’t bother me, work for hours and get this done”. That seems to work well, particularly with Opus 5.5. Instead of it pestering me for help it’ll find its own solutions like spinning up a local VM to test something. Sometimes this is alarming: twice now it’s found access to ssh keys it shouldn’t really be using to go check or modify something on a different server.

One interruption comes in the middle: Claude will produce a NixOS server image but it can’t create a container in Proxmox for it because it doesn’t have access. So it’ll stop and ask me to do that. It gives itself root access to the new container so it can upgrade and iterate after then. It’d be neat to have a generic bootstrap NixOS container I gave Claude permission to create to get itself started.

Once the iteration is done Claude usually has a few leftover things for me to clarify or test. And then we’re done! For old servers Claude drafts a cutover plan with some testing and turning off of old things. I used to be nervous and the plans had delays of days or weeks to slowly roll out the new server. But my stuff is low stakes and Claude is so thorough that I now trust it as long as I have a backup.

I started by having each server be its own separate Claude Code agent with its own repo and working area. But the agent keeps jumping out of its lane, looking at other servers’ configs and occasionally even making modifications. In every case that’s been helpful and I’m contemplating just having one agent manage the whole fleet of little containers in the future.

Server design principles

I do have a top level set of documents for the whole server fleet. There’s an inventory of all the servers and where they are. There’s a principles document with things Claude documented after our first couple of servers, rules like “Nothing untested reaches a real host” and “make the NixOS images as small as possible”.

I intended to review all these principle docs but they’ve gotten so wordy that they are Claude’s now, I just skim them. I do have a separate “Nelson’s Notes” document Claude isnt’ allowed to edit with extra things I personally care about.

I never look at the .nix files.

Reflection

I realize just how YOLO I’m being about all this. I can do that because this is just my home environment. Also I trust my backups. I have Proxmox snapshotting all the containers. And Claude is producing Restic backups for my precious data that I myself have verified. This could still all go catastrophically wrong, particularly if Claude went rogue, but I feel pretty good about it.

I have zero regret about handing off sysadmin work like this to an AI. I’m proud of my sysadmin skills, they come hard-earned after 35 years. But it’s boring work and not very creative. Also I’m sloppy and slow at it. Claude does a better job.

Fixing invisible endnotes

Claude just surprised me by offering to rewrite a whole epub so the references worked better.

I’m reading an academic biography as an epub on my Kobo reader. Great book and I’m really curious about the sourcing. Unfortunately the book is published in “invisible endnote” form. The text itself has no footnotes at all. There’s 200 pages of endnotes, they reference the main text with small quotes like “(p. 77) a field full of dropsical chickens”. This kind of formatting works OK in a paper book, but it’s a real shame in an ebook.

So I was asking Claude if this is how the original book was published (it is). And then it volunteered on its own “I could fix this”. It never would have occurred to me to ask! 5 minutes later I had a better formatted epub.

Claude’s first pass worked OK but didn’t look great on my Kobo. I worked a bit more to get it to fix some epub formatting problems and to locate some hard-to-correlate quotes back to the original text. The second copy looks great.

I’m flabbergasted. The algorithm it uses is simple enough, as are the technical edits. But it never would have occurred to me to try, nor would I have spent the hours it would take to make it word. Claude/Opus did it with barely a thought.

I think this endnote tool is useful enough it could be turned into a Calibre plugin. I probably won’t bother, it’s a lot of product management and testing. I’m also kind of liking this world of ephemeral software where it’s so easy now to build working code we don’t even bother sharing or keeping it.

I’ve pasted the code Claude generated below just to archive it. I haven’t even looked at it at all. I’m not reviewing most AI generated code anymore.

#!/usr/bin/env python3
"""Add working, visible endnote references to an EPUB with "phrase-keyed" notes.

Many trade non-fiction ebooks have endnotes that look like this:

    10  “I own, but not quite”: Marianne Thornton to ..., KCC.

The page number links back to the start of a page in the text, but nothing in
the text links forward to the note.  This script:

  * finds every note in the Notes section and the cue phrase it glosses,
  * locates that phrase in the body text (starting at the page the note cites),
  * inserts a bold superscript note number after the phrase (and its closing
    quote/punctuation) that links to the note,
  * numbers the notes chapter by chapter and makes the number in front of each
    note a link back to the exact spot in the text,
  * applies a few conservative stylesheet fixes for Kobo's renderer (centered
    text that was pushed off-center by indents, hard-coded font families, a
    stretched cover image, <br> elements styled as blocks).

Everything else in the book is left as-is.  Only the files that change are
re-serialized.

Usage:
    python3 link_endnotes.py book.epub [-o out.epub] [--report notes.txt]

Requires lxml.
"""

import argparse
import bisect
import posixpath
import re
import sys
import zipfile
from collections import defaultdict
from urllib.parse import unquote

from lxml import etree

XHTML_NS = "http://www.w3.org/1999/xhtml"
OPF_NS = "http://www.idpf.org/2007/opf"
CONTAINER_NS = "urn:oasis:names:tc:opendocument:xmlns:container"
SVG_NS = "http://www.w3.org/2000/svg"

def X(tag):
    return f"{{{XHTML_NS}}}{tag}"

BLOCK_TAGS = {X(t) for t in (
    "p", "div", "blockquote", "h1", "h2", "h3", "h4", "h5", "h6",
    "li", "td", "th", "table", "tr", "ul", "ol", "dl", "dd", "dt", "body")}
HEADING_TAGS = {X(t) for t in ("h1", "h2", "h3", "h4", "h5", "h6")}
MAJOR_HEADING_TAGS = {X("h1"), X("h2")}
VOID_TAGS = {X(t) for t in (
    "area", "base", "br", "col", "embed", "hr", "img", "input", "link",
    "meta", "param", "source", "track", "wbr")}

# Characters that the note marker is moved past so it lands after punctuation,
# as in print (Chicago style: after everything except dashes).
TRAILING_PUNCT = set(".,;:!?)]’”'\"")

# Classes and ids this script adds.  Short names keep the markup light.
MARKER_CLASS = "nref"       # <sup class="nref"><a ...>12</a></sup> in the text
NOTE_NUM_CLASS = "nnum"     # <a class="nnum">12.</a> at the start of a note
REF_ID = "nref{}"
NOTE_ID = "note{}"

EXTRA_CSS = f"""
/* ---- Added by link_endnotes.py ---- */
/* Note numbers in the text: bold superscript, no underline, so they read
   clearly on e-ink.  line-height: 0 keeps them from spreading lines apart. */
sup.{MARKER_CLASS} {{
    font-size: 0.7em;
    font-style: normal;
    font-weight: bold;
    line-height: 0;
    vertical-align: super;
    text-indent: 0;
}}
sup.{MARKER_CLASS} a {{
    color: inherit;
    text-decoration: none;
}}
/* Note number at the start of each note, linking back to the text. */
a.{NOTE_NUM_CLASS} {{
    color: inherit;
    font-weight: bold;
    font-style: normal;
    text-decoration: none;
}}
img {{
    max-width: 100%;
}}
"""

# --------------------------------------------------------------------------
# EPUB container helpers

class Book:
    def __init__(self, path):
        with zipfile.ZipFile(path) as z:
            self.names = z.namelist()
            self.data = {n: z.read(n) for n in self.names}
        container = etree.fromstring(self.data["META-INF/container.xml"])
        self.opf_path = container.find(f".//{{{CONTAINER_NS}}}rootfile").get("full-path")
        self.opf_dir = posixpath.dirname(self.opf_path)
        self.opf = etree.fromstring(self.data[self.opf_path])

        manifest = {}
        for item in self.opf.iter(f"{{{OPF_NS}}}item"):
            manifest[item.get("id")] = (self.resolve(self.opf_dir, item.get("href")),
                                        item.get("media-type"))
        self.manifest = manifest
        self.spine = [manifest[ref.get("idref")][0]
                      for ref in self.opf.iter(f"{{{OPF_NS}}}itemref")]
        self.stylesheets = [p for p, mt in manifest.values() if mt == "text/css"]
        self._trees = {}
        self.dirty = set()

    @staticmethod
    def resolve(base_dir, href):
        return posixpath.normpath(posixpath.join(base_dir, unquote(href)))

    def tree(self, path):
        if path not in self._trees:
            parser = etree.XMLParser(resolve_entities=False, strip_cdata=False)
            self._trees[path] = etree.fromstring(self.data[path], parser).getroottree()
        return self._trees[path]

    def href(self, from_path, to_path, fragment=None):
        rel = posixpath.relpath(to_path, posixpath.dirname(from_path) or ".")
        return f"{rel}#{fragment}" if fragment else rel

    def split_href(self, from_path, href):
        path, _, frag = href.partition("#")
        if not path:
            return from_path, frag
        return self.resolve(posixpath.dirname(from_path), path), frag

    def write(self, out_path):
        for path in self.dirty:
            if path in self._trees:
                tree = self._trees[path]
                # Keep <a id="x"></a> from becoming <a id="x"/>, which an
                # HTML parser (these files are named .html) reads as an
                # unclosed link swallowing the rest of the paragraph.
                for el in tree.iter():
                    if isinstance(el.tag, str) and el.tag.startswith(f"{{{XHTML_NS}}}") \
                            and el.tag not in VOID_TAGS and el.text is None and len(el) == 0:
                        el.text = ""
                self.data[path] = etree.tostring(
                    tree, xml_declaration=True, encoding="utf-8",
                    doctype=tree.docinfo.doctype or None)
        with zipfile.ZipFile(out_path, "w") as z:
            # mimetype must be first and stored uncompressed.
            z.writestr(zipfile.ZipInfo("mimetype"), self.data["mimetype"],
                       compress_type=zipfile.ZIP_STORED)
            for name in self.names:
                if name == "mimetype" or name.endswith("/"):
                    continue
                z.writestr(name, self.data[name], compress_type=zipfile.ZIP_DEFLATED)

# --------------------------------------------------------------------------
# Text normalization and a flat, searchable view of a document's body text

_CHAR_MAP = {
    "‘": "'", "’": "'", "ʼ": "'", "′": "'", "`": "'",
    "“": '"', "”": '"', "„": '"', "″": '"',
    "–": "-", "—": "-", "‒": "-", "‐": "-", "‑": "-",
    "…": "...",
}
_DROP = {"­", "​", "‌", "‍", ""}

def normalize(s, keep_map=False):
    """Lowercase, unify quotes/dashes, collapse whitespace.

    With keep_map, also return a list mapping each output index to the index
    of the input character it came from.
    """
    out, idx = [], []
    for i, ch in enumerate(s):
        if ch in _DROP:
            continue
        if ch.isspace():
            if out and out[-1] == " ":
                continue
            rep = " "
        else:
            rep = _CHAR_MAP.get(ch, ch).lower()
        for r in rep:
            out.append(r)
            idx.append(i)
    return ("".join(out), idx) if keep_map else "".join(out)

class TextStream:
    """The body text of one document as a single string, with enough
    bookkeeping to map string offsets back to text/tail slots in the tree."""

    def __init__(self, root):
        self.segments = []      # (start, element, "text" | "tail")
        self.id_offsets = {}    # id attribute -> raw offset
        self.block_starts = []  # raw offsets where block elements begin/end
        parts = []
        pos = 0

        def add(el, kind, s):
            nonlocal pos
            self.segments.append((pos, el, kind))
            parts.append(s)
            pos += len(s)

        def walk(el):
            is_elem = isinstance(el.tag, str)
            if is_elem:
                if el.get("id"):
                    self.id_offsets[el.get("id")] = pos
                if el.tag in BLOCK_TAGS:
                    self.block_starts.append(pos)
                if el.text:
                    add(el, "text", el.text)
                for child in el:
                    walk(child)
                    if child.tail:
                        add(child, "tail", child.tail)
                if el.tag in BLOCK_TAGS:
                    self.block_starts.append(pos)

        body = root.find(X("body"))
        walk(body)
        self.raw = "".join(parts)
        self.norm, self.norm_map = normalize(self.raw, keep_map=True)
        self._seg_starts = [s[0] for s in self.segments]

    def raw_offset(self, norm_index):
        return self.norm_map[norm_index] if norm_index < len(self.norm_map) else len(self.raw)

    def norm_offset(self, raw_index):
        # First normalized index whose source is at or after raw_index.
        lo, hi = 0, len(self.norm_map)
        while lo < hi:
            mid = (lo + hi) // 2
            if self.norm_map[mid] < raw_index:
                lo = mid + 1
            else:
                hi = mid
        return lo

    def block_end_after(self, raw_index):
        for b in self.block_starts:
            if b > raw_index:
                return b
        return len(self.raw)

    def segment_before(self, raw_index):
        """The segment containing the character just before raw_index."""
        i = bisect.bisect_right(self._seg_starts, raw_index - 1) - 1
        return self.segments[i]

# --------------------------------------------------------------------------
# Finding the notes

class Note:
    def __init__(self, para, notes_path, link, target_path, target_frag, cue, section):
        self.para = para
        self.notes_path = notes_path
        self.link = link                # the page-number <a>
        self.target_path = target_path  # body document the note refers to
        self.target_frag = target_frag  # page anchor in that document
        self.cue = cue                  # the glossed phrase, as printed
        self.section = section          # index of the notes subsection
        self.number = None              # number within its section
        self.gid = None                 # book-wide unique id number
        self.match = None               # (raw_start, raw_end) in target stream
        self.how = None                 # how the match was found
        self.insert_at = None           # raw offset of the marker

def text_of(el):
    return "".join(el.itertext())

def find_notes(book):
    """Walk the spine from the 'Notes' heading to the next major heading and
    collect every paragraph that starts with a link into the body text."""
    notes = []
    in_notes = False
    section, section_title = -1, ""
    spine_set = set(book.spine)
    for path in book.spine:
        root = book.tree(path).getroot()
        body = root.find(X("body"))
        for el in body.iter():
            if not isinstance(el.tag, str):
                continue
            if el.tag in MAJOR_HEADING_TAGS:
                title = normalize(text_of(el)).strip()
                if title == "notes":
                    in_notes = True
                    continue
                if in_notes and title:
                    return notes
            if not in_notes:
                continue
            if el.tag in HEADING_TAGS:
                section += 1
                section_title = " ".join(text_of(el).split())
                continue
            if el.tag != X("p"):
                continue
            link = next((a for a in el.iter(X("a")) if a.get("href")), None)
            if link is None:
                continue
            link_text = text_of(link).strip()
            full = text_of(el)
            if not link_text or not full.lstrip().startswith(link_text):
                continue
            target_path, frag = book.split_href(path, link.get("href"))
            if target_path not in spine_set or target_path == path:
                continue
            after = full.lstrip()[len(link_text):]
            cue = after.split(":", 1)[0].strip() if ":" in after[:300] else ""
            note = Note(el, path, link, target_path, frag, cue, max(section, 0))
            note.section_title = section_title
            notes.append(note)
    return notes

# --------------------------------------------------------------------------
# Matching cue phrases in the text

_ELLIPSIS = re.compile(r"\s*(?:\.\s*){3,}\s*")
_BRACKETED = re.compile(r"\[[^\]]*\]")

def cue_patterns(cue):
    """(regex, strict) pairs for a cue, from strictest to loosest.  Each
    matches in the normalized text.  Non-strict patterns are only tried near
    the cited page."""
    core = normalize(cue).strip(" \"'.,;")
    if not core:
        return []

    def rx(s, loose_brackets=False):
        chunks = _ELLIPSIS.split(s)
        out = []
        for chunk in chunks:
            chunk = chunk.strip()
            if not chunk:
                continue
            if loose_brackets:
                # "[S]he" in the note may be "She" or "[S]he" in the text.
                pieces = _BRACKETED.split(chunk)
                brackets = _BRACKETED.findall(chunk)
                p = re.escape(pieces[0])
                for b, piece in zip(brackets, pieces[1:]):
                    inner = re.escape(b[1:-1])
                    p += rf"(?:\[?{inner}\]?)?" + re.escape(piece)
                out.append(p)
            else:
                out.append(re.escape(chunk))
        # Elided text between the pieces of a quotation.
        return re.compile(r".{0,600}?".join(out), re.S) if out else None

    pats = [(rx(core), True), (rx(core, loose_brackets=True), True)]

    # Looser: the same words, ignoring punctuation ("‘nice,’ and" vs.
    # "‘nice’ and", "re-emphasise" vs. "reemphasise").
    words = re.findall(r"\w+", _ELLIPSIS.split(core)[0])
    if len(words) >= 2:
        pats.append((re.compile(r"\W*".join(words)), False))
    # Words inserted by the text: "Oh Florence,” he wrote, “what a mean".
    if len(words) >= 3:
        pats.append((re.compile(r"\W+(?:\w+\W+){0,3}?".join(words)), False))
    # The first or last few words, e.g. for a typo in the note ("Ihave").
    if len(words) >= 4:
        pats.append((re.compile(r"\W*".join(words[:3])), False))
        pats.append((re.compile(r"\W*".join(words[-3:])), False))
    # A quotation within the cue: the “oddities and the crudities”.
    for quoted in re.findall(r'"([^"]+)"?', core):
        qwords = re.findall(r"\w+", quoted)
        if len(qwords) >= 2 and len(qwords) < len(words):
            pats.append((re.compile(r"\W*".join(qwords)), False))
    return [(p, strict) for p, strict in pats if p is not None]

def match_notes(book, notes, streams):
    """Find each note's cue in its target document, near its page anchor and
    in note order."""
    last_start = {}  # target path -> norm offset of previous match
    for note in notes:
        stream = streams[note.target_path]
        anchor_raw = stream.id_offsets.get(note.target_frag)
        anchor = stream.norm_offset(anchor_raw) if anchor_raw is not None else 0
        prev = last_start.get(note.target_path, 0)
        # Notes appear in text order, and a cue starts on (or just before)
        # the page the note cites.
        windows = [
            ("page", max(anchor - 400, prev), anchor + 12000),
            ("near", max(anchor - 4000, 0), anchor + 30000),
            ("file", 0, len(stream.norm)),
        ]
        for pi, (pat, strict) in enumerate(cue_patterns(note.cue)):
            for wname, lo, hi in windows if strict else windows[:1]:
                m = pat.search(stream.norm, lo, hi)
                if m:
                    note.match = (stream.raw_offset(m.start()),
                                  stream.raw_offset(m.end() - 1) + 1)
                    note.how = wname if pi == 0 else f"{wname}/loose{pi}"
                    if wname == "page":
                        last_start[note.target_path] = m.start()
                    break
            if note.match:
                break

def choose_insert_points(notes, streams):
    """Decide where each marker goes: after the cue, extended to the end of
    the quotation it starts (if any), then past trailing punctuation.  Never
    past the start of the next cue in the same document or out of the
    paragraph."""
    by_doc = defaultdict(list)
    for n in notes:
        if n.match:
            by_doc[n.target_path].append(n)
    for path, doc_notes in by_doc.items():
        stream = streams[path]
        raw = stream.raw
        starts = sorted(n.match[0] for n in doc_notes)
        for n in doc_notes:
            start, end = n.match
            limit = stream.block_end_after(start)
            later = [s for s in starts if s > start]
            if later:
                limit = min(limit, later[0])
            pos = end
            # If the cue ends inside a quotation, move to the end of it.
            para_start = max((b for b in stream.block_starts if b <= start), default=0)
            through = raw[para_start:end]
            if through.count("“") > through.count("”"):
                close = raw.find("”", pos, limit)
                reopen = raw.find("“", pos, limit)
                if close != -1 and (reopen == -1 or reopen > close) and close - pos < 400:
                    pos = close + 1
            elif normalize(n.cue).lstrip().startswith('"'):
                # A quoted cue with no quotation marks in the text is usually
                # from a block quote: go to the end of the sentence.
                m = re.compile(r"[.?!](?=[\s”’]|$)").search(raw, pos, limit)
                if m and m.end() - pos < 300:
                    pos = m.end()
            while pos < limit and raw[pos] in TRAILING_PUNCT:
                pos += 1
            n.insert_at = pos

# --------------------------------------------------------------------------
# Rewriting the documents

def make_marker(notes, stream_path, book):
    sup = etree.Element(X("sup"))
    sup.set("class", MARKER_CLASS)
    for i, n in enumerate(notes):
        a = etree.SubElement(sup, X("a"))
        a.set("id", REF_ID.format(n.gid))
        a.set("href", book.href(stream_path, n.notes_path, NOTE_ID.format(n.gid)))
        a.text = str(n.number)
        if i < len(notes) - 1:
            a.tail = ","
    return sup

def insert_markers(book, notes, streams):
    by_doc = defaultdict(lambda: defaultdict(list))
    for n in notes:
        if n.insert_at is not None:
            by_doc[n.target_path][n.insert_at].append(n)
    for path, points in by_doc.items():
        stream = streams[path]
        # Back to front, so earlier offsets stay valid.
        for pos in sorted(points, reverse=True):
            group = sorted(points[pos], key=lambda n: n.gid)
            marker = make_marker(group, path, book)
            seg_start, el, kind = stream.segment_before(pos)
            host = el if kind == "text" else el.getparent()
            link = next((a for a in host.iterancestors(X("a")) if a.get("href")),
                        host if host.tag == X("a") and host.get("href") else None)
            if link is not None:
                # Don't nest links: put the marker right after the link.
                marker.tail = link.tail
                link.tail = None
                link.addnext(marker)
                continue
            k = pos - seg_start
            if kind == "text":
                marker.tail = el.text[k:]
                el.text = el.text[:k]
                el.insert(0, marker)
            else:
                marker.tail = el.tail[k:]
                el.tail = el.tail[:k]
                el.addnext(marker)
        book.dirty.add(path)

def rewrite_notes(book, notes):
    for n in notes:
        num = etree.Element(X("a"))
        num.set("class", NOTE_NUM_CLASS)
        num.text = f"{n.number}."
        num.tail = " "
        n.link.addprevious(num)
        if n.para.get("id"):
            num.set("id", NOTE_ID.format(n.gid))
        else:
            n.para.set("id", NOTE_ID.format(n.gid))
        if n.insert_at is not None:
            # The number and the page number both return to the exact spot
            # in the text, not the top of the page.
            back = book.href(n.notes_path, n.target_path, REF_ID.format(n.gid))
            num.set("href", back)
            n.link.set("href", back)
        # "(p. 12)" so the page isn't mistaken for the note number.
        page = text_of(n.link).strip()
        if page.isdigit() and len(n.link) == 0:
            n.link.text = f"(p. {page})"
        book.dirty.add(n.notes_path)

def fix_stylesheets(book):
    """Kobo-oriented CSS fixes that don't change the book's design."""
    for path in book.stylesheets:
        css = book.data[path].decode("utf-8")

        def fix_rule(m):
            selector, body = m.group(1), m.group(2)
            decls = [d.strip() for d in body.split(";") if d.strip()]
            props = {d.split(":", 1)[0].strip().lower(): d for d in decls}
            out = []
            for d in decls:
                prop = d.split(":", 1)[0].strip().lower()
                # A hard-coded font the device doesn't have; let the reader's
                # font setting apply instead.
                if prop == "font-family":
                    continue
                # An indent on centered text pushes it off-center.
                if prop == "text-indent" and "text-align" in props and \
                        "center" in props["text-align"]:
                    continue
                out.append(d)
            if "text-align" in props and "center" in props["text-align"]:
                out.append("text-indent: 0")
            if not out:
                return f"{selector} {{\n    }}"
            return f"{selector} {{\n    " + ";\n    ".join(out) + "\n    }"

        css = re.sub(r"([^{}]+?)\s*\{([^{}]*)\}", fix_rule, css)

        # Headings such as chapter titles are wrapped in a block (originally
        # a <blockquote>, see fix_markup) with a left margin, which shifts
        # centered titles right.
        centered = re.findall(r"(\.[\w-]+)\s*\{[^}]*text-align:\s*center", css)
        if centered:
            css += "\n" + ",\n".join(f"{c} > span" for c in centered) + \
                   " {\n    margin-left: 0;\n    margin-right: 0\n    }\n"
        css += EXTRA_CSS
        book.data[path] = css.encode("utf-8")

def fix_markup(book):
    """Small markup fixes across all content documents."""
    for path in book.spine:
        root = book.tree(path).getroot()
        changed = False
        # <br class="..."> where the class says display: block renders as an
        # extra blank line (or nothing) depending on the reader.
        for br in root.iter(X("br")):
            if br.get("class"):
                del br.attrib["class"]
                changed = True
        # <h3><blockquote>...</blockquote></h3> isn't valid XHTML and strict
        # renderers may mishandle it.  A <span> with the same class (the
        # class already says display: block) renders the same and is valid.
        for heading in [e for e in root.iter() if e.tag in HEADING_TAGS]:
            for bq in heading.iter(X("blockquote")):
                bq.tag = X("span")
                changed = True
        # Cover pages stretched to the screen with preserveAspectRatio="none".
        for svg in root.iter(f"{{{SVG_NS}}}svg"):
            if svg.get("preserveAspectRatio") == "none":
                svg.set("preserveAspectRatio", "xMidYMid meet")
                changed = True
        if changed:
            book.dirty.add(path)

# --------------------------------------------------------------------------

def context(stream, pos, width=60):
    s = stream.raw[max(0, pos - width):pos] + "⟦*⟧" + stream.raw[pos:pos + 25]
    return " ".join(s.split())

def main():
    ap = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
    ap.add_argument("epub")
    ap.add_argument("-o", "--output", help="output path (default: '<name> - linked notes.epub')")
    ap.add_argument("--report", help="write a line per note showing where its marker went")
    args = ap.parse_args()

    out = args.output or re.sub(r"\.epub$", "", args.epub, flags=re.I) + " - linked notes.epub"
    book = Book(args.epub)

    notes = find_notes(book)
    if not notes:
        sys.exit("No notes found (looked for a 'Notes' heading followed by "
                 "paragraphs starting with page links).")
    # Number notes within each notes subsection (i.e. per chapter).
    counters = defaultdict(int)
    for gid, n in enumerate(notes, 1):
        counters[n.section] += 1
        n.number = counters[n.section]
        n.gid = gid

    streams = {p: TextStream(book.tree(p).getroot()) for p in {n.target_path for n in notes}}
    match_notes(book, notes, streams)
    choose_insert_points(notes, streams)

    if args.report:
        with open(args.report, "w", encoding="utf-8") as f:
            for n in notes:
                where = (context(streams[n.target_path], n.insert_at)
                         if n.insert_at is not None else "NOT FOUND")
                f.write(f"[{n.section_title} / {n.number}] ({n.how or '-'}) {n.cue}\n"
                        f"    {where}\n")

    insert_markers(book, notes, streams)
    rewrite_notes(book, notes)
    fix_markup(book)
    fix_stylesheets(book)
    book.write(out)

    found = sum(1 for n in notes if n.insert_at is not None)
    loose = sum(1 for n in notes if n.how and n.how != "page")
    print(f"{len(notes)} notes, {found} linked into the text "
          f"({loose} needed a looser match - worth a glance in the report).")
    for n in notes:
        if n.insert_at is None:
            print(f"  not found: {n.section_title}, note {n.number}: {n.cue!r}")
    print(f"Wrote {out}")

if __name__ == "__main__":
    main()

Claude automemory, Nix, and .git

I’m running into a complicated snarl of things in my server management. Long story short: both Claude and Nix make assumptions based on your current working directory and where the nearest .git folder are. You may want to manage that carefully.

Claude Code has a couple of features that are defined “per project”. The one I care about is automemory, where Claude records little things about your projects. The directory Claude attaches these memories to seems to be the top level directory that has something named .git in it. That means if you have git repos in nested directories, the memories are attached to the largest scope.

Nix also has features where it scans all the files in a directory with a .git in it, assuming they belong to the NixOS build you’re doing. This caused me various problems that I can’t really explain.

My fix for all of these is for a sever project like “caddy”, I have a directory with a .git repo in it called src/ai/servers/sfpve/caddy/repo. I launch Claude from inside src/ai/servers/sfpve/caddy, where there is no .git. The memories then attach up to the src/ai/servers/ parent directory where I want them. Claude Code itself is launching Nix and somehow this helps it manage Nix’s magic with .git.

It’s more complicated than that in reality and I don’t actually understand what I’ve done or whether it’s a good idea. But Claude using the location of a .git to decide where automemory goes was helpful for me to learn.

BBR, Proxmox containers, and Starlink

I tried to sync a bunch of big data last night and only got 5MBytes/s despite 30MBytes/s being expected. The fix turned out to be enabling BBR congestion control on the Proxmox host and container I was syncing from.

In detail... I first learned about BBR congestion control three years ago. It’s an alternative TCP congestion control algorithm you enable on a server. It greatly improves performance for Starlink clients connecting to that server. Enabling BBR instantly boosted rsync performance from 5MB/s to 30MB/s for me: that is expected. It’s so extreme because of the high packet loss of Starlink. It’s probably the same for clients on cellular links.

To enable BBR in a container, the easiest way is just to enable BBR in the Proxmox host and then restart the container. On Proxmox:

# Load and enable BBR right now without reboot
modprobe tcp_bbr
sysctl -w net.ipv4.tcp_congestion_control=bbr

# Enable BBR on reboot
echo tcp_bbr >| /etc/modules-load.d/bbr.conf
echo 'net.ipv4.tcp_congestion_control = bbr' >| /etc/sysctl.d/90-bbr.conf

It is not necessary to explicitly enable BBR in containers. They will pick up the Proxmox host’s congestion control algorithm on restart. However any existing containers won’t switch immediately. You can run this in the container to switch without restarting:

sysctl -w net.ipv4.tcp_congestion_control=bbr

It is probably necessary to enable BBR in any VMs you have. I haven’t tested this but it must be this way since the VM has its own kernel and TCP/IP stack.

It is possible to have containers have different algorithms than the Proxmox server or each other. I didn’t test this but Claude Code was telling me I needed to load the modules in the Proxmox server and then set net.ipv4.tcp_allowed_congestion_control= reno cubic bbr. After than containers can choose their own algorithm.

(Claude Code was a big help in diagnosing and fixing this problem. I understand all the commands above and tested them myself.)

I continue to wonder why BBR isn’t the default on Linux. Apparently it can cause contention problems if every server isn’t using BBR. Also so much server traffic these days is QUIC and it has its own congestion control. The TCP setting doesn’t matter to a lot of servers.

rsync --append trap

I learned something from Claude Code today. rsync --append isn’t very safe. The common pattern of rsync --partial --append is suggested as a way to copy files and allow resume. That’s not a good idea to put in recurring sync jobs you run regularly over a long period of time.

The problem is --append won’t retransfer a file in many circumstances if the contents changed. And it only writes new data. It is append only and rsync’s man page warns it is “only applicable to update files that are known to be growing larger, that is, where any existing content on the receiving side is also known to be the same as the content on the sender”. If the file changes on the sending side, it can cause all sorts of corruption on the receiver.

I was using rsync --append to sync video between two machines once a week. But the source occasionally updated files in-place when I got better copies of the video. The destination wouldn’t replace the file when the source changed and so my destination slowly got out of sync.

Before 2008 and rsync 3.0, rsync did more checking with --append. So old advice may not have been wrong at the time.

In modern rsync there’s a --append-verify that will help but won’t catch the case where the updated file is smaller than the original. --append will still skip it in that case.

Claude Code advises me to not use --append at all, it’s the --partial that does the work of allowing resumes (for network copies). There’s also a --partial-dir which keeps partial downloads in an out-of-sight directory until they’re done.

If you’ve been running --append on a mirror, do an rsync -c to verify checksums and find damaged files.

Claude Code, Nix, ssh, and Linux

Claude Code figured out it could use my Desktop ssh agent and did some surprising things on remote systems. Thankfully it only did good things but it was alarming. In short: the problem was I’d set allowAllUnixSockets: true to make Nix work. That enabled ssh access and Claude was smart enough to discover it. Details and a fix below.

ssh agents

ssh agents work by having a daemon listening on a Unix socket. Mine is in /run/user/1000/ssh-agent.socket and $SSH_AUTH_SOCK points to it. Claude is ambitious enough to find and use this agent to access other machines if it helps get a job done. The default sandbox denies access to Unix sockets though, so it’s usually prevented. But...

Nix

Nix’s default install has some elaborate daemon setup to do Nix operations like building new artifacts. The client tools talk to it via a Unix domain socket /nix/var/nix/daemon-socket/socket. That wasn’t working for Claude Code because the default sandbox disallows access to all Unix sockets. (Many are sensitive!) So the devil suggested I augment the sandbox with the policy allowAllUnixSockets: true. And then Nix worked! Only now Claude had access to all sockets. Including ssh-agent.

The fix on MacOS

I can’t test this, but the very sensible fix on MacOS is instead of giving access all Unix sockets, just set "allowUnixSockets": ["/nix/var/nix/daemon-socket/socket"].

Unfortunately this doesn’t work on Linux right now (Sep 2026), some limitation of the sandboxing system. The directive is a no-op on Linux so no access is allowed (and no warning). Your only easy option is to enable all sockets.

The fix on Linux

I’m not certain, but the best I can do on Linux is enable access to all sockets, then disable one by one “dangerous” sockets that Claude might try to use. Claude suggested this configuration based on what it found on my system today:

  "sandbox": {
    "credentials": {
      "envVars": [
        { "name": "SSH_AUTH_SOCK", "mode": "deny" },
        { "name": "SSH_AGENT_PID", "mode": "deny" }
      ],
      "files": [
        { "path": "~/.ssh", "mode": "deny" },
        { "path": "~/.aws/credentials", "mode": "deny" },
        { "path": "/run/user/1000/ssh-agent.socket", "mode": "deny" },
        { "path": "/run/user/1000/gnupg", "mode": "deny" },
        { "path": "/run/user/1000/op-daemon.sock", "mode": "deny" },
        { "path": "/run/user/1000/1Password-BrowserSupport.sock", "mode": "deny" },
        { "path": "/run/user/1000/kwallet5.socket", "mode": "deny" },
        { "path": "/run/user/1000/bus", "mode": "deny" }
      ]
    }
  }

Of course blacklisting some sockets is terrible security, no doubt next week (or next ssh session) some new socket I haven’t blacklisted will be created. Docker is a good example: its sockets are very powerful and I haven’t thought to block it here. (Might not want to, having Claude drive Docker is useful!)

Basically the Linux sandbox isn’t strong enough to protect against a real adversary. But Claude isn’t an adversary. It’s an enthusiastic and very curious puppy. I think it provides helpful protection to put puppy gates across the doors you don’t want it to go through.

The problem is Claude is also the devil. A very persistent one. If you ask it to try hard to get something done it will. It’d be much better to have a more solid sandbox stopping it. Hopefully they fix this limitation about only allowing certain Unix sockets soon. There’s various bug reports about it but I haven’t researched them.

I wonder if there’s some other way to let Nix do its thing without a Unix domain socket, or with some proxy script that Claude is allowed to use.

Vault: my new file storage

After some 35 years of ad hoc carrying files around from place to place, I finally have all my important digital files in one well built storage system I’m calling “Vault”. More or less like a lot of people do with a NAS, but a little different.

Hardware

Vault is a Linux container running on Proxmox in SF. It stores files to three ZFS pools managed by Proxmox. One small volume for important small files on NVMe storage (two devices, mirrored). One large volume of large media files on spinning rust (again, a mirror). And one large volume of backups on spinning rust (single disk). There’s also offsite backups of everything but the video files to Backblaze B2.

Software

So far that’s pretty basic. The slightly unusual thing is what software runs on vault. Note this whole thing is LAN and Tailnet only, not on a public network. The setup was all built via AI but the big choices are mine.

  • Proxmox and ZFS for the hardware management. Tailscale for network access.
  • NixOS in a privileged LXC container for the vault operating system. Nix is my new thing for using AI to build servers. The declarative system seems a good match for coding agents.
  • No NFS or SMB. That’s the weirdest choice I made. I’ve never liked synchronous network filesystems, they are lies. It would be easy to add one of these but I don’t need it.
  • Syncthing. The most important volume I store is all my source code, about 15GB of my career over 35 years. I sync this to several different computers. I’ve been using Syncthing for years and it is a reliable workhorse. This is what I use instead of a network filesystem, particularly when working in Grass Valley.
  • sftp/sshfs. For needing to access a remote file outside of src. Purely for ad hoc use, this is very easy in the Linux Dolphin file manager. I could set up a FUSE mount too.
  • bind mounts and virtiofs. This is what allows a container on the SF Proxmox host to access the files in the Vault’s ZFS pools. Vault itself is working through bind mounts to the volumes. virtiofs is a relatively new option for the same thing for VMs. (I used to use NFS for that.)
  • Restic for backups. Both to a local disk and also offsite to B2.
  • File Browser for web access to files. Not sure I really need this, and the project just got shut down, but it’s there.
  • plocate for finding files. This is really not adequate: I have to ssh in and all it does is grep filenames. But it’s something. One big project I’m considering is some fancy full text indexing of all the contents and their metadata. That’s an endless project, I wonder if there’s something good off the shelf I can use.
  • ntfy.sh for notifications. What a great little service! I just use the public free tier, it’s enough for my needs and very easy to use

AI development

I bought the hard drives for this project in 2024. I even got halfway through building a Debian VM to manage everything, poorly, and then abandoned it because I couldn’t see a path forward to trusting this thing with my files.

I built the whole thing with Claude Code and Opus/High in 5 days.

Claude was active about 23 hours of that time. Me, maybe 10 hours? It used $205 in credits but all fit in the $20/mo subscription.

The process mostly went well. I had it come up with a design, then a work plan, then we stepped through tasks. I gave Claude more power than I have in previous projects and that was a good choice. But then I also had a lot of verification steps, including full backup tests outside Claude’s control. (I’m still trusting Claude somewhat: on my own I’m testing backup integrity and completeness but only spot checking identical files. Claude says it checked every single file.)

We made one major mistake. Part of the consolidation involved changing the UID for my files. I still have a VM that uses the old UID and so now it can’t write some files it used to be able to. (Unfortunately Proxmox’ UI for virtiofs doesn’t support any way to map UIDs.) It’s not a big deal, and I plan to shut that VM down entirely. Claude mostly was working to anticipate and avoid problems like this, as was I, but we both missed this one.

Overall the AI did a much better job than I would have. It got it done with no drama and with better testing and monitoring and backups than I’d ever manage on my own. I’m a total AI convert for this kind of project now.

Giving Claude Code the keys

I’m setting up a new server at home with Claude and NixOS. It’s a NAS-like thing for all my precious files, I’ll talk more about it later. Wanted to note here how I’m working with Claude.

In three devops projects I’ve gone from “talk to Claude and run all the commands myself” to “trust Claude to build a server VM but do all the config work by hand” to “trust Claude with access to Proxmox to create and maintain a server VM”. This Proxmox server is all my important stuff! It’s scary. But it’s also very nice letting an AI do the work.

I’m not insane, I do have backups of everything precious. A truly malicious Claude could probably destroy those backups too. But I’m trusting the agent isn’t adversarial. My goal is to just make it so an honest mistake isn’t catastrophic.

Protections

The first protection was giving Claude clear limits on what I wanted it to do. Don’t delete any data. Only work to make a single container with ID 300. Only use certain resources. Claude seems to be trying to obey those limits in good faith.

One simple protection: Claude mounted my precious data read-only to copy it into the new system. That was its idea and it’s a good one, I feel much safer that way.

I gave Claude an unrestricted ssh login with sudo access. One nice thing it did was make a very precise sudoers file. So for instance pct create 300 is allowed to create a container with id 300, but it doesn’t have general access to pct to manipulate all the containers. I’m not confident the sudo restrictions are complete. And I’m sure a malicious Claude could escalate privileges with the access it has. But it seems to help prevent accidents.

Claude has no trouble sshing to my box. I’m a little confused about this: the default sandbox restricts networking to localhost only plus one HTTP proxy. But Claude just happily writes a script to proxy ssh through HTTP (using the CONNECT command). I don’t know if this is Claude working as intended or if its entire mode of accessing my computer is an exploit.

One thing that did not work great is trying to get Claude to interactively ask me for any commands it runs as root. The new defaults in Claude let it run anything the heuristic checker approves. That’s a lot of things! Including ssh server sudo * (although there may be some restrictions on *. I want to review each command, so I overrode that by explicitly listing commands that I should be asked for. But that matching is very literal. And Claude keeps coming up with new ways to invoke ssh. So now I have something like this in the permissions file:

    "ask": [
      "Bash(ssh -F /home/nelson/.local/state/claude/ssh_config claude@sfpve:*)",
      "Bash(ssh -F /home/nelson/.local/state/claude/ssh_config sfpve:*)",
      "Bash(ssh -F ~/.local/state/claude/ssh_config claude@sfpve:*)",
      "Bash(ssh -F ~/.local/state/claude/ssh_config sfpve:*)",
      "Bash(ssh claude@sfpve:*)",
      "Bash(ssh sfpve:*)",
    ]

There’s nothing stopping Claude from coming up with yet another way to ssh into the box, bypassing these checks. Maybe this is fixable with a smarter glob, not sure.

Update Sep 21

After watching what Claude does some more I got nervous and decided to not give it this much access to Proxmox. I’m fine with it managing individual containers but Proxmox is too much.

For initial setup of a new container I’m having the agent write a shell script I run as root on Proxmox. I look at it closely. It’s basically just a single pct create in the simple case.

For managing a container that has tailscale, Claude has no more access at all to Proxmox. If the container doesn’t even have tailscale I’m giving Claude ssh access to sfpve but solely to run ssh -J to forward into the container via the local IP address. Something like this in the authorized_keys: restrict,port-forwarding,permitopen=”192.168.0.108:22″,command=”/bin/false”

Alarming behavior

Claude did two things that made me nervous.

  • Claude deleted some data despite being told to never delete data. It used rclone to remove something from Google Drive. We’d just established I had other copies of the data and wanted to delete it, so it was reasonable enough to delete the data, and really it only moved it to Trash anyway. But still, it violated a direct limit.
  • A new project went grubbing through other Claude project history, found the ssh key it had, and happily used that to give itself access to answer some questions about the Proxmox setup for something else. It was doing what I asked of it, and I did tell it to try to work autonomously and not bother me. But it got a little frisky letting itself in the door with its cousin’s keys.

Another major problem in my environment.. I use an SSH agent and SSH_AUTH_SOCK is available to Claude. I’m not sure it can normally access that. But Claude convinced me to give it "allowAllUnixSockets": true in its sandbox so it could do Nix things. That enables access to the SSH agent socket, too.

I’m currently testing giving it permission just to talk to Nix and no other sockets via "allowUnixSockets": ["/nix/var/nix/daemon-socket/socket"] but hit a snag. more tomorrow.

No, Opus is really good at reasoning

I’m genuinely flummoxed by how good Opus is at some sysadmin tasks. Today I asked it:

I need some way to manage all the web page content that’s stored on the server. right now the authoritative copy is on the server and the restic backup is the only stopgap. and if I want to change something I live-edit it on the server, or at best live-edit it on a copy and then sync it over. that seems too ad hoc, I should have a content here on my dev machine and some process to sync it. ... help me figure out what to do.

I did not propose a solution. Claude/Opus reasoned very well to get to a solution for me. It’s thinking is clearer than my own!

The AI inventoried all my files. Then it came up with three sensible groups.

  1. Truly hand-edited files that change sometimes
  2. Files that only exist on the server but are archival and never really change
  3. Files that actually exist elsewhere and already are being synced to the server.

It came up with those groups itself. It was using some knowledge from previous discussions (particularly about the synced-from-elsewhere group 3) and I think inferring the archival idea of group 2 from the sizes and ages of files.

It then proposed treating each of the three categories separately. And building a special publish tool for group 1, so I can have them in git on my dev machine and then sync them over. No new publish tool needed for group 3, I already have tools doing that. And no publish tool needed for group 2 at all. Backups are sufficient.

One wrinkle: the AI proposed a fairly minimal solution for solving the problem of me hand-editing the same file in group 1 in both places. (The naive solution has one edit clobbering the other, it suggested adding a --dry-run flag). I asked it to do something more automatic and it came up with a reasonable thing involving touching a sentinel file after each sync and then using find to see if anything had changed. This isn’t super fancy, but it sure is sensible.

This AI is solving design problems as well as I could with very little direction. And I know it will go off and implement it very competently for me. It’s not just saving me time, it’s doing a good job of it.

An AI server project

For nearly 20 years I’ve hand-maintained an Ubuntu Linux server for somebits.com. Every few years I had to recreate it from scratch, a tedious process involving a couple of days of forensics, editing config files, watching logs... so boring. And often stressful because I was doing it only after the old server had died.

No more. I now have a brand new server running NixOS. Here’s the thing. I don’t really know Nix. I played with it once for about an hour and thought “this is cool but too much to learn”.

Thanks to Claude Code and Opus I don’t have to learn it. The AI knows it already. And I think NixOS is a good match for an AI. The whole thing is declarative, you configure the server with some basic text files. AIs are good at writing text and testing the results!

The result worked spectacularly: way better than I expected. I thought I’d tinker with this for a week and learn how poorly AIs are at this complex a task. Instead it got it done for me in about a day and I was ready to switch over. I’m confident Claude did a better job than I would have myself, and much much faster.

The project took 270M tokens, 6M of which were actual work (the rest is cache). Claude values that at about $200 although I did it all in my $20/mo plan.

How I worked with Claude

In the past I haven’t trusted Claude to do complex things with live sites but this time I was setting up a brand new server so was willing to go full YOLO. The more work it did, the better.

I first wrote a page-long README explaining what I wanted to Claude and asking it to come up with a design document. I described the server, pointed it to my old notes, copied off some config files for it to look at, and told Claude I wanted it to do as much work itself as possible. I also suggested Nix. We talked back and forth for awhile and it drafted a 15 page design document. Too much to read! But I skimmed it and suggested some changes. Honestly it was Claude itself that was going to be reading this thing frequently. This whole design process took an hour or two back and forth.

Then I started a new Claude session and asked it to create a work plan. It came up with about 12 pages of specific tasks, each labelled as to whether Claude could do it or I could. (In general I only gave it access to the new server so I had to manually do things to DNS entries, the old server, etc.) One key thing it started doing here was asking for more data from the server, writing scripts for me to run to collect things it wanted to inspect. It made good choices. Again this took a couple of hours.

Then I fired off Claude sessions over a day or so to do the actual work. The work plan was helpful here: each Claude session new what to do or what to tell me to do for it. And I had some idea what it was going to do. Mostly it stuck to the plan and resisted the urge to add things to it: we did create a future work document for new ideas that came up. This process took maybe 4 hours? Some of the time was spent waiting for long network test jobs to finish.

The actual building of the Nix config files went remarkably quickly. The real work was all the testing, particularly in the final phases. Claude was way more thorough than I would have been which was reassuring. OTOH I don’t really know how complete those tests are. They seemed pretty good to me.

I started new Claude sessions every hour or two, after major work. The context window gets full. And anecdotally AIs get dumber as the context gets longer. Automatic compaction is supposed to help with that but I don’t trust it. I’d prefer Claude to dump its thinking into permanent documents that it rereads in a new session, that way I can read them too. The design and work plan docs were the big ones.

Claude Code also keeps a memory. Most of it is technical notes but it’s also developing a theory of my own personality.

  • He wants to be able to verify things himself
  • He values finding what was missed over being reassured
  • He gives blanket “work alone” permission for a stretch and expects a plain report at the end

I still need to have one more session with Claude to tell it to summarize the work it did and document things. It created a lot of scripts, some of which I will want to use. Again these docs are partly for me, partly information for future AI agents.

Thoughts on using AI for devops

This is the first project where I really trusted Claude Code to do things, as an agent, to make server changes and lots of network requests. It worked fine. Great, actually!

This is also the first project where I think Claude did a better job of the work than I would have. First, I don’t know Nix, and while I could have learned it on the fly it would have taken a lot of time and I wouldn’t have been good at it. Also Claude was just much more organized and thoughtful about server setup tasks and how to verify they worked correctly. And it thought of a lot of things I wouldn’t have, like the subtleties of the new server having an IPv6 address.

The magic thing here is how self-directed Claude/Opus was. It came up with its own idea about how to figure out what was on the server. Then came up with its own tests, like a complete set of 150,000 URLs (from Apache logs) to verify and then a 6000 URL sample to run for development work and a 22 URL sample for a smoke test. It wanted to actually test all 150,000 for a final ch eck and I told it that was too much so it whittled it down to 17,000 URLs that would test all the important paths through the server configs.

I’m trying to think what didn’t go well and not coming up with a lot. Opus is awfully wordy though, it’s a bit exhausting to talk to. Maybe I’ll find out something big went wrong in the next few days.

I do need to double back and learn to read the nix configuration files, or at least understand them. Maybe I’ll find something awful in them but on first look they are reasonable.

If I were a working sysadmin I’d be real nervous about my job now. I guess most of them already are. There’s still room for a human in the loop, at least for now. I felt like I had to manage Claude’s work, I gave it a lot of guidance in how to do certain things, and I was riding it pretty hard to verify its work. But the job I did was more like someone managing devops folks with 5+ years experience than being that devops person. This suits me fine, but it is alarming for my industry.

Kobo eReader customizing

I just got a Kobo Clara BW ereader. This seems to be the recommended “not an Amazon Kindle” ebook device. Relatively inexpensive, decent hardware, and a fairly open platform. Some notes as I tinker with it.

Loading books

I guess Kobo has its own store or something? I got this device to read books from all over, not so much to buy books from their catalog.

Adding a new book you already have is as simple as dragging the .epub file to it via USB. It can go anywhere in the filesystem, I made a new Books directory for things. Kobos support some other formats too but epub is the best choice.

Standard Ebooks is an excellent source for free, well edited books that are out of copyright. Note they have a special kepub format that supposedly works better on Kobos. A regular epub will work too.

Kobo also has Libby / Overdrive integration so you can get library books easily. You have to log in through the ereader’s settings program, which gives you a qrcode to scan on your phone. I haven’t seen this actually work yet because I don’t have any books on loan.

I think there’s a built-in web browser you can use to download ebooks directly on the device from our friend Anna or wherever.

If you install KOReader (see below) you can also browse OPDS catalogs which makes it very easy to download books on the fly direct to the device. Standard Ebooks publishes an OPDS server. You can also install Calibre-Web for yourself to give yourself access to a private book collection via OPDS.

Customizing the book reader

I found the reader’s default visual settings surprisingly bad. Some of that may be the formatting of the epubs themselves. But there’s various options you can tweak in the book reader to improve things.

The main thing I did was download the Charis font and install it via USB to the fonts directory. (4 files: Regular, Bold, Italic, BoldItalic.) This is a lovely serif font designed for book reading. It’s attractive without having too much personality.

Beyond that I tweaked the margins to use the full screen. (The device is tiny! Why reserve half an inch of blank screen on either side?!) Then font size to get it to about 8 words a line, tightened up the line spacing. And turned off the footer, epub page numbers, and book progress bar.

Customizing the software

Kobo is a pretty hackable Linux system. My main goal was to get KOReader installed, that’s a popular open source document reader with all the bells and whistles. I followed this guide to get going which has you installing the one click package which gives you a choice of KOReader and/or Plato for reading, also KFMon and NickelMenu for customizing the system. It was very easy to install and worked right out the box.

Having done all that I think I’m happy with the stock Kobo reader. KOReader is your classic open source UX disaster, a zillion settings. Very powerful and I may yet get into it if I need to do something complex. I do like the option to have Readest integration. Plato was a much nicer reading experience but then it doesn’t do as much, not sure why I’d choose it. For basic reading I think Kobo’s got me covered.

The device is open enough you can install a lot of Linux stuff like an ssh server (for rsync), various image displays, a Z-Machine emulator for text adventure games, or a full Linux userspace. Not sure why I’d want to do all that on a device about as powerful as a 2010 cell phone but it’s neat that it’s a general purpose device.

Postcards AI hacking

Just finished a big AI coding project, my travel postcards. I’m very happy with how it turned out. (I’m talking about AI code but this post is written entirely by me.)

I’d originally created a simple thread unroller for my Mastodon posts using an old version of Claude Code and then later Jules + Gemini Flash 3.5. It worked well on a relatively simple task, the Mastodon threads I create are very tidy.

But I’ve been tweeting about trips since 2009 and not always so organized. So I set Claude + Opus 5 to work on a recovery task, to collect all the old travel threads. It did very well, way better than I would have done on my own. I never would have done all this work myself.

(An aside: AI coding is very divisive. One argument is “it doesn’t work very well”. I think that’s just wrong. AI coding can work very well indeed. This experience with Opus 5 was really good, it’s a major improvement over the older models. And this task is well suited to AI. I don’t really care much about the code quality. And it’s easy to inspect the final output and determine if it’s working.)

Interesting work we did

The basic recovery project was pretty simple: take some old Storify posts and my Twitter archive export and tell the AI to write a program to find and organize all the trip tweets.

I gave it a pretty open-ended brief for this and didn’t suggest how to do it. It tried out various heuristics and tested them against one known-good output I already had hand edited. It finally settled on a combination of the text using travel words and city names plus looking at timestamps on tweets for when I was apparently in a different time zone. I really appreciated its proactive autonomy, both for coming up with heuristics and for validating them.

Recovering photos was a harder problem. Twitter’s export archive doesn’t contain full resolution images. And for older tweets there isn’t an image at all, sometimes all you have is a dead twitpic URL.

I would have given up, just accepted the low-res photos and lost images. The AI was much more persistent and found hundreds of photos for me. Some of the strategies it came up with:

  • Finding Flickr photos in my Flickr data export by realizing that the URLs in the tweets were base-58 encoded versions of the IDs in the export.
  • Finding Twitpic and Yfrog images on the Wayback Machine. (Sorry Brewster, y’all throttled me a lot.)
  • Matching low-res photos from the recovery process with higher res originals in my Google Photos export using image-similarity heuristics that it chose and validated itself.
  • Matching cropped photos from the recovery process into uncropped originals on Google Photos by guessing what crop I applied and matching similar images. This was slow but it worked and helped recover a bunch of photos from India.
  • Where no image from Twitter was available, finding photos in Google Photos based solely on timestamps.
  • The only thing it didn’t try was matching my tweet text (“picture of my ice cream!”) to a semantic analysis of the images (identifying pictures of ice cream). I know the AIs are capable of doing vision but I didn’t ask it to and it didn’t volunteer.

A key part of working with AI is knowing when you can just trust its output, when you can have it effectively validate its own output, and when you need to step in and validate it yourself. I spent a lot of time skimming over the output pages it was generating making sure they were plausible. And in several places I had it write tools to let me do editorial work myself, like picking photos when they were ambiguous.

Some AI things that worked

Early on Claude was giving me markdown files to hand-edit to make some editorial decisions. That’s tedious, so I asked the agent to write a basic Web GUI tool that was a custom editor for the task. That was so easy and productive I ended up having it build several tools. times. I would never ever write a throwaway task-specific GUI tool for my own project, it would take hours or days. But Claude got it done in 10 minutes.

I was surprised with how well Opus 5 did with open ended tasks. (I started out on XHigh effort, then dropped to High). I quickly learned to just describe the result I wanted rather than try to lead it by the nose on how to achieve that result. Sometimes it surprised me with what it came up with! And it saved me a lot of work. Opus is very capable, this kind of high level thing wouldn’t work nearly as well with a dumber AI. (You know, the ones that are just six months old...)

Having big data exports from Google, Twitter, and Flickr was a huge help. Those data dumps are hard to work with, they’re often just a big pile of JSON files and images and no organization. It’s 53GB of stuff for Google Photos! But the AI is very good at that kind of thing. I just pointed it at the .zip and said “figure this out” and it did.

Some AI things that didn’t work

The code the AI wrote seems to mostly work but I didn’t read any of it. I’m sure there are horrors there. But I don’t care for this project: as long as the AI can understand it’s own code it’s fine.

The code did run fine. But sometimes it was awfully slow. For instance for the image matching was taking minutes for each post. I aborted it and said “make this faster”. And so it did, mostly by rewriting the code to use numpy. I wish it had taken the initiative to make it faster itself. I wonder if Claude Code could be given agent instructions about when it was worth spending extra time to optimize something instead of relying on me to notice.

I don’t really know if the code is right. It wrote some 600 unit tests but they could be useless for all I know. I was validating the output by eye. If I were more serious about this as a real product I’d write my own high level system integration tests to really validate the output. Or at the very least have the AI write those tests and check very closely they are correct.

Claude is very verbose. It’s really quite annoying when talking to the AI agent and I bet the code is chatty too. This seems to be a problem with all LLM systems. Nothing it’s saying is particularly redundant or wrong, but there is an awful lot of it. Almost like it was talking to another LLM...

The workflow Claude came up with for the recovery process was very complex. I ran tool A and it’d generate a partial config file which tool B could use to get more data for the config file. Then run tools C and D to process, then go back and run tool A again with that extra data, etc etc. I never could quite figure out how to run it all correctly. This is mostly my fault, it reflects the iterative way we designed the whole thing. The good news is Claude itself knew how to run its own tools and was good at diagnosing and fixing failures, so I gave up trying to understand how to run it myself and just had Claude run it for me. That’s OK for a one-off hack like the recovery process. The Mastodon unroller I plan to keep using is much more tightly designed.

Some reflection

Claude tells me we spent about 20 hours working on this over 5 days. I typed 177 prompts to the agent. It processed just about 1 billion tokens in 4200 API calls. It says that’s nominally $685 worth of API usage although I did it all in the bounds of my $20/mo subscription.

Tokei says it’s 14,450 lines of Python code plus another 8600 lines of test code. That feels like an awful lot, I’d have guessed ⅕ that size if I wrote this carefully by hand.

I dunno how I feel about all this. Impressed, mostly. A little sad, I’ve always enjoyed crafting good code and I feel like that skill is suddenly much less useful. But honestly I haven’t been doing much of that in years now. I had a lot of fun getting an AI to build this for me.

I don’t love the emotional experience of working with Claude Code. It’s just fast enough that you mostly want to be paying attention, but still slow enough you get bored and do something in parallel. Most prompts I was typing were 2-15 minutes of work? I liked the Jules asynchronous model better, but then you have to trust it to work autonomously for longer tasks.

I still wouldn’t use an AI for something where the code quality really matters. Or rather I’d use it much more carefully. But for a data processing one-off job? It sure did a good job here.

Cleaning up my hosted services

I’ve got a shiny new dashboard and consistent access to all my home services! It’s very nice.

Since adopting Proxmox a couple of years ago I’ve grown to hosting a bunch of my own services. I didn’t really think about how I accessed them: I just threw them all on Tailscale and accessed them ad hoc. Each with their own URL on a random port, password, failing SSL, etc.

In this new setup I have a gateway that proxies requests to backend services. I have a single wildcard domain for them all. So linkding.private.example.com gets me to linkding instead of linkding.some-nonce.ts.net:9090. And SSL works. For some services, the gateway running at private.example.com could even handle authentication so I don’t have to use Linkding’s own password system. And in theory this system is safe to run on the public Internet, but in the last minute I chickened out.

Gateway: Reverse proxy

¾ of the value of my setup is running Caddy as a reverse proxy for *.private.example.com. I wish I’d done this a long time ago! Now all my requests go to one proxy web server with a wildcard domain. It’s much nicer than setting up tailscale on each service container. And Caddy makes SSL easy so I no longer have to click through a bunch of SSL errors.

Setting this up is pretty easy, mostly it’s just a bunch of config blocks like

        @linkding host linkding.private.example.com
        handle @linkding {
                reverse_proxy 192.168.0.34:9090
        }

A few of the services get persnickety about the hostname on the request matching their idea of their hostname, so you have to tell them to accept the proxy name as theirs.

Gateway: Authelia

The complicating factor on the gateway is I have Caddy set up to only proxy requests if I’m authenticated via Authelia. That works by setting up something like this in Caddy and including it in each service definition:

(authelia) {
        forward_auth 127.0.0.1:9091 {
                uri /api/authz/forward-auth
                copy_headers Remote-User Remote-Groups Remote-Name Remote-Email
        }
}

There’s a bunch of extra work to configure Authelia. For simple things a basic policy: two_factor rule is sufficient, Authelia will demand I log in before forwarding requests. For Linkding I had to add a special bypass rule for /api/ so that the Chrome extension worked.

I’m not sure Authelia was worth the trouble. Originally I did all this because I wanted to make this gateway host be on the public Internet, and so of course authentication is important. I think the config I have is secure to do that. But it’s complicated and I don’t really trust it, so at the last minute I put the gateway on my Tailnet instead of the public Internet. That’s fine for me.

The neat thing about this gateway approach is it works for multiple users. If I had many people accessing my backend services, possibly not from the tailnet, I’d commit to building trust.

The other nice thing Authelia can do is single sign-on. I log in to Authelia as Nelson, then it tells the backend services I’m Nelson and they trust that. Sometimes this works with a simple HTTP header, sometimes you need something more complex like OIDC.

I did set up proxied authentication for the linkding service. It was remarkably complicated, the key config is telling linkding LD_AUTH_PROXY_USERNAME_HEADER=HTTP_REMOTE_USER.

Every backend service has a different setup. And of course this means fully trusting Authelia’s authentication, it’s a little scary. I may do more of this in the future but for now I still have a bunch of passwords.

Homepage

The other part of this project was setting up Homepage, a simple website which serves as a lightweight dashboard + bookmarks for services. I like how it works, everything’s configured in one simple file and it’s pretty stateless. I’ll see how useful this is as a UI, I’m hoping it replaces my unwieldy list of bookmarks.

Sysadmin in the age of Claude

I never would have tried a project this complex without AI help. I used to love tinkering with this kind of stuff. But as I’ve gotten older and more retired I’ve gotten crankier about learning new things.

But using Claude is a marvel. I mostly did this with Opus/High and it was mostly right. I wanted to learn it as I went and I didn’t quite trust Claude, so I ran all the commands myself. Next time I might trust an agent to do the work for me.

Overall this project took about 6 hours over 3 days.

Being Claude’s agent

I’ve been working on a complex project where I am the agent following instructions and running commands while Claude is the planner giving high order instructions. It’s kind of fun, an inversion of the usual coding agent work pattern.

(An aside: no one can define what an “agent” is. Not even me, a 1990s PhD student in the Software Agents Group at the MIT Media Lab. But one definition is “agents are software that can do things to the outside world”. Agents edit files, or push to GitHub, or pwn a competitor’s AI company. It’s the agency that makes an agent an agent. By this definition I am the agent in my scenario.)

The project I’m working on is updating my homelab / selfhosted services on Proxmox. Mostly adding a new reverse proxy to give me better access to things. This boils down to creating and configuring a bunch of little Linux containers (caddy, authelia, homepage, ntfy, etc).

I don’t really now how to do all this, so I got Claude Opus to come up with a design that I reviewed. But I didn’t trust Claude Code to implement it. And I wanted to understand how it all worked. So I had Claude write up a very verbose tasklist for me. For the past few days I’ve been dutifully following it. I’m very slow, it’s taken me ~4 hours of actual work when Claude Code would have done it in 10 minutes. But I do understand what it’s doing.

Part of what’s been fun is duplicating some of the way software agents use scratch files as memory. I have a Claude Project with several chat sessions and some text files Claude created keeping track of state. The project has like 15 tasks, each with 3-5 subtasks, and I’ve totally lost the plot. But I trust Claude to keep track of it and every once in awhile I just tell it “ok I did task 13.3. what’s next and what do I do?”

When I work with AIs I am trying to use them as partners for thinking. Most of my interactions with AI are back-and-forth, with me reviewing what its saying and using the AI as a source of ideas and things to consider. I don’t much trust an AI agent to go off and do a complex task for me, at least not one whose result I can’t easily verify. This interactive session where I do the work feels better to me.

One problem is Claude is a never-satisfied taskmaster, it keeps adding things to a giant “backlog” new task list. This is a problem inherent with how these AIs are prompted, it keeps coming up with more things to think about. I feel a bit like Sisyphus. But Claude is pretty good about accepting when I tell it “no, I’m not doing that”.

Linux gaming: GPU overview

I’ve been installing Linux on whatever hardware I happen to have. It’s worked OK on various video cards. But there’s big differences. Most of this post is from the point of view of gaming (Windows games with Proton) but some AI stuff too. No deep expertise here, but I’ve had to learn this all recently and am sharing here.

AMD

AMD GPUs are the best supported in Linux. In general they just work. There’s a reasonable kernel driver built right into the kernel, fringe side features are better supported, and the Mesa user space stuff all does its job well in providing graphics APIs like Vulkan. Valve has invested an enormous amount into supporting AMD cards well in Linux and it shows. Next time I buy a video card, it will be AMD.

The one caveat is AI. Inference does work on AMD, ROCm is a real thing that really works. But there’s a sense the performance isn’t quite as good as with NVidia. I haven’t really tested it carefully.

Intel Arc

These are rumored to work reasonably well for gaming on Linux but they are still rare cards. I have no experience with them. The kernel drivers are part of the regular Linux kernel. Not sure about AI performance.

Nvidia

Oof. This is what I’m saddled with for the high performance cards I have. And the situation is not great. It does all work, and works reasonably well, but it’s such a kludge. I’m grateful to distros like Bazzite or Nobara or CachyOS that take the difficulty out of getting the drivers working. Arch’s docs are helpful info.

The problem is that historically Nvidia’s drivers have been closed source. But they have to run in the kernel. Now they have a more open source driver but only the kernel parts are open source, there’s still a lot of closed user space stuff providing higher level APIs (instead of using Mesa).

So even now there’s some insane thing where you are compiling drivers from source code you get from Nvidia when you install a new Linux kernel. And the kernel has to be signed to boot in Secure Boot, which just makes it more complex. It’s a mess.

There’s at least four flavors of Nvidia GPU driver.

The good ones come from Nvidia. They’re proprietary, but they have good performance. And they do work.

  • The “open” Nvidia drivers. This is the best option and works on cards starting with the 16xx cards and newer (ie: around 2018, Turing architecture and beyond). This driver is under active development by Nvidia, the latest 610 release recently came out. The kernel code is real open source but is only useful in pairing with a bunch of closed user space code.
  • The legacy proprietary Nvidia drivers. These are slowly on the way out but are the only thing that supports older cards like my 1080. I believe these drivers are still supported and getting updates but only limited ones. I think 580 is the last version that will be released?

The bad ones are fully open source and from third parties. They’re not really bad, it’s amazing work, but it’s a lot of reverse engineering and extra effort and their performance is not up to the closed ones.

  • Nouveau with NVK is the main open source driver. Linux systems will install this because it’s easier and license-friendly. But the performance is not great.
  • Nova is a new project to provide a new Nvidia driver in Rust. It’s very new and I think not ready for regular use.

AI inference works great on Nvidia, they pioneered most of the work and are still the leaders in Linux AI.

Rii K22 keyboard reset for Linux

I bought a cheap-but-nice wireless keyboard for occasional use. It works great in the system BIOS (with 2.4GHz) and Windows, but not in Linux. It’d connect but not let me type. Whether connected via 2.4Ghz or Bluetooth.

Turns out this is a known problem with a workaround.

Apparently in this state the keyboard is basically working but somehow the driver didn’t get initialized right and so keyboard and mouse events don’t come through. The workaround is to unbind and rebind the HID just after it’s plugged in using commands like echo 1-2.1.2:1.0 > /sys/bus/usb/drivers/usbhid/bind

I tried a scattershot version of this and it worked once. The permanent fix is to add something to udev that does the unbind/rebind trick when it detects the device is activated. Yuck!

Full details at https://forums.raspberrypi.com/viewtopic.php?t=397618

Linux gaming: switching video and sound

I use my Linux box with a long cable to play games on my TV. When I plug in the TV I want to change resolutions and change sound output devices for the TV. (The display is mirrored from my desktop). This is the kind of thing I’d only do manually in Windows but in Linux it’s reasonable to automate it. Particularly with an AI doing the hard work.

The switch script

Switching boils down to using kscreen-doctor to set the video mode and pactl to change the audio device. I’m using this script manually and it works great.

#!/bin/bash
# Description: Toggle display resolution and audio output between Desktop and TV modes.
# Safe to run multiple times consecutively.

# ================================
# Configuration Variables
# ================================
DISPLAY_NAME="DP-3"

# Desktop Settings
DESKTOP_RES="6016x3384@60"
DESKTOP_CARD="alsa_card.pci-0000_0b_00.4"
DESKTOP_PROFILE="output:analog-stereo"
DESKTOP_SINK="alsa_output.pci-0000_0b_00.4.analog-stereo"

# TV Settings
TV_RES="3840x2160@60"
TV_CARD="alsa_card.pci-0000_09_00.1"
TV_PROFILE="output:hdmi-surround-extra1"
TV_SINK="alsa_output.pci-0000_09_00.1.hdmi-surround-extra1"

# ================================
# Helper Functions
# ================================
switch_audio() {
    local card="$1"
    local profile="$2"
    local sink="$3"

    # 1. Set Card Profile
    pactl set-card-profile "$card" "$profile" 2>/dev/null

    # 2. Set Default Sink
    pactl set-default-sink "$sink" 2>/dev/null

    # 3. Move active audio streams safely
    pactl list short sink-inputs | awk '{print $1}' | while read -r stream; do
        if [ -n "$stream" ]; then
            pactl move-sink-input "$stream" "$sink" 2>/dev/null
        fi
    done
}

# ================================
# Main Execution
# ================================
MODE="${1:-desktop}"

if [ "$MODE" = "tv" ]; then
    echo "📺 Switching to TV Mode..."
    
    # Switch Display to 2160p
    kscreen-doctor "output.${DISPLAY_NAME}.mode.${TV_RES}"
    
    # Switch Audio to NVIDIA 5.1 Surround
    switch_audio "$TV_CARD" "$TV_PROFILE" "$TV_SINK"

else
    echo "🖥️  Switching to Desktop Mode..."
    
    # Switch Display to 6K
    kscreen-doctor "output.${DISPLAY_NAME}.mode.${DESKTOP_RES}"
    
    # Switch Audio to Starship/Matisse Stereo
    switch_audio "$DESKTOP_CARD" "$DESKTOP_PROFILE" "$DESKTOP_SINK"

fi

echo "Done!"

Switching automatically

I haven’t tried this yet, but Gemini has a reasonable plan for making this happen automatically when I plug in the cable. It boils down to running a user systemd service to run udevadm monitor to get notified when the cable is plugged in.

#!/bin/bash
# Description: Auto-detects HDMI hotplug events and calls switch_mode.sh

# Path to your switch script (adjust if located elsewhere)
SWITCH_SCRIPT="$HOME/bin/switch_mode.sh"

# Automatically find the first HDMI connector status path
HDMI_STATUS_FILE=$(ls /sys/class/drm/card*-HDMI-*/status 2>/dev/null | head -n 1)

if [ -z "$HDMI_STATUS_FILE" ]; then
    echo "Error: No HDMI port found in /sys/class/drm/"
    exit 1
fi

echo "Monitoring HDMI port: $HDMI_STATUS_FILE"

check_and_switch() {
    STATUS=$(cat "$HDMI_STATUS_FILE" 2>/dev/null)
    if [ "$STATUS" = "connected" ]; then
        echo "HDMI Connected -> Switching to TV"
        "$SWITCH_SCRIPT" tv
    else
        echo "HDMI Disconnected -> Switching to Desktop"
        "$SWITCH_SCRIPT" desktop
    fi
}

# 1. Run check immediately when the script starts
check_and_switch

# 2. Listen for DRM kernel display events in real time (no root required)
udevadm monitor --subsystem-match=drm | while read -r line; do
    if echo "$line" | grep -q "change"; then
        # Brief pause to let the hardware settle
        sleep 1
        check_and_switch
    fi
done
[Unit]
Description=HDMI Hotplug Display and Audio Switcher
After=graphical-session.target

[Service]
Type=simple
ExecStart=%h/bin/tv_auto_switch.sh
Restart=always
RestartSec=3

[Install]
WantedBy=graphical-session.target

More switching

I didn’t actually set it up but I’m pretty sure udevadm monitor will work as a way to know when an HDMI cable is plugged in to activate the switch. But I realized I’d rather leave the thing plugged in all the time and only switch modes on my Linux box when the TV receiver switches to its video input. I tried for awhile and couldn’t make it work. An AMD video card might.

Some TVs make it look like you basically disconnected the cable when you switch away from that input. They turn off the HDMI hot plug signal and stop sending EDID. My TV does not do this, on the Linux side it looks like it’s always on.

The TV should be sending HDMI-CEC commands down the wire to notify the device when it’s selected as input. In Linux those should be available on /dev/cec0 or the like. Unfortunately the NVidia graphics drivers just don’t support this. Intel and AMD supposedly do. Yet another way NVidia’s Linux support falls short.

I finally just put a button to invoke my script on the KDE taskbar so it’s very easy to switch modes.

Yay for AI

I have the skills to figure scripts out like this myself. It would take me ~2 hours to research and write and debug this script. Or it takes me 10 minutes with an AI. I never would have bothered without. My expertise is still important: I’m asking the questions of the AI the right way and I can review the suggestions to see if they make sense. But the AI is definitely great at this kind of one-off hack.

/tmp woes on Nobara Linux

/tmp filled on my desktop Linux box running Nobara (Fedora 44). WTF? The problem turned out to be Chrome leaving behind download files.

What is /tmp on Nobara

/tmp is not a disk-backed filesystem. It’s tmpfs, which sits in RAM. Fedora sizes it to be 50% of RAM by default, or 14GB in my case.

/tmp gets cleared on reboot. It also gets cleared daily by systemd-tmpfiles. That’s configured (mostly) in /usr/lib/tmpfiles.d/tmp.conf and by default deletes files older than 10 days.

There’s also a /var/tmp on regular disk which is for temporary files that should last longer than just a reboot. The systemd job deletes files older than 30 days there.

Finding the /tmp usage

First thing I did is run du /tmp. And saw nothing there but some small files. Which sent me down a rabbit hole of using lsof to find deleted files and some eldritch possibilities of giant RAM pages or other memory management problems.

Nah, the problem was just that Chrome writes its download turds to hidden . files like /tmp/.com.google.Chrome.GsPvIQ. Which du -s /tmp/* won’t show. Have to do du -s /tmp* /tmp/.* Fucking Unix.

Anyway, once I found what the /tmp files were I quit Chrome expecting them to be deleted. Nope. Was it a Chromium app? No. lsof showed nothing had the file open, it was just something Chrome left behind. Ugh. Arguably Chrome should be writing these to /var/tmp.

A reboot should fix this kind of stupidity but I’m stubborn and think Linux systems shouldn’t need rebooting.

Temporary data in my RAM?

I’m wondering why tmpfs is a thing. To me, /tmp is where you put data that you don’t want to keep in RAM. Why waste precious RAM on temporary dross? Why have such a small temporary partition?

I guess the theory is you want /tmp to be fast and not wear an SSD. And if there’s memory pressure, why, that’s what swap is for. (I have 30GB of swap on a partition in an SSD). That makes a certain kind of sense to me but I don’t love it.

While I’m here, the real confusing thing in a modern Linux is zram. Or alternately zswap. And the controversy between them. I started trying to read about this and realized I couldn’t make an informed decision, so I’m just taking Nobara’s defaults.

Which worked fine right until Chrome did something dumb like assume /tmp was OK for large files.

Linux desktop gaming: ways to run

I’m deep in the weeds of tinkering with how Steam launches games. In Linux you have a bunch of options. Here’s some experiments I did running Borderlands 4 (Unreal Engine 5) on a mini PC with an AMD Ryzen 7 PRO 8845HS and a Radeon 780M graphics chip, trying to run the game at 1080p on my 6016 x 3384 screen.

Note this machine is woefully underpowered to run this game well, I’m on full Low settings. And Borderlands 4 is considered poorly optimized. I’m mostly concerned about the different display options: resolutions, HDR, upscaling. Those choices should apply on better hardware too but there’s less need to squeeze out more pixels with clever choices.

In all cases I’m changing launch options by right clicking the game in Steam, choosing General / Launch Options, and then pasting in command strings.

I’m using GE-Proton11-1 as the compatibility tool. This is a very recent version.

A useful reference: Proton Variants. This documents all the various fiddly environment variables the different compatibility tools use.

First, two digressions on other options

Frame generation

I am not ever enabling “frame generation” (DLSS or FSR) in the game. This is a gimmick where the GPU will generate whole frames by time-interpolating other frames. But it doesn’t look very good and it adds latency and seems always bad to use.

Gamemoderun

A wildcard: you can preface any program you run with gamemoderun. That enables game mode, a set of Linux kernel tweaks that lowers latency. This seems entirely orthogonal to different display options and offers only a tiny improvement, at least on a quiet system. I mostly use it but will not worry about testing it separately, I just use it everywhere.

Simply running it directly

gamemoderun %command%.

Just launch the game directly without tweaks. This works pretty well in Borderlands and arguably is the best way to run the game. The game will try to run at full desktop resolution but Borderlands detects other resolutions and lets you apply them. You can pick your upscaling algorithm, I’m using AMD’s FSR. TSR looks better but is a little slower.

The one drawback with this is there’s no HDR.

Running it directly with HDR

PROTON_ENABLE_WAYLAND=1 PROTON_ENABLE_HDR=1 DXVK_HDR=1 ENABLE_HDR_WSI=1 gamemoderun %command%

This is a variant of simply running it: Borderlands will talk directly to the display compositor the desktop is using. However there’s a whole raft of flags there to enable HDR. Why three flags for HDR? I don’t know honestly, I’m copying what the AI tells me to do. It’s possible these aren’t all necessary, particularly with GE-Proton, but they are harmless if not used.

The other flag here is PROTON_ENABLE_WAYLAND=1. That’s arguably the most important one. Without it, Proton runs games under XWayland, so that Proton is using X11 graphics and the XWayland X server is translating those to Wayland. With that Proton uses a native Wayland driver. That’s better but I guess that native driver isn’t entirely stable yet, so it’s not the default.

Running with Gamescope

gamemoderun gamescope -W 2560 -H 1440 -f -F fsr -- %command%

Gamescope is an intermediate compositor that smooths over a bunch of issues with gaming on Linux. It basically creates a virtual display that the game draws too, then blits that image to the real display. It’s pretty low latency and has solved a lot of problems for me, particularly older games that don’t seem to understand the Linux display very well. It doesn’t seem necessary for Borderlands 4 but we’ll try it anyway. (One drawback: Gamescope breaks the Steam overlay. There’s an experimental flag to enable it again but it doesn’t seem to work.)

-f just tells gamescope itself to be fullscreen, not a window.

-W 2560 -H 1440 -F fsr tells gamescope to run its virtual display at 1440p and use FSR if needed to scale things. The game will think it is running on a 1440p monitor. Borderlands lets me choose my own resolution inside the game, and I choose 1080p. So now Borderlands is drawing at 1080p.

Borderlands is well behaved and lets me set the resolution. Another way to set the resolution is to add -w 1920 -h 1080 to the gamescope options. That tells gamescope to tell the game it’s a 1080p screen but to automatically upscale to 1440p itself. I’m acomplishing the same thing by using the Borderlands menu to pick 1080p.

An added complication here is Borderlands itself may do some spatial upscaling depending on the graphics settings. I’m a little fuzzy on this but an AI tells me on “Performance” mode it renders the game at 50% (540p). So there’s several scaling steps here.

  1. 540p: the actual game geometry rendering
  2. 540p → 1080p. Borderlands upscaling with FSR 3.0
  3. 1080p → 1440p. Gamescope upscaling with FSR 1.0
  4. 1440p → 3384p. Linux graphics (KDE’s compositor?) upscaling with a crummy linear filter.
  5. 3384p → monitor. Linux is handing a full 3384p signal so the monitor doesn’t need to use its hardware upscaler. In other circumstances the monitor might upscale.

Writing all this out, step 3 seems bogus and it’d be better to eliminate it. Have gamescope just work at the same resolution you want the game to work at. The flipside is the FSR 1.0 in step 3 is probably better than whatever upscaling is in steps 4 and 5, so it might still be preferable to do the extra work in gamescope.

The other option that seems appealing is to run gamescope -W 6016 -h 3384 and have it fully upscale things with FSR 1.0. I think that’s how gamescope is intended to be used. But that’s a lot of pixels and this little video card is kinda limited, so the AI is advising me 1440p is better. FWIW I tried it at 3384p and it seemed to run just the same as with gamescope at 1080p.

Gamescope with HDR

ENABLE_HDR_WSI=1 DXVK_HDR=1 gamemoderun gamescope -W 2560 -H 1440 -f -F fsr --hdr-enabled -- %command%

Gamescope by default doesn’t do HDR. You have to add these flags to enable HDR both in the game (the environment variables) and in gamescope (--hdr-enabled).

Putting it all together

For Borderlands, I don’t want to use gamescope. I mean I could, and maybe the FSR 1.0 upscaling is better than the linear upscaling the Linux desktop would do. But it doesn’t look much better and gamescope certainly adds complexity and a little latency.

Without Gamescope I get about 39 fps in one little test I ran with this command:

PROTON_ENABLE_WAYLAND=1 PROTON_ENABLE_HDR=1 DXVK_HDR=1 ENABLE_HDR_WSI=1 gamemoderun %command%

If I did want to use gamescope, I’d run it at 1080p like this. I tried this and it might look a tiny bit better and runs at 38 fps instead of 39.

ENABLE_HDR_WSI=1 DXVK_HDR=1 gamemoderun gamescope -w 1920 -h 1080 -W 1920 -H 1080 -f -r 60 --hdr-enabled -- %command%

Closing thoughts

Hilarious thing: all these various options don’t really look that different to me. It seems less blurry when I do the more “optimal” things. And maybe I get 10% more framerate depending on how I tweak it. But honestly with this particular heavy game and this particular underpowered hardware, it’s not a big thing.

Linux gaming is easy!

Seriously, all this tinkering is ridiculous. One nice thing about Bazzite is you can ignore most of it: if you use Game Mode, it just handles Gamescope in the background and stuff works. Desktop Steam should get there eventually, but this transition where options like native Wayland rendering don’t work reliably yet is awkward.

A modern HTTP request

I got curious about what HTTP headers Chrome is requesting so I stood up a trivial HTTP server and this is what is on the wire.

$ while true; do echo -e "HTTP/1.1 200 OK\nContent-Length: 3\n\nOK\n" | nc -l -p 8081; done

GET / HTTP/1.1
Host: localhost:8081
Connection: keep-alive
sec-ch-ua: "Not;A=Brand";v="8", "Chromium";v="150", "Google Chrome";v="150"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Linux"
DNT: 1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: none
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9
sec-gpc: 1
permissions-policy: browsing-topics=()

Goodness that’s a lot of stuff! I still remember when even the Host header was optional (in HTTP/0.91). And my knowledge taps out around HTTP/1.1, the Connection: keep-alive and the Accept headers.. Anyway, what else is there?

The sec-ch-ua stuff is a modern replacement for User-Agent

DNT, sec-gpc, and permissions-policy are various requests to preserve my privacy. I just installed OptMeOwt, it is adding some of these. I think permissions-policy is a Google thing.

The Sec-Fetch stuff is about the intent of the request and is apparently used to make decisions related to CSRF, CORS, etc.

Upgrade-Insecure-Requests is telling the webserver to redirect me to https if it can.

In general sec- is a “forbidden request header”: only the browser is allowed to set these headers, not Javascript on the page. (Extensions can set them though.)

One other trivia I learned about: HTTP Trailers. This lets you set more headers at the end of an HTTP request instead of the start. Say data you only know about after a long POST or something. These date all the way back to 1997 and HTTP/1.1 apparently but I’ve never encountered them. They don’t work with the simplest request format since there’s no way to identify the end of the HTTP body. Chunked encoding allows for them and I imagine later encodings have something similar.

Linux remote game streaming

One thing I miss from my Windows machine was it was easy to stream games to my TV. I installed a Steam Link client on the Android TV and it connected to my Windows box running Steam. Game streaming works surprisingly well on a LAN.

Steam streaming from Linux server

In theory I should be able to do the exact same thing from Steam running on Linux. In practice I found it didn’t just work when I tried it. I should try again, particularly now that I understand better how to use gamescope and deck mode to make the Linux box run Steam games better.

Sunshine / Moonlight

The other option for remote streaming is the Sunshine server running on the Moonlight client. This is an open source evolution of NVidia’s game streaming systems. It’s well loved because it’s very low latency, like 3ms on a LAN.

I’ve made it work but it’s very unreliable. The Sunshine server on Linux is quite janky and the way it captures audio and video seems delicate. It does work sometimes! But not regularly for me. Also I have to remember to manually set my desktop to 1080p before launching Sunshine. I think the Sunshine server can do that too but again I had trouble making that work.

Headless?

What I really want is a headless system. Something where the game is running on a virtual / offscreen display and doesn’t affect my desktop at all. In practice this also seems very difficult, in particular to get the GPU to render with hardware acceleration.

One solution is a dummy HDMI plug that looks like a fake monitor. I bought one and plugged it in and it sort of works. But now I have a new display in my desktop and I couldn’t get KDE Plasma to not use it for anything, it kept causing problems.

A second solution is a virtual display with a spoofed virtual EDID pretending to be a monitor. Apparently you can hack Linux to do this. The result is similar to the dummy HDMI plug but without the stupid hardware dongle. I have not tried this.

A third solution is truly headless. Most solutions for this use the Sway compositor which has both good support for running headless and also a remote video capture system wlr-screencopy that Sunshine can work well with. This all sounds good but very complicated to set up and too bleeding edge for me. Some links on that:

Linux desktop gaming notes (Gamescope)

I’m finally understanding how Linux gaming works. Particularly the problem of setting display resolution and driver features. See also this CachyOS guide.

Compatibility tool

The most important Linux-specific thing is what Windows emulator Steam uses to launch your game. They call this a “compatibility tool”. I believe Proton 10 is the default these days. Valve ships other Proton versions: there’s Proton 11, Experimental, Hotfix. You can select which one Steam uses. Proton-GE is a popular third party one, by the same GloriousEggroll who puts together Nobara.

Gamescope and resolutions

The other tricky thing with Linux is the display resolution compatibility is not great. If I launch something from my normal Linux desktop most games are fixed to some bizarro resolution like 7400x4000. There’s also issues with X11 vs Wayland vs XWayland.

The solution to a lot of this is Gamescope, a graphics compositor Valve built for the SteamDeck. It makes it very easy to launch a game with a specific resolution independent of what the underlying hardware and drivers are doing. For instance you can easily launch games in 1920x1080@60 fps. They will run well and gamescope will make sure it looks good on your screen.

You can run games directly in Linux without gamescope, but the quality of that experience is highly variable. Gamescope simplifies things so that games run more reliably.

Also related: MangoHud, the overlay for monitoring FPS in games and other things. I find it annoying and intrusive but it is the preferred tool if you want to test how well a game is running. Steam also has its overlay but it can be unreliable in Linux.

Steamdeck game mode

Bazzite and Nobara both have a thing they call “deck mode”. You log in to a special SteamDeck-like session instead of a normal KDE desktop session that is for nothing but running Steam in Big Picture mode. Behind the scenes that game mode is a GUI wrapping several tools.

Games are run with gamemoderun which tweaks Linux to run an app for better game performance. It does things like change the CPU governor and kernel scheduler to make the game run smoothly. It seems to actually help.

Game mode also launches games under Gamescope. And it has a GUI built into Steam that lets you configure the resolution, etc that Gamescope presents. It’s quite nice!

ProtonPlus

ProtonPlus is a standalone GUI for downloading compatibility tools like Proton-GE. That’s its main use and is under the “Tools” tab.

But the “Games” tab has a very handy feature: a sane editor for Gamescope configurations. All this is doing is modifying Steam’s config files to set launch options; you can do the exact same thing by setting custom command lines with the Steam properties editor. But there you are typing command lines by hand, with Proton Plus you can edit them with a GUI. Just remember to exit Steam first so that it doesn’t clobber the configs that ProtonPlus sets.

I am using this all the time to enable HDR and to set a specific resolution I want the game to run at. It’s a kludge but gamescope works around some limitations of Linux gaming.

Note ProtonPlus doesn’t really help you use gamemoderun. There’s a way to enable it but no simple checkbox for it.

Other configs

gamescope for resolutions is the main thing I’ve used so far. There’s a variety of environment variables that are popular for further tweaking how things run, stuff like PROTON_ENABLE_WAYLAND=1 and PROTON_ENABLE_NVAPI=1. I don’t know much about them. ProtonPlus sets some of them if you enable Advanced mode.

Gaming on desktop

Putting it all together... the easy thing is to use the Steam Deck mode that Bazzite or Nobara offers. If all you’re doing is gaming on the computer, it’s a great choice. But me I’m mostly working on this thing and then occasionally playing a game. So I use ProtonPlus to configure Steam to launch games with the resolution and options I need.

Nobara update

I continue to like my Nobara Linux system, a Fedora variant. But the upgrade process is not giving me a good feeling.

Fedora 44 was released late April. Two months later Nobara updated to it. It’s a huge update, some 8000 packages on my system. But part of the promise of Fedora (and Debian) is these upgrades are safe, transactional, reliable.

Not so much Nobara. Common wisdom on the subreddit is to wait a couple of weeks after a Nobara release before installing it yourself. And to make a snapshot to rollback to (by hand). And to expect it might just not work.

The underlying problem is Nobara is pretty complex and mostly the heroic work of a single developer. He’s hand-vetting package upgrades to Fedora and then incorporating them when he thinks its safe. And Nobara itself is complex, a set of packages layered on top of core Fedora and handling conflicts and the like is tricky.

The scariest thing is you’re not allowed to just use Fedora’s dnf to update. Instead you’re supposed to use a GUI tool custom to Nobara, although there is an underdocumented CLI option too. It’s not clear what all this tool is doing but this list of “quirks” is one hint.

System Update: 2026-07-11 09:18:39 - INFO - QUIRK: Make sure to refresh the repositories and gpg-keys before anything.
System Update: 2026-07-11 09:18:39 - INFO - QUIRK: Make sure to update the updater itself and refresh before anything.
System Update: 2026-07-11 09:18:45 - INFO - QUIRK: Cleanup outdated kernel modules.
System Update: 2026-07-11 09:18:45 - INFO - QUIRK: Remove RPM Fusion release packages if they exist, we use Terra and they conflict.
System Update: 2026-07-11 09:18:45 - INFO - QUIRK: maliit-keyboard, as plasma-keyboard is now default.
System Update: 2026-07-11 09:18:45 - INFO - QUIRK: Repair incomplete TigerVNC server package set.
System Update: 2026-07-11 09:18:45 - INFO - QUIRK: Make sure dnf-app-center is installed.
System Update: 2026-07-11 09:18:45 - INFO - QUIRK: Replace SDDM with Plasma Login Manager when SDDM is installed.
System Update: 2026-07-11 09:18:45 - INFO - QUIRK: Make sure to run both dracut and dkms if any kmods or kernel packages were updated.
System Update: 2026-07-11 09:18:45 - INFO - QUIRK: If kwin or mutter are being updated, ask for a reboot.
System Update: 2026-07-11 09:18:45 - INFO - QUIRK: Install InputPlumber for Controller input, install steam firmware for steamdecks. Cleanup old packages.
System Update: 2026-07-11 09:18:45 - INFO - QUIRK: Problematic package cleanup.
System Update: 2026-07-11 09:18:46 - INFO - QUIRK: Clear plasmashell cache if a plasma-workspace update is available.
System Update: 2026-07-11 09:18:47 - INFO - QUIRK: Fix Nvidia epoch so it matches that of negativo17 for cross compatibility.
System Update: 2026-07-11 09:18:47 - INFO - QUIRK: Also swap akmod-nvidia for dkms-nvidia.
System Update: 2026-07-11 09:18:47 - INFO - QUIRK: Update old N41 mesa packages to current versions.
System Update: 2026-07-11 09:18:48 - INFO - QUIRK: Swap old AMD ROCm packages with upstream Fedora ROCm versions.
System Update: 2026-07-11 09:18:48 - INFO - QUIRK: mesa-vulkan-drivers fixup.
System Update: 2026-07-11 09:18:49 - INFO - QUIRK: vaapi fixup.
System Update: 2026-07-11 09:18:49 - INFO - QUIRK: Kernel fsync->nobara conversion update.
System Update: 2026-07-11 09:18:49 - INFO - QUIRK: Media fixup.

Some of this complexity is the mess that is NVidia drivers on Linux. As I type this I’m waiting for my computer to finish recompiling from sources. That’s not Nobara’s fault, that’s NVidia’s.

Bazzite has the same complexity btw. But they hide it in their atomic releases. You just install one big immutable blob they give you. I think that is great for a consumer applicance OS. But for me as a developer it’s too inflexible.

Anyway this update has failed twice now. (Once with a full disk: btrfs checkpointing means your filesystem never shrinks!) I think this third update will work, at least it will install completely, then I get to see if the system still works. My #1 concern is that one of the failed updates somehow permanently broke something. But the core of the update itself is still a dnf transaction and I am hoping that’s pretty robust to failures.

Update: seems to have worked, system boots, graphics look right.

Kiwix on Android (June 2026)

Kiwix is a fantastic offline Wikipedia reader. Last time I tried installing a new library it was a usability nightmare. It’s still not great but it’s better now.

  1. Pick a Kiwix variant to install. The Play Store version is mostly fine but you can also sideload an APK that has file path restrictions listed. (See step 4).
  2. Choose a Kiwix library. The library picker is very poorly designed but it does work. I picked “Wikipedia The Free encyclopedia” at 115GB (from Feb 2026). That’s all 7+M articles. That collection also comes in a 48GB version (no pictures) and a 12GB version (short summary text only).
    Consider if “Best of Wikipedia” (50,000 articles) or “Wikipedia’s 1m Top Articles” would do for you instead, they are significantly smaller.
  3. Download. For this giant file I’m using BitTorrent and enjoying a full gigabit download, mostly from one direct web peer.
  4. Transfer the .ZIM file to your phone. If you have the Play store version it’s restricted to a couple of directories, I’m using /Android/media/org.kiwix.kiwixmobile/. The APK sideload can read ZIM files anywhere you put them.

Their library picker doesn’t show you versions or dates. Consider looking at the direct download directory instead. The files named “maxi” include full text and pictures.

A note on Android file transfer

The MTP file transfer Android uses for USB is slow: limited to about 37 MiB/s for me, or about 30% of my Internet speed. The big ZIM will take an hour! MTP is also apparently kinda buggy with big files.

The copy alternative I’m using is USB debugging mode and adb push. An AI claimed it would be about 2-3x as fast as MTP but it’s not: it copied in 33 MB/s. Good news is it did successfully copy.

Another option is to use SolidExplorer or some other file explorer with a Wifi transfer utility. Not clear that’ll be faster than USB, WiFi speeds cap out at about 80MiB/s in practice in my experience.

You know, for what’s at its heart a Linux system, Android is not very good at working with big files. Not a big deal in general but it must be a real nuisance for anyone maintaining a video library.

WebP revisited

I’m tinkering with my postcards project. It’s a thread unroller: it takes Mastodon threads and reformats them in a way that makes sense for my “travel postcard” format I post in when I’m on a trip. This whole thing was vibe coded from the start, but I like the result enough I’m trying to turn it into a real tool and maybe a hosted product at some point.

Anyway, today’s task was to convert the images from JPG to WebP to save space. It’s not a general image tool: this is taking tourist snaps from my pixel camera and displaying them in web box nominally 800 pixels wide. The images themselves are 1600 px and I’m mostly testing visually on a HighDPI display.

The end result was the old 800px JPGs took 10M, simple 1600px JPGs took 36M, and 1600px WebP at quality=50 took 16M. The WebP looks as good as the JPG to me, even at the low quality setting. (The JPGs were at quality 85, I think, whatever the default is.)

Encoding parameters

The end result I landed on is quality=50, method=6. This is a remarkably low quality! Last time I looked at this I ended up with quality 90. But for this application with the 2x images I’d rather have a smaller file.

FWIW I tested with an input file that’s 388k as a JPEG quality 85. Output sizes in webp from quality 10 to 90:

60 76 96 116 132 148 168 216 364

I also briefly tested method 4 vs method 6. Method 6 just makes slightly smaller files but using more CPU. It’s not a big difference either way.

Code details

WebP is good for smaller files that every browser can display, but WebP is staunchly an 8 bit format. I’m bummed, my Pixel is now outputting weirdo HDR JPGs that look nice. But it’s still a challenge to work with those, so I’m giving up on HDR for now. (I think the right answer is to resize to AVIF files but the open source tools for that are still difficult in HDR.

I’m using PIL to create the webp files. Saving it is as easy as img.save(fn, 'WEBP', quality=50, method=6). The trick was getting a version of PIL with webp support. uv is compiling my own wheel, I think, which may be part of my problem. Anyway adding config-setting = { pillow = ["webp=enable"] } to pyproject.toml fixed it.

AI programming notes

I feel increasingly weird writing these work notes to myself. Everything done up above was done with coding agents, I’m not sure I learned much myself. But I spent a bunch of time tinkering to get there. Jules/Gemini had the wrong idea how to fix PIL the first time. I didn’t trust its own judgement about what quality level to use, I had to determine for myself.

Some notes picking up linkblog dev

I did a lot of work 4 years ago writing my linkblog generator and then haven’t had to touch the code. I did a good job! Unfortunately it is now time to migrate off of Pinboard to Linkding, so I needed to update the code that fetches my bookmarks to use the new site.

Dev Environment

My code uses shot-scraper and Playwright to generate screenshots and that explicitly does not support Fedora, has various Debian dependencies on it. (I didn’t like this hack-around). So I set up distrobox as a dev environment. Now when I want to develop I have to do this

distrobox enter linkblog-dev
cd ~/src/linkblog/pinboard-to-static/
source venv/bin/activate
./update.sh

It also helps to run a web server in the site-generated/ directory to see the output.

I don’t have VS.Code set up on the Fedora machine. Right now I’m using Kate, which is capable enough as a text editor. Note it has to run in the host OS, not inside the distrobox. (Files are bind mounted so there’s no container boundary problem.)

AI programming

Four years ago I wrote all my code by hand, of course. Now I want to use agent tools like Jules. This turned out to be pretty easy and I could just tell the agent to rewrite the Pinboard code for a new API. It read the Linkding docs and figured out most of it itself.

The problem is I didn’t structure this code for anyone else, even an agent, to run it. It depends on some secrets (not checked in) and access to a Tailscale server. Worse, it has no tests. Yes, I hang my head in shame, this project was done very sloppily. And without tests or the ability to even run it a key part of the agent development loop doesn’t work.

I yoloed this one change anyway and reviewed it carefully and it was fine. But I probably should adapt this code to be agent-friendly for further development. Test suites are a good idea for people too! But they are essential for an agent.

Going forward

I’m a little nervous about these code changes, particularly without testing. I’ll run it by hand for a few days and see how I feel.

Proxmox secure boot: June apocalypse

The failed Secure Boot technology has a booby trap in it that might keep Linux boxes, including VMs, from successfully booting because some certificates start expiring June 24. The suggested fix is to enroll new security keys, which require a lot of BIOS fiddling. I was impressed Proxmox had a warning about this for your VMs and a tool for fixing it. Seems to work. It adds ms-cert=2023k,pre-enrolled-keys=1 to the disk options for the EFI partition.

Update: secure boot keys on PC hardware

I have some hardware I don’t have access to and I’m wondering if it will refuse to boot come June 27. Here’s some stuff you can do from a Linux CLI. RedHat also has decent docs on this.

mokutil --sb-state will tell you if secure boot is active at all. It looks like it’s disabled on both of my Linux servers. A little surprised at that, btw.

mokutil --db will show you the enrolled keys for secure boot. I don’t really know how to read all this, but you can find the problematic keys.

        Issuer: C=US, ST=Washington, L=Redmond, O=Microsoft Corporation, CN=Microsoft Corporation Third Party Marketplace Root
        Validity
            Not Before: Jun 27 21:22:45 2011 GMT
            Not After : Jun 27 21:32:45 2026 GMT

Apparently the good new key will say 2023, but I don’t have one to be sure.

Adding the new key is something you have to do in the BIOS. Installing a firmware update from the console is the surefire way. LVFS should also be able to do it, maybe as simple as fwupdmgr update. But that doesn’t seem to add a 2023 cert for me on my ASUS motherboard.

Looking in dmesg for things about X.509 certs may be instructive for what the Linux system is doing. That won’t tell you what the BIOS is doing though.

A fine rant

Secure Boot is a complete disaster. In theory it was supposed to protect against pernicious malware. In practice it’s been a complete sham since the beginning because all the implementations are deeply buggy. See here for some history on that. If BIOS malware were a real thing in practice we would have seen a lot more attacks against these buggy implementations using such things as CN=DO NOT TRUST that were trusted by every major PC manufacturer.

What Secure Boot did do was protect Microsoft’s monopoly. It continues to make installing other operating systems very difficult on PCs. About once a year I have to spend an hour+ dealing with some sort of secure boot fiasco in Linux. The most recent example: Nobara just doesn’t support it at all because they have no practical way to sign kernel packages in their build system.

So I’m disabling Secure Boot everywhere. Including in VM BIOS, what a farce. I had one old PC that caused problems if you disabled it though. If you turned off secure boot there was no way to use some other platform features, maybe the TPM? I haven’t run into that in awhile though.

ISO dates and Unix locale

I want my dates to be displayed in ISO year-month-day like this: 2026-06-09. And I want my times to be in 24 hour clocks with leading zeroes, like this: 08:37.

There is no Unix locale to reliably do this.

There is a hack, which is to set LC_TIME=en_DK.UTF-8. en_DK is a weird confection meaning “Danish formatting but with English words”. glibc defines it to be like I want. Problem solved?

Unfortunately not entirely. Because actual Danish people sometimes write times with dots instead of colons. 08.37. I’m not entirely sure where all this happens but KDE Plasma is showing my system clock that way.

What we could really use is a synthetic locale for international use. A locale that prints ISO dates and times.

We could also use a synthetic UTC timezone. Right now I use Reykjavik time on servers, since that’s GMT+00:00 and doesn’t do timezone shifts. But it’d be nice to have an explicit “UTC” option. Some systems do have that, actually, but a lot of software expects a geographic time zone. The ones that make you pick off a map are the worst.

(I feel like this blog post is self-parody, the most detailed of minutiae. But we use these dates and times everywhere! Why don’t they display the way I want, according to the primary international standard?)

Changing your hostname in Fedora

I wanted to change the name of my Nobara Linux system. Nobara is a variant of Fedora. I’m running KDE Plasma on it. The process was remarkably manual. If you’re running GNOME there’s a GUI tool to do this. KDE doesn’t have one, but there is a 15 year old feature request.

Basic process

  1. Add the new hostname as an alias for the old in /etc/hosts, on my system it’s pointing to 127.0.1.1.
  2. Run sudo hostnamectl set-hostname mynewname.
  3. (Optional) Reboot.

hostnamectl(1) is a systemd program. It updates /etc/hostname and also updates some live system state. In theory the reboot isn’t necessary but it seems safer.

Cleanup

While the process above resets the system name, there’s still a lot of applications and services that need custom updating. I only found most of these by running rg and looking for the old name.

  • CUPS / printing: /etc/printcap has the old hostname in it. Apparently this file is generated from somewhere so you can’t just edit it. I ended up removing and reinstalling the printer.
  • akmods: /etc/pki/akmods/cacert.config has the old system name in it. As far as I can tell this is entirely cosmetic, and doesn’t need updating it. Changing this is scary because it has to do with kernel loading and secure boot signing, so I didn’t touch it. System seems fine wihtout.
  • syncthing: the hostname was baked into the syncthing node name. This seems cosmetic but is easy to change in the Web GUI.
  • KDEconnect: the hostname is baked into ~/.config/kdeconnect/config. Again, cosmetic. It’s easy to edit the file and the phone-side of KDEconnect will pick up the new name. Gemini advised I kill kdeconnectd first, apparently it will rewrite your config file out from under you?
  • /etc/hosts your old hostname is still here as an alias. It’s harmless to leave it there, and may even be papering over problems. But remove it if you want.

Getting a no-DRM epub from Kobo

I bought a book from Kobo. It’s from 130 years ago, long out of copyright, none-the-less Kobo added some DRM to it. Here’s how I fixed it.

  • Buy the book on Kobo
  • Go to My Books. Click the three dots next to the book, choose “Download”.
  • Joke’s on you! Instead of downloading the book you get a 1.3KiB file named “URLLink.acsm”. This is really just a pointer to a copy of the book hosted by Adobe Digital Editions.
  • There are various ways to download the actual book. I used the Calibre ACSM Input Plugin to download it. Note this requires you log in to your Adobe ID or generate a temporary credential. Also note you have to install the plugin and restart Calibre before importing the ACSM file.
  • Joke’s on you! There’s now a ~2MB epub file but Calibre and nothing else can read it. It’s copy protected. Go ahead and delete the entry from Calibre.
  • Install the DeDRM tools plugin for Calibre. This one you have to download as a file. Restart Calibre.
  • Drag the ACSM file into Calibre again. It will download the epub, fix it, and store an unprotected version of the epub in your library. You can also export it and get a readable file.

Note for most books you can save yourself a lot of trouble by just downloading the book from an unlicensed source. They won’t play any jokes on you, either.

Streaming Linux audio to a Sonos S1

My new Linux desktop has a neat trick: I can route the sound I’m hearing to my Sonos S1 speakers. It’s always annoyed me I couldn’t do that easily before.

The magic plumbing is PulseAudio, the Linux subsystem that handles media streams. (Or actually PipeWire, the replacement.) Basically it lets you pipe music (and video) around from program to program.

There’s a third party Sonos controller app for Linux called Noson. It has the ability to tell the Sonos unit to play audio from a network stream. It will then create a network stream for you that is listening to PulseAudio on your Linux box.

Once this is going the Sonos shows it is playing a track named “pulse.flac?acr=hostname:1400”. I don’t think hostname has to actually resolve for it to work.

The other trick is to get the audio going out to PulseAudio. For me the source I want to play is Plexamp. By default Plexamp is playing out my speakers. I used pavucontrol to re-route it, choosing “noson” instead of my usual sound card / speakers for the output. I think I could also have just set this in Plexamp: right now it’s being told to play to “System default” but I can choose where it goes inside the app.

The one downside to this setup is latency. Sonos wants to buffer a stream before playing it so anything I play is delayed about 10 seconds. Not awful but a little annoying.

I’m doing all this to get Plexamp to drive the speakers in my house. Plexamp is really cool, working off my music library and doing all sorts of advanced DJ and mood / genre matching tricks.

(As with anything these days, I figured all this out thanks to AI. Here’s a link to the conversation.)

Pipewire

Need to learn more about this! Here’s what qpwgraph shows me, you can also edit this like patch bays. coppwr is another tool that shows a similar view with more low level detail

USB ports on my new computer setup

USB ports are so complicated now! So many different speeds and capabilities. I got a new computer for a Linux desktop. A Beelink SER8 and a fancy ProArt PC32QC monitor. Then I tested all the USB ports to see what they did.

The test I did was plugging a Crucial SSD into each port with a good cable. The SSD maxes out at 10 Gbps, and I observed speeds of 10 Gbps, 5 Gbps, and 480 Mbps on various ports.

Note: the monitor is plugged in with a USB-C cable between the monitor’s Thunderbolt upstream port to the Beelink’s USB4 40Gbps port in the back.

Beelink SER8 ports

There’s some good photos and info on the Beelink SER8 ports here.

Observed drive speeds:

  • Front A: 10 Gbps
  • Front C: 10 Gbps
  • Back A, top left: 10 Gbps
  • Back A, bottom left: 480 Mbps
  • Back A, bottom right: 480 Mbps
  • Back C: ???
    This is a USB-4 40 Gbps port, I’m using it to carry video and data to my monitor.

Bottom line here: the front ports are good. That back USB-C port is special. The back bottom ports are for low speed crap.

ProArt PA32QC ports

Observed drive speeds:

  • 6 Back USB-C (left): 10 Gbps
    This is actually a Thunderbolt daisy chaining port
  • 6 Back USB-C (right): ???
    This is a Thunderbolt port that goes to your computer. It’s carrying both video and data for me.
  • 7 Back USB-C (right). nothing
    This is an “upstream port”, hard drive does not work. I believe this is the port you connect to your computer if you’re not using the Thunderbolt at port 6.
  • 9 Back A: 5 Gbps
  • 9 Bottom A: 5 Gbps
  • 10 Bottom C: 5 Gbps

This is confusing! The two ports on the bottom of the monitor are utility ordinary USB ports. Shame they’re only 5 Gbps. The back ports are complicated because this monitor also functions as a KVM so needs to separate upstream and downstream.

I have another computer with a second ProArt monitor. That computer is plugged in from a USB 3.1 to to that back port 7 on the monitor the upstream port. That setup doesn’t work as well but I should test it again.

GV desktop (X570-Pro)

My ATX Linux desktop with an ASUS X570-Pro motherboard. The ports are all color coded and all seem to work as they should.

  • 2x USB-A black ports on front: 480M
  • 2x USB-A blue ports on front: 5G
  • 4x USB-A blue ports on back: 5G
  • 3x USB-A teal ports on back: 10G
  • 1x USB-C port on back: 10G

GV desktop monitor (ProArt)

I’ve got a ProART PA32QCV monitor plugged in to one of those 10G ports on the back of the computer. The hub in the monitor is only registering at 5G, not sure if that’s a cable problem or if it’s just a limitation of the monitor’s USB hub.

  • 6 Back USB-C (left): nothing
  • 6 Back USB-C (right): nothing
  • 7 Back USB-C (right). this is the port that has a USB cable going back to my desktop computer.
  • 9 Back A: 5 Gbps
  • 9 Bottom A: 5 Gbps
  • 10 Bottom C: 5 Gbps

The Apple keyboard I have plugged into 9 Back A has its own USB port on it, presumably for a mouse. A drive plugged into that works at 480M.

ProArt USB hub

Having done all this testing I now understand what the ProArt PA32QCV is doing with USB. And it’s all very sensible.

You have two choices for plugging the monitor in to your computer. Either a video cable (HDMI or DisplayPort) along with a USB 3 cable to port 7 on the back. Or else a USB 4 / Thunderbolt cable into port 6 (right) on the back carrying both video and data.

Either way, the ProArt gives you three ports for regular use: keyboard, mouse, speakers, drives. 9 Back A, 9 Bottom A, and 10 Bottom C. These all work at 5 Gbit.

The ProArt also has two unusual ports on the back in block 6. That’s really for the Thunderbolt subsystem: if you plug in the right side to your computer, then it’s daisy-chained to the left side and you can use it for a second monitor, or a peripheral, etc. It works at least up to 10G, wouldn’t surprise me if it does 40G. If you connect your monitor to the computer via video+USB both of these ports do nothing.

RII K22S keyboard bluetooth pairing

The trick is to hold down Fn+Shift for a few seconds until the light binks rapidly.

The Rii K22S keyboard is a nice little wireless keyboard. It’s well built and usable but I wouldn’t want to use it as my primary keyboard. Just perfect if you need an occasional couch keyboard or a backup for computer tinkering. I particularly like that it supports both Bluetooth and a proprietary 2.4GHz wireless dongle. (I don’t think it works via USB cable though, too bad.)

Anyway, the manual lies to you about Bluetooth pairing. It says

Press Fn+Shift, enter the Bluetooth pairing mode, the BT indicator flickers slowly. To pair with your device, open Bluetooth on the device, select RI721 BLE Keyboard and click on the connection.

The misinformation here is that flickering slowly is pairing mode. It’s not. You have to hold down Fn+Shift a few seconds and then the light will start flashing fast (twice a second?). Only then is it in pairing mode.

Rii makes a bunch of neat small wireless keyboards. I like the ultra-mini K06, about the size of a game controller. Not at all suitable for real typing but just perfect for a home theater PC where you need to press Win-Tab occasionally so the stupid game window comes into focus.

Proxmox container for a Tailscale exit node

I want to set up a Tailscale exit node for me on the server with a good home Internet connection. This is a sort of poor-man’s VPN, routing all traffic through my home ISP connection. It’s pretty easy but I ran into a problem with IP forwarding.

First I set up a tiny Alpine container and used the Tailscale community script to set up Tailscale on it. You can install Tailscale by hand but this script handles the extra config needed to give an unprivileged LXC access to the tunnel device.

Then I set up Tailscale in the container to advertise as an exit node. The key thing there is sysctl configurations to enable IP forwarding inside the container OS. Very important! You also have to tell tailscale to advertise itself as an exit node.

Once I did this it worked. At least, I think it did. But it stopped working, maybe after a reboot?

To fix it, I also enabled IP forwarding via sysctl on the Proxmox server itself. I’m not 100% sure this is required or even a good idea. But when I enabled it, the exit node started working again. I’m a little confused about this but I think it’s OK.

Death to Tailscale MagicDNS

It took several years but I finally disabled Tailscale MagicDNS. It just caused too many problems. It broke Proxmox containers. It broke private DNS on my Android phone. It broke all sorts of stuff. I don’t want tailscale to mess with DNS.

I’ve replaced it with tailscale-cloudflare-dnssync. This is a simple Python program that uses Tailscale and Cloudflare APIs to read your entire tailnet’s list of hostnames and create DNS records. There’s a zillion versions of this kind of script, including some that support other DNS services. This one works fine for me. I’ve set it up to run daily but since the Tailscape IP assignments are static, the DNS records aren’t going to change much.

I also set up my local resolver to search the subdomain I put all the tailnet hosts in. So I can use short hostnames like sfrouter instead of FQDNs like sfrouter.tailscale.example.com.

The downside of this new setup is now all my tailnet hostnames are out there in a public DNS list somewhere. They all point to private unroutable IP addresses, so there’s very little someone can do with that info. But now someone could figure out with some DNS queries that I have, say, a PiKVM and then try to attack it somehow. Then again I remember when AXFR was still a supported DNS query, and a very useful one at that! It just doesn’t seem that big a worry for me.

MagicDNS was always a kludge. Tailscale would basically try to intercept your system’s DNS resolvers and insert its own at 100.100.100.100. Its primary feature I used was to serve address records for hostname.your-tailnet.ts.net. (These aren’t real DNS records, they were only visible to you from their special nameserver). Over time it has grown a lot of other complex features, none of which I want. And it caused all sorts of problems. Good riddance.

As a bonus I think this will make it easier for me to get working SSL certificates for my tailscale names. There’s some way to do that with MagicDNS but I never figured it out.

Working with Ultra HDR JPGs

My Pixel phone takes nice HDR images and saves them as UltraHDR. (aka ISO 21496-1 or Adaptive HDR). These files look and act mostly like normal JPEGs but HDR-aware software can find a second raster image in there with a “gain map” which has extra brightness information for boosting the image into 10 bit HDR.

It’s a bit of a kludge but seems to work well in practice. Chrome and a lot of Android software works with them as true HDR images. Microsoft and Apple both support them, as do all the browsers. Any old software without UltraHDR falls back to an 8 bit SDR image: not great but better than nothing.

GUI HDR programs

I’d like to view and edit HDR images on my Linux desktop. I have a nice HDR monitor that is working! Unfortunately I can’t find a single mainstream Linux image viewer or editor that supports Ultra HDR JPGs. A little surprised at that. The only thing that will show them correctly is Chrome, you can drag a local file to it and it displays in HDR.

There are a couple of specialist viewers that sort of work. tev seems to handle the HDR data but I couldn’t easily get a display that looked right although fiddling with the tone mapping the image looked intact. HDRView displays the image great but I think is only rendering at 8 bits, just nicely tonemapped. Also it doesn’t scale the UI to my display so it’s unusable.

CLI HDR programs

Even worse, I can’t find a good command line program to work with UltraHDRs or even convert them intact to other HDR formats like AVIF or EXR. At least, nothing simple seems to work. I tried out a bunch of Gemini suggestions on a Pixel photo and didn’t get very far.

The winner is hdrify-cli, a pure Javascript node program. It is easy to install and use. I can convert the UltraHDR-JPG to a EXR file that when opened in Okulus looks... different than the source SDR. Like a badly tone mapped image, but maybe that’s Okulus’ display algorithm fault. If I convert it back to a JPEG and view it in Chrome it looks like the original, so actual round trip conversion! hdrify also supports writing 8 bit SDR files like WebPs, it seems to just extract the SDR from the source.

ImageMagick now has some HDR support but I can’t honestly tell how much. The build on my Nobara Linux system doesn’t include the support. I tried a precompiled build from the project but didn’t get much success with the converter. I got somewhere using this elaborate command, but the resulting tone mapping was too dark. Also this is way too complicated, why doesn’t convert foo.jpg foo.avif just work?

uhdr2avif seemed promising but the program just spun and ate 2 CPUs.

Google’s reference libultrahdr has a demo program but it’s more of a swiss army knife for working with UltraHDR images, not a simple converter.

A lot of these tools all seem very much aimed at experts who understand tone mapping curves and color spaces and gamuts. Not intended for civilian use.

File formats

Part of my confusion is what image format I should be using for HDR images.

UltraHDR JPG is what Google is giving me when I download my photos. It’s a kludgey format but has a lot of support, it seems OK.

AVIF seems like the “best” choice for a clean image format that happens to also do HDR. Unfortunately hdrify doesn’t support writing it.

EXR is a very low level HDR format that has some broad support. Main issue is there’s no lossy compression so files are huge.

JPEG-XL in theory should work but in practice is still a dead-on-arrival format.

HEIC/HEIF is what Apple has been doing but I don’t think much else supports it.

Wake on LAN

One fun thing about my new Linux desktop is that the computer is useful enough that I want to be able to access it remotely. I never cared with a Windows machine. I’ve got this machine set to go to sleep automatically but just set up Wake on LAN for the first time. Works like a charm.

The key piece of this is UpSnap. That’s a little Go program that provides a web server with a GUI for monitoring machines and sending Wake-on-LAN packets when you click a button. I installed it with a Proxmox community script and then put Tailscale on it so I can access the webapp remotely, like from my phone.

Beyond that was verifying my PC would actually Wake on LAN. There’s a BIOS setting to enable (although with that off it will still wake from sleep, just not full power off). There’s also a Linux feature you might have to enable in NetworkManager (it was already on for me). “Wake-on: g” is the important thing, the “g” means “wake on magic packet”

$ sudo nmcli connection modify "Wired connection 1" 802-3-ethernet.wake-on-lan magic
$ sudo ethtool enp5s0 | grep -i wake
        Supports Wake-on: pumbg
        Wake-on: g
      

Wake on LAN is a 30 year old technology! The core thing I’m using is that most ethernet hardware will wake up if it hears a magic packet sent to its MAC address, even if it’s otherwise mostly turned off. (Gemini says this uses under 1 watt) There’s a WiFi version too although I have to think that’s a lot more complicated given the need to maintain a radio link.

CoolerControl / quieting CPU fan

Awhile back I identified the fan that makes noise on my computer. It’s Fan 2, the Noctua CPU cooler. When it gets over about 55% (1000 RPM) I start to hear it. I just fixed it with a custom cooling curve, with help from Gemini. It was more annoying in Linux than in Windows. Not sure if Windows had some custom fan discipline or if Linux just had a way of spiking heat.

The result is at idle the cooler runs at about 30-35% speed, I can’t hear it, and the CPU hovers around 60°-70°C. Under heavy CPU load it gets to 80°C and 40% fan. I still can’t hear it!

I’m using CoolerControl to do this. It overrides the BIOS fan control. I’ve set a custom fan speed curve that’s slower than the BIOS. And then I added a smoothing function with a 3s delay to add a little hysteresis.

It seems a bit silly to have userspace software controlling this. Maybe I’ll figure out if I can make the BIOS do this for me. This CPU cooler is really quite good and lets me run the fan slower.

Update Nov 2026: CPU usage 3, BIOS

I got Claude Code to look deep at why CoolerControl keeps using so much CPU and it boils down to the kernel driver. Apparently it goes through the BIOS to read the numbers, which is slow. Also the driver has some caching but reloads things every 1.5 seconds for some reason, maybe just to work around bugs?

In any event I’ve now got the BIOS controlling the fan directly and it’s staying quiet even under load. The best thing is if the BIOS is wasting CPU time I won’t even know it.

Update Sep 2026: CPU usage 2

It’s taking about 3% of CPU.

ps -C coolercontrold -o %cpu=

Update August 2026: CPU usage

I noticed coolercontrold was using 5-10% of a single CPU. That seems like a lot! I spent some time with Claude trying to figure out why and what to do without it. To get dumb stuff out of the way: I’m polling once a second. I’m not using liquidctl.

First, a somewhat accurate measurement method for CPU time:
watch -n 1 ps -C coolercontrold -o pid,etime,time,cmd
This tells me the process has been running 90 seconds and has used 6 CPU seconds in that time.
systemctl show coolercontrold -p CPUUsageNSec will give you a more precise measurement but I didn’t want to deal with nanoseconds.

Second, what is the thing doing? strace helps here

sudo strace -c -p $(pgrep coolercontrold) -f
gives an overview of the system calls. Run this for a minute or so and Ctrl-C out of it to see the report. Here’s the big work.

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 39.93    3.246640       10274       316         1 futex
 39.82    3.237968        7100       456           epoll_wait
 20.05    1.630602        1811       900           read

sudo strace -f -e trace=openat -p $(pgrep coolercontrold) -T 2>&1 | head -50
Will show details on the last 50 openat() calls.

The big thing I learned doing this is for some reason the daemon is reopening a file once a second for every single sensor in my nct6798 fan controller. I helped this by disabling a bunch of sensors I don’t care about in the CoolerControl GUI. That brought down the CPU usage a little bit but not much. I’m still at about 6% CPU.

I can’t make any sense out of the futex calls at all. The AI’s guess is it’s using threads to monitor multiple sensors and we’re wasting a lot of time in thread synchronization. Could be true!

Temperature graph, including a stress period

Fan curve

Controls

Charging cheap devices with broken USB-C Charging

I have a tiny portable Bluetooth speaker (EWA A106) that I like but has an infuriating problem: I can’t charge it via its USB-C Charging port if I plug it into a USB-C charger with a C-to-C cable. I can only charge it by plugging into a USB-A charging port with an A-to-C cable or adapter. There’s a lot of cheap electronics that have this charging problem. They ship an A-to-C “charging cable” in the box and consider it good enough.

USB-C charging is complicated. Fancy devices use USB-PD and a protocol negotiation to charge. Even simple devices require 5.1k resistors on a couple of control pins: without them the USB-C chargers won’t know to charge. USB-A charging is much simpler. A-to-C cables work because USB-A chargers will just put out 5V without any signaling at all.

Another fix is a special C-to-C adapter that has the resistors. Amazon sells one named Hagibis 5.1k Resistor 5V/3A Charging Adapter. This Reddit teardown says it is reasonably well built. Adafruit sells another that’s not as nicely packaged.

It’s infuriating so many devices are being sold with these broken USB-C charging ports. The adapter is cheap enough but I really don’t want to have to carry it around!

Customizing my Nobara system

I’ve now set up KDE Plasma desktops under Fedora about 5 times. Here’s my notes on all the things I do. It’s a lot! What’s particularly annoying is there’s no easy way to capture all this config and just replay it all. The config files are too much of a mess.

Earliest setup

  • Switch to Breeze theme
  • Set wallpaper to solid #001830
  • Install Chrome from downloaded RPM.
  • Install 1Password from downloaded RPM.
  • Install tailscale
    curl -fsSL https://tailscale.com/install.sh | sh
  • Remove the Brave browser and disable its repository.
    sudo dnf remove brave-browser brave

Nobara Welcome App

First steps

  • Update my system. The installer will do this for you if you let it.
  • Install the Nobara codec package. It is very aggressive about launching this!
  • Open Driver Manager: I didn’t need to do anything

Optional Steps

  • Launch Steam. Then use ProtonPlus to Install Proton-GE

Recommended

  • Install Discord
  • Install Flatpak Bazaar
  • Uninstall OBS Studio, Kdenlive, and Blender 3D

Misc

Set up ssh agent stuff

Install RPMs

dnf history list is very helpful for reconstructing this list.

  • ghostty
  • joe
  • input-remapper
  • chezmoi
  • sunshine (beta)
    dnf copr enable lizardbyte/beta
    dnf install miniupnpc
    dnf install sunshine --repo=”copr:copr.fedorainfracloud.org:lizardbyte:beta”
  • syncthing
  • coolercontrol
  • adobe-source-sans-pro-fonts adobe-source-code-pro-fonts adobe-source-serif-pro-fonts google-roboto-fonts google-noto-sans-fonts jetbrains-mono-fonts fira-code-fonts

Install Flatpaks

flatpak history or flatpak list can help to reconstruct this.

Use Bazaar (installed above) to find things instead of Flatpost or Discover or whatever.

  • Slack
  • Mission Center. Consider hack to enable wattage info:
    sudo chmod a+r /sys/class/powercap/intel-rapl*/energy_uj
  • Gear Lever
  • Signal. Launch it and follow instructions about kwallet.
  • Plex. Had to install via command line.
  • Calibre
  • SyncThiny. Set up sync for ~/src

Install AppImages (in Gear Lever)

  • LM Studio
  • noson (for Sonos)

Customization

  • sudo systemctl enable --now sshd
  • chezmoi init nelson@sf.somebits.com:~/gitrepos/chezmoi
    chezmoi apply
  • Set up apps for favorites for launcher
  • Timeshift to do daily btrfs snapshots
  • Move system tray to left side, 146 pixels wide
  • Set date format to ddd MM/dd
  • Install KIM6 for image conversion in file manager
  • Set up an ssh-agent for the graphical environment. This is complicated and the linked AI answer is wrong in important ways.
  • Log in to every website, there is no way to copy login cookies to other machines.

Keyboard customizations

  • Fix the function keys
    echo "options hid_apple fnmode=2" | sudo tee /etc/modprobe.d/hid_apple.conf
  • Use Input Remapper to override CapsLock to be F15. Make sure to apply it at boot!
  • Use Shortcuts to bind F15 to launch clipboard in web browser
  • Use Shortcuts to override F13 to take screenshots with Spectacle. (May not be necessary: F13 is in the same spot on my Apple Keyboard.)
  • Set up XCompose key under “Position of Compose Key”
  • Disable the Plasma virtual keyboard. It uses a lot of VRAM (a known bug).

Chez Moi: modernizing Linux config

I’ve used Linux since 1994 and Unix since 1989. I have some very old and crufty configurations I’ve hauled around over the years with some clunky script to set up a new machine. I’ve modernized it with help from Gemini.

Dotfile management

The key tool I used is chezmoi. It’s a nicer version of my clunky script. It feels a little like git, but customized for shell configs. For instance I run chezmod add ~/.bashrc and it makes a copy of my current bashrc to ~/.local/share/chezmoi. If I run chezmod apply it copies all the files from that chezmoi repository to live places. It’s a little goofy but it works and it has advanced features for templating, encrypting secrets, etc. Note you’re expected to use git yourself to keep versions of this chezmoi mirror of your config files.

Setting up chezmoi was a very manual process of deciding what config files I want and manually importing them. In the end I’ve got 31 config files. A bunch of ancient tty stuff from my old configs and some new KDE stuff from my new Linux desktop

Modern Linux file locations

XDG defines is the modern standard location for config files. The key thing is ~/.config, which in theory is where all config files belong. This has been predictably corrupted over the years. Chrome spams it with over 6000 files including a bunch of binary junk. But it’s still a pretty useful standard. ~/.config/lesskey for instance lets you configure the less pager. (And in a text format now, hooray!)

Auditing config files

It’s very confusing what all your config files are. xdg-ninja is a helpful tool. It looks in your home directory for standard config files for a bunch of programs and advises you ways you can modernize and move things to .config. Not a panacea but a helpful tool!

Modern bash shell

There’s some nice tools that make bash really nice to use.

starship is a lovely dynamic prompt framework that is very fast. The key thing I rely on is it showing me git repo status.

atuin turns your shell history into a giant database you can query. It’s very nice if you have the habit of building up complex commands interactively.

Modernizing configs

I had a surprising amount of fun showing Gemini my config files and asking it to advise me on how to update things. For instance it suggested I don’t need 25 year old Netscape environment variables anymore. And that there’s better / newer ways to do some things with modern tools. It was a fun interactive process for an hour or two sweeping off some of the cobwebs. Particularly impressive that I can ask it things like “what does mpage -a do?” and it remembers some 25 year old BSD utility I long since forgot.

Linux gaming and resolution scaling

Deep into tinkering with gaming on Linux using Bazzite 44. The problem I’m wrestling with is that fullscreen games are guessing a different resolution than they should. my screen is 6016x3384 natively but instead the game is trying to run at 6863x3860 or some other wrong value. This doesn’t happen for all games.

These tests are for the game Rhythm Storm, a fairly simple but graphically intense game. I’m playing on a ProArt display that’s 6016x3384 natively, with a NVidia 5060 and the 595.71 Linux open drivers installed. Bazzite is pretty much an all-Wayland system, with just a bit of X11 compatibility. I am running the display at 225% scaling. This Gemini chat is all the research I’ve done so far.

First, a useful tool: xrandr. That shows a set of resolution that X11 apps think are valid. On my system with 225% scaling it shows 6863x3860, the mode the game is picking. If I change scaling this number changes in some mathematically way I can’t quite understand. Anyway this must be what the Steam game is picking up.

One tool to fix this scaling problem is gamescope. That’s some sort of Steam graphics shim that sits between the game and the Linux display software. It can be told to enforce a specific resolution and you can impose it for a particular game by altering the Steam game launch options. That works! Unfortunately it also hides the Steam overlay. There’s supposed to be a -e or --steam option to work around that, but when I try that the game never launches at all.

I’ve been surprised at how well games work on Steam / Linux in general. Proton is a marvel! But this kind of problem is exactly the sort of infuriating bullshit that makes Linux seem unacceptable as a desktop OS. Right now I’m still cheerful about trying to figure problems like this out, so I’ll stick with it. Wonder how long that will last.

Remote game streaming

Some things I’ve learned about playing games by running them on a big computer and using my TV as a client. Basically this is an optimized form of desktop screen sharing.

The client TV is a 2160p Sony Bravia. That runs Android and seems the best of the smart TV platforms. The server running the games is a desktop gaming PC, I’ve tried both Bazzite Linux and Windows. Both devices are wired on the same LAN. (This stuff works on the Internet too and is surprisingly responsive.)

Steam Remote Play

Valve has had a remote gaming product for some 10 years. I still have working Steam Link client hardware! But these days it’s easier to run a Steam client on the TV.

It works pretty well but is surprisingly flaky. The biggest problem is resolution switching. Steam should change the desktop resolution to the TV’s resolution, or down to 1080p if I tell it to. That only works one time out of three so mostly I have to change the resolution on the PC myself. (The TV can display anything, but 3440x1440 looks terrible on a 2160p display.)

The other knock on Steam Remote Play is that it’s not very optimized. Folks report 20-40ms latency, or maybe 2 frames of a 60fps game. I haven’t really noticed that but I’m not super sensitive to it.

Sunshine / Moonlight

The alternative fancy gamers recommend is the Sunshine streaming game server and the Moonlight client. These have been around quite awhile, started as an open source reimplementation of the NVidia Game Shield protocol. The big advantage folks quote over Steam is latency: it delivers 4ms on my LAN, or well under one game frame.

The server works well on Windows. It seems reliable. It has some nice stuff about launching things when a client connects, like invoking Steam Big Picture. I’m still having to set the Windows desktop resolution manually although I think Sunshine can do that for me.

The server does not work for me on Bazzite Linux. It sort of does. But the NVidia drivers on my old 1080 card aren’t correctly detecting display modes so I’m stuck streaming 3440x1440.

Alternate resolutions

One dumb thing about all these solutions is that they’re displaying what’s on the PC’s screen, at the PC’s resolution. But basically I have a remote screen on the cliente TV: why should I care what’s plugged in on the server?

One solution is a dummy HDMI plug. This does the EDID handshake to make the computer thing you have a monitor plugged in so you can configure the OS to use it as a primary or secondary screen. These are particularly popular for headless machines: with no monitors plugged in some GPUs refuse to operate at all.

The dummy plug seemed to work as a second screen on Linux. But caused all sorts of problems. First, the desktop GUI wants to use that screen! But it’s invisible, so stuff gets placed there you can’t see. Second, I couldn’t reliably get all the gaming stuff to happen on that fake screen while leaving my desktop alone for normal stuff. The software is just not designed to do it.

I went down a rabbit hole of trying to fix the resolution-switching problems on Linux with my 1080. Total disaster. There’s some hack with kernel keyword arguments with display mode lines, yuck! There’s also a hack where you load fake EDID data from a file to trick the graphics card. I couldn’t make any of that work. Honestly why doesn’t the NVidia driver just detect the modes that are there?

The other solution is a virtual display. Basically have a device driver fake a viritual screen disconnected from actual hardware. This feels like the right solution and reminds me of the ancient X11 virtual desktop hacks. Ironically, virtual displays are reportedly unreliable to impossible on Linux.

On a Windows server folks recommend Apollo, a Sunshine fork, which has virtual displays as a headline feature. I’ve tried this server and it works, but I haven’t tried the virtual display feature yet.

Bazzite desktop impressions

I’ve had the nicest time using a Linux desktop OS the last few days, so good I may make this my daily driver. For the first time this OS feels like it works better than Windows. Faster, cleaner. Also it feels like a coherent product in a way previous Linux desktops haven’t.

I tried Bazzite 43, a Fedora variant intended for gaming. The GUI I’m suing is KDE Plasma 6. Most of what I like about it seems to be the KDE + Fedora stuff. Bazzite adds on top of that a bunch of gaming apps pre-installed, working NVidia graphics drivers, and an atomic OS release system suitable for civilian use.

I’m running this on an AMD desktop system with an NVidia 5060.

First Impressions

I was thrilled that stuff just worked out of the box. I installed it on an external USB drive. Key thing: my NVidia 5060 with a 6K HDR display just worked, first try! Even Windows can’t manage that. I could launch Steam and be playing games full speed in minutes.

I also got an immediate impression that stuff Just Works in this Linux distribution. Windows 11 feels the weight of its history, lots of crufty hacks and weird brokenness. Bazzite felt fresh and new in a nice way. That honeymoon broke down once I got deeper into it but at least there’s a new set of bugs and there’s some hope of hacking your way around them.

Graphics

Linux desktop has come a long way. This is the first time I’ve used Wayland and it’s nice that stuff like font scaling, HDR, etc work correctly. And KDE Plasma is a remarkably coherent system.

One particularly neat trick: I have two screens set at different scaling. If I drag a window across the both it scales correctly, one side at 200% and one side at 250%. Windows can’t manage that.

I did run into rough edges eventually. The Nvidia-open driver that’s the default works great on my 5060, but not on my old 1080 card. The proprietary Nvidia driver does work on the 1080 but isn’t identifying all the display modes it should find. I went deep down a rabbithole of video mode hacking complete with programming video card dot clocks, like it was 1995. Ugh! I never did get it working. TO be fair, the 1080 is nine years old now.

Atomic Linux

Fedora is a pretty solid Linux. I’ve never really used it, I went down the Debian / Ubuntu road instead. But it’s solid.

What’s unusual about Bazzite is it is an atomic distribution. Instead of upgrading individual packages piecemeal you install one giant 5GB release that bundles kernel, important packages, graphics drivers, apps.. Everything you’d want. Then you can reboot to this new release, or roll back. There are tools for layering custom stuff on top of these releases but you are discouraged from doing that.

If you want to add an application, Bazzite suggests you get a Flatpak from some online app store. These work great right until they don’t! You also have the option of running AppImages using GearLever, I use this for LM Studio.

If you want to Linux CLI tools or other low level stuff, Bazzite suggests using Homebrew and installing it just in your home directory. UGH! Homebrew is awful and is the main reason I switched away from MacOS all these years ago. Another option is distrobox, which gives you a nice container for Linux shell work.

The problem I’ve run into with this model is some stuff just doesn’t work. The most pernicious is 1Password. It wants to run a persistent process storing state securely, then a browser extension talks to it. But this won’t work if 1Password is in one Flatpak container and the browser extension is in another container. I tried various hacks to get around it and it got really complicated. I can imagine someone adding a specific integration for this just for Bazzite, a bridge between containers, but no one has yet.

Update: someone made the integration! This worked for me but 😬 at using something so hacky for something as important as my 1Password data store.

Rollbacks are awfully nice though! I experienced this today. Bazzite 44 just came out so I tried it out only to find the graphics driver isn’t working right. Just one button to go back to yesterday’s 43 release, no drama.

Customization

A lot of personalization is nice on Bazzite but not everything is great.

Changing hostname is surprisingly clunky! The default I got was computer. There’s no GUI for changing it!

The keyboard function keys didn’t work as F keys out of the box. On my Apple keyboard they act like “media keys” and do things like screen brightness. There’s various hack fixes for this all involving the command line: really should have a GUI for this.

I’ve done a bunch of other customization. Input Remapper to remap Caps Lock to a script to open clipboard content as web pages. tweaking the desktop to look just so. Etc. It’s always fun for me to re-do this kind of setup, or at least every few years, and in general KDE Plasma is providing a good experience.

Signal

Shame on Signal, WTF is this warning? I tried using their instructions for the experimental “use kwallet6 to store secrets” and it seems to be working but I can’t be sure.

Gaming

It’s funny: I set up Bazzite and pretty much haven’t run any games. But they run great!

One problem I’ve run into is the OS seems to use more GPU RAM. Some of it is wasted, like a virtual keyboard I’ve never used wants 400MB. Some of it is legit, Chrome has 600MB or more even with few tabs open, Discord wants another 250MB, Wayland itself needs a bunch. I’m using a bunch of Factorio mods that want 13GB of GPU RAM and I only have 16. This works fine on Windows but I’m having to close stuff to get it to run in Linux.

The underlying problem is Windows is better at evicting apps from VRAM when a game wants the memory than Linux is. There’s some brand new work about a dmemcg-booster patch to the kernel to allow prioritizing certain processes for GPU memory. This sounds like a good thing. And necessary in the world of Electron bloat.

Conclusion

I like Bazzite enough it makes me want to use Linux as my daily OS. Windows has never been easy to love and seems worse lately. This KDE Plasma environment is good enough that there’s pleasure in making it work for me, not just frustration.

I think I don’t want the Atomic OS though. It’s causing too many problems. And it makes perfect sense for a computer appliance, something like a SteamDeck or a gaming PC where you don’t want to tinker with the OS. But I’m tinkering with Linux all the time and am OK with the instability that comes from manually upgrading things myself. Well, I’m sorta OK with it. At least I prefer it to this set of jails that Bazzite is shoehorning everything in to.

So now I’m looking for some other distribution. Lead contenders are Kubuntu or else Fedora 44. Something that’s not atomic. I think I’d rather try a stock general Linux distro and then add a little bit of gaming stuff (graphics drivers, Steam app). Nobara is also interesting, another Fedora customized for gaming but this one isn’t packaged as an atomic distribution.

Bazzite is a very nice product. And they have a lot of momentum. I’m very glad I tried it out and would definitely recommend it to someone who’s less of a tinkerer.

Update: an Update

Since writing this Bazzite 44 was released. And was silently upgraded to everyone running Bazzite 43. It’s been a confusing update and I think they need to rethink their update notification or policy. Some problems:

  • A serious NVidia driver bug that broke displays. Fixed in one day.
  • They removed the Sunshine that was installed and expects you to install it via Homebrew instead. Folks on Reddit are confused.
  • A MakeMKV flatpak was installed. Again folks on Reddit are confused / alarmed

I think it’s good that the Bazzite team is making new releases and changing features. But not sure how to do that without confusing all the civilians who are just expecting their TV gaming box to work the same every day.

Secure Boot’s ongoing pain

Microsoft invented this thing called “secure boot” whose ostensible purpose was to stop malware from installing in your boot loader, but whose actual function is to make it very difficult to use other operating systems on Wintel hardware. Here it is 2026 and I’m still struggling with it.

First, to clear any illusions: secure boot, as deployed for the last 15 years, is a total sham. Every device had a security exploit that made it easy to defeat. Even better pretty much every device trusted a key named DO NOT TRUST, right there on the whitelist in the BIOS. This key was compromised. Whatever apocalypse Secure Boot was supposed to protect us from didn’t happen and good thing since the tech didn’t happen.

What does happen is about once a year I try to do something with Secure Boot and Linux and get flummoxed. For a long time it was Proxmox VMs, I finally just gave up on secure boot in the VM BIOS. But I also have a problem with my old ASUS Z270-P BIOS, it doesn’t make it easy to disable secure root. I’m not sure I even can, I’m supposed to do something scary about erasing boot keys and I’m scared I’ll leave it in a state where Windows won’t boot.

So now I’m playing with Bazzite Linux, a Fedora variant, and it has some complicated crap involving MOK keys which aren’t real secure boot keys but some subsidiary of a Microsoft key. And it’s not working.

Look at that! Turns out, old BIOS had like 64kb of static storage for secure keys. And Microsoft has put so many entries into it over the years that there’s no room left for operating systems from competing companies. Gosh, I wonder how that was allowed to happen?

The “fix” is to go in the BIOS and either delete all the keys (scary)... Or delete the DBX keys, which is a blacklist of all the compromised keys that Microsoft has revoked over the years. Well, however many will fit in 64kb. Anyway none of these are necessary so you can delete them. That leaves enough room for a legitimate operating system to enable itself to boot. Well, sorta...

I think this error means “you need to install our key to boot”. so now I’m off to boot a Linux system that is signed with an existing key that has the tool to add this other key for Bazzite I need.

What a complete farce.

Outgoing SMTP relay services

Fiddlesticks. I had my somebits.com email all set up right. DKIM and SPF were working, I had a DMARC policy of rejecting unsigned email for three weeks with no problems. And then I broke my setup by cancelling Google Workspace.

Now I’m back but sending email via SMTP2Go. Details below.

I broke it

Last year I set up somebits.com to be on Google Workspace for incoming and outgoing email. And then promptly forgot what I did. Last month I stopped using somebits.com for incoming email because it was not working right. Cloudflare’s email relaying seemed better. So I figured I could stop paying $8/mo for Google Workspace since I wasn’t receiving email.

I forgot about sending email. Without Workspace, there’s no way to DKIM sign outgoing emails I send through Gmail. Gmail will still send email from @somebits.com but it won’t even try to sign them. That’s sort of OK, at least once I turned off my p=reject DMARC policy. But I like the idea of DKIM signed emails.

The easy thing would have been to re-enable Google Workspace. But when you do that you get a notice about how things might not work right for 24 hours. Google’s stupid eventual consistency designs still biting me in the ass, 20 years later. Also I just don’t like Google Workspace, it’s a messy product and does way more than I want. Time for an alternative SMTP sender.

SMTP relay services

The trick is finding a reliable sending service that caters to small legitimate users. Clearly all the business is in helping spammers marketers deliver bulk email. Not me!

I asked several AIs what I should use. My main concerns are correctness of DKIM and SPF and a good reputation so I don’t get blocked along with a bunch of spam customers. Here’s a quick summary of what the AIs suggested:

  • SMTP2Go. Generous free tier of 1000 emails / month, supposedly forever. Good reputation, good service.
  • Brevo. Very generous free tier (9000 emails / month). But some question about reputation.
  • Postmark. The leader for correct + good reputation, in part because they segregate marketing email. But the free tier is only 100 messages a month. If I get to the point of needing to pay $15/mo to deliver email I’ll look at them again.
  • Forward Email. They came up as a relay for receiving mail too. The free tier doesn’t allow sending mail via the relay so I didn’t look further. OTOH $3/mo may cover me, worth a look again maybe.
  • MailerSend. Generous free tier (3000 emails/month). Didn’t look further.
  • Amazon SES. Not interested in the mire of AWS.
  • SendGrid / Twilio. Nah.
  • Mailgun. Seemed good but no real free plan.

I wanted to use Cloudflare since I already use them for receiving email. They did finally launch their email sending service in public beta. But near as I can tell they don’t have an SMTP relay suitable for pointing Gmail at to deliver mail. It’s not really their goal, the purpose of their service is more backend stuff.

Sorry for the half-ass evaluation, I was losing patience. I picked SMTP2Go based on what I saw.

SMTP2Go

So far so good with SMTP2Go. It’s pretty simple. You set up an account, tell them what domain you want to send mail as, then they give you three DNS records and you’re off to the races. One neat trick is the DNS records are all CNAMEs to their servers, no need to configure complex TXT records with nonces in them.

I like their dashboard UI. You can set up different users, manage passwords, etc. It’s all overkill for my small use case but easy enough to work with. I appreciate the rapid view into sent email with logs and reporting and the like.

One weird thing: smtp2go explicitly says you don’t need to set up an SPF record. Instead they are using something called VERP that involves a CNAME, see here for more detail. One of the test tools I tried complained about an SPF failure so I went ahead and added smtp2go as an authorized sender for my whole domain, which shut up that error.

Email receivers for testing

I keep tinkering with my email setup. It’s very helpful to have an email address you can send messages to that gets you some diagnostics. Here’s a few.

Technical tools

dmarctester aka learndmarc. A very cute interactive tool. A little cumbersome for quick testing but there’s a fast forward button. It shows results for SPF, DKIM, and DMARC. It does not show spam score nor the exact message it received.

dkimvalidator: very barebones but good for basics of SPF, DKIM, DMARC. Shows original message front and center. A little hard to read but then again quite complete. I’ll note this flagged an SPF error where others didn’t. I suspect this isn’t supporting the VERP that SMTP2Go uses or if there’s a real problem. (The problem went away when I added a supposedly unnecessary SPF entry.)

mxtoolbox has a responder on ping@tools.mxtoolbox.com. The email reply gives you basics (SPF, DKIM, DMARC) and you can click through for a nicely formatted detailed report. Not much marketing / reputation info. Does show you the exact message received.

Marketing tools

mail-tester.com. Nice mix of technical stuff (SPF/DKIM/DMARC) and content / marketing stuff. Shows your spamassassin score. Tells you if you’re on any major blocklists. Will show you original message. I like the way this tool looks.

aboutmy.email. Marketing-oriented tool. Does tell you about SPF and DKIM, also Yahoo/Google requirements (like an unsubscribe link)

Not useful

check-auth@verifier.port25.com: this tool was great but recently stopped working (April 2026).

Another Twitter archive

Since Twitter was destroyed it’s been frustrating losing access to all the stuff I wrote. X still allows you to download an archive of your own tweets, but then there’s the challenge of making the data useful.

For awhile now I’ve been using Julia’s tweet-archive. It works great but I never loved the styling. (I never tried to improve it, either.) You can see my archive in Julia’s thing here.

Matt Haughey just vibe-coded up an alternative. I like the way it looks. It’s also got a couple of extra tricks. The code works with various old formats of Twitter exports. The Javascript has some nice functions like filtering by year. And it displays reply tweets, albeit not linked to what you’re replying to. You can see my archive in Matt’s thing here.

Matt’s code worked out of the box for me but some of the path management and permissions are a little fiddly. Here’s what I did to get it working, from a Twitter archive I pulled just yesterday.

# Download and prepare the files
mkdir /tmp/t; cd /tmp/t
unzip twitter-dump.zip
git clone https://github.com/mathowie/tweet-search-archive

# Clean up the repo a bit and link in the data
cd tweet-search-archive
rm -r tweets_media
ln -s ../data/tweets.js .
ln -s ../data/tweets_media .
sed -i 's/Your Name/Nelson Minar/; s/yourhandle/nelson/' build.py

# Build the archive
python build.py

# Copy the output to a web server and fix permissions
cp -a tweet_search.html ../data/tweets_media ~/public_html/tmp/tweets/
find ~/public_html/tmp/tweets/ -type d -exec chmod 0755 {} + -o -type f -exec chmod 0444 {} +

restic cheatsheet notes for myself

I use Restic for backups. It’s great! But I forget how to use it, the usability for what I’m doing is not great. I’m using resticprofile as a CLI frontend. Last I looked backrest was a good option for a Web GUI: I should reconsider and switch.

Anyway, some notes on the current setup on my personal Linux box with all my important files. (This is the host tt.)

Configuration

Important stuff is in /usr/local/etc/restic, including passwords (also in 1Password) and profiles.toml

/ and /home/nelson are backed up locally to /mnt/backup/restic (another disk). /home/nelson is also backed up to BackBlaze emulating an S3 datastore in a bucket named “restic2”.

(there’s also backups for other hosts in Backblaze in other buckets and honestly I’ve forgotten what they are for! See Below for update)

Shell setup

alias rp='/usr/local/bin/resticprofile --config /usr/local/etc/restic/profiles.toml’

Look around

rp profiles
rp home.show
rp home.snapshots
rp home.mount /tmp/m

Check metadata integrity

rp home.check
rp root.check
rp bbhome.check

Check local home backups are working by verifying 5% of the data

rp home.check --read-data-subset=5%

Check backblaze backups with read (note: slow)

rp bbhome.check --read-data-subset=1%

Maintenance (slow!)

rp home.prune
rp root.prune
# rp bbhome.prune # may be expensive!

Somebits.com backups (2026-05-11)

My public server somebits.com backs up all of / to BackBlaze via Restic. The details are described in a 1Password note “Restic backup password for somebits.com” and contains a TOML file for resticprofile and the necessary passwords and keys. I tested it today (May 11 2026) and the backup seems to be working.

I also have rsnapshot backups of just /home configured. That doesn’t include /var/www or the important stuff in /etc.

Starlink handoff latency

Starlink has a core design of changing to new satellites potentially every 15 seconds, exactly at 12, 27, 42, 57 seconds into the minute. Globally. Weird, huh?

That pattern shows up in this ping tool. The yellow smears occur every 15 seconds and indicate brief periods of higher latency, like 200ms instead of 30ms. I’m surprised this is every 15 seconds, I thought the dish mostly stayed locked on one satellite for a few minutes at a time.

Gemini vs Google Keep

I’m using Gemini 3 for all my AI queries. One thing that makes it better than ChatGPT for me is it has good integration with other Google products. The Gmail tool is particularly good, I am regularly using it now to ask complex queries about emails going back months.

The Google Keep tool though is a total mess. It just doesn’t work and fails in exactly the way LLMs so often fail. It’ll say it can do something, then try to do it and fail, then tell you it succeeded. It’s too bad: Google Keep would be the perfect tool as a sort of external memory for my chats. In particular having Gemini write output notes to something I can then easily consult on my phone.

The one thing the Keep integration seems to do reliably is append to a note. It can add content.

Gemini thinks it is also capable of editing notes, and updating them, and deleting them.

This is AI lies. The tool doesn’t seem able to do some of these things, particularly “Add & Update Content”. And it will say it updated something when in fact it hasn’t.

Also other stuff just doesn’t work. I tried “delete all notes in Google Keep”. It then deleted 2 of the 3 notes I had and confidently told me it deleted all of them. Ugh.

It’s too bad: I really like the idea of a notepad for Gemini to manage.

Slow network: rebooted switches

Boring post for my own notes. My Internet got slow about 3 days ago, from the usual 100-400Mbps down to an average of 10-80Mbps. There was no increase in packet loss or latency. Rebooting the switches fixed it.

No idea what went wrong. The problem started 2026-04-03 11:00Z, or about 3 in the morning here when Starlink sometimes reboots itself for a firmware update. So that was my first guess for the problem. I rebooted my router and Starlink and the problem persisted.

Then I rebooted the simple unmanaged switches in my network. That fixed it. Real mystery, that. If I was stuck at 100Mbps I’d understand it was a link speed problem. If I had a lot of packet loss I’d blame a flaky switch or cable. But 40Mbps? No packet loss? No idea.

Well one guess. My original round Starlink dish has some weird behavior about its ethernet port. I have it plugged into a switch rather than directly to my router because that helped stabilize it. So maybe Starlink rebooted itself and something went wrong with the link and only rebooting that switch fixed it? Total guess here.

My real concern was Starlink throttling. They’ve added various cheaper metered plans lately. I’m on Residential Max so that shouldn’t apply to me.

Schwab vs. Cloudflare

I have accounts at Schwab. Some of their email isn’t getting forwarded to me via Cloudflare, mail sent from @schwab.com. Some is, mail sent from @mail.schwab.com.

The problem seems to be that schwab.com has an SPF record dictating strict rules about who can send mail as them and Cloudflare is obeying them.

$ whois 205.220.171.227 | grep Organization
Organization: Proofpoint, Inc. (PROOF)
$ dig schwab.com TXT | grep -i spf
schwab.com. 0 IN TXT "v=spf1 include:%{ir}.%{v}.%{d}.spf.has.pphosted.com -all"
$ dig mail.schwab.com TXT | grep -i spf
mail.schwab.com.        0       IN      TXT     "v=spf1 include:cust-spf.exacttarget.com -all"
mail.schwab.com.        0       IN      TXT     "spf2.0/pra include:cust-senderid.exacttarget.com -all"

It looks like the problem is at Proofpoint, their secure email system. schwab.com has an SPF record that says only Proofpoint is allowed to send mail as schwab.com and receivers should reject anything from a server not in Proofpoint’s list. But the IP address that sent the mail isn’t on that list, despite whois data saying it belongs to Proofpoint. Sure seems like their error but it’s not transient.

The Schwab mail that is getting through is being sent from mail.schwab.com. That has a different SPF record for ExactTarget (Salesforce). They seem to be doing SPF correctly.

Fix web forms that break paste

Bad product managers sometimes think it’s a good idea to prevent you from pasting data into a web form “for security”. This is a particularly popular trick on websites where you enter payment account numbers.

Here’s a quick fix that seems to work. Supplied by Gemini but no doubt well known.

document.addEventListener('paste', (e) => e.stopImmediatePropagation(), true);

This basically overrides any event handlers for paste that the page code might have done. Not a good idea in general but it does seem to fix pasting into a box.

DMARC p=reject

I’m further working to secure my new somebits.com email domain. Today I’m setting a strict p=reject policy for DMARC. If a message arrives claiming to be from @somebits.com and isn’t DKIM signed, the receiver should bounce it. Scary!

Why do this? Because I think all email I’m sending will be DKIM signed, so it’s harmless to my legitimate mail. And it will stop spammers from spoofing mail from my domain. I’m hoping this will also be seen as a positive sign that my domain is not a spam source. Or at least, prevent my domain from getting a bad reputation from people spoofing it. Let’s see.

Details

DMARC and DKIM have been around for awhile but almost no one enforces it strictly. If an email should be DKIM signed but isn’t, email receivers like Gmail will take that as a signal that maybe it’s spam. But they aren’t strict about it.

You can set a DMARC policy for a domain about what to do for unsigned email. A lot of folks run p=none, which means “don’t worry about the signature but send a report if it doesn’t match”. A monitoring setup, you can send error reports to nice consoles like PostMark’s or Cloudflare’s.

I’ve been doing that for a few weeks now and all my emails seem to be properly signed. They should be, I only ever send mail out from Gmail. I have seen some reports of failed signatures but they all look like spammers impersonating me. Today it was an email from China Mobile to mail.ru. Definitely not me.

A lot of folks advise testing the waters by setting p=quarantine first. That tells the receiver to just put the mail in a spam folder, not bounce it. But that means I get no feedback. My theory of jumping straight to p=reject is if anything goes wrong my mail will bounce and I’ll see it. At least, I hope so.

What might go wrong? The usual problem is a bunch of legacy systems are built around spoofing email. Various cron jobs, mailing list software, etc impersonating @somebits.com. But I haven’t done that for years because it’s unreliable. I send all my mail via Gmail’s servers where they are DKIM signed. So I should be good.

Another way to test is pct=25 or the like, to say “only reject 25% of the mail if it’s not DKIM signed”. I can see the value of this for a high volume domain so you don’t break all your customers. But for a personal domain it would just make things unreliable. I either want it 100% working or 100% failing, not for a quarter of my mail to randomly get dropped.

So now we run this way for a few weeks and see what happens. I’m liking Cloudflare’s DMARC reports, they are aggregated daily and presented in a nice dashboard.

Subdomains

Currently I have no setting for the subdomain policy sp=. The default behavior is to follow the p= policy, so now I have sp=reject as well. That means any email for subdomains like foobar.somebits.com will act the same as somebits.com. Which is just fine for my situation, I’m not even using subdomains.

SPF

BTW, all this DMARC and DKIM stuff is different from SPF. DKIM says “this email claiming to be from @somebits.com was signed by a valid somebits.com system”. There’s also SPF, which says “this email for @somebits.com arrived from an IP address belonging to a valid somebits.com system. I do have some SPF failures because various folks are legitimately forwarding email around who aren’t valid SPF senders for my domain. I had this problem for my inbound email and fixed it by using Cloudflare as my MX. They do ARC signatures right which works around the SPF problem.

It’s possible to set aspf=s to tell mail systems to strictly drop any email for the domain if there’s an SPF failure. I can’t imagine that works well in practice. I’m not doing it.

Bottom line: Cloudflare still reports SPF failures but it’s OK. They are often from legitimate activity. And systems are supposed to not drop my mail just because of an SPF failure.

Testing

Gemini helped me test what happens with email that’s not signed. It’s gotten a little tricky to forge email: all the legitimate mailing services don’t allow you!

LearnDMarc is a tool that will forge mail and show you what happens. It’s a little too scripted though, I’m not sure if what I was seeing is real.

swaks is a modern tool for forging mail, a replacement for the old days of just telnetting to port 25. That’s hard to run from a home ISP because they all filter outgoing port 25, but I have a cloud server that still can send email. So I tried sending an email to gmail from me at somebits.com:

 -> Date: Tue, 31 Mar 2026 19:13:45 +0000
 -> To: ******@gmail.com
 -> From: *****@somebits.com
 -> Subject: test Tue, 31 Mar 2026 19:13:45 +0000
 -> Message-Id: <20260331191345.1520151@localhost>
 -> X-Mailer: swaks v20240103.0 jetmore.org/john/code/swaks/
 ->
 -> This should be rejected by DMARC.
 ->
 ->
 -> .
<** 550-5.7.26 Unauthenticated email from somebits.com is not accepted due to
<** 550-5.7.26 domain's DMARC policy. Please contact the administrator of
<** 550-5.7.26 somebits.com domain if this was a legitimate mail. To learn about
<** 550-5.7.26 the DMARC initiative, go to
<** 550 5.7.26  https://support.google.com/mail/?p=DmarcRejection 46e09a7af769-7da0a433fadsi8755951a34.58 - gsmtp
 -> QUIT

Looks like it worked! An immediate rejection from Gmail’s receiving SMTP server. Great!

Shotcut: simple video editing

Video editing is so hard! The online tools are good, like Youtube’s editor, The commercial tools are good. But open source free for desktop.. not so good.

I’ve settled on Shotcut. I finally figured it out more or less for editing some videos I shot on my phone. I’m starting with 1080p60. 8bit: I haven’t figured out managing 10bit HDR so it looks right at the end.

Step 1: trim the start and finish of the video. This involves putting it on your timeline, then using S to split the video into two, then using X to “ripple delete” which means not just remove the media but also trim the project length.

Step 2: fix the video. I’m generally wanting to crop to a subset of the frame. The trick here is to set the project output to the target size (ie: 480p). Then use zoom and the center adjustment in the Size, Position, & Rotate filter to select a crop.

Step 3: fix the audio. In this case I was too far from the mike so the speech was mumbly and quiet. I used a normalizer to boost overall gain, an equalizer to boost 3kHz a little more to make speech louder, then a limiter to keep it all under -1 dBa so it didn’t clip. The limiter is doing some smart dynamic adjustment that sounds good. I could also have used a compressor to first knock down the loudest audio before boosting everything.

Step 4: export. H.264 High, I exported to 480p@60. Lots of options here.

Not depicted: keyframes for filters. I’m just applying the filters to the entire video but you can limit it to subsets. Either by slicing the timeline up and different filter stacks, or putting keyframes on the filters for a whole timeline.

Gemini’s view of my linkblog

Oh no, I’ve become that person who posts AI responses as if other people will be interested. But this blog is foremost for me, and I think the following is insightful enough I want to keep it for myself.

I pointed Gemini-in-Chrome at my linkblog archive page and asked it “look at this archive page. can you detect trends over t he years?” (typo and all). Below is its summary of over 20 years of me sharing interesting links. I think it’s pretty good.

It detects changes in the topics I’m interested in over years: blog tech to start, then mobile, and now AI and politics. It also detects a shift in my tone, from optimism to skepticism. I don’t love that I’ve done that but I think it is correct and a useful mirror for me. It doesn’t mention a couple of topics that were big parts of my interest for several years. Maps, plotters. And I think it may be overstating the tone changes.

Gemini’s analysis

Analyzing Nelson’s Linkblog archive, which spans from late 2003 to the present day (March 2026), reveals a fascinating shift in how a technically-minded observer has interacted with the evolving internet.

Here are the primary trends visible over the decades:

1. The “Golden Age” of Blogs (2003–2010)

  • The Topic: In the early 2000s, the blog is heavily focused on the fundamental building blocks of the modern web. You see frequent links to RSS feeds, XML standards, and early Open Source movements.
  • The Vibe: There is a strong sense of “building the future.” Nelson often links to niche technical documentation and academic papers about distributed systems (like his work on Gnutella).
  • Trend: A shift from purely technical infrastructure to the social implications of early social media (Friendster, Flickr, and the rise of Twitter).

2. The Mobile & “Social” Pivot (2011–2019)

  • The Topic: This era shows a transition toward the smartphone revolution. The links shift from desktop-centric web standards to iOS/Android development, mobile UX, and the consolidation of the web into “walled gardens.”
  • The Vibe: This is where “Enshittification” (a term coined later but felt here) begins to surface. There are more links criticizing the business models of Uber, Facebook, and Google.
  • Trend: A move from “how to build the web” to “how the web is breaking society.”

3. The Era of Crisis and AI (2020–2026)

  • The Topic: From 2020 onward, the blog becomes more political and reactive.
    • 2020-2022: Heavy focus on COVID-19 data, public health policy, and the logistics of remote work.
    • 2023-2026: A massive surge in Generative AI content. Links shifted from “cool tech demos” to deep skepticism about “AI slop,” the ethics of LLMs, and agentic engineering patterns.
  • The Vibe: There is a recurring theme of “Joy in Resistance” and looking for decentralized alternatives (like Mastodon and Bluesky) to the major tech platforms.
  • Trend: The blog has become a “digital bunker”—a place to track the decline of mainstream platforms while highlighting niche, high-quality human creativity.

Quantitative Snapshot

EraPrimary FocusMood
2003-2009Peer-to-peer, XML, early PythonOptimistic / Academic
2010-2018Privacy, Social Media, GadgetsObservational / Concerned
2019-2026AI Ethics, Climate, Political ActivismSkeptical / Resilient

Summary of the Shift: The archive moves from optimistic experimentation (how do we make this work?) to defensive curation (how do we save the good parts of the internet from the bad parts?).

Would you like me to dig into a specific year in the archive to see what Nelson was focusing on during a particular historical event?

First impressions of Jules, Google’s coding agent

Google has a coding agent product called Jules. It’s similar to Claude Code. But it’s designed foremost as a web interface. And to run in the cloud, on Google ephemeral containers from code stored on GitHub. It’s also more asynchronous: you give it big tasks and it comes back in ~10 minutes with a pull request. There’s some interactive back and forth when making the plan if you want.

I think this web async design is a better fit for me, I don’t like Claude Code’s text UI and I don’t like how I have to install and run parts of it on a local machine. Update: Claude has “Code on the Web” which is more like Jules.

One other difference is Jules is using Google’s models. That would have been a bad experience with Gemini 2.5, which is what the free Jules still uses. But if you pay $20/mo for Google AI it includes access to Gemini 3.1 Pro which has proven to be a very good model for general queries. Not sure if it’s as good at coding as Claude but so far so good. There’s also a Gemini Flash which is faster and specifically coding optimized, I’m trying that out now instead of Pro and it seems fine.

Working with Jules has been a good experience so far. I feel like I’m instructing a junior engineer. I have to be explicit about what I want and check everything it does. Sometimes it says it did things that it didn’t, and sometimes it tries to do things it shouldn’t. Sometimes it does things wrong. But it’s very good at doing a lot of things and the use of GitHub pull requests as a review mechanism lets me fix things t hat are problems. It sure looks like Jules is doing high-order reasoning about algorithms and side effects and how systems work. I think I can trust Jules to understand this code better than I do.

A project

I’m using Jules to work on Feditrends, a simple scraper / link ranker that I maintain. I’ve never really touched this code, I took it over from someone else, and honestly I wasn’t excited to get my hands deep into it. Perfect thing to experiment with an AI instead.

I started by asking it to read all the code and make suggestions for what to change. Then I had it make a simple test suite. (It’s not great, but it’s a start. I’m a fan of test driven development and ordinarily would have more tests. I think that’s important for AI coding but we gotta start somewhere.) All that done, now I’m having it make one improvement at a time as it suggests things.

Here’s an example pull request for a very simple change: reformat a list of server names and then remove a duplicate. The code change is trivial and I was quite pedantic about it, building trust. But not shown here... Jules spotted this little code problem itself when I asked it to review the code and make suggestions. It found the duplicate. It also correctly reasoned about how this change might affect the algorithm (it doesn’t)

AI chat transcript (partial)

Nelson: I want to work on your suggestion “Fix Server Duplication: Remove the duplicate sfba.social in fetch.py.” look at the code and verify that the server is duplicated. then tell me, if we remove that does it change the algorithm results significantly? I’m guessing sfba.social gets double weighting in the ranking because it’s done twice.

Jules: Regarding your question about the algorithm results: The ranking algorithm in mastodon/build.py uses count(distinct instance) to calculate the number of instances a link appears on. Because of the distinct keyword, having the same instance name twice in the database for the same snapshot should not increase the “instance count” part of the score.

Jules: It also uses max(uses_1d) and max(rank). If the data on sfba.social changes slightly between the two fetch cycles, max(uses_1d) would take the higher value and max(rank) would take the higher (which means numerically larger, but lower/worse ranking) value. So if anything, it might slightly penalize a link if its rank drops during those few seconds, or slightly boost it if uses_1d increases, but it certainly doesn’t “double” the weighting in a straightforward way.

Nelson: let’s go ahead and proceed with the plan to remove it. but before you remove it: please reformat the code so the list of instances in fetch.py is no longer all one line. break it up into one line per server name. but keep the duplicate. make a pull request for me to be sure you did it right. we will then remove the duplicate later, as a second change.

It did exactly what I wanted in this case, a good result. Some other changes it gets wrong at the start and I have to catch it in review but so far I’ve been able to redirect it to success every time.

Update: CoPilot

A friend encouraged me to compare Jules to CoPilot Agents, built into GitHub. Roughly speaking they are very similar. CoPilot has nicer integration with GitHub, so some of the git stuff feels a bit more reliable and featureful. Different set of models of course, with CoPilot mostly being OpenAI models. It’s $10 or $20/mo to use and has some limits. I’m already getting Jules as part of my Google $20/mo AI subscription and it has no disclosed limits but only a choice of two Gemini models.

I suspect there are meaningful differences in the two products, particularly in how they manage code environments and the details of the prompt engineering. I’m not equipped to compare them very deeply. Jules is doing well for me so far so I’ll stick with it.

Email woes again, CloudFlare setup

A few months ago I gave up using monkey.org for my email and moved my email setup to my personal domain somebits.com. I was using Google Workspace as the MX entry for receiving mail for that domain; as of today I’m using CloudFlare. So far so good.

Google Workspace problems

The setup I was using was to pay for Google Workspace and have them receive all mail for my domain via an MX entry. Google Workspace was then told to forward all of it to my personal @gmail.com account. This worked pretty well but every once in awhile friends @yahoo.com or @hotmail.com would complain that a message bounced.

The problem turns out to be the way Google Workspace forwards email to Gmail. They don’t do it right! I’m not confident but I think they’re not doing SRS or ARC correctly. So Gmail receives this mail claiming to be from some random @yahoo.com person and to me@gmail.com, but the mail isn’t correctly signed and so Gmail rejects it as spam. It didn’t happen often, not as often as my old monkey.org setup, but it happened enough to annoy me. Google should be able to forward mail to itself reliably!

It’s possible I could have fixed this by not using Google Workspace to forward the whole domain and instead just to forward individually from my name @somebits.com to my personal Gmail. Some reports suggest ARC/SRS works better in this configuration. I didn’t try it.

CloudFlare Email

Instead I followed an AI’s advice and have switched to using CloudFlare as my MX provider, a feature they call “Email Routing”. (The other option was forwardemail.net). It’s simple but seems good. The free tier is all I need. You can have CloudFlare forward email to specific names @ your domain to specific destination email addresses. There’s also a Catch All forwarding option that’s off by default.

The key thing is CloudFlare seems to be doing ARC and SRS stuff correctly. Email I send to myself from yahoo mail arrives fully intact and properly signed as far as Gmail is concerned. Yay!

As part of this change I also made CloudFlare the nameserver of record for my domain instead of Porkbun. I’m not sure that’s 100% necessary but it makes things easier on CloudFlare. Also they are the best in the business at providing DNS so why not?

One gotcha: CloudFlare email routing doesn’t support subdomains, at least not easily. I wanted to test all this just for test.somebits.com at first but it was either all of somebits.com or nothing.

Another gotcha: CloudFlare rewrites the SPF record for your domain saying only CloudFlare is authorized to deliver email for your domain. This isn’t a total disaster, it’s a soft fail, but it means that Gmail can’t sign mail it sends for you. The solution is to hand edit the SPF record to include both Gmail and Cloudflare as authorized senders. The test address auth-results@verifier.port25.com was a big help in figuring this problem out.

(It’s a bit weird that CloudFlare injects itself in the SPF records because CloudFlare doesn’t yet offer a service that delivers email for you. Ie, no outgoing SMTP. You have to send your mail out via Gmail or someone else. The AI says that ClouldFlare still needs an SPF record so that the mail forwarding is allowed and properly signed. Anyway a hybrid SPF record seems to work fine.)

Update: Cloudflare is better

Cloudflare’s email forwarding is better. All my forwarded email used to show up in my Gmail with failing SPF. Now it shows as passing. I can no longer understand email headers, particularly all the signature stuff, but apparently the difference is Cloudflare is doing the Sender Rewriting Scheme (SRS) whereas Google Workspace does not. According to Gemini the crucial difference is the Return-Path header, which reflects the data sent on the MAIL FROM part of the SMTP exchange:

FeatureEmail 1 (Failed SPF)Email 2 (Passed SPF)
Return-Pathsomeone@hotmail.comSRS0=tzui=rb=hotmail.com=someone@somebits.com
SPF CheckChecked against hotmail.comChecked against somebits.com
ResultFail (Google isn’t a Hotmail server)Pass (Cloudflare is allowed for somebits.com)

I don’t really understand all this stuff. But Workspace seems to be just forging mail when it forwards it to Gmail, pretending to be sending on behalf of hotmail.com. Cloudflare is being more honest that the email is really from my domain somebits.com but still mentions the hotmail addresses. The actual From header is hotmail in either case, that’s the one I most care about since it’s what is displayed.

I still think Gmail should have special rules for accepting email from Google Workspace. But I can see why they don’t, both for technical reasons and for anti-trust reasons. Failing that, why isn’t Workspace doing SRS?

Bidet, floor heater power usage

I got some upgrades in my bathroom: a Toto S5 Washlet bidet and a Schluter electric heated floor. They use power! Here’s how much.

The Toto uses 5–10W when idle. That powers a little light and a toilet seat heater (set to low). It peaks at about 500W for a minute or so when you are using heated water. We’re averaging about 0.25kWh a day for two of us, or just $0.10 a day. That seems very low!

A Toto C5 I have was about 0.08kWh a day. That model has a water tank, not instant heat, and no seat heater nor light.

The floor heater is set to turn on 7am-11am to 82°. It’s been 40-60° outside, the furnace heats the air inside to 68°. The bathroom is about 200 sq.ft. The heater draws a full 1300W for a couple of hours to bring the floor up to temperature, then 700Wh an hour to maintain the temperature for a couple more hours. Overall it’s about 3.5kWh a day, or about $1.50 a day. It doesn’t seem to heat the air in the room much so I think all this heat is wasted, not saving us furnace usage.

Notes on keyboards

For years I’ve been using Apple’s external keyboards, the classic A1243. But mine failed so I am looking to replace it. I ended up buying some new old stock of A1243s from eBay.

Mechanical switch keyboards are what all the keyboard hipsters like. Some folks like very loud clicky keys, ugh. But even with “silent” keys they are still noisy devices because of the physical action and motion. The other common quality option are scissor switch keyboards. That’s what Apple uses, also pretty much every laptop. Other switches in the mix.. Membrane keyboards, generally low quality. Butterfly switch keyboards, which Apple recently introduced and everyone hated. And optical switches, which kind of get lumped in with mechanical but are different. I’ve seen Hall effect keyboards advertised too.

Keyboards come in all sorts of layouts. Keychron has a nice summary of popular layouts. I prefer the Tenkeyless (TKL) layout, which they call “80%”. 65% and 75% compact keyboards are also popular, particularly on laptops. Nothing wrong with a full 100% keyboard if you have the space, but the problem is it pushes the mouse further to the right. I never use the tenkey pad so prefer to not have it.

Good keyboards have features called “anti-ghosting” and “n key rollover” which make typing better. The problem is when you press several keys at once, particularly gaming. What happens? With ghosting you press two keys and the keyboard registers some completely third keystroke. Rollover refers to how many keys you can press at once and have them recognized. This site lets you test it your rollover. USB devices are limited to 6 keys at once, a protocol limitation. Keychron delivers the full 6 keys. My Apple 1324 delivers somewhere between 3 and 5 depending on which key you press. A Cherry keyboard I tried sometimes only sends 2. It also has ghosting. It is cheap.

Keyboards come wired, Bluetooth, or proprietary 2.4GHz wireless. The Bluetooth ones historically have been laggier and have worse battery life. Folks get all twisted up about keyboard latency but I think in practice it’s like 4ms or better in any practical setup. Anti-ghosting adds lag too, or maybe it’s debouncing.

Keychron is a good option for well made relatively inexpensive mechanical keyboards. I have a K1 Pro that I like pretty well. Even with low profile keycaps it still sits taller than an Apple scissor switch keyboard. And even with the red silent switches it’s still kind of noisy, a meaty thunk as each key bottoms out. I gather you can stuff foam inside the keyboard to quiet that.

I cannot find a good scissor switch keyboard other than Apple’s. Apple’s is unusual in having just 0.9mm travel, very very slim. Also their manufacturing is just impeccable. Unfortunately the new keyboards are like $200 and have features I can’t use. That’s why I may buy some used ones.

Matias scissor keyboards comes close but there’s something about their keycaps that constantly has me mis-keying when I type. I wrote their support and they said compared to Apple their keyboards has 2.0mm travel (not my problem) and something about the dome design meant you had to hit the keys in the middle (probably my problem).

The Cherry Stream is popular as a cheap quality scissor keyboard. It is well made for the price. But the keys feel heavy and squishy and the keycaps have this weirdly angled design that makes it hard to type on.

There are other scissor options I haven’t pursued yet. I’ve mostly been looking for Tenkeyless layouts and those are rare. May need to give up on that.

I ended up ordering a couple of new-in-box Apple A1243s on eBay. They stopped making these in 2017. I found some for about $70 delivered which is a pretty good price for new. Used seem to be $30-$100 depending on which order you look at. Amazon has refurbished ones for about $80. The new ones that arrived do appear to be genuine and work.

Totally different thing but I love these tiny palmtop keyboards. Smaller than a game controller. Definitely not for real typing but great for a PC plugged in to your TV where you occasionally have to press one or two keys.

Portable monitor for desktop use

There’s a new class of “portable monitors” that are small: 14″, 15.6″, etc. But high density, often 4K resolution, and surprisingly bright. These are basically laptop screens in a package to use as standalone monitors. They’re intended to be used portably with a little cover / stand but you can use one for your desktop too. It’s just not simple to mount them! Read on for notes on finding a small second monitor and mounting it on a VESA stand.

Here’s my new setup. At left is the 31.5″ 6K screen, an ASUS ProArt. At right is a UPERFECT 15.6″ 4K display mounted on a FeeLazy 75mm VESA mount. I am using that as a second screen for side distractions, like Slack or Signal. (I used to have a 34″ ultrawide, just one screen, but the new 16:9 monitor isn’t wide enough to let me have a main window and then something useful to the side.)

Portable monitors

Portable monitors are a new product category to me. They take USB power in and HDMI or DisplayPort or USB-C/Thunderbolt for the video. No battery in the ones I’ve seen but they are designed to be portable and easy to set up anywhere.

NewEgg has a wide selection but if you look closely the brand UPERFECT dominates. They are astonishingly cheap: I paid $130 for a 15.6″ 4K display with superior brightness (450 nits) and good color. It’s only 8 bit SDR, and 60Hz, but within those constraints it’s great. Let’s see how long it lasts, there are reports this kind of hardware tends to overheat and have a short lifespan.

UPERFECT has a wide variety of portable displays for different needs: low density, high density, high refresh for gaming. They sell via NewEgg and direct but not via Amazon. The one I picked seemed particularly good for cheap desktop use.

Portable monitor stands

The one drawback is it doesn’t come with a stand. It has a little magnetic cover that can fold back and hold it up in landscape mode. But I wanted this mounted like a desktop monitor, and in portrait mode. That proved surprisingly difficult.

The good thing is UPERFECT monitors have VESA mounting holes. Not all portable monitors do. Mine has four M3 screw holes at 75mm x 75mm VESA spacing. The screw holes are very shallow, they recommend 6mm screws and I think the hole itself is probably just 4mm deep. That makes mounting difficult. (The manual claims the screws are M4 6mm but that is not true: it’s M3 6mm).

The first stand I tried is well built but too big for the application. The whole thing is just big, it’s designed for full size monitors. Also it supports both 75x75 and 100x100 VESA mounts. That’s nice but the 100x100 hangs off the edge of the monitor! Not great. (If you do try to use a bigger mount like this, note that M3 screws are tiny: you will need large washers to work with the big mounting holes.)

The stand I’m using is a FeeLazy stand designed for portable monitors. The build quality is not great. The monitor plate is plastic, the mount joint is a screwy ball-and-socket thing that does not feel terribly secure. But it’s OK for a small light monitor. It’s working well enough and feels right-sized for the screen. Other small stand options include this JUNEBOX or maybe a stand from UPERFECT.

Overall I’m happy with this setup. With the new 16:9 monitor I was missing a place out of the way to put small windows. Now I have one.

Chromebooks identify USB C details

I learned something neat from a Google engineer on Reddit the other day: Chromebooks have superpowers when diagnosing USB-C connections that PCs don’t have. Including reading the e-marker built into the cable that identifies its capabilities.

Modern USB is a remarkably complex thing, with both the cable and the device on the other end negotiating capabilities like speeds, power for charging, etc. Most of that isn’t particularly visible to the user, not without USB debugging hardware. But turns out on a Chromebook it’s as simple as plugging in the USB device, going to chrome://system, and reading the info from typec_connector_class. At the bottom is an example with my Chromebook plugged into an Anker 65W charger, charging at 37W on a cable that nominally supports 100W.

Yeah I’ve got no idea what all that debug dump means either. I asked Gemini and it identifies the charger as doing Power Delivery 3.0 and that it offers various charging power settings including a programmable power up to 11V at 4.55A.

As for the cable, Gemini says that Vbus Current Handling: 0x2 is the cable’s way of saying it can handle 3A at most, which makes me wonder about that 100W claim on the cable. The product_type_vdo1: 0x84050 is a bitmask identifying various cable capabilities. This one is USB 2.0 only, 3A max. Ie: a “charging cable” and not a very good one at that. (The neat thing about this cable is it has a little display built in, that’s what says it’s charging at 37W. Maybe 15V or 20V and not at full 3A draw?)

The Reddit discussion has more detail. The Linux typec driver is doing a bunch of work along with a typec daemon in userspace. Unfortunately it requires cooperation from the firmware on the computer to make this information available to the kernel and PC hardware doesn’t do it.

port0
uevent: DEVTYPE=typec_port
TYPEC_PORT=port0
vconn_source: yes
supported_accessory_modes: none
power_role: source [sink]
data_role: [host] device
preferred_role: source
power_operation_mode: usb_power_delivery
usb_power_delivery_revision: 0.0
usb_typec_revision: 0.0
waiting_for_supplier: 0
port0-partner
uevent: DEVTYPE=typec_partner
accessory_mode: none
usb_power_delivery_revision: 3.0
type: not_ufp
number_of_alternate_modes: 0
supports_usb_power_delivery: yes
identity
id_header: 0x180ffff
USB Vendor ID: 0xffff
Reserved: 0x0
Product Type (DFP): 0x3
Modal Operation Supported: 0x0
Product Type (UFP/Cable Plug): 0x0
USB Capable as a USB Device: 0x0
USB Capable as a USB Host: 0x0
product: 0xffffffff
bcdDevice: 0xffff
USB Product ID: 0xffff
cert_stat: 0x0
XID: 0x0
product_type_vdo1: 0x0
Port Number: 0x0
Reserved: 0x0
Host Capability: 0x0
Reserved: 0x0
DFP VDO Version: 0x0
product_type_vdo2: 0x0
product_type_vdo3: 0x0
pd0
uevent: DEVTYPE=usb_power_delivery
revision: 3.0
sink-capabilities
uevent:
source-capabilities
uevent:
4:fixed_supply
uevent:
maximum_current: 2050mA
voltage: 20000mV
1:fixed_supply
uevent:
dual_role_power: 0
unconstrained_power: 1
usb_communication_capable: 0
unchunked_extended_messages_supported: 0
maximum_current: 3000mA
usb_suspend_supported: 0
dual_role_data: 1
voltage: 5000mV
2:fixed_supply
uevent:
maximum_current: 3000mA
voltage: 9000mV
3:fixed_supply
uevent:
maximum_current: 2730mA
voltage: 15000mV
5:programmable_supply
uevent:
pps_power_limited: 1
minimum_voltage: 3300mV
maximum_voltage: 11000mV
maximum_current: 4550mA
port0-cable
uevent: DEVTYPE=typec_cable
usb_power_delivery_revision: 2.0
type: passive
plug_type: type-c
identity
id_header: 0x18000000
USB Vendor ID: 0x0
Reserved: 0x0
Modal Operation Supported: 0x0
Product Type: 0x3
USB Capable as a USB Device: 0x0
USB Capable as a USB Host: 0x0
product: 0x0
bcdDevice: 0x0
USB Product ID: 0x0
cert_stat: 0x0
XID: 0x0
product_type_vdo1: 0x84050
USB Speed: 0x0
SOP'' Controller Present: 0x0
Vbus Through Cable: 0x1
Vbus Current Handling: 0x2
SSRX2 Directionality Support: 0x0
SSRX1 Directionality Support: 0x0
SSTX2 Directionality Support: 0x0
SSTX1 Directionality Support: 0x0
Cable Termination Type: 0x0
Cable Latency: 0x2
Reserved: 0x0
USB Type-C Plug to USB Type: 0x2
Reserved: 0x0
Firmware Version: 0x0
HW Version: 0x0
product_type_vdo2: 0x0
product_type_vdo3: 0x0
port0-plug0
uevent: DEVTYPE=typec_plug
number_of_alternate_modes: 0
physical_location
panel: left
horizontal_position: left

HDR screenshots on Windows

tl;dr: if you’re using HDR on Windows you probably want a new screenshot tool. Bandicamera seems to do HDR reasonably well.

I’ve got HDR10 on my Windows machine working. I like it! Everything looks normal and bright and then occasionally some very bright image comes along that’s even brighter and looks quite striking, a highlight. It’s particularly fun with photos: most photos are normal 8 bit color but a 10 bit comes along sometimes on Instagram and everything comes to life. Also your eye is a marvel, it quickly adjusts to the extra brightness so nothing looks too bright, just more dynamic.

Anyway, making a good screenshot from Windows in HDR mode proves to be hard. The underlying problem is screenshots tend to be 8 bit PNG or JPEG, so you have to collapse the 10 bits down to 8 bits. Ordinarily those brighter 9th and 10th bits aren’t needed, you’re only screenshotting normal SDR images, so often you can just take the ordinary reference white #ffffff as the brightest white in the output #ffffff and it’ll be fine. But that doesn’t work well if there is an overbright part in the screenshot.

Why not take 10 bit screenshots? You can, but you have to save them as an unusual new PNG format or in JPEG-XL or something. For my purposes I usually want a normal 8 bit PNG or JPG.

Anyway, on to the tools. Here’s two test webpages I’m screenshotting: a page with only regular images on it and a page with an eye-searing HDR on it. The key thing I’m looking for here is in the SDR image the white is #ffffff, white. That’s my most important use-case. It’d be nice if the HDR

Greenshot

Greenshot is an old free screenshot tool that is easy to use but quite old fashioned and doesn’t seem HDR aware at all. It seems to do be doing my naive thing: assume all images are 8 bits and just sort of crush any brighter images down to white. The white background is #ffffff like I want, but then any contrast in the HDR part is blown out to white.

Update 2026-03-31: I didn’t describe the problem with Greenshot, which is sometimes even with SDR images if you take a Chrome screenshot it makes everything brighter and wrong.

I can’t figure out what’s going on. Sometimes it works, but if I open a second SDR tab in that Chrome window then the first tab stops working.

There’s a solid bug report for this problem and an experimental fix. Unfortunately even with this fix enabled I’m still seeing problems.

Windows Snipping Tool

The built in-snipping tool can be HDR aware, the tool has an option for “HDR screenshot color corrector”.

With color correction turned on, the good thing is the extra bright parts are brought back into the normal gamut so you can see the contrast. But now the plain white is crushed down to #e1e1e1. That’s necessary for the HDR source image, how else could you have brigher-than-white? But it is not good for a fully 8 bit SDR source image.

With the correction turned off the HDR source ends up blown out just like on Greenshot. But weirdly the SDR source also looks wrong. The white is #ffffff in the screenshot, so great! But it’s hard to see but the snipping tool also brought up the brightness of everything else a little, it doesn’t look what is on the source screen. (Indeed you can see this happen: a tone curve is applied when the screenshot starts being taken).

Bandicamera

Bandicamera is new to me and claims to be an HDR-aware screenshot tool It seems to do a pretty good job.

I like this! The SDR source comes out as a normal looking SDR image, with white at #ffffff. The HDR PNG is blown out, that’s not ideal, but it’s acceptable. I would prefer the Windows snipping tool output but at least I know what it’s doing. Ironically this is exactly what Greenshot does so arguably this is not an improvement. Note these are the ordinary 8 bit PNGs Bandicamera emits. (They don’t support HDR PNGs with cICP chunks).

However, Bandicamp will also write out an AVIF or JXR file that has the full 10 bit screenshot in it. So I do get a second copy with full data. AVIF support is better than I realized: works in major browsers, Windows Photos is fine with it too. I’ve pasted the AVIF below into Wordpress, it looks correct on my blog’s site to me.

ShareX

I didn’t try ShareX. I’ve never liked it, and the website doesn’t say it supports HDR. I did find this ShareX fork for HDR that may be worth a look.

Update: I tried the ShareX fork. It does just what I want: a normal white-is-white screenshot for SDR content and a tone mapped 8 bit PNG for HDR content. It doesn’t save the HDR original like Bandicamera does. Also the “white” in the SDR is #f5f5f5, not sure what that’s about but I can live with it. I just really dislike ShareX, it’s bloated and complicated.

KDE Spectacle (Linux)

Update June 2026: I switched to Linux desktop! They have a fantastic screenshot tool, KDE Spectacle. It currently doesn’t support HDR screenshots. It does a good job with the HDR content on screen though, and screenshots of SDR content look correct.