Some Bits: Nelson's log

213 posts about devices

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

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.

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

/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.

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.

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.

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.

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.

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.

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.

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.

ASUS PA32QCV firmware: use a small drive

I noted before my new ASUS PA32QCV wasn’t updating the firmware correctly, it failed to recognize the PA32QCV.bin file in the 2025/11/14 ASUS download of MCM102. Thanks to this Reddit post I was able to update the firmware! The trick is to use a small flash drive partition. My 16GB drive failed. Reddit OP reported it working with a 1GB drive. I don’t have any such small drives myself but I did get it working with a 512MB FAT32 partition on a 16GB drive.

There’s lots of ways to make a small FAT32 partition. I did it using Linux fdisk

o        # create new DOS (MBR) partition table
n        # new partition
p        # primary
1        # partition number
<enter>  # default first sector
+512M    # partition size
t        # change type
b        # W95 FAT32
w        # write and exit

After preparing the drive that way I copied the file over on my Windows box, then followed ASUS’ instructions for updating firmware. The docs are squirrely and wrong, depicting a different set of USB ports on the back of the monitor! It worked for me on the USB-A port on the back of the monitor (not the bottom).

First you get an error about a “MCU firmware file”, then you get a success for “Scaler updating firmware”. Note when the update works the monitor’s OSD is broken, so you can’t open the menu or use the soft power button. I had to flip the rocker switch in back to reboot.

Anyway, now I’ve updated the firmware. I’m still having USB port problems although at the moment the USB-A port on back is working for both that USB drive and now my Apple keyboard. No idea if it’s reliable. I still can’t get my camera to work with the USB-C ports on the back.

Update Sept 2026: I went to install the new 103 firmware and it didn’t find the firmware on the carefully prepared drive. I turned the monitor off with the rocker switch and back on, then it did find it and the update worked.

Locale fine tuning

I finally fixed an annoyance of several years where date in Linux was printing out 12 hour time like Sun Dec 21 02:53:05 PM UTC 2025. Here’s where I landed in my .bashenv

# locale configuration. US UTF-8 everywhere but 24 hour clocks.
export LANG=en_US.UTF-8
export LC_TIME=en_GB.UTF-8
export LC_NUMERIC=en_US.UTF-8
export LC_COLLATE=POSIX
export LC_CTYPE=en_US.UTF-8
# have to unset this so LC_TIME will override.
unset LC_ALL

The key thing here is LC_TIME. But also unsetting LC_ALL.

I used to just set LC_ALL to en_US.UTF-8, I started doing that before UTF-8 became common. But if you do that it overrides LC_TIME so you still get 12 hour dates. Instead you have to unset LC_ALL and then set each locale thing separately. There’s twelve of them! Most systems I log into are probably already set up as en_US.UTF_8 so this doesn’t matter, but hopefully this overrides the important stuff. I haven’t tested it well, I’m going off ChatGPT’s recommendation which is suspect as always.

LC_COLLATE=POSIX is something I’ve been doing many years, ever since Unix environments started doing more proper language-specific collation. The problem is that changed the behavior of /bin/sort which broke a lot of things, so hacking it back to a non-linguistic sorting works better for programming.

Now I also have to hope the system generated the en_GB.UTF-8 locale.

ASUS ProArt PA32QCV impressions

After years of envying my Mac friends I finally got a high density monitor (aka “retina display”). It’s an ASUS 6K 31.5″ monitor, the PA32QCV, and is the first genuinely new display panel I’ve seen on the market in a long time. I bought it because it’s 218ppi, or about double the density of the usual Windows 100 ppi displays we’ve all been using before. It’s about the same density as Apple’s main desktop displays although not quite as nice as the laptop screens (which go up to about 254ppi) and nothing like a modern phone’s 450ppi. But it’s only $1300.

Does it work? Hell yeah! I plugged in it and it looked great. Windows 11 autodetected it and set it up and is running at 200% resolution so most ordinary stuff looks fine. Some old Windows apps still don’t do high DPI right but most anything in the past few years does, it seems fine.

I’ve been using ultrawide 34″ 3440x1440 monitors for awhile. This new monitor is 6016x3384 but at 200% that’s really 3008x1692. So a little narrower, a little taller, it’s a standard 16:9 instead of the 21:9 aspect ratio. I will miss the extra width but not a lot. I miss the curved screen a bit more, the left and right edges of the new screen are noticeably dimmer.

One small drawback is it’s limited to 60Hz: gamers will tell you 120Hz and variable refresh is important. I like the idea of those in theory but in practice I pretty much never used it.

It worked out of the box but I’ve run into some hassles. The main problem is my ancient NVidia 1080 can’t drive this thing with HDR at full resolution. Works fine at 3840x2160 but this old video card doesn’t have whatever magic video compression is required to push 10 bits per pixel over the DisplayPort. So I’m running at full resolution but 8 bit color for now. I’ve got a new video card on order, was about time to upgrade anyway.

In theory this ProArt monitor has particularly correct color. I’ve got Windows color profiles loaded but I am not equipped to really evaluate color correctness or extended gamuts. Stuff looks good, yo.

The other thing I’m about to upgrade my life with is a soundbar for the PC. Solely to reduce clutter on my desk, I’m tired of wires and speakers. There is a speaker in the PA32QCV but it sounds like shit.

Update: I finally figured out I should turn off ClearType for the high DPI screen. ClearType is the heroic subpixel rendering hack that draws colored pixels even for white/black to exploit subpixel geometry on low DPI screens. It doesn’t help nearly as much at 218 ppi as it does at 100 ppi. And it caused some color fringing, enough that I wonder if maybe the PA32QCV doesn’t use a standard RGB subpixel layout. (I have no evidence it doesn’t, but it sure doesn’t look right.) One gotcha: most of Windows redraws running apps when you turn ClearType off and on but Chrome doesn’t, you have to relaunch it.

Update 2: the USB ports don’t work right. The two on the bottom work but only as USB 2 ports (they are supposed to be 3.1). The three on the back don’t work at all. I can see there’s a USB 3 hub there but devices plugged in mostly don’t work. One worked once, briefly. This isn’t a deal-breaker for me but it is disappointing. Folks who are eager to use the Lightning daisy chaining may want to take note.

Update 3: I just got a second one of these monitors and tested it with a cable to a USB-4 port on my Beelink. It seems to all be working consistently, I can get 5 Gbps on the utility USB ports at the bottom of the monitor. I went back and tested my original monitor and it is also working consistently. What tripped me up is some of the ports on the back are special and not regular USB ports. Read the other post for details.

Android migration Pixel 8 → Pixel 10 Pro

I got a new Pixel 10 Pro to replace my Pixel 8. After previous bad experiences migrating from old Pixel phones, how did it go this time? About the same, the only real improvement is that my Verizon eSIM transferred automatically.

By far the biggest problem is many Android apps don’t migrate their state or settings. It doesn’t have to be this way, some apps do migrate successfully. I suspect many don’t bother.

I used a cable instead of WiFi for the transfer this time. This option isn’t highly promoted but seems to be faster. I’m not sure it changed what data was transferred over though.

Good things

  • It migrated my Verizon eSIM first thing. Previously that was something I had to do myself. Update see below about visual voicemail.
  • It migrated the credit card stored in Google Wallet. I had to enter the CVV to verify it. My Clipper card also migrated.
  • It initiated the data transfer in the background while my phone was still busy asking me to answer some setup questions.
  • The transfer mostly went seamlessly. It was a bit of a nuisance answering a bunch of questions but then I could walk away.
  • Some apps migrated seamlessly.

Bad things

  • Many apps don’t copy their settings or data over to the new phone. See below.
  • I had to reboot to finish the setup, updating OS and enabling a bunch of stuff.
  • I had to re-enable WiFi Calling.
  • It’s not copying all my data? I did the custom route and selected everything and it’s only 66 GB. My phone is nearly full at 256GB. Some big chunk of that is the OS, and 100 GB is a copy of Wikipedia. I wish there was a way to know what was missing.
  • There’s a lot of setup questions, some of which is them trying to trick me into turning on features I’d previously deliberately turned off. Unless there’s some new feature unique to the new phone it should not be asking. Particularly offensive: an attempt to opt me in to marketing spam.
  • It turned a bunch of ad tracking stuff on without asking me. I’m sure I’d turned it off in my old phone.
  • It did not restore my custom launcher (Niagara). I had to enable it.
  • The PWA Phanpy didn’t get restored as an app on my new phone. I had to reinstall it.
  • All my F-Droid open source apps didn’t come over. Not entirely a surprise, these are sideloaded as far as Android is concerned and I can see why they wouldn’t copy over. Sure is a nuisance though.
  • Stuff looks different. Different font sizes, different color temperature.
  • I gave up trying to transfer my Paris Metro tickets. They have some elaborate thing where the ticket is stored on your phone. They have a backup plan for transferring tickets but it involves creating another account. This is most definitely a case of the software being bad, not Android’s fault (alone).
  • I had to manually import my Google Maps Timeline data from an old online backup. This is possible at least but quite confusing, I think because in general the Timeline data is stored so awkwardly.

App migration

The biggest problem is that most apps don’t seem to migrate. Instead of being copied they have to be re-downloaded and re-installed. Then configured again. What this means in practice is I have to manually launch and inspect every single app before I can get rid of the old phone.

What’s particularly strange is that some apps do migrate themselves. The Paprika recipe database. Sony’s Playstation app, including my login state. It seems very hit-or-miss. Last time I looked at this I found a note from the Niagara Launcher team saying “We’re currently using Google’s Backup implementation, which is not 100% reliable…” Since then they’ve built a custom backup / restore system which mostly worked but I had to use manually. Other apps are using Google’s official implementation and it did work.

Problems in particular:

  • It didn’t immediately copy the apps over. Instead it is reinstalling them from the Internet. Perhaps Android apps can’t reliably be copied from one device to another?
  • Apps don’t come with all the permissions I enabled before. I have to re-enable permissions in each app individually, stuff like “access files” in Solid Explorer. Some permissions do carry over, maybe just not the most sensitive ones.
  • A bunch of apps didn’t restore their settings. Some have custom backup and restore options I can do manually, like Niagara or Weawow.
  • A bunch of apps didn’t realize that I had paid for the app until I launched it and waited for some handshake to happen.

Syncthing

I used to use Syncthing to synchronize some data from my phone to a Unix folder. It worked but always felt a little creaky. And between Android making it harder and harder to work with the filesystem and the Syncthing project having some drama I decided not to bring it to my new phone.

The obvious alternative is Google Drive. But a whole lot of apps don’t support storing data there, like Aegis’ backups. It’s possible to use a third party app like MetaCtrl - Autosync to sync local files to Google Drive but it comes with limitations and it annoyed me to pay $10 for what should be a system feature.

In the end I was only using Syncthing for Aegis backups and GPSLogger logs. Aegis already backs up to Google Cloud, so that’s OK. GPSLogger has explicit Google Drive support.

F-Droid

F-Droid is an alternate app store for open source apps. It also lets you run some apps that violate Google policies.

On my own phone I had four F-Droid apps: Bubble, GPSLogger, OpenTracks, and WiFi Analyzer. The only one I really care about is GPSLogger. I went ahead and re-installed F-Droid just to install GPSLogger. I may install more F-Droid apps later, some 8 of the Google Play apps I use have F-Droid versions.

Amazingly there is no free, ad-free spirit level / bubble level app on the Play store! There are several on F-Droid, including Bubble. I just reinstalled it. It warned me that the developer is not going to comply with Android’s new signed apps policy, so this app may go away next year.

Update: Visual Voicemail

My Basic Visual Voicemail wasn’t working. The Phone app just showed an error message. The online advice for this is to have Verizon reprovision visual voicemail. Easier said than done, Verizon now makes you run a gauntlet of 10+ minutes of AI bullshit. I did finally get through to a support person who reset some things and had me do Reset Mobile Network Settings and reboot. It’s working now. They also upgraded me to Premium Visual Voicemail, at least for a month. It’s nice! Text transcript. Not sure it’s worth $4/mo given no one leaves voicemail anymore.

Aegis backups

One nice thing about the Aegis authenticator app is it has no bullshit support for exporting all your tokens to an encrypted file and restoring from it. You can then back that up however you want and it’s even possible to use the token data with other software. The other 2FA apps I see all lock your data away.

Aegis also will write your token data into your Android backup. When I set up my new phone recently Aegis just worked, restoring my tokens. (It worked in 2021 and 2023, too). I think you have to enable “Android cloud backups” in Settings > Backup to allow this.

Aegis will also write a backup file anywhere you want on your Android filesystem. The problem is it’s stuck on your phone. Aegis doesn’t support storing the file in Google Drive and amazingly Android has no built-in way to say “sync this folder to Google Drive”. (You can with third party software.) I used to use Syncthing for this but am trying not to use that anymore on Android. For now I’m just writing the backup file to my phone’s Downloads folder. Not ideal, it’s stuck on the device. Although it did at least copy to my new phone on setup. Hopefully I’ll remember to copy it off once a year or something.

There’s been some updates on the Aegis docs recently about this: see this changelist that is part of this github issue.

Taming notification spam in Android 16

I complained on social media:

Android makes it hard to run background processes, but one hack to work around it is to display a notification. So my entire phone’s notifications screen is now filled with notifications that allow background jobs to run. GPS tracker, fitness tracker, web messages access, syncthing, doze stopper (itself to fix another Android bug). This is a very bad user experience

A friend helped me improve things. In the settings for App Notifications, for each notification channel (not the whole app), you can silence the notification and then also minimize it. This silences only this category of notification so that others still come through.

That gets it down to one line in the notification screen. It also hides the icon in the top bar. Finally, for the first time in my life I’m seeing the Screen Saver and Pixel Stand idle screen. Those weren’t being shown because there were visible notifications.

Here’s what it looks like now. Still feels spammy but much better.

Android phone without a slippery back

My Pixel 8 is an OK phone. Except it’s impossible to hold it in your hand. So I have to put a case on it, which I hate. Glass backs are a scourge. But companies are starting to be brave and offering alternatives again. I had a productive ChatGPT search about options.

My conclusion is the Pixel 9a may be the best choice. It has a matte plastic back. This redesign mostly gets dinged in reviews, it’s not very sexy. But if I can hold it in my hand that’s a big bonus. My Pixel 8 is not at all sexy in a big chunky case.

I’m more interested in Motorola’s new phones. They have a variety of new phones with pleather backs: the Moto G56, the Moto G86, the Edge 60 Pro. But they basically aren’t available in the US. I think because they lack CDMA or otherwise aren’t certified with US carriers. I’m on Verizon, which historically has been a PITA. They do have a couple of phones for the US market. The Moto G56 is called “Moto G” here but doesn’t have an OLED screen. There is an Edge 60. And there’s an Edge 60 Pro for sale in the US that warns us it’s not guaranteed to work.

Meanwhile I ordered some cheap grip tape. No one makes this stuff in interesting colors!

Making Adobe Acrobat not open PDFs downloaded in Chrome

This problem was driving me crazy: Adobe Acrobat was opening PDFs that Chrome downloaded despite every setting I could think of in Chrome or in Windows. This was blocking Chrome’s own PDF reader. Also Sumatra, my favored PDF reader.

The solution is in Acrobat’s preferences. Menu > Preferences > General > Basic Tools > Open PDFs automatically in Reader when they are downloaded in Chrome browser.

I have no idea how an Acrobat preference could be overriding Chrome. I blame Windows, Microsoft built a bunch of hijacking stuff in to Windows to boost their browser. I suspect Adobe is exploiting some thing in Windows.

Adobe is also using malware tactics to reinstall itself as a Chrome extension every month or so. Chrome won’t actually run it, but you do get nagged to use it.

Adobe: 20+ years of terrible, hostile software.

Google Pixel Ultra HDR

My Pixel 8 phone camera is great. It takes photos in HDR. But very little software supports it. The image displayer on the Pixel does, it has some extra-bright display mode that makes the white too bright on screen. Also Google Photos has some HDR editing support with its “Dynamic” and “Enhance” automated presets, plus a slider for “HDR effect”. But when you download the original image file from the phone, it just looks like a regular 8 bit JPG. What’s going on?

I only spent a few minutes researching this but the images appear to be a special Google format they call “Ultra HDR Image Format v1.1” or maybe “JPEG R”. More info in this article and this Reddit discussion. Also older info here, here, here. There’s even a Wikipedia article.

Basically it’s an ordinary 8 bit JPG with some extra data in th efile. Some of that is general metadata about brightness range, etc. And there’s something like a second raster image, a gain map which “provides a mechanism to store data sufficient to recover the original, higher dynamic range luminance data”.

I can’t find any non-Google software that works with the format. Fortunately the files do work pretty well as a regular 8 bit SDR JPG. And Google Photos lets you edit the tone mapping from HDR to that SDR. I’m also not sure which editing tools preserve the extra HDR metadata even if they can’t do anything with it.

M4B files, audiobooks, Android

I have an unlicensed audiobook file that fell off the back of a truck. It’s an M4B file. How to play it on Android?

Long answer short, probably any audio player will manage to play it. Musicolet, Voice Audiobook Player, and VLC can all play it fine on Android. It’s basically just an M4A file, or MP4 file. If a player doesn’t recognize it, try renaming it from .m4b to .m4a or .mp4. I’ll probably use Voice to play it: that’s a dedicated audiobook player and does a nice job playing at 1.4x speed.

On Linux, file identifies it as “ISO Media, MP4 Base Media v1 [ISO 14496-12:2003]”. fprobe identifies it as “mov,mp4,m4a,3gp,3g2,mj2” and/or “isomiso2mp41”. Inside is an AAC audio stream at 44.1kHz, 64 kb/s stereo, nearly 14 hours of book audio. There’s also a bunch of chapter markers, one per book chapter, which index into the audio.

The file also has a stream of text of some sort: VLC identifies it as a tx3g subtitle file. I couldn’t find any tool to extract the data, I’m not even sure how big it is or what it contains. There’s also a third stream which is a 500x500 mjpeg, I’m imagining it’s the cover image for the audiobook.

Google Pixel vs. screen casting

Roku has a nice feature where you can easily mirror video from your Android or Apple phone or tablet right to your TV. Super easy from my Samsung tablet: just launch “Smart View”, select the Roku on your LAN, and off it goes. There’s some nice extra UI for mirroring vs second screen, etc.

None of this works on my Pixel phone. I launch “Cast” and it just sits there, not finding any devices, no feedback why.

I was guessing it was some sort of networking gremlins until I asked an AI. Turns out this is just Google screwing over its customers on its flagship Android phone. Details here

Rokus accept casting via Miracast and Apple Airplay. Google dropped Miracast from its Pixel phones in 2013 in order to push its own Chromecast protocol.

Thanks Google! That anti-trust action can’t happen fast enough.

I’ve never really read about Miracast before. It’s a widely adopted standard, basically “HDMI over Wi-Fi”. Seems to work great. Shame Google crippled their phones to not support it. I did find some Miracast apps on the Play Store but there’s a bunch of them, they all look dodgy, and they all want to charge me a surprising amount of money. So I’ll just stream from my Samsung tablet that works.

I was already holding off upgrading to another Pixel phone, here’s another reason to switch over to Samsung. The Android on my tablet is quite nice.

Sharing files from Chrome OS to Android tablet

Challenge today: share two 3GB video files from my Chromebook to my Samsung tablet. So many ways, none of them reliable.

  1. USB try 1. Plug in tablet. Popup says “access via Linux? Android?” I chose Linux, probably a mistake. Could never find the device in Linux. It’s there via lsusb but no appearance of file access. Maybe have to mount via command line?
  2. USB try 2. Plug in tablet. Nothing happens. Try several times.
  3. USB try 3. Reboot Chromebook. Plug in tablet. Device shows up in Files immediately! Drag file to copy, says “preparing” for one minute+, then shows an error
  4. USB try 4. Unplug, replug. Try copying again. Get instant error.
  1. WiFi try 1. Launch Solid Explorer on tablet, run its FTP server. Install ftp command line client in Linux. Vaguely remember binary and mput commands like it’s 1994. It seems to work but will take 15 minute. Stalls when one device goes to sleep. No clear way to resume.
  1. Bluetooth try 1. Try Quick Share for first file. This kinda just works?! It’s slow, 10+ minutes, but it copies the file to and seems to be robust even if the device goes to sleep.
  2. Bluetooth try 2. Try Quick Share for second file. Gives error. No diagnosis available, just “try again”.
  3. Bluetooth try 3. Reboot both devices. Try Quick Share. Seems to work.

All that is just to get the file over to Android somehow, somewhere. The other challenge is working around how Android has slowly eroded the idea of a filesystem with general purpose access. Solid Explorer works as a file browser through some hack / special permission that lets it browse things. VLC can access things in Downloads reasonably reliably. Fortunately Quick Share put things in a folder named Downloads / Quick Share, so that wasn’t too bad.

I tried using Google to figure out how to do this and found a bunch of outdated advice that didn’t work. Also tried various AIs that suggested various hilarious non-working options, including things like running Android Debugger.

Why is this so bad? Does no one want to copy their photos from their phone to their Chromebook? It’s really dumb the USB doesn’t work. For some reason tablets and phones don’t show up as a normal USB storage device but instead use some weird mobile device system that’s awkward AF.

More on Doze Stopper

I learned some more about Doze Stopper, the app that seems to be fixing my delayed notification problems on my Pixel phone (Android 14). (Previous discussion.)

First, some observations from using it:

  • Notifications are no longer delayed. Problem fixed?!
  • One drawback: the app prevents scheduled Do Not Disturb mode
  • It doesn’t seem to disrupt battery life much if any

Second, some notes on how it works:

  • The app is using alarms to interrupt Doze mode.
  • Alarms during doze are delayed by a few minutes. This delay seems configurable in the app, I have it set to 5 minutes, the current minimum. So maybe my notifications are delayed by a few minutes still? I haven’t observed that.
  • The app also receives push notifications, I think to enable the alarm.

It’s a pretty minimal app but it seems very good to me. I’m excited I found it.

The lack of battery impact makes me wonder why Google is fooling around with delayed notifications at all. I only get a few notifications a day because I carefully disable everything that’s spammy. Maybe it’d be worse for a normal phone?

Or maybe dozing notifications is just a bad idea that Google could remove from Android. When it was introduced years ago Android had all sorts of background activity consuming battery. Over the years they’ve cracked down on background processing and on network connectivity and maybe the platform is in a place where they could re-enable instant notifications.

One other mystery: Firebase has an option for high priority notifications that should get through even when Doze is active. So why aren’t messages from important apps like Gmail or Signal getting through? Maybe they’re just not setting the important bit? That’d be silly if so.

Doze Stopper, a fix for Android notifications?

I’m testing a new fix for delayed notifications in Android and so far (24 hours) it’s working well. See also this Reddit post I made.

The fix is a free Google Play store app called Doze Stopper. There’s little explanation what the app does but judging by the logs what it’s doing is setting an alarm for itself every 5 minutes, then doing something to wake up from Doze mode. The timestamps on the logs don’t quite make sense though.

I’ve deliberately left my phone idle as much as I can for about a day now, then tested it every few hours with a notification from Gmail or Gotify. The notification always appeared within 30 seconds or so. Also the Messages webapp connects immediately now. In the past often those tests would fail: notification wouldn’t appear, messages wouldn’t connect. But this is hard to test reliably!

Didn’t notice any significant downside in battery life. Left the phone off the charger overnight for 10 hours and it went from 100% to 74%, about typical from before running this app.

Update Sep 15: left it running for 24 hours with no charging. Phone went from 100% to 44% which is roughly the same as it would without Doze Buster. Can’t measure precisely but it’s definitely not killing the battery. Also notifications keep working, Gotify notification shows up immediately after an hour+ idle. Some Gmail notifications may not be coming through immediately, not sure what’s up with that.

Update Sep 17: still seems to be helping a lot. It does seem to disrupt Do Not Disturb mode though. I have DND scheduled every night but in the morning I find it’s not enabled on my phone when it should be. I did a test now and DND was disabled sometime between 8 and 16 minutes after a schedule turned it on. I wasn’t watching closely, but there were no log events in Doze Stopper the first 10 minutes: my guess is the alarm or disabling doze is also turning off DND. There is a DND setting for “Alarm can override end time” but I want that enabled for my own alarms!

Note, the developer has a second app called Doze Buster that also does the same thing but apparently for older versions of Android. It’s a little confusing, none of this is well documented.

Moving $HOME from one WSL to another with local rsync

I’m installing a new WSL system, essentially a Linux VM. I want to move my 13GB of home directory files over. WSL doesn’t provide any easy way to do this. You can export and import a whole virtual disk. You can tar up your home directory and copy it just like you would any other Linux box. And you can use WSL’s various strange mounts (including 9P) but those will be slow and screw up persmissions.

The way I settled on was running an rsync daemon from the command line.

The client send command in the source WSL instance is the easy part. The only strange thing here is “localhost” as the destination. WSL’s networking magic means that two separate Linux instances apparently share “localhost”. They probably share it with the Windows host, too. (The ::xfer in the destination looks magic too; see below for the server config file that defines it.)

rsync -az --info=progress2 --port=12345 ~ nelson@localhost::xfer

The server side to receive things is trickier. Launching the server is easy enough. I just ran this as root, was running into problems with changing group ownership as a normal user

rsync --daemon --config=rsyncd.conf --no-detach --address=localhost --port=12345

All the real work here is in rsyncd.conf. Here it is:

pid file = /tmp/rsyncd.pid
lock file = /tmp/rsync.lock
log file = /tmp/rsync.log

[xfer]
path = /home/nelson/xfer
comment = xfer
read only = false
list = true
uid = nelson
gid = nelson
auth users = nelson
secrets file = /home/nelson/secrets.txt

I didn’t check this too closely, an AI generated it for me. It seems to work. It’s possible all my files got chowned and chgrped to nelson but in this case (my home directory) that’s ok.

The one gotcha is secrets.txt. The contents are simple, I just made it nelson:p for the insecure plaintext password “p” (you have to have some password). But that file has to be only readable by the user running rsync. Otherwise auth won’t work but the error message won’t tell you why.

Samsung SSD firmware updates

This post is a rant about how bad Samsung’s SSD software is. Summary: the ISOs only boot with legacy BIOS, not UEFI. Samsung Magician for Windows is awful.

My 256GB Samsung 970 Evo used to be a system drive, then sat idle, and is now a new system drive replacing the failed one in my BOSGAME. But this new (old) drive is also suspect, I got a scary looking error from the kernel last night

[28863.608367] sd 2:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s [28863.609453] sd 2:0:0:0: [sda] tag#0 Sense Key : Illegal Request [current] [28863.610523] sd 2:0:0:0: [sda] tag#0 Add. Sense: Invalid command operation code [28863.611537] sd 2:0:0:0: [sda] tag#0 CDB: Write same(16) 93 08 00 00 00 00 00 02 fe 90 00 00 09 70 00 00 [28863.612526] critical target error, dev sda, sector 196240 op 0x3:(DISCARD) flags 0x800 phys_seg 1 prio class 0

So I checked some error logs with nvme and the firmware version with smartctl. I had firmware 1B2QEXE7 but there might be a 2B2QEXE7. There’s no clear way to update firmware from a running Linux system, so looking for options...

Updating from ISO

Samsung makes firmware available as ISO updates. Burn a small USB disk, boot it, update. Only joke’s on me, their ISO images won’t boot on a modern BIOS. Doesn’t seem to work with UEFI at all, secure boot or no. I could get it to boot in legacy mode / MBR, at least in a test VM, but screw that. (BTW the ISO contains a Linux system, lol.)

So I gave up. I pulled the drive and put it in a USB enclosure to update on my Windows machine. Which didn’t work either.

Samsung Magician Windows Updates

Samsung has a consumer management tool called Magician. I thought it used to be pretty good but over the years it has enshittified.

I had a copy of Magician my Windows system already, version 5.0.0.790. Which lies about auto-updates. Also the uninstaller fails to handle the very simple case where the program is running in the foreground.

screenshot claiming 5.0.0 is latest version

The installer is terrible. The 8.1 installer takes most of a minute to put a window on the screen. Which then inquires if I’m a member of a European GDPR country (or Brazil), so I guess this thing is preparing to fully invade my American privacy. (I wonder if Samsung is aware of California law?) Magician installs in the years-deprecated Program Files (x86) directory. It now takes up 677MB of disk space when installed (5.0 was 25MB).

The usability is terrible. You can’t copy and paste, you have to re-type the serial number off the screen. Don’t mix up those 0s and Os! Also it has stupid formatting for the SMART data, but at least here there’s an export button. Temperature in Kelvin? Really?

Also the functionality is terrible. I can’t do anything with the USB drive I’m trying to fix. It seems upset that it can’t mount the filesystem (it’s a ZFS Linux system, no duh.) and it refuses to do anything else with the drive because of that. Not a very useful hardware management tool.

Magician also says another drive is counterfeit, an internal drive I’ve used for seven years to boot Windows. That’s not impossible, but awfully unlikely. This forum thread suggests that Magician has bugs leading to false counterfeits. Either way it locks me out of updating the firmware, and I think I’m two revisions behind. Ugh.

Magician couldn’t do anything with two of three hard drives I tried. Why is so much software is so bad? Do they not give a shit?

Update: I reinstalled Magician and ran it again and now it says the drive is legit, not counterfeit. (Also a Samsung service person looked up the serial and number said the same.) I upgraded the firmware. Revealing another bug: the firmware update says “your computer will be rebooted”. But it’s not, it shuts it down instead which caused a brief moment of panic until I thought to hit the power buttonn

Did I mention Magician has some weird input thing where it blocks my global screenshot hotkey if the window had focus? How do you even do that?!

Back to the ISO

So I tried again to boot the update tool from the ISO image. I failed. First I tried setting my BIOS to legacy boot and boot that way: it didn’t recognize the USB I burned with unetbin according to instructions as bootable. Then I tried using Ventoy to boot it as an ISO. No such luck.

The only thing I’ve seen booting this ISO is Proxmox with the legacy BIOS. I suppose I could pass through the SSD to a virtual machine, maybe via USB, and update that way. But yikes that seems risky.

So I gave up. Not updating this firmware. Thanks, Samsung. Between this mess and the disaster of data loss on 980s and 990s I’m unlikely to buy another Samsung drive.

Linux console fonts are too small

My eyes are getting older and I have big screens: the default Linux console fonts are too small. And I’ve been spending more time than I’d like in consoles lately. Some ideas here for coping.

setfont -d is the quick fix. This will double the size of the current font as a one-off thing.

setfont in general is the tool for changing fonts. But it’s hard to find a nice clear choice for an alternate bigger font, there’s a list of a zillion for different languages. I should go find one good font that’s likely be available on a system and remember its name.

dpkg-reconfigure -plow console-setup works on Debian systems and gives you a nicer chooser.

Android notifications are still terrible

I’m still missing Android notifications, Gmail this time. I asked the Claude AI for help. Check out this list of 20 options. Perhaps Android’s product has gotten too complicated? The list isn’t entirely correct and it misses a few (some are hidden in the Gmail app itself, for instance) but it gives a gist.

What are all the settings on Android Gmail that might mean I don’t see a notification for a new email? I want all of them, a comprehensive list.

Here’s a comprehensive list of Android Gmail settings that might prevent you from seeing notifications for new emails. Sorry for bad formatting.

  1. Notifications disabled in Gmail app:
  • Settings > [Your account] > Notifications > Notify for new messages
  1. Notification categories turned off:
  • Settings > [Your account] > Notifications > Manage notifications
  1. Sync turned off for your account:
  • Settings > [Your account] > Sync Gmail
  1. Battery optimization interfering:
  • Device Settings > Apps > Gmail > Battery > Battery optimization
  1. Do Not Disturb mode active:
  • Device Settings > Sound > Do Not Disturb
  1. App-specific notification settings in Android:
  • Device Settings > Apps > Gmail > Notifications
  1. Notification importance set to low:
  • Device Settings > Apps > Gmail > Notifications > Importance
  1. Notification channels disabled:
  • Device Settings > Apps > Gmail > Notifications > [Specific channels]
  1. Gmail app data restrictions:
  • Device Settings > Apps > Gmail > Mobile data & Wi-Fi > Background data
  1. Gmail app battery restrictions:
    • Device Settings > Apps > Gmail > Battery > Restricted
  2. Inbox categories filtering:
    • Gmail app > Menu > Settings > [Your account] > Inbox categories
  3. Priority Inbox settings:
    • Gmail app > Menu > Settings > [Your account] > Inbox type > Priority Inbox
  4. Filters or labels automatically archiving emails:
    • Check filters in desktop Gmail settings
  5. Outdated Gmail app version:
    • Google Play Store > My apps & games > Gmail > Update
  6. Android system notification settings:
    • Device Settings > Notifications > App settings > Gmail
  7. Power-saving mode active:
    • Device Settings > Battery > Power saving mode
  8. Account sync issues:
    • Device Settings > Accounts > Google > [Your account] > Sync account
  9. Airplane mode enabled:
    • Quick settings or Device Settings > Connections > Airplane mode
  10. Poor internet connection:
    • Check Wi-Fi or mobile data connectivity
  11. Gmail storage full:
    • Check available storage in Gmail account

This list covers most settings that could affect Gmail notifications on Android. The exact names and locations of these settings may vary slightly depending on your Android version and device manufacturer.

Would you like me to elaborate on any specific setting or provide more information?

Windows screenshot tools in 2024

It’s 2024 and Windows is still bad at taking screenshots. Actually the built-in Snipping Tool is sort of OK but third party solutions are better. Also my Apple keyboard doesn’t have a Print Screen button so all the defaults are awkward for me.

For years I’ve used Lightshot but the last release was 2009. Then I used ShareX but never liked it’s complicated UI.

Greenshot is my new bae. It’s open source and has a good UI with some attention to usability and simplicity. There’s a simple built-in editor. I could suggest some minor UI improvements but basically it’s fine. The one feature it’s missing is WebP support but I can easily convert manually with File Converter.

Relationship with Greenshot ended. Turns out it has a serious vulnerability over a year old that is actively being exploited. The release hasn’t been updated in 7 years. The developer keeps making noises about wanting to put out a new release but having trouble with signing keys, etc. IMHO it’s irresponsible for them to keep offering the software if they can’t fix it. I regret recommending it.

Flameshot is also nice with a capture UI that looks like the old Lightshot UI. But there is no way to change the hotkey from PrintScreen and the three year bug report discussion left a bad taste in my mouth. In general Flameshot seems to not have quite the usability polish of Greenshot, and since I can’t even launch it with my keyboard I won’t use it.

Flameshot’s last release was 2022. There’s been a lot of submitted improvements since then but no release on Windows.

Inside BOSGAME B100 (adding a drive)

My Mini-PC has support for adding a SATA drive so I took a look at what’s involved. Kinda fiddly. Not as nice as the Beelink in this video where the drive cage has a SATA connector already wired to the motherboard. In the BOSGAME instead there’s a tiny 12 pin connector and the computer came with a cable to plug into that with a SATA connector on the other end. There’s a similar looking cable on Amazon so maybe this connector isn’t entirely proprietary but it is unusual. Also fragile.

USB speeds and bad cables

I had a problem where copying from one USB disk to another was slow, averaging 10.5MBytes/s. The source disk seemed fast enough but while the destination should do 100 MBytes/s it was one tenth that. The problem is it was connected with a USB 2.0 cable at 480 Mbit/s. With better cables it goes fast like expected. Still I should be getting 60MBytes/s out of it, or at least over 30.

I discovered every single USB C-to-A cable I have is USB 2.0 and limited to 480 Mbits/s. I diagnosed this with lsusb -t to see the interface speeds (480, 5000, or 10000) and hdparm -t to test throughput (100 MBytes/s or more when working well.)

Good USB 3 C-to-A cables do exist and can do at least 5000Mbits/s but they cost more. I’m going to have to buy some. There’s no easy way to tell a slow USB 2 cable apart from a fast USB 3 cable, but usually the USB 3 Type A cables have blue connectors or are marked SS or SS+ for “SuperSpeed”.

Update: good cables to buy

I bought a bunch of cables on Amazon and tested them. All of these advertise 10Gbps and tested fine at 10Gb/s. They all have blue connectors but only the Monoprice cable has “10 SS” printed on the connector. I did not test the power on max charging.

  • Monoprice USB 3.1 Gen 2 cables. These are my favorite because they are well labeled. Shortest length is 3 feet.
  • LDLrui, a generic USB 3.2 Gen 2 cable. These seem to work fine and come in 1 foot length.
  • Monoprice USB 3.1 Gen 2 adapter. The only adapter I’ve seen that works at SuperSpeed in both orientations, no “flip for super speed”. No idea if that means it can’t do high power charging. Note this adapter is big, much longer than the flip-style.

I also tried this Ugreen “up to 10Gbps” adapter. It’s one of those “flip to act differently” designs that I think are confusing. Also while I could connect at 5Gbps once, mostly it was connecting at 480Gbps no matter which of 4 orientations I tried. I’m returning them.

Lots of detail

Below is a deep dive on my troubleshooting and some theoretical disk speeds for consumer hardware. But first...

Good USB C-to-A cables

The cable matters! For some reason there’s a bunch of bad cheap C-to-A cables and adapters out there. The good ones cost more, should be marked “super speed”, and probably have blue connectors.

SuperSpeed C-to-A cables exist from name brands like Anker or Monoprice. They cost more. I’ve ordered these and these.

SuperSpeed C-to-A adapters are harder to find and are usually female on the USB-A end. But that’s not what I need, I need a male A plug to stick into the A receptacle on the mini-PC. There’s lots of generic adapters in this configuration but precious few name-brand ones. I ordered these from UGREEN and this Monoprice. (There’s also lots of USB 2.0 C-to-male-A adapters but that’s what I’m trying to replace!)

I am curious about this specific C-to-A jack adapter from XAOSUN. It has a strange design, the docs say “The Type-C female port allows you to switch between USB 3.1 speed and USB 2.0 speed with a simple flip of the Type C plug.” Why would you do that?! One reviewer says “Be aware that devices like this support high-speed charging and high-data transport from USB-C to USB-A 3.0 and above are not symmetrical on the USB-C end. One side of the USB-C supports single-lane USB 3.1 Gen 2 data and low-power charging. The other side of the USB-C supports USB 2.0 data transfer and up to 100W 20V 5A charging.” So maybe that’s it? I did notice the name brand C-to-A adapters talked about maxing out at 3A. Maybe they’re trying to fake non-standard 100W charging on a USB-A port which requires weird wiring incompatible with 10Gbit/s data? Anyway “works differently when flipped” sounds like a confusing mess so I’d rather get something that just does high speed data. All my fast charging devices now are USB-C and USB-PD anyway.

Update: almost all C-to-A small adapters have this flip-for-superspeed design. This discussion says the whole concept of C-to-A adapters is problematic.

Disk medium, SATA, and PCIe speeds

Modern spinning disk media can transfer at least 100MByte/s, more like 150 or even more if you have a high performance disk. SSDs are much faster, like 3000MByte/s or more.

Older disks are interfaced via SATA. SATA 3.0, from 2008, is 6 Gbit/s = 750MByte/s. That’s faster than any spinning disk but slower than modern SSDs. New SSDs interface via M.2 / NVME which runs at PCI bus speeds. That’s very fast, even the oldest PCIe 3.0 with 4 lanes is almost 4000MBytes/s. I’m not clear on whether these SATA and PCIe speeds are shared between devices or not. In practice any PCIe interface is fast enough for any SSD and SATA is fast enough for spinning disks but not SSDs.

Bottom line, here’s a low estimate of speeds of typical disks on modern hardware:

  • Spinning disk via SATA: 100MByte/s
  • SSD via SATA: 500MByte/s
  • SSD via M.2: 3000MByte/s

USB 2 and USB 3 speeds

A proper PC connects to the drives directly via SATA or M.2. But mini-PCs often use USB instead and you have a drive enclosure with SATA or M.2 input and USB output. Modern USB enclosures support at least 5Gbit/s (625MByte/s) which is just about as fast as any SATA drive (HDD or SSD) but will limit an M.2 SSD.

USB comes in multiple flavors, this is a good reference. USB 2.0 is “high speed”, ie: slow. It means 480 Mbit/s (60 MByte/s). USB 3.0 dates to 2008 and is 5Gbit/s (625MByte/s). USB 3.1 is 10Gbit/s and USB 3.2 2x2 is 20Gbit/s. Sometimes you see USB 3 stuff advertised as “SuperSpeed” or “SuperSpeed+” but these days it’s more common to just publish the number. Everything in the last 10 years or so should be supporting at least 5Gbit/s on USB 3, 10Gbit/s is common. 20 is rare.

Note these speeds are shared between all devices on the same USB bus. So if you have two drives plugged in to a 480Mbit/s USB bus the max throughput copying from one to the other is going to be 480 / 2 = 240Mbit/s or 30MByte/s (I think?).

Cables also matter. I think USB-A maxes out at 10Gbps, it can’t do the x2 part required for 20Gbps. Older USB-A cables may be limited to 5Gbps. And old, cheap, or bad cables are limited to 480Mbps USB 2. Look for a blue block inside the connector, that’s the branding for at least 5Gbps. Or the words “SuperSpeed” or “SS”.

USB-C is better. I think most USB-C cables are SuperSpeed but there are probably some cheap “charging cables” out there that aren’t.

Unfortunately, mini-PCs mostly still have USB-A ports on them. So you need a C-to-A adapter or cable. That’s where I got in trouble, turns out a lot of those are not SuperSpeed but limited to USB 2 speeds.

I think mixing USB 2 and USB 3 devices on the same bus is OK and that the USB 3 devices can operate at their faster speeds. Not positive though. (Reference.)

Bottom line theoretical speeds from USB:

  • USB 2.0: 60MByte/s, half that if transferring between two drives
  • USB 3.0 5GBps: 625MByte/s
  • USB 3.1 10GBps: 1250MByte/s
  • USB 3.2 2x2 20GBps: 2500MByte/s

In practice USB 3.1 10Gbps is faster than any SATA interface and even 5Gbps is close to SATA speeds. But USB 2.0 is slow, slower even than spinning disks. It is a bottleneck to be avoided.

Cable testing

I decided to try a bunch of cables with a Samsung SSD 860 EVO 1TB SSD in a UGREEN SATA enclosure. It has a USB-C port. The USB interface is 10Gbit/s, the SATA is 6Gbit/s, and this old SSD drive can do about 500MByte/s. The disk is the bottleneck then, but should be capable of 500MByte/s.

With a USB C-to-C connection to the USB-C port on the BOSgame, lsusb -t shows 10000M speed and hdparm -t measures 500MBytes/s. Great! (I also tested a spinning rust 1TB disk at about 90MBytes/s with this same C-to-C cable. Yay!)

With a blue USB C-to-A cable sold with a hard drive as SuperSpeed, lsusb -t shows 5000M speed and hdparm -t measures 410MBytes/s. Still quite good but it’s interesting the C-to-A connection speed is half the C-to-C and that is reflected in actual throughput. In theory 5000Mbit/s should still deliver 500Mbyte/s transfers but in practice, it gets knocked down to 410MBytes/s.

With various other C-to-A cables: cheap ones, fancy Anker ones that are actually USB 2, the good C-to-C cable plugged into a cheap C-to-A adapter, every other cable I tried it connected at 480Mbps. And the drive measured out about 16MBytes/s. Turns out these are all USB 2.0 cables, WTF? They are garbage but I guess they are common because they are cheaper.

I don’t understand why I’m getting 16MBytes/s with USB 2.0 connections and not the theoretical 60MBytes/s. Maybe the Mini-PC’s USB 2.0 implementation is not very good?

Mini PC speeds

I have a BOSGAME B100 I bought in December 2023. The Amazon marketing page picture says the USB-A ports in back are USB3.2 Gen 1*2 and the USB-A ports in front are “USB3.2 Gen 2*2”. (Note this says “*2” which I think means two ports, not the USB x2 double speed ports.) There is also a USB-C port on front. The Bosgame site spec page also says four USB 3.2 ports but it suggests the front ones are the slower 5Gbit/s and the back are 10Gbit/s. Testing confirms this is true: the back ports are 10Gbit/s, the front ports are 5Gbit. But all these ports should be USB 3 and capable of at least 5Gbit/s = 625MByte/s, faster than any 2.5″ SATA disk. (There is also room for an internal SATA drive.)

I also bought a Beelink S12 Pro Mini PC. According to the Beelink sale page it has 4 USB3.2 Gen2(10Gbps) ports. Good! It also has room for an internal SATA drive.

The good disk

The USB disk I was copying from is an old WD Passport I bought in 2012 and use mostly as a backup drive. It is an honest USB 3.0 drive. lsusb -t shows 5000Mbit/s and hdparm -t tests out at about 100MB/s. I get this using either a USB-A port in the front or the back or the BOSGAME. It’s using a short cable with USB-A on one side (colored blue) and Micro USB 3.0 Micro-B connector on the drive side.

The bad disk

Actually no disks are bad. If I connect them with C-to-C cables, they all test at 100MBytes/s. The badness comes from the crappy C-to-A cables, not the disk.

But the destination disk that was slow for my copy is a WD Blue 2.5″ SATA spinning disk in a cheap Orico enclosure. The disk can do up to 150MB/s and the enclosure claims 10Gbps USB 3.2 Gen2 so should not be a bottleneck. smartctl doesn’t show any obvious errors, the drive has 32,000 hours on it but no errors. It should be capable of 150MByte/s. In practice I get 100MByte/s with a good cable.

The test disk

Described above in cable testing: a 860 EVO in a SATA enclosure. Gets 500MBytes/s with a proper cable.

The best disk

I have an SSD in a UGREEN M.2 enclosure that says it does 10Gbits/s via USB-C. (The SSD itself is a 970 Evo that can do 3000MByte/s, or faster than the USB.) So I should get an honest 1250MByte/s with this device. Just for fun I tried it with a C-to-C cable. It connects at 10,000 Mbit/s. hdparm -t shows just about 1000 MBytes/s, or close to the USB speed. The SSD is capable of 3x that speed but that’s too fast for USB 3. In theory I might get double the speed if I could manage a USB 3.2 2x2 connection at 20Gbit/s.

Observed bad copy behavior

Notes from the slow copy using a bad C-to-A cable. I’m using rsync -a --partial --append --progress to copy a 700GB file from one USB disk to another. It’s slow, it copied at 10.5MBytes/second. the rsync outpput:

699,404,892,160 100% 10.51MB/s 17:37:25 (xfr#1, to-chk=0/2)

That’s terrible. Even worst case (both drives on USB 2.0) I should expect nearly three times this speed.

Watching the rsync progress it fluctuates between 20MB/s to as slow as 2MB/s. iotop doesn’t show me anything interesting, this copy is the only major I/O.

Linux diagnostics: USB

The thing that got me started looking at all this in detail was this output from lsusb -t

/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
    |__ Port 3: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
    |__ Port 4: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
    |__ Port 6: Dev 5, If 0, Class=Mass Storage, Driver=uas, 480M
    |__ Port 7: Dev 4, If 0, Class=Mass Storage, Driver=uas, 480M
    |__ Port 8: Dev 2, If 0, Class=Wireless, Driver=btusb, 12M
    |__ Port 8: Dev 2, If 1, Class=Wireless, Driver=btusb, 12M

That’s telling me two disks (dev 4 and dev 5) are running at 5000Mbit/s. Good! But two are running at 480Mbit/s. Bad! Even so, I should still get at least 30MByte/s (or more), but something’s not right.

Device 5 is the slow Orico disk I’m writing to. dmesg tells me “usb 3-6: new high-speed USB device number 5 using xhci_hcd”. But lsusb says it’s running at 480Mbit, because of the bad cable.

Device 4 is the 2.5″ SATA SSD in a Ugreen enclosure. Also connected at 480Mbit/s because of the cable.

Note the slow disks are connected with the UAS driver. That should be good, that’s more capable than the older usb-storage driver. These enclosures are newer and support the newer UAS protocol.

Linux diagnostics: hdparm throughput

Not much to say here, just hdparm -t /dev/sdd is a quick test of max throughput on a disk. Something like fio is better for real disk I/O benchmarking but hdparm is useful for seeing if it’s basically working right.

Android Doze mode vs. notifications

Still trying to understand why my fancy Google Pixel doesn’t show me notifications in a timely fashion. I got some new insight into a possible cause from some Reddit comments: Android Doze mode.

Long story short, Doze is a power saving system w here the phone only wakes up every 15-28 minutes to process things in what they call “a maintenance window”. Normal notifications get delayed too, although there is an option for high priority notifications from apps. There’s no way to configure it with the usual Android settings. There are ADB hacks you can apply (and have to re-apply every reboot): see here or here for detailed discussions and solutions. The key thing is the command dumpsys deviceidle disable.

But Doze has been around a very long time, since Android 6. I only started noticing a problem around a year ago, maybe around Android 13 or 14. Did something change?

I’ve got no problem with low power modes! But they can’t interfere with basic use of the device. It’s particularly vexing for me since my phone spends most of its time sitting on a Pixel Stand at 100% battery, power saving is not my problem. (Which suggests one possible change: Pixels have gotten recent changes in battery charge optimization that means the phone may not realize it has a source of charging power when it’s near 100%.)

Another possible explanation for a change is that high priority messaging thing. It’s hard to imagine but maybe Gmail, Signal, and Messages aren’t getting high priority messages anymore and so don’t wake up? That’d be dumb. But maybe it’s a bug / bad system interaction?

Update: Gmail is definitely not getting reliable updates. Twice today I only got updates when I woke the phone up maually. I have no way of knowing what priority Gmail sends its notifications at but it’d sure be dumb if it weren’t high. Gmail has a zillion options for configuring its notification behavior. Most of them were turned on but “Notify for every message” was off. I’ve turned it on, now to wait a few days to see if it makes a difference. (No immediate improvement, just had more mail not show up as notifications. Even after I woke the phone, still took 30 seconds or more.)

Mostly I’m just tired and cranky about this bug. It’s affecting a huge number of Android users all over the world. It has to be obvious to any Google engineer who uses an Android phone regularly. Do they just think it’s OK? Can’t reproduce it? Don’t care?

This is the point where I’d be the hero who does a lot of testing and figures out the problem himself, finds a fix. But fuck that, I’ve got better things to do and don’t really know enough to tackle this one myself. It’s particularly frustrating because it’s hard to reliably reproduce the problem, mostly I notice when I haven’t seen an email I know I got about once a day. Anyway if I do get the interest to tinker again, things to try:

  • the ADB hacks
  • turn off Google’s battery saving charging, see if it works better on the charging stand.

Update: ntfy.sh

Got some interesting perspective reading ntfy.sh’s docs.

Instant delivery allows you to receive messages on your phone instantly, even when your phone is in doze mode, i.e. when the screen turns off, and you leave it on the desk for a while. This is achieved with a foreground service, which you’ll see as a permanent notification that looks like this: ....

Limitations without instant delivery: Without instant delivery, messages may arrive with a significant delay (sometimes many minutes, or even hours later). If you’ve ever picked up your phone and suddenly had 10 messages that were sent long before you know what I’m talking about.

The reason for this is Firebase Cloud Messaging (FCM). FCM is the only Google approved way to send push messages to Android devices, and it’s what pretty much all apps use to deliver push notifications. Firebase is overall pretty bad at delivering messages in time, but on Android, most apps are stuck with it.

The ntfy Android app uses Firebase only for the main host ntfy.sh, and only in the Google Play flavor of the app. It won’t use Firebase for any self-hosted servers, and not at all in the the F-Droid flavor.

Another failed Ubuntu 23.04 upgrade

Failed again to upgrade my recalcitrant Ubuntu 23.04 system. I give up and I’m mad at Ubuntu’s EOL policies.

The fun thing is how much some new tools make this kind of thing easier and safer. I had a lot of confidence experimenting thanks to Proxmox and the ability to easy rollback the whole system or restore a backup. I also got a lot further than I thought I would using Claude. These AIs still have a problem that sometimes it confidentally recommends bullshit. But as long as you understand that and evaluate suggestions yourself it’s a lot faster using an AI to find things than searching ordinary docs and forum posts. I tried more things more quickly than I would have without the AI help.

Hacking around GRUB

The problem last time is my system was installed with GRUB referencing a disk in /dev/disk/by-id that no longer exists. When I virtualized the server those IDs got lost. Claude did a great job suggesting various fixes. Some were wrong (like a hallucinated GRUB_DEVICE config) and some were plausible but don’t work (purge and reinstall GRUB). The good suggestion was to use debconf-set-selections to force a reconfig.

echo "grub-efi grub-efi/install_devices select" | sudo debconf-set-selections
dpkg-reconfigure grub-efi-amd64

This forced GRUB to reconfigure the path. It picked /dev/vba1. Not ideal (a UUID path would be better) but should work. And it did! I could reinstall GRUB on my 23.04 system, reboot, the BIOS all seemed happy. Success!

Maybe. After far too much drama upgrading to 23.10 the system then didn’t reboot. It all looked like it worked but the BIOS was no longer happy with what it found for a boot partition. I chickened out at that point and rolled back, gave up.

Ubuntu’s hostile EOL policy

Even though I think I fixed GRUB, I once failed in my attempt to upgrade Ubuntu.

Ubuntu has a clear but obnoxious policy that outside LTS releases, their interim go end of life quickly. 23.04 went EOL on January 25, 2024. The entire lifespan of this release was 8 months and if you don’t upgrade quickly enough, too bad. I’m a little confused why it won’t still let me update to 23.10: it goes EOL in three days. But when I tried I was told “Your Ubuntu release is not supported anymore”. There’s no option to upgrade directly to 24.04 LTS either.

I don’t mind that they EOL releases and don’t offer regular patches. But they really should offer some sort of upgrade path. They kind of do, I’ve upgraded an EOL system once before by hacking the sources.list to point at http://old-releases.ubuntu.com/. But there’s absolutely no tool help for doing that and you are on your own.

This time around I tried just swapping URLs and doing apt full-upgrade. It sure looked like it worked but then the reboot failed, maybe because of a bad update process or maybe because of my weird GRUB situation. Either way, I gave up.

At this point I’m going to give up and use Ubuntu LTS releases only. Which means one release every two years. I guess I’ll use something with rolling releases (Arch or Debian testing) if I need a more updated OS.

And now I’m doubly committed to rebuilding my main home Linux server. I kind of punted on that six months ago when I virtualized it into Proxmox as a whole system. I don’t relish rebuilding it all as lots of little containers but it’s probably a good idea. (Oh joy, now I can update 20 little Ubuntu systems instead of one big one!)

Messages for Web unreliable: phone asleep?

I use Google Messages for Web frequently to read my text messages on my Pixel 8 running Android. About half the time I first use it in the morning it can’t connect, despite my phone sitting right next to the computer on the same network at full charge on a Pixel Stand. If I wake up the phone then the web app can connect.

It didn’t used to be like this. Connections worked reliably. Does anyone else have this problem?

I’m wondering if this is related to the long-standing problem of delayed notifications. Overall it feels like Google has made these phones go into such a low power mode that they are no longer connected to a network. So notifications don’t come in and the messages webapp can’t connect. It’s really irritating!

(This is a copy of a Reddit post I made.)

Update: a clue from lower power mode

I managed to reproduce the problem. Messages couldn’t connect. Before I woke the phone I found its IP address in my router and pinged it from the same LAN. Interesting result!

64 bytes from 192.168.3.81: icmp_seq=1 ttl=63 time=234 ms
64 bytes from 192.168.3.81: icmp_seq=2 ttl=63 time=539 ms
64 bytes from 192.168.3.81: icmp_seq=3 ttl=63 time=759 ms
64 bytes from 192.168.3.81: icmp_seq=4 ttl=63 time=8.50 ms
64 bytes from 192.168.3.81: icmp_seq=5 ttl=63 time=293 ms
64 bytes from 192.168.3.81: icmp_seq=6 ttl=63 time=516 ms
64 bytes from 192.168.3.81: icmp_seq=7 ttl=63 time=1240 ms

The phone is online but answering very slowly. After I woke the phone up messages connected and pings got faster. But not consistently and still way more latency than I’d expect on my wireless LAN.

64 bytes from 192.168.3.81: icmp_seq=33 ttl=63 time=110 ms
64 bytes from 192.168.3.81: icmp_seq=34 ttl=63 time=76.3 ms
64 bytes from 192.168.3.81: icmp_seq=35 ttl=63 time=83.4 ms
64 bytes from 192.168.3.81: icmp_seq=36 ttl=63 time=5.29 ms
64 bytes from 192.168.3.81: icmp_seq=37 ttl=63 time=7.93 ms
64 bytes from 192.168.3.81: icmp_seq=38 ttl=63 time=131 ms
64 bytes from 192.168.3.81: icmp_seq=39 ttl=63 time=33.6 ms

So that’s weird. But it’s more evidence of a low power mode that affects networking. OTOH it’s also evidence the phone never goes fully offline, so why can’t messages connect?

Chromebook powerwash / channel downgrade

My Chromebook on the beta channel (v125) has been flaky, the Android and Linux subsystems kept crashing. So I decided to downgrade back to stable channel (v124). That all worked but was tricky enough I’m writing notes. See below for the dream of 1990s computing.

An important concept here is ChromeOS “powerwashing”. That’s basically a full software reset, wipe the whole system (including your local data) and reinstall. It’s a neat feature of Chromebooks, the easy full reset as an important part of the product.

Changing channels

There’s a “Channel” pane in settings with a “Change channel” button. If you use it to downgrade from beta to stable it tells you that you have to powerwash the system (fully resetting it) and reboot. But rebooting doesn’t do anything, neither does manually powerwashing. Turns out you have to click “check for updates” somewhere to get it to download the stable release, then follow that path to install it which results in the reboot and powerwash.

Note that powerwashing is the default way to downgrade ChromeOS and will avoid compatibility problems. But it’s not necessary. There’s a crosh shell command to downgrade without powerwashing. Enterprise-enrolled Chromebooks also have an alternate channel switching method where it doesn’t switch immediately but instead waits a few days / weeks for the stable release to catch up so you can smoothly move from beta to the newer stable without a reset.

But Chromebooks were designed to be safely powerwashable. In theory all your important stuff is stored in Google’s cloud already and a powerwash is painless. How does that work out?

Powerwash: the ChromeOS stuff

After a powerwash it is indeed easy to get your basic Chromebook back to the state it was in. Basically you log in once and Google syncs back over your web browser state, which in ChromeOS is basically everything on the computer. The big hassle is you have to log in again on every website, all your cookies are gone. But in general your Chromebook environment looks the same after a powerwash and login.

Google will force you to once again re-enable ad privacy in the Chrome configuration. Sleazy.

Two things special to me inside ChromeOS, unlikely most people would do this:

  • I had to re-enable the ComposeKey input method as a second keyboard. It was installed but I had to go into settings to make it accessible.
  • I will need to reinstall the Bypass Paywalls Clean Chrome extension. That has to be sideloaded from local files, Google won’t allow such useful stuff in their Chrome addon store.

However, I don’t just use ChromeOS stuff on my Chromebook. I am also a developer running Linux and I use a bunch of Android apps. That’s a little trickier.

Powerwash: Android

Android apps are almost first class citizens in ChromeOS these days. The powerwash restore app will offer to reinstall “your Play apps”, which means Android apps I guess. It reinstalled all the apps I had before on this Chromebook. But then they all have to be re-authenticated and configured. For me that means adding a new device to Tailscale and resyncing Obsidian with their sync service.

Powerwash: Linux subsystem

I also run a Linux container on my Chromebook. ChromeOS has a nice backup and restore system for that. I backed up to a USB drive, powerwashed, restored, and everything was back the same in Linux. Both the Debian image and my /home stuff. The Linux Signal flatpak app even stayed logged in. Couldn’t be easier. (the backup file is called .tini but is mostly just a .tar.gz of the filesystem with an extra metadata.yaml at the front.)

I had to manually re-share my ChromeOS Downloads folder to Linux so /mnt/chromeos/MyFiles/Downloads worked again.

Powerwash: Steam

ChromeOS now has experimental Steam support which basically amounts to a second Linux container. I just reinstalled that which was painless since Steam Cloud stores everything anyway.

The dream of the 90s is alive

There’s a couple of old ideas about computing from the 1990s that are finally sort of to fruition now.

One is the idea of a “thin client”, that the computer you sit in front of has nothing important on it and instead interfaces with what you want on the network. That’s how a lot of stuff works these days with hosted webapps. But we’ve never quite gotten free of your personal computer still being customized. The ChromeOS team put a lot of work into syncing that customization and it mostly is productive although then I messed it up again wanting a local stateful Linux environment. Also authentication is a huge PITA, no one wants to sync the actual login token to the cloud.

The other is the idea of “ubiquitous computing”, that I could access my personal computer environment anywhere I go seamlessly. Again we’re mostly there with modern Internet and cloud based stuff, but there’s still the tricky problem of local state. A simpler login system (like passkeys should be) would go a long way to making the re-authentication easier. And you’ll never completely avoid the reality that having local state on a local computer is faster than something over a network. That’s why I bother with the local Linux machine, for instance.

Windows and voice recognition

Looking for typing accommodations while my wrist is giving me trouble. I love how Google Voice recognition works on Android, you’d think that it would be even easier and better on a desktop PC. But the UI doesn’t quite seem to be there.

Update. I originally wrote this post using Windows 10. Turns out Windows 11 has an entire new thing called Voice Access and it’s quite good, just about what I need. I’ve edited the post to reflect all this, but it’s probably a little confusing.

I’m fortunate that I can use both hands still and mousing gives me no trouble, just trying to take some load off my left hand.

Windows 10

Windows 10 seems to have two different systems for voice recognition. There’s an older speech control system that is mostly focused on UI control like opening the start menu or closing windows. It has some speech to text dictation but the language model is terrible and not useful.

There’s also the newer windows dictation accessible via Win-H. It’s dictation only, not really system control, but reasonably good. However the UI’s awkward. Also the language model is not as good as what I get on my pixel eight. But it is usable.

The biggest problem is activating dictation mode. I have to click in the window I want to type in, then click this weird microphone icon that’s hovering in a fixed width window on the desktop. And even then it does not work reliably. I would dearly love to assign the “take dictation” function to something like a hot key or mouse button four. Haven’t found a way to script that. Quick searches make it look like it’s not possible.

I had thought Microsoft put more work into usability. The full speech control system does work, but it’s pretty awkward and is something you would only use if you had no alternative. And the fact it’s basic dictation speech model is no good makes it useless to me. Maybe it’s better in Windows 11? I think the full control Voice Access system is much better.

Windows 11

Microsoft did put more work into usability! Windows 11 is significantly better. The old speech control system that I didn’t like is basically gone. Windows Dictation has been extended to Windows Voice Access and gives you fairly reasonable control over the whole UI.

For my purposes, the most important thing is that the speech to text in the new Windows voice access is much better. The UI is also better. You can basically leave it running all the time, no need to press a button to activate the microphone every time you need it. It doesn’t do anything until you start talking. Then it will just insert what you say as if you typed it. That means I can leave the thing running all the time. And when I have something more extensive to say, I can talk instead of type. (Although it seems like it picks up audio from the speaker so that’s a little annoying if you are playing a video with someone talking.) The speech model is pretty good, other than the automatic punctuation system which I’ve had to turn off. Totally usable though, it’s closer to Google Board speech detection than not.

There’s a good little voice control demo that I ran through and I’m impressed that I could actually use this to control a PC with my voice if I’m patient enough. It works by you speaking voice commands. It has some generic controls for clicking named buttons or narrowing in on a region of the screen to click on. It also has some specific app integration. For instance, “close tab” seems to be something it understands explicitly to close tabs in a web browser. It doesn’t work in Chrome but it works great in Edge. Maybe Edge has extra code to interface with voice access? One drawback is there is some ambiguity. If I start a sentence with the word start or close it may interpret it as a command and not me trying to type those words. There is a dictation only mode but I haven’t figured out how to turn it on (saying “switch to dictation mode” should do it but does not for me.)

Voice In extension

Now I’m wondering why Chrome on desktop doesn’t have voice typing. It seems like it would be easy to build it into the browser. I’m finding some third party hacks like Voice In.

I gave Voice In a try and it seems to mostly work and be a lot simpler trigger than the windows built-in thing. You can bind it to any windows hotkey but in Chrome that means control or alt + a letter. I really want just a mouse button. I probably can use Autohotkey to make that happen. Being a Chrome extension makes it pretty limited but then also probably easier to integrate.

I gave it more of a try and it’s mixed results. The language model these things recognize to is so important. I was writing an email to a friend about gay stuff and it kept missing very basic words that would be common in a gay context but not in some other. Also it has a habit of capitalizing random words like extreme or City. Mostly it just made me wish I could use Google Voice typing model because I am very good at getting what I want to out of it.

Having the extension be Chrome only is a little irritating particularly when I switch to slack. I guess I could run slack in the browser. The free version works reasonably well but really you’re going to pay $60 a year if you use it all the time. It’s not a big problem not having a keystroke to activate, mostly you just leave it active all the time.

Google could absolutely build a good Windows desktop or Chrome product for voice typing. I suspect the market just isn’t big enough for them

Kinesis classic on a modern computer

My RSI is flaring up so I thought I’d fire up my ancient Kinesis Classic keyboard, the one that saved my career 20+ years ago when I first had problems.

The keyboard has an ancient AT keyboard cable. I found it with a PS/2 adapter already attached, those two ports are electrically identical so the adapter is easy. I don’t have a PS/2 to USB adapter around the house but fortunately my 2019 PC still has PS/2 ports on the back. Purple for keyboard! After plugging it in the keyboard lit up but I had to reboot to make it actually work. IIRC that’s a problem with the old Kinesis firmware. It works fine with a second keyboard on USB.

It mostly seems to still work fine. Sometimes keys seem to be repeating when I don’t mean it, like I’ll press x once and xxx is inserted. It’s not frequent though, a missed interrupt maybe? I mostly still remember how to type with it too, I suspect it’ll take a day to adjust (took a week or more the first time).

I can’t find any documentation of the custom remapping I set up long ago. It sounds complicated but the main effect is to move keys more to where they are on a normal keyboard. Here’s what I found I had:

  • Bottom row right hand: all 4 arrow keys in hjkl vi configuration.
  • []{} remapped to bottom row left hand (where left and right arrow were)
  • `~ is moved to upper left (where += is on the Kinesis)
  • += is moved to caps lock
  • Caps Lock is unmapped.
  • Escape is moved to the key marked “delete” on the thumb
  • Delete is on lower left (where ~` is on the Kinesis).
  • The Backspace key sends VK_BACK in windows, a Backspace.
  • The Insert key is default, VK_INSERT.

I also went and found my ancient notes on the keyboard firmware for programming.

Progrm-Ctrl-F10   Reset keyboard memory 

Progrm-Backslash Toggle keyclick mode
Progrm-Hyphen Toggle tones for caps lock, etc.
Progrm-F9-xx Change repeat rate to xx
F1 .5 cps F2 3 cps F3 5 cps F4 7 cps F5 10 cps F6 15 cps
F7 20 cps F8 30 cps F9 40 cps F10 60 cps F11 125 cps F12 300 cps

Progrm-Ctrl-F5 Toggle Dvorak/Qwerty mode

Progrm-Shift-F6 Toggle shift as sticky modifier
Progrm-Ctrl-F6 Toggle control as sticky modifier
Progrm-Alt-F6 Toggle alt as sticky modifier

Progrm-F12 Enter/exit remapping mode

Progrm-F11 Enter/exit macro definition mode
Progrm-F7 Make macro pause for data / End entering macro data
Progrm-F8 Put a half-second delay into a macro
Progrm-F10 Disable/Enable all macros

Shift-Shift-F12 Report firmware version (press both shift keys)

Fix for Android Pixel Delayed Notifications

I’ve had an annoying problem on my phone for two months: notifications would be delayed by many minutes, mostly only showing up when I manually woke the phone. I think I found a fix.

Turn off Adaptive Connectivity. Details in this Reddit post the text of which I will duplicate below.

Update Apr 10: after a few days of trying this I’d say turned it off has helped but not fixed the problem entirely. Updates still don’t always come immediately but they are delayed by just a few minutes now, not 30+. I don’t have solid data on that, just observing.

Update Apr 24: notifications still seem better before but it’s not perfect. Also I’ve since learned about Android Doze, a feature that dates back to Android 6 where the phone goes into a low power Doze mode. It’d cause exactly the delay problem I’ve seen. Some more discussion here. I wonder if something changed recently with the implementation that made the delay much more noticeable?

But first, a rant. This is a supremely irritating kind of problem that shows how frustrating the modern tech support experience is. There was no realistic way to get helpful info from Google about what this bug might be or how to fix it. I don’t know if there’s even any real personalized support path at all, if there is one I assume it’s the usual “turn it off and on again” useless response. Web searches didn’t get me anywhere, in part because Google’s index is awash in spam. The Android docs are not good, Adaptive Connectivity doesn’t seem to be described adequately anywhere. I did finally find my way to Google Issue Tracker which has what looks like a relevant bug entry. But that’s write-only, barely any acknowledgment.

I’m a software engineer! I understand the tech, I’m careful, I’m willing to spend the time providing expert help to reproduce and debug this issue. But I have no way to get through to someone. I guess that’s inevitable given the economics of supporting millions of users. Still irritating for my $1000 flagship phone.

Not for the first time have I wished that shibboleet was a real thing. I did get some really helpful Google engineer feedback on Mastodon after a passkey problem I reported but that was just dumb luck and a particularly friendly Googler, the right person happened to see my complaints.

The Reddit post

Are you getting delayed notifications on your phone? Try turning off the setting “Adaptive Connectivity” (under Network & internet in Android 14). I think that fixed it for me. Also check that “Adaptive Battery” and “Battery Saver” are off.

Two months ago I posted about getting delayed notifications; they’d only show up when I woke up the phone. A popular post, it keeps getting comments from people saying “me too”. Thanks to a hint in this comment I learned about the “Adaptive Connectivity” setting. I’d never heard of it before. But it was turned on; I turned it off and now 24 hours later my phone has been reliably getting notifications the moment they happen.

As a bonus, I think this may have also fixed my problem with the weather app showing me in the wrong location. Sometimes I’d get weather for Los Angeles where my IP address is rather than Grass Valley, CA where my phone is. I’m less certain of it but it’s plausible.

It’s not clear to me what Adaptive Connectivity is supposed to do, I can’t find clear docs about it. I think it may be a Google Pixel only thing? A lot of web pages talk about it only in terms of cellular, 4G vs 5G. I’m on WiFi almost always and still had notification problems. I don’t know what Adaptive Connectivity’s intent is but my experience is in Android 14 it means “break notifications”. My guess is it’s some power saving setting that is having the effect of taking the phone offline.

Note there’s other phone settings that might cause delayed notifications. Adaptive Battery is the big one (I’ve always had it off). Battery Saver mode may disrupt notifications.

Also individual apps all have battery settings. That used to be Unrestricted / Optimized / Restricted and my understanding is Optimized was supposed to let notifications through immediately. The UI for all that just changed in Android 14 QPR2 but I think it functions the same. Most of my apps are set to Optimized and are getting notifications on time.

Bottom line: turn off Adaptive Connectivity and Adaptive Battery if you are having trouble with delayed notifications.

Notes on 110ppi monitors

I had to help Ken get some new monitors for his desktop. He currently has two 24″ 1920x1200 monitors. He doesn’t want high DPI monitors, good old cheap 110ppi-ish monitors are fine. Here’s what I learned.

PC monitors come in several standard sizes. Here’s some measurements for what’s out there:

24″ monitors 1920x1200 (unusual height)

This is what Ken has now. Most 24″ are 1920x1080.
20.4x12.8″ = 522 sq in (for two)
95 PPI

27″ monitors, 2560x1440

23.5″ x 13.2″ (596.7 x 335.7 mm) = 620 sq in (for two)
110 PPI

34″ Ultrawides 3440x1440

This is what I have now.
31.4x13″ = 411 sq in.
109PPI.

38″ Ultrawides 3840x1600

34.6x14.4″ = 498 sq in.
111 DPI

49″ DQHD 5120x1440

Basically two 27″ monitors glued together
47″ x 13″ = 611 sq in
109PPI.

Resources

Screen size calculator
PPI calculator
Wirecutter 24″ monitors
Wirecutter 27″ monitors

Pixel 8 system shows out of date information

I have a frustrating problem with my new Pixel 8 phone (running Android 14). The phone often shows out of date information when it’s idle, sitting on my charger at 80% or more battery.

One problem is the weather is wrong. In Grass Valley today it’s currently fully sunny and 43° with a forecast of 47–62. I think my phone is showing me weather in LA instead. That’s where my IP address geolocates too, so it must be a dumb service. My phone knows I’m in Grass Valley with WiFi or GPS location but that information is not getting used.

The other big problem is notifications are often delayed; the Gmail app (for instance) won’t chime when I get a new email until I unlock the phone, when suddenly a flood of notifications arrive all at once.

I think the underlying problem is all the various battery saving tricks that have been added to Android. The “Adaptive Battery” feature definitely can cause delayed notifications, it says so right in the settings, and turning that off helps some. But also the “App battery usage > Optimized” setting. I know to turn that to “Unrestricted” for certain apps (like Syncthing, GPSLogger, etc) but I just went and turned it on for a bunch of core Google services like “Google” and “Android System Intelligence” following this guide. We’ll see if it helps. If the Google system components don’t work in “Optimized” it’s a pretty serious bug, Google should fix that by either changing optimization or else disabling it where it breaks things.

Part of the problem here is how complex Android settings have gotten. Here’s the full list of fixes in a guide I found to fix At a Glance weather

  1. Go to settings -> privacy -> personalize using app data (ON)
  2. Go to Google app -> Profile photo -> Settings -> Location -> Always (ON)
  3. Go to settings -> Apps - > Search for Pixel Launcher -> Battery -> Unrestricted (ON)
  4. Go to settings -> Apps - > Search for Android System Intelligence -> Battery -> Unrestricted (ON)
  5. Go to settings -> Apps - > Search for Google app -> Battery -> Unrestricted (ON)
  6. Go to settings -> Location -> Location -> Permissions -> Google app -> Allow all the time (ON)
  7. Have your location (GPS) always turned on
  8. Go to settings -> Apps - > Search for Google app -> Mobile Data & Data -> Background data (ON) and Unrestricted data usage (ON)

Got that? 8 different places just to make the stupid weather widget display correctly. Which may or may not work, and these instructions are a year out of date. Didn’t work for me; I rebooted and the phone is still showing me LA’s weather.

Even more complex.. the lock screen display of the time and weather isn’t actually configured in Android’s Lock Screen. That’s some other older system lock screen. My Pixel phone is actually using the Google Assistant’s “At a Glance” feature, which is configured separately. Well most of the time; when the phone first boots it’s using the default lock screen. It’s all a big mess.

I should add here my GPSLogger stopped logging reliably. For years I’ve coaxed this thing into running 24/7 getting my location every few minutes, something Android really doesn’t want to let you do. That stopped working two days ago, with 3+ hour gaps of no logging. I’m hoping that was just a temporary thing and restarting it will fix it, but we’ll see.

Android’s been around now, what, 20 years? I guess a bunch of platform cruft and confusion is to be expected. Maybe it’s time for a new OS to rethink everything. Or for some dedicated product manager inside Google to spend two years figuring it out, untangling it all, and coming up with a new rational design that makes all this configuration work well and be comprehensible. That’ll never happen, no promotion in fixing old shit.

Ubuntu 23.10 upgraded: signed GRUB failed

Tried upgrading my main daily driver Ubuntu system from 23.04 to 23.10 and got left with a broken system. Upgrading grub-efi-amd64-signed failed with the error Unknown device "/dev/disk/by-id/*": No such device. I tried hacking around to get it working and failed. Finally reloaded from the Proxmox VM backup I’d thankfully made before trying the upgrade. I filed an Ubuntu bug.

I’m totally guessing here but I think the underlying cause is from when I virtualized the Linux server from physical hardware to a VM. That worked, including Secure Boot and ordinary kernel updates and update-grub, but now upgrading the GRUB packages fails. On the virtual system there really is no /dev/disk/by-id filesystem right now after rebooting back to 23.04. This discussion says that’s working as intended, that virtio devices don’t have serial numbers. I assume my old physical server had entries in /dev/disk/by-id. Those old entries are referenced in the hard-to-find /var/cache/debconf file, which contains the actual configuration options chosen at apt install time. And so now when I go to update the grub package it picks up the old config which is no longer valid.

If my diagnosis is right the fix is to get the working GRUB install to reconfigure itself somehow to use whatever new path is relevant, to stop referencing /dev/disk/by-id. And only then attempt an Ubuntu release upgrade.

Update: I tried just running dpkg-reconfigure grub-efi-amd64-signed. That just prints the error about /dev/disk/by-id missing. That seems like a usability bug; the reconfigure tool should recover gracefully if the configuration is bad. I tried various other methods of convincing apt to reconfigure GRUB but the best I could do was change the menu entries or Linux command line, never change which device it thought GRUB should be installed on.

Update 2: I may have found a fix using debconf-set-selections to reconfigure GRUB. It sort of worked but not entirely.

It’d be awfully nice if the package installer had better error messaging and recovery.

Detailed notes

Some extra details that are poorly edited but I’m capturing anyway.

Looking around on the Internet I found lots of posts about upgrades failing on this package going back to Ubuntu 18.04. Lots of various cargo cult solutions. This one is clearer than most. See also here or here. All of them boil down to forcing apt to remove and reinstall GRUB.

Here’s what I did in my failed attempt to reinstall GRUB after the upgrade had failed.

apt remove --allow-remove-essential grub-efi-amd64-signed shim-signed
apt install grub-efi
update-grub

This succeeded in that it installed a new, unsigned GRUB. But the Proxmox OVMF BIOS refused to boot it. The BIOS had secure boot turned on; turning that off it still refused to boot. Probably what I really should have done was force a proper reconfigure of the signed GRUB install instead. I tried to do that but various methods of reinstalling grub-efi-amd64-signed kept failing on the missing /dev/disk/by-id/. Need to look up how to force a full reconfigure of that package.

Boy do I hate messing with GRUB.

Dump of error logs:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up grub-efi-amd64-signed (1.197+2.12~rc1-10ubuntu4) ...
Unknown device "/dev/disk/by-id/*": No such device
dpkg: error processing package grub-efi-amd64-signed (--configure):
installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of shim-signed:
shim-signed depends on grub-efi-amd64-signed (>= 1.191~) | grub-efi-arm64-signed (>= 1.191~) | base-files (<< 12.3); however:
Package grub-efi-amd64-signed is not configured yet.
Package grub-efi-arm64-signed is not installed.
Version of base-files on system is 13ubuntu2.1.
shim-signed depends on grub-efi-amd64-signed (>= 1.187.2~) | grub-efi-arm64-signed (>= 1.187.2~); however:
Package grub-efi-amd64-signed is not configured yet.
Package grub-efi-arm64-signed is not installed.

dpkg: error processing package shim-signed (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
grub-efi-amd64-signed
shim-signed
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

Here’s the entries in /var/cache/debconf that reference the missing path

Name: grub-efi/install_devices

Template: grub-efi/install_devices
Value: /dev/disk/by-id/nvme-eui.002538b22140b542-part1
Owners: grub-common, grub-efi-amd64, grub-pc
Flags: seen
Variables:
CHOICES = /dev/nvme0n1p1 (1127 MB; /boot/efi) on 2000398 MB Samsung SSD 980 PRO with Heatsink 2TB
RAW_CHOICES = /dev/disk/by-id/nvme-eui.002538b22140b542-part1

Name: grub-pc/install_devices
Template: grub-pc/install_devices
Value: /dev/disk/by-id/nvme-Samsung_SSD_980_PRO_with_Heatsink_2TB_S6WRNS0T220037X
Owners: grub-pc
Flags: seen

This might be the original install log that shows what path was chosen. If so, it gives a choice for an alternate name for the device.

2022-08-09 23:28:45,261 - cc_grub_dpkg.py[DEBUG]: considering these device symlinks: /dev/disk/by-id/nvme-Samsung_SSD_980_PRO_with_Heatsink_2TB_S6WRNS0T220037X,/dev/disk/by-id/nvme-eui.002538b22140b542,/dev/disk/by-path/pci-0000:01:00.0-nvme-1

2022-08-09 23:28:45,261 - cc_grub_dpkg.py[DEBUG]: filtered to these disk/by-id symlinks: /dev/disk/by-id/nvme-Samsung_SSD_980_PRO_with_Heatsink_2TB_S6WRNS0T220037X,/dev/disk/by-id/nvme-eui.002538b22140b542
2022-08-09 23:28:45,261 - cc_grub_dpkg.py[DEBUG]: selected /dev/disk/by-id/nvme-Samsung_SSD_980_PRO_with_Heatsink_2TB_S6WRNS0T220037X

More info on how debian is configured

# debconf-get-selections | grep dev/disk
grub-common grub-efi/install_devices multiselect /dev/disk/by-id/nvme-eui.002538b22140b542-part1
grub-efi-amd64 grub-efi/install_devices multiselect /dev/disk/by-id/nvme-eui.002538b22140b542-part1
grub-pc grub-efi/install_devices multiselect /dev/disk/by-id/nvme-eui.002538b22140b542-part1
grub-common grub-efi/install_devices_disks_changed multiselect /dev/disk/by-id/nvme-eui.002538b22140b542-part1, /dev/vda1
grub-efi-amd64 grub-efi/install_devices_disks_changed multiselect /dev/disk/by-id/nvme-eui.002538b22140b542-part1, /dev/vda1
grub-pc grub-pc/install_devices string /dev/disk/by-id/nvme-Samsung_SSD_980_PRO_with_Heatsink_2TB_S6WRNS0T220037X

Pixel cases vs Android gestures

Current phone design drives me crazy. They make these beautiful devices that look great in product shots with fancy glass backs. That are so damn slippery you immediately have to put some ugly case on the phone so it doesn’t fly out of your hand. They never show the necessary case in the product marketing shots.

Worse, the trend to slab-of-glass means there’s nothing really for the case to grab on to on the front of the phone. Cases have to have a little rim that extends above the glass. Which then gets in the way when you try to make swipe gestures from the edge of the screen, your thumb hits the raised case edge and misses the edge of the glass. This was particularly bad in the brief trend towards curved glass on the sides so there was no bezel at all.

The swiping is a real usability issue. Android makes heavy use of swipe gestures: from left for back, from right (sometimes) for delete, from the bottom to switch apps. And every single time I tried to do them the case got in the way. The raised lip is a help for protecting the phone, particularly if you drop it on its front, but it makes the phone harder to use.

Anyway, I tried a bunch of cases. Here’s a few.

  • Peak Design: the winner! This case is super thin in front, a very low profile. It’s still raised a tiny bit but so little over the phone it doesn’t get in the way. Unfortunately none of their product marketing shots show the front of the case, probably because they want to downplay the relatively ugly plastic frame that holds it on. But here’s a still from a video I made that shows it.
  • Ringke Onyx: the runner up. It’s cheap and pretty ugly. But there’s cutouts on the sides that help with side swipe gestures, see this shot. Even so the bump on the sides is still annoying enough to interfere. And there’s an enormous raised lip on the bottom which makes swiping up really awkward.
  • Caseology Nano Pop: a disappointment. Raised rim all around, no effort made to accomodate a swipe.

I considered giving up on a case entirely and just putting some sticker on the back so I could still hold it. Something like Dragon Grips. But they are so ugly. I did try ordering a dbrand skin which was a terrible waste of money. The sticker I got is still slippery. And the edgelord marketing extends all the way to customer support, the installation video has a dumb joke where the instructions to align the sticker should have been. I got a condescending response from their support when I asked for help. Screw those guys.

GRUB alternatives

I’ve never liked GRUB much. I don’t understand it and it makes me anxious. I never have good experiences using GRUB, I don’t want to use GRUB at all really. I want to use Linux. The only time I think about GRUB is when something goes wrong and my system is broken.

Anyway, there’s alternatives to GRUB in the modern UEFI world. EFI itself really was designed to be a boot loader, it’s weird we only use it to boot a second boot loader. Why not boot Linux directly?

One reason is drivers and filesystem support. EFI supports FAT12, FAT16, and FAT32. If you want to put your kernel on a more Linux-native filesystem you need something to load a driver for it in EFI first.

EFISTUB. The option with no extra boot loader. You build the Linux kernel with an option that makes it directly bootable from EFI. There is no boot firmware or OS at all; the EFI BIOS directly loads the Linux kernel. You put the kernel and initial ramdisk in the existing EFI partition, which is probably a FAT32 filesystem. Then you use efibootmgr from Linux to tell EFI about your kernel and the command line options to boot it. This seems remarkably straightforward.

systemd-boot. Yes, systemd also comes with a boot manager, a whole mini-OS. You install systemd-bootx64.efi in the EFI partition as an EFI boot manager. You put an ordinary Linux kernel and init ram disk in a XBOOTLDR boot partition and systemd-boot calls them. You can also have systemd-boot load drivers for devices and filesystems to get to your Linux kernel.

rEFInd (formerly rEFIt). Another boot manager. It has some built-in support for some filesystems and can load drivers. This one boots EFISTUB kernels, not normal kernel images.

So three different boot managers all roughly similar. Or boot the kernel directly via EFISTUB. I’m not sure in practice any of these buy me much over using GRUB. They all seem simpler than GRUB, that seems like a small advantage.

I think all of these are tricky with Secure Boot. One nice thing about GRUB is it has a binary signed by a key that commercial computers already recognizes, no work required. For the other options there’s some magic tool called sbctl that seems to be able to sign binaries so Secure Boot will boot them. There’s a step of “enroll keys”; you create your own your own signing key that you then install in the BIOS as a one time thing. Then with sbctl you can sign any binary. (Here’s some notes on a manual process instead).

With all of these alternatives you need to evaluate what your plan is to getting to a rescue mode or single user if you have to. Honestly for me my plan is usually “boot from USB”, not relying on whatever GRUB has access to. But I think all 3 boot loader OSes have some menu or command line editing. EFISTUB direct is trickier, but maybe the BIOS EFI shell can do.

Now that I have Proxmox set up it’d be easy to create VMs to experiment with this. I wonder if the OVMF UEFI BIOS they offer causes any issues. A quick search doesn’t show any clear guides on how to use alternate boot methods with OVMF but a bunch of suggestions it should work.

For that matter on a virtual machine it’s not clear using UEFI really offers any advantages over the old fashioned MBR-style BIOS. I kinda miss LILO. (IIRC, you could also boot Linux directly from an MBR BIOS with some tricks, but not sure about initial ramdisks.)

Phone migration: what I think should happen

Lots of responses to my rant about the bad experience of getting a new Android phone. A real mix. Some folks saying “worked for me!”. Some folks saying “I had those same issues but they didn’t bother me”. Not so many people just saying “I feel your pain, it should be better” but then my post was ranty enough that I expected aggressive responses.

Here’s what I would like for a phone migration experience.

Requirements

Every app should transfer all settings and data. Every preference and config. All data, including cached data you could download over the Internet again. The migration process should be more comprehensive than restoring from a cloud backup; the data is already available locally. (I’ve seen hints that Android does better with a USB wired migration vs. wireless. The Pixel 8 never prompted me to plug in a cable so I didn’t try it.)

Every single app should be aware I migrated. Most apps probably shouldn’t care but some may need to respond to a migration event so the product needs to adapt to the new hardware somehow.

Low stakes apps like Spotify should keep me logged in. The migration was a secure process, my login tokens should transfer too.

High stakes apps like banking or a password store might choose to reauthenticate me after migration, for extra security. But the app on the new phone should already know who I am, already have my username pre-filled. Apps that require two factors for login on a new install should only require one of those factors on a migrated phone.

Some apps require you do something on the old phone to migrate, like de-register it. Those apps need to treat that requirement as a serious thing requiring explicit user action. Notify me during the migration if I need to do something on the old phone. “Hey, you need to do something special for this product”. As it stands now for some apps (Volvo, WhatsApp, Battle.net, ...) you only notice you have to do something on your old phone when you get around to launching it on the new phone. That may be several days later, after you’ve already wiped and sold your own phone. That’s not acceptable. (I literally spent a couple of hours launching every single app to make sure it worked. Don’t make me do that. I’m still scared to wipe and sell the old phone.)

Google needs to work with cell providers to migrate cell service better. This used to be great on iOS, not sure if it still is. All Android says is “lol contact your cell provider”. Maybe the Google Fi version is nicer?

Google should respect my ad privacy settings on migration. As it stands now Android uses a migration as an opportunity to trick you in to agreeing to being tracked.

I’m on the fence whether Android should copy over app permissions. It doesn’t seem to, at least for location, file access, and biometrics. OTOH a migration is a chance to fight the proliferation of promiscuous permissions. That e-commerce app really doesn’t need my precise location.

Commentary

A lot of people responded “it’s an inconvenient experience because of security”. Sure, security-vs-usability tradeoffs are often tricky. But make the tradeoff explicitly, on purpose! Not just this lazy mess. And for security, wouldn’t it be better if the product recognized that it’s not a new install, but rather a secure transfer from an old install? A migration is a different, lower risk. Most of the apps I used don’t do anything that nice, they just reset me back to zero. I suspect they do this because it’s easy and they trust that process is relatively secure rather than building a special migration experience. They didn’t put any product effort into the tradeoff during migration, they just made it inconvenient.

Many of my requirements are predicated on the assumption that the migration itself is a secure process. That no hacker can produce an unauthorized clone of my phone and use that to access my bank account. I am pretty sure Google designs for secure migration and trusts it. But I can understand why my bank might not trust Android. So fine, require I log in again if the stakes are high. But at least design that process nicely. The bare minimum is not making me type my username again.

Secure hardware enclaves complicate migration: it may not be possible to move some data. I don’t know Android well enough to know how prevalent that is. I don’t think it explains most of the problems I saw.

Both 1Password and Aegis did a good job on migration. These are some of the most sensitive apps I own; both migrated my data in a way that I trust is secure. They did require me to reauthenticate but that process was simple. Both already had my data and knew who I was. This proves that secure convenient migration is possible on Android. My guess is their product teams put a lot of effort into making migration work well, it’s a primary feature for both.

Several simpler apps also migrated well. (Yay Paprika!) And Google’s apps also mostly did a good job on migration. Not exactly a surprise, they control the whole platform. Also they have a very clear authentication and account model, most of their apps just trust the system’s Google login. I logged in once to Google during the setup process and then my Gmail, etc was already available. Wallet and GPay were exceptions, both had problems.

Special shout-out to the Wikipedia app which kept all my tabs during the transition. That was a nice surprise!

Migrating to a new Android phone sucks

I upgraded my Pixel 6 Pro to a Pixel 8. I just spent some five hours getting the new phone working the way the old one did. It was a terrible experience. Getting a new phone isn’t a delight, it’s an awful chore to be avoided. Every product manager and engineer involved in this mess should feel bad. FWIW it was bad two years ago when I did this last time, too. My impression is the iOS migration experience is much better. (Update: mixed opinions about iOS on the Fediverse.)

Update: see this followup.

(Content warning: this note is a bit ranty. I felt it was important to capture the emotional experience.)

Broadly speaking, the problems fall into several categories:

  1. Data not copied over to the new phone
  2. Random app settings not being configured
  3. Having to log in to every app
  4. Security critical stuff
  5. Getting the cellular contract to work
  6. Google being sleazy with surveillance

I think the underlying problem is the Android platform must not specify how migration is supposed to work well enough that every app gets it right. No one owns the whole migration product: it’s partly Google/Android’s responsibility, partly the phone manufacturer’s (Google in my case), partly the carrier, and partly the apps’.

Also I can imagine each app / product owner not thinking it’s a big deal. “Migration only happens every two years, no need to worry about it”. I bet these products lose 5–10% of their customers every two years. Also the problem is much worse for the individual because they have to manage 100+ app migrations all on the same day.

It’s not like it’s not possible for migrating to a new phone to work. Some things even do work in Android. The little mom & pop Paprika app migrated perfectly. All my recipes on the new phone, still logged in. So did Libby, the public library book borrowing platform. But many other well funded apps sucked. High stakes things like my banks or Uber, but also low stakes things like my Spotify account. My suspicion is the product people for most of these apps just don’t care enough to make it work.

Details

Do I have detailed notes? You bet I do!

Data not copied over to the new phone

Android has a fancy migration tool for new phones. It’s pretty slick! Wireless, auto-discovery, relatively quick considering what it’s doing. And it does successfully copy a lot of data over. But not everything. For instance all of my music files copied over. But the 3GB of map databases Organic Maps had? Have to download those again. Also the 80GB of Wikipedia database from Kiwix. I suspect there’s a deliberate decision here not to copy this data since it can be downloaded again. It may be tied to the set of data that’s backed up. But re-downloading 80GB over the Internet is a big burden and the data is right there for the copying.

Google Wallet kept my credit card, the most sensitive item it had. But it lost my Clipper transit card. Also lost my Covid vaccination record (again). Maybe no one on the Google Wallet team cares enough to make sure the user’s cards in their wallet transfer over. Just empty the wallet into a fire and start over.

Random app settings not being configured

A whole lot of apps had to be reconfigured. A few apps copied their configs over entirely, worked great. Most didn’t even try, I started new. A few special apps copied some settings but not all. A whole lot of apps treated me to a New User experience, some condescending 8 page onboarding slideshow like I’d never used the product before. (Including, bafflingly, a few that had copied my configs.)

A related detail: all my system settings for app permissions had to be re-enabled. I had to manually tell the phone, again, to allow the maps app to know my location and the file manager app to access my files. I think my notifications preferences were kept though.

The notes from the Niagara Launcher app are possibly instructive here. “We’re currently using Google’s Backup implementation, which is not 100% reliable...” In my case I had to fully reconfigure Niagara. There’s a feature request for Niagara to implement its own settings export / migration tool. Some of the apps I use have those but I didn’t use any of them because the process of juggling the settings file was too tricky. It should just sync to the Google Cloud Backup Drive Panopticon, why does this not work for every app consistently?

Having to log in to every app

A huge PITA is that most apps are basically just wrappers around a website. And almost all of them demanded I log in again. I suppose they think this is “for security reasons” but for 90% of the apps there’s very little risk. It doesn’t help that the login process is a PITA. I use 1Password for logins and for about half the apps it works very well, I just tap a button in the keyboard and it fills. The other half? I have to cut and paste across two apps. Or the new trend, the app doesn’t even let you use a password but insists on sending an SMS message with a login code. Which cuts 1Password out of the loop entirely.

Security critical stuff

A few apps have special security needs, I expected them to be awkward to migrate. Except: they aren’t! Both 1Password and Aegis (my 2FA store) worked great. I think I had to type a password into each one once on the new phone. All data, login tokens, etc transferred. Because they care to get it right.

By contrast the various bank apps and other things with material consequences to security all sucked. In all cases it was basically like I was installing a new app for the first time on a new device, no aspect of the transfer worked at all. Only because these are security conscious products the new app setup process is always onerous.

And then there are the special apps that insist I do something on my old phone to deregister it before it will let the new phone work. The geniuses at Volvo managed to build a car where if you lose your phone or uninstall the app you have to factory reset the entire car software in order to connect a different phone to it. Fortunately I have the old phone and could unpair it but I still haven’t paired the new phone because I have to have both physical car keys with me to pair a new phone. The Android migration tool did nothing to help me here.

I was going to check what happened to my Passkeys but hahaha I have no Passkeys because that technology rollout is going very poorly.

Getting the cellular contract to work

Another special case I have a little sympathy for: migrating cell service is tricky. And very security important, given how every app treats SMS to your phone number as a primary means of identification. I give Verizon credit here, the transfer process was actually pretty good. eSIMs should make this simpler but in practice make it more complicated since there’s no physical object to move your identity on. But it still worked mostly fine, although Verizon’s website and docs are wildly inconsistent on what you need to do to migrate. (The obvious thing worked for me without talking to anyone.)

But Android did nothing at all to help make my phone be a phone. Why not recognize I’m moving a phone with a Verizon contract and help migrate the eSIM service over at the same time?

Google being sleazy with surveillance

A special bonus here. Somehow Google forgot my ad privacy preferences. Google rolled out a whole new ad privacy setting this fall. I immediately opted out of all surveillance on my phone and my Google Account. But despite migrating a Google Account opted out on a phone opted out, the new phone demanded I set my ad preferences up again. Defaulted to full tracking. Twice: once for Chrome and once for the phone device itself.

Of course Google knows exactly what they’re doing, it’s not a bug. They want desperately to track users but they need to maintain the fig leaf that we somehow consented to the tracking. So the phone transfer doesn’t transfer the privacy settings and resets me to full tracking. But this game they’re playing undermines their goal. They clearly ignored my informed preferences and tried to trick me into undoing them. That’s not informed consent, that’s fraud. I know to pay close attention for this garbage but most users won’t follow it.

Conclusion

Phew, feel better getting that rant out. But seriously, the experience of migrating one Android phone to another is really bad. It’s a mess of a difficult problem, complicated tech that apparently doesn’t work right, and a product conundrum that no one cares enough about to fix.

BOSGAME B100 thoughts

I bought a cheap new mini-PC for Linux, a BOSGAME B100. I don’t have a lot to say about it except it has made a very good impression, particularly for the price.

Update August 2024: the cheap SSD in this thing failed after 9 months. Gave errors on reads sometimes. I still like this product category and it’s easy enough to replace the SSD, but ugh.

There’s a bunch of these generic inexpensive mini PCs on the market now based on Intel N100 CPUs (or before, N95). Beelink is a popular brand; I picked the BOSGAME because it would ship same day. I bought it from Amazon for $160 (with a coupon).

It’s wild how cheap these are for the capability. The CPU has 4 cores that can run up to 3.4GHz. 16 GB of RAM, 512 GB SSD that reads an honest 500 MByte/sec, a 2.5GB ethernet controller from Intel, 10 Gbps USB 3.2 ports. Supposedly 802.11ac and Bluetooth but I haven’t checked if they work in Linux. None of these parts are top of the line. For instance, the RAM is DDR4-3200 but it’s a single module (not a dual channel pair) and it’s CL 22. You can get SSDs that are 50% faster. But still, it’s pretty capable hardware. And that price!

It’s actively cooled with fans. I can’t hear the fan when it’s idle, I can hear it but it’s not very loud running at full load. One drawback of its design is it has the exhaust fan in the top, which means you can’t put anything on top of it. You could stack the Intel NUCs. (For an alternative see these fanless designs on sale here. But that’s got a big ol’ heat sink on top, still can’t stack it.)

Stress-ng gets it to 61C, the CPUs stays at 10.6W and 2900MHz. Plex actually works it harder when it scanned my video library for the first time. I saw the CPU peak around 76C, 14W, and 3300Mhz or more on all 4 cores. It’s using the GPU too, at least sometimes. The fan is a little noisy but the system is stable. Can’t find fan speed with lm-sensors.

The server seems to draw about 7W when running but mostly idle; the CPU package is using 2W of that. stress-ng on all CPUs gets the system to 19W, CPU package at 11W. Mind you that includes a spinning laptop drive which is 3W all in itself. It’s just remarkable how low power it is.

Samsung vs Material You

I wrote about this awhile back: creating a new Android UI with Niagara Launcher, dynamic backgrounds, and colored icons. The neat trick is Tapet can set a background with a random palette, then Niagara can pick that up and make the icons match the colors of the background. It looks great on Pixel!

It does not work on Samsung devices, because of a bug / design flaw in their OneUI. Samsung’s Material You colors ignore the screen background and are by default some boring blue. You can statically change the blue to something else with Theme Park, but there’s no way to have it dynamically set based on the background something else sets.

I just documented this all in painful detail in this Tapet GitHub issue. The interesting thing is the author clarifies that Tapet is not actually a Live Wallpaper app, it’s doing something similar (or older?) with simple static backgrounds.

I think the Live Wallpaper app Muzei was briefly working the way I wanted on Samsung. Muzie set the background, then Niagara picked up the new colors and changed the icons. But I tried the same thing today and it didn’t work, so maybe I’m wrong.

Windows fan speed controls in 2023

Computer fan noise was annoying me in my office, this high pitched whine. So I went looking for Windows software to understand what my desktop was doing.

LibreHardwareMonitor is a good open source program for monitoring fan speeds. It’s a fork of OpenHardwareMonitor, which stopped getting updates in 2020. You just run it and it quickly gives you a list of fan speeds, CPU temperatures, and a bunch of other hardware sensors. It has support for a whole lot of hardware and requires precious little effort to get going.

Usually a PC’s BIOS controls fan speeds. My ASUS X570 has a fancy thing called Q-Fan which has little control graph settins of fan speed vs temperatures. This works pretty well. My vague memory is if you run the “Optimize” thing in the BIOS once everything works better, but you still want to tweak it manually afterwards. (Bonus memory: the Apple keyboard I usually use is not capable of opening the BIOS with F2/Del. Something weird about how it initializes, or rather doesn’t. I have to plug in a standard PC keyboard to open the BIOS.)

Fan Control is an open source program to override the BIOS’ fan settings. If you ever used the ancient SpeedFan program, this is a better version of the same idea. It has a very slick setup system where it enumerates all the fan controllers, then tries changing input power and then sees what the fan RPM sensors tell it happened. Once it’s set up you can then manually alter fan speeds (overriding the BIOS) or enable one of several “Curves” which automatically change fan speed in response to temperature or other sensors. I decided not to use this but if I wanted to do more than the BIOS’ settings, I would.

CPUStres is a Microsoft Sysinternals program to generate CPU load to test your cooling. I found this really confusing to use.

HeavyLoad is a third party program for generating load. It’s no cost but is not open source. it’s easy to use to peg your CPU and GPU to 100%. It has a weird bug where it launches but the GUI doesn’t get events; if you switch to another window and back it seems to work right.

I spent half an hour figuring out what the fans were in my computer.

  • Fan 1: the fan at the back of my computer chassis. Very quiet even at full speed, software controlled. Usually runs at 550RPM, max is about 830.
  • Fan 2: the fan in the middle of the Noctua NH-D15S CPU cooler. This gets a little noisy at full speed (1500 RPM) but usually runs more like 550 RPM. It’s the fan I hear when my computer gets busy and is a little annoying, but sounds like moving air and not a whine. Software controlled.
  • Fan 5: no idea what this is, it shows as 840 RPM almost always no matter how busy the system is. It is software controllable and I can hear it, but I never did quite find where it was. The ASUS BIOS shows an “AIO Pump” running at 840 RPM but I certainly don’t have any pumps or liquid cooling. Maybe someone reused the motherboard header for a fan for the motherboard chipset or something?
  • Mystery 2866 RPM Fan. The BIOS shows me a PCH fan running at 2866 RPM. I have no idea what that would be and there’s nothing running loud enough to be that fast. The speed slightly varies so I suspect the sensor is hooked to something.
  • Power supply fan. My Corsair RM750X has a fan. It has no software interface at all but does turn up or down based on temperature. It seems very quiet.
  • NVidia 1080 GPU fan. Almost always entirely off, gets up to 650 RPM or more when the GPU is busy. It’s pretty noisy when it turns on.

The ironic conclusion to all this: the noise wasn’t coming from my Windows machine at all. But rather the NUC Linux server in the closet. Noise goes away when I close the closet door, d’oh. This is the same NUC that is overheating and is unstable at full CPU speed. The fan does work, I haven’t looked at controlling it.

Towards a calmer Android home screen

I just completely changed how my Android devices look and couldn’t be happier. I switched from the usual “grid of random icons” to a clean monochrome look. I like the result, here’s screenshots from my phone and tablet. Edit after 6 weeks I like it even more. Read below for notes on how I did it.

Background: Tapet

The simplest part is the screen background, generated by Tapet. That’s an app that makes a new abstract image once an hour. It’s tweakable, I’ve set it to 60% Adaptive Dark and 10% Blur so the images are less distracting. (The pink screenshot is without the dark setting.) Tapet has been around a long time and is great. You can use it on its own without the other stuff. It’s free but it’s worth paying a few bucks for the premium unlock.

Launcher: Niagara

The big change; I switched from Pixel Launcher and Nova Launcher to Niagara Launcher. That’s a pretty major change to phone UI and I really like it. Niagara has you choose ~8 apps for the home screen (as seen above). Then the rest of the navigation is based on a really neat rolodex UI that lets you pick an app out of a list alphabetized by name. I’ve been launching apps by searching by name for years now; this picker is way better than typing the name!

Beyond that Niagara has a limited but thoughtful set of features to help you keep the home screen clean and minimal. Despite that it also packs in some great detail. See the text on Moshidon on the left screenshot? That’s an Android notification displayed inline in the launcher. There’s also a fancy “popup” feature that’s like folders but better, when I tap on News I get a nice popup of various news related apps.

Niagara is free or $10/year for the not-really-necessary Premium.

Icons: Pix Material You Light/Dark

Niagara can replace the app icons with an “icon pack”, something you download from the Google Play store. These packs contain thousands of icons, both specific ones like “Slack” and generic ones like “Video”. Niagara does a great job helping you use these icons. Google is encouraging all apps to provide a monochrome icon for Material Design but even after two years most of my apps don’t have them. The icon pack lets you override them.

The icon pack I’m using is Pix Material You Light/Dark. These are monochrome icons that adapt to the device theme (more on that below). It’s $2, well worth it. Another nice option is Whicons, all white icons (there’s a black version too), it’s free. I prefer the shapes of Pix but they’re both good.

Weather: Weawow

Niagara lets you have one widget visible on the home screen. I picked Weawow for weather. My first choice would be Windy but its widget is full of colors. Weawow has a nice simple monochrome widget that looks clean. (Does anyone make a weather widget that uses adaptive colors?)

Colors: Material You

Here’s the tricky part: the icons adapt to the colors on the background screen recently generated. See the pink cast to the app icons on the right that matches the pink background? That’s Material You design in action. The system picks a color based on your background screen and customizes all the UI to use that one color as a highlight. And it changes every hour. Subtle variety.

Niagara works well with Material You, most of its UI elements are themed to it. And it can re-color an icon pack to match the Material You color. Works great on my Pixel phone. Unfortunately Samsung chose to break Material You. As Niagara explains, “On Samsung devices the Material You palette consists by default only of shades of blue, no matter what wallpaper you have applied.” Samsung’s apparently really committed to their brand identity color. You can use the Samsung Theme Park app to edit it: it will still be stuck to one color, but at least that color can be white. That’s what I’ve done on the screenshot on the left.

Thoughts

I always feel guilty spending time customizing my environment, but I think it was worth it this time. I’ve got something that looks clean and fresh. And it shouldn’t require much updating or maintenance. I feel like Google is working its way to this kind of look in Android; the core concept I’m using is just an extension of their Material design. But the Niagara launcher is a pretty radical departure.

Update

I like this setup more and more as I use it. Niagara just launched a new version with “Anycons”, its own set of monochrome icons that can be recolored. They are very nicely drawn and it looks great, I’ve replaced the Pix icons. Unfortunately the Samsung bug is still there and still breaks the color detection, see more notes on that. Niagara now has a set of static options you can pick that look fine on most backgrounds, including a neutral white.

Obsidian Sync

I’m really liking Obsidian as my note taking app. I just paid $10/mo for Obsidian Sync, their syncing solution, and had some thoughts. This was originally an email to their support team.

Obsidian Sync mostly worked great. The docs are good. It feels like a solid product.

I previously was syncing with Syncthing. It worked mostly fine but was a little awkward. The thing that got me to buy the service was not having a great way to run Syncthing + Obsidian on a Chromebook.

I really balked at the $10/month or $98/year price. I’m sure they’ve heard a lot of complaints about the price and have their reasons. But if it were half the price or less I would never have set up SyncThing in the first place. FWIW I think 1Password is a good comparable at $3/mo for a single person.

Migrating to Obsidian Sync was a bit tricky; a lot of juggling of vaults, passwords, state. The extra steps to sync Obsidian settings and plugins were particularly confusing. This is the primary customer acquisition pathway, some streamlining here would help. None of the steps were technically wrong! Just awkward and given how easy it is to screw everything up with sync, a little nail-biting.

That reminds me they totally undersell one of the best features of Obsidian: the vaults are just simple text files and some JSON data! It’s so easy to make a backup of a vault or move a copy. So many systems (like 1Password) are opaque; Obsidian is refreshingly transparent. Ironic, given the product name ;-)

My new Acer Chromebook Spin 714 (2022)

I finally picked a Chromebook to be my travel laptop; an Acer Chromebook Spin 714. Specifically the 2022 model, CP714-1WN-53M9 SKU:6507836. I got this on sale for $529 from BestBuy, I probably wouldn’t have bought it at the usual $729 price but I’m glad I got it on discount. (Chromebooks often go on discount, it’s weird.)

It’s very good hardware! The screen is nice and bright and at 1920x1200 has enough pixels. The keyboard feels fine. The system feels quite fast, a combination of ChromeOS being responsive and the CPU in this thing being pretty high power for what it’s doing. Unusually it also comes with 3 USB ports (two USB-C) and a dedicated HDMI output.

Note there’s no SD card slot. The 256GB of SSD is more than enough for normal Chromebook stuff though. I have a complaint about the trackpad. It’s a little floaty, apparently a design flaw with inexpensive laptops that you might be able to fix yourself. I’m also not thrilled about the vents and fan; the fan comes on a little just sitting in my lap if my clothes are blocking the bottom vent at all. Ut doesn’t spin if sitting unobstructed on a flat table. And it’s very quiet when it’s running but there’s a difference between no fan at all vs. a very quiet one.

It’s a “Spin” which means the hinge rotates all the way around so you can use it fold it backwards and use it like a tablet. (Touch screen or stylus, the keyboard and trackpad get disabled). I was thinking that’d be a great feature but now I don’t; it’s just too bulky and awkward. Also the hinge doesn’t fully lie flat so it feels a little springy, like it might break if you press wrong on it.

One nice surprise is that Steam is available in beta on ChromeOS and a bunch of games seem to work well on it. The Chromebook isn’t going to win any gaming benchmarks but some games with light 3d were perfectly playable. I wouldn’t recommend buying a Chromebook for gaming, particularly not this one, but it’s nice to have the option.

The main thing I like about it is the screen. Bright, clear, and while not high DPI text looks pretty good on it.

Alternatives

Acer is now offering a slightly updated Spin 714, the CP714-2WN at $699. That one is mostly the same. Slight upgrade to the CPU (13th generation vs 12th) but the rest seems the same. They took out the stylus from the package, that’s kind weird.

I kind of wish I’d bought one of the Kompario 1380 systems. Either the $489 HP x360 13b-ca0047n or the $599 Acer Chromebook Spin 513 cp513-2h. That latter one is particularly interesting for its 2256 x 1504 screen. The ARM CPU means lower power so they have longer battery life and are truly fanless. OTOH ChromeOS on ARM is a mixed bag. It won’t matter for basic stuff but if you’re installing Linux you need arm64 packages that may not be available. And Steam is out of the question AFAIK.

I was pretty impressed with my $120 Chromebook, an old Acer 311 also based on an ARM processor. Still a great value.

Update

Worked great for my recent trip to Ireland! Didn’t miss having Windows or MacOS, not even once. Loved the light machine with a big bright screen. Really appreciated that it doesn’t need its own proprietary charger; I guess most laptops charge via USB-C now but this was my first one and it’s great to have a lighter bag.

Chromebook, Ubuntu, Crostini and other containers

ChromeOS has nice support for running your own Linux distro in an LXC container. By default it installs Debian in a container named “penguin” and there’s a Terminal app to connect to a shell in it. I’d rather use Ubuntu. There’s lots of instructions on how to do this online but most of what you’ll find are using the outdated Crouton container environment.

The 2023 way of setting up Ubuntu on a Chromebook is with Crostini. This Reddit Wiki has thorough instructions. This article is also fairly good as is this outdated gist. It boils down to launching a special Termina shell to control containers. Then to install Ubuntu in a new container, then to install some Chromebook specific stuff, then to set up your user login.

All that being said I could easily set up a container with a different Linux distro but I couldn’t get it to connect nicely to the Terminal GUI app. This is all pretty complicated tinkerhacking. One reason I’m excited about ChromeOS is you don’t really need to do this kind of thing for an ordinary experience. But I’m being a little extra about a Linux environment.

Alternate distro support is a work in progress and there’s lots of notes about current development online. I stopped about here, which was instructions on telling Terminal how to connect to a different container. This is related to the crostini-multi-container flag in about:flags. That’s a feature that gives you a GUI for accessing multiple containers but is not complete. See also discussion here.

A failed Ubuntu install

Unfortunately the online instructions didn’t work for me with Ubuntu 23.04 and ChromeOS Beta 114.0.5735.18.

One problem is the Chromebook-specific stuff (cros-ui-config and friends) failed to install, either using the fancy script or just running “apt install” and hoping for the best. The Reddit Wiki has complicated instructions and a script for installing cros-ui-config. I guess the packages are still not working quite right but different hacks are needed than what that script did. These didn’t work for me with Ubuntu 23.04 and ChromeOS Beta 114.0.5735.18. Simply running apt install cros-ui-config got fairly far but failed in the end.

Worse, even a vanilla Ubuntu 23.04 install (without cros-tools) didn’t work right for me. It seemed to be fine, I could get a working shell with lxc exec. But then I couldn’t connect to it via the Terminal app, the little spinning progress thing ran and stalled without giving me a shell. It’s like whatever connects the ChromeOS UI to the containers wasn’t working. I couldn’t even completely wipe the Linux development environment from the Settings app, it also hung, although the wipe did work after a reboot. At least I didn’t have to powerwash the whole system and start over.

For now I’m just going to settle for Debian. When I feel like tinkering again I’ll revisit Ubuntu, maybe update this blog post.

Other containers and VMs in ChromeOS

It’s not just a Linux environment that uses a container on a Chromebook.

Modern Chromebooks run android apps in a container called ARCVM. I don’t know much about how this works, it’s all pretty opaque. Folks complained it uses more resources than the old method but it seems fine to me.

ChromeOS 108 got the ability to run Steam games. It does this with a VM environment called Borealis. From what I’ve read this is Ubuntu 18.10 and using Valve’s Proton stuff to emulate enough Windows API to run a lot of games. Ie: similar to what a SteamDeck is doing.

This is all a lot like what Windows does, btw; WSL is the Windows equivalent of Crostini, and Windows can run Android apps in a VM too.

Chromebook shopping

I’m on the hunt for a good Chromebook, a real laptop for travel. The cheap Acer 311 C722-K4CN I bought is fine but underpowered and not a great screen (low res, TFT not IPS). I want something with a touchscreen and sturdy hinge but that folds back 360° so it’s like a bulky tablet. Would like a fingerprint reader and decent speakers. And I want an ARM processor, not Intel, on an unsubstantiated theory you get more life on the same battery.

Lenovo is about to come out with a $270 Lenovo IdeaPad Slim 3 Chromebook. It looks good except that the hinge doesn’t do 360°. Also it’s marketed as “budget” but it seems plenty powerful enough to me.

HP has a $370 HP Chromebook x360 13b that also looks promising. This review and this one note “bottom firing speakers” which is not great. Also no fingerprint reader. Still it looks good, particularly at $100 off the original price. If I had to buy one today it might well be this one.

Shopping for Chromebooks is so frustrating. HP makes 17 machines named Chromebook x360 that all look pretty different. The “13b” is the only ARM one. Apple does so much better at marketing their laptops.

Insisting on ARM is really limiting my options. Maybe I should give up on that.

What I really want is an OLED screen. The only option I could find is the Lenovo Chromebook Duet 5. But it’s a detachable keyboard which doesn’t meet my “sturdy” requirement. In particular I need to be able to hold it by the keyboard and have the screen stay put. Could be an interesting alternative to my Samsung Android tablet though.

Update: needed this sooner than I expected so I ordered theHP Chromebook x360 13b-ca0047nrr for $409. Note this is slightly updated from the 13b-ca000 that until recently was the offering. The newer one has a faster MediaTek Kompanio 1380 and 8GB of RAM. Reviews for this machine are mostly positive with the main complaint being the screen is nothing special (1920x1080, 250 nits). I was sorely tempted by the Samsung Galaxy Chromebook 2 360 because it has an amazing screen: 2560 x 1600 and 350 nits. But the $450 model has only 4GB of RAM and a Celeron N4500 and reviews said it felt underpowered, even for a Chromebook. I’m going to keep using my Android tablet for high end video stuff so I’m OK with the better computer with the less exciting screen.

Update 2: ha, cancelled the HP order and am getting a Acer Chromebook Spin 714 instead. They’re on sale right now for $529. Compared to the HP laptop it’s a brighter screen (350 nits vs 250 nits), better speakers, and significantly faster (80,000 octane vs 30,000, according to videos). Downside is it’s not the ARM processor I was hoping for but, eh, that was a bit of a silly thing to stand on. The Acer apparently gets an honest 10 hours of battery life which is plenty (compare “up to 16” with HP).

I’ll add that hp.com is a miserable place to try to buy something direct. The ordering experience is OK but then it takes 2+ weeks to ship? Maybe it’s backordered. But then cancelling is a nightmare. There’s no automated order cancellation, you have to talk to support. Which takes 10+ minutes and involved three separate attempts to retain my order and/or sell me something new. And at the end of that I’m just told “we’ll try to cancel your order let you know in 48 hours”. So dumb.

Migrating Joplin to Obsidian, metadata

I’m migrating from Joplin to Obsidian for my little personal notebook. Some notes on doing that with metadata for each note.

Migrating note text is easy. Joplin has an export-to-Markdown option that creates simple .md files that can just be dropped into the Obsidian vault directory. Done. However, that doesn’t preserve any metadata the note may have.

You can get Joplin to export the metadata as well by choosing “Markdown with Front Matter” as the format. That will add tags for each note, here’s an example:

---
title: My Note
updated: 2023-03-21 17:32:36Z
created: 2021-11-08 16:12:48Z
latitude: 37.30000000
longitude: -121.80000000
altitude: 0.0000
---

It’s the dates I care about most; Obsidian’s default UI shows these when you hover over a note as “Last Modified” and “Created”.

Last Modified is pretty easy; Obsidian seems to be using the file mtime timestamp. I wrote a little Python program that parses that date and sets the mtime on each file accordingly.

Created is harder or impossible. Unix and Posix have no way to store the creation time of a file. (There’s ctime, but that’s actually the creation time of the inode and can be demolished in various ways. Also there’s no clean way to set that on a file.) I’m not sure what Obsidian is showing; NTFS on Windows does store creation time so maybe that’s what it’s using? There’s reports of people saying it gets broken when you use Obsidian Sync, so it’s apparently not reliable. I just gave up on it. I’m honestly not sure why Obsidian even shows this in the UI if it’s not correct.

The other metadata folks often care about are tags. I never set tags in Joplin so I didn’t look at it. But I think it’s as simple as reading the tags from the Joplin export and then sticking them in the note as #hashtag style tags in the body of the note. Or alternately...

Obsidian does have a way to put arbitrary metadata in a note; frontmatter, just like the Joplin export. You can use that for tags as well. For now I’m not using those. Note as near as I can tell there are no standard metadata keys for note creation time, that’d be a solution to that problem. I think some parts of the plugin ecosystem have a standard set of metadata keys they use, maybe including creation.

Thoughts on Obsidian

Obsidian’s nice! Every single time the Joplin UI bugged me I realized I should try this obviously better thing.

Obsidian also has a very active user community. I’m leery of getting deep into a complex note taking tool; I’d prefer mostly just simple text files. But it’s kinda neat to see what complex things folks are doing with it, also all the plugins.

For syncing.. this is still an experiment, but my plan for now with Obsidian syncing is to use SyncThing. Now that I understand how SyncThing deals with conflicts I’m not worried it’s going to fail in some inscrutable manner. If that doesn’t work well I’ll buy Obsidian Sync. I confess I’m balking at the price; $100/year seems like an awful lot. Maybe I should think of it as paying for Obsidian itself plus the extra network feature.

I’ve installed it on Android too and synced following these notes. Seems to work so far.

I need a good HTML export option, I like to write blog posts in Markdown and then post them to my blog, which needs HTML fragments. There’s several plugins that do it, need to pick one. I’ve tried 3-4; the two “copy as HTML” result in nothing useful in my clipboard. One of the “save to file” ones does sorta work but sure generates a lot of extra CSS, etc to make the HTML look fancy. I just want a simple HTML fragment conversion.

Update

After a couple of weeks I really like Obsidian. I’ve switched entirely over to it. Mostly I just liked the UI; say what you will about Electron bloat but the web UI + command palette paradigm makes for some nice apps. (See also: VS.Code). I still feel a bit strange about how powerful and complex Obsidian can be. Folks on Reddit are sharing their 10,000 document knowledge bases full of interlinking. But it works fine also for just a few simple text notes.

SyncThing on the folder is working fine for me to sync between two desktops, a laptop, and two Android devices. I’d rather be using Obsidian Sync but can’t quite get myself to pay the price for it.

For HTML export I’m using Obsidian Enhancing Export, the consensus choice. It uses pandoc. Honestly it’s overkill but the HTML it produces is nice. In particular it does “smart quotes” in the output, something most of the other HTML exports don’t do.

Economist Android app: two bugs when changing font size

Finally figured out what causes a couple of bugs that have been driving me crazy in the Android app for several months now. Both are caused by changing the font size of articles (with the Tt button displayed at the top of every article screen).

The simpler bug is that if you increase the font size from the default, the last paragraph’s line spacing is incorrect. It looks like every other paragraph has the line spacing adjusted to match the font size but this last paragraph does not. This is 100% consistent and reproducible on both my phone and tablet. Screenshot below.

The more pernicious bug is that sometimes the navigation at the end of the article doesn’t work. It’s a bunch of links to other articles in the same section. But tapping them sometimes takes you to some other story, generally one or two above the one you tapped on. I think this is also triggered by changing font sizes. (Could it be the page is calculating tap zones based on the original font size layout, not the visible one?) I can’t reproduce it 100% reliably.

Broken line spacing
This navigation menu doesn’t work

Syncthing and conflicts (also Joplin)

I’ve been using Syncthing for several years now to sync several gigabytes of files, mostly various kinds of user-generated documents. Like my entire personal source code repository. Also my Joplin notes. Across 3-5 systems: Windows, Linux, and an Android device. It works great. I’ve never had to think about it much. But something went wrong with Joplin recently and I learned something...

Syncthing has no conflict resolution tool.

Seriously. Syncthing detects conflicts and does something sensible with conflicted files but does not offer any sort of merge tool or UI to help you know about conflicts and deal with them. I got confused because SyncTrazor, the Windows UI for SyncThing I use, does have a simple GUI Conflict Resolver. But there’s nothing like that in the main SyncThing web-based GUI.

All the core SyncThing does if it detects a conflict is try to guess which version of the file should be canonical. It has some heuristics based on modification dates and will prefer a modified file to a deleted one. It then renames the discarded version as <filename>.sync-conflict-<date>-<time>-<modifiedBy>.<ext>. That gets kept forever as a regular file also in your syncthing store and gets synced just like any other file. It’s up to you to notice these conflicts and do something about them; syncthing will not tell you about them. (Hilariously, you can have conflicts on conflicts and end up with files named ...sync-conflict-…sync-conflict -…-sync-conflict...)

I’m not complaining about Syncthing; what it does is very simple and understandable. Conflict resolution is hard and subtle, better not to do anything than do a bad job. Automated merge strategies are possible but fraught with dangers, and manually requiring users to merge is not in keeping with SyncThing’s background nature. OTOH I’m a little spooked that these potential errors have crept in without any visibility. It’d be nice if the Web GUI at least showed a count of conflicts, but maybe that’d just cause anxiety?

I’ve got about 50,000 files in my Windows Documents folder (synced between two PCs) and just today learned I have 27 conflicts. Mostly saved game files; it’s possible Steam Sync was also involved which no doubt causes all sorts of confusion. FWIW none of these conflicts have caused any problems, so maybe I don’t really need to care about them. I just deleted them; nothing was going to be reading those conflict files anyway. The 3 conflicts in my source tree worry me a bit more, they’re all in git repo metadata. But those git repos are working fine and git fsck isn’t complaining, so going to just delete those too.

How do conflicts happen? When two separate syncthing instances update the same file before they sync them to each other. This happens surprisingly seldom for me, I think because I have an always-on hub that everything syncs to and Syncthing seems to be watching the file system for changes and uploading them quickly. Conflicts seem more likely to happen on my Android phone where running in the background is a challenge and it may not sync at all when I’m not on WiFi.

Which brings me to Joplin. I’m looking at all this because I’d had a lot of problems with Joplin/Android and file sync. I recently encrypted my Joplin notes and something weird happened on the phone when it synced to it. Not sure what was really wrong but I just deleted all the conflicts my phone generated and I seem to still have all my notes. Joplin itself only syncs to local files every few minutes, then Syncthing itself only syncs those files to the hub every few minutes. Seems a little delicate.

Joplin works again on Android

I’ve been using Joplin for a few years now as my note taking app. It’s mostly good but has some rough edges. But there was one ugly thing; Android file system sync was broken for most of a year, without acknowledgement. I used this to sync my machines (via SyncThing for the files). This got fixed a few months ago with Joplin 2.9 but then that release was never pushed to the Google Play Store, making it much less accessible to users.

Happy to report that my phone currently has Joplin 2.10 from Google Play and filesystem sync is now working. The UI is still a little awkward but it seems to be functioning. (With some delay; Joplin is not super swift in re-syncing.)

The whole experience has left me with a sour feeling about Joplin. Maybe that’s not fair; it’s a free open source project. And it’s remarkably complex, supporting a bunch of platforms and sync methods. The underlying technical issue (Android file system permissions) was genuinely complicated. OTOH the developer didn’t handle the bug very well and between that and the Google Play release problem I get the impression he doesn’t much care about the Android platform. Also the UI really is clumsy in a lot of ways.

Another bug / UI problem: I just enabled encryption on my Windows desktop. It re-encrypted the notes and synced them. Then I went to my phone and tried to synchronize and got some generic error (“TypeError”) that suggested data was bad. So I manually turned encryption on in the phone app (it should have turned itself on) and now my phone is very slowly encrypting and re-uploading all its notes again. This is bad! In general the encryption implementation seems wonky.

Alternatives

So maybe I need an alternate notetaking product again. It seems like a simple product but then it needs to be really well designed and reliable, so that it becomes a piece of your memory and not some hated complex app. The main things I need are syncing between Windows and Android (and/or ChromeOS) and good Markdown support. And a good UI for displaying and editing markup.

There’s a lot of note apps out there; here’s a recent roundup of 7. Simplenote was the first I used and loved. I stopped using it because notes aren’t encrypted. Although ironically I never turned encryption on with Joplin because of my sync problems. I switched to Standard Notes for awhile but the price went to $50/year and it had so many UI problems I didn’t want to pay that. So I switched to Joplin.

I’d try Google Keep but the UI is like a clown circus. Evernote is way, way, way too complicated. So I’m sticking with Joplin or now. Maybe I should just pay for Joplin Cloud, that would have solved my Android sync problem.

1Password has a pretty functional little notes app in it, btw, but it doesn’t have the Markdown UI stuff I want, not its intended purpose.

Anyway, Joplin seems to be working for now. If I see something better I’ll try it. If Joplin breaks again I’m going to consider going back to Simplenote. I love how Automattic supports this little product.

Update: thanks to a comment from reader Gina I tried Obsidian, a closed-source Electron app. I like it! The UI is very nice, I particularly like the default Markdown editing mode where the markup syntax is hidden except for the line you’re editing. Also despite all the fancy features it has the basic data model is “text files in a folder” which is refreshingly transparent. The app has a well-used plugin architecture with a lot of third party plugins. It supports advanced things like a canvas, a graph view, and links between notes, but the basic stuff is pretty solid. I hope they aren’t going down the Evernote road of increasing complexity.

I was able to import from Joplin by exporting markdown from it, although I couldn’t get the updated/created metadata to come over (this might be fixable; joplin does export the dates). Obsidian doesn’t encrypt data files on local disk but supports end-to-end encryption in their $96/year cloud sync product. It also looks plausible to sync yourself via SyncThing, but you won’t have the fancy extra layer of conflict resolution that Joplin sync provides. All in all it looks like a very promising product.

Google Pixel security disaster

There’s a major, bad security flaw in Google Pixel phones and some Samsung phones

allow an attacker to remotely compromise a phone at the baseband level with no user interaction, and require only that the attacker know the victim’s phone number.

This notification has been published despite the bug not being patched. Google’s announcement blames Samsung; it’s their modem software that has the flaws and apparently they “hit their 90-day deadline” for disclosure and so now it comes out in public. Even so, Google decided to withhold the worst details because fixes aren’t out.

There is a patch for Google Pixel phones, the March 2023 security update. But that update isn’t available yet for my Pixel 6 phone; rumor has it that it might come out March 20. (Part of a pattern of late updates for what should have been a flagship product.) In the meantime, well, my phone could be owned at any moment. More discussion on Reddit.

The recommended workaround is to disable VOIP (“WiFi calling”). Which I’ve done, and which makes my phone basically useless. The cellular chip in the Pixel 6 Pro has never worked reliably, its connection performance is terrible. Also Verizon hasn’t gotten around to building cellular infrastructure in obscure, non-techy places like Noe Valley, San Francisco. At least I still sort of have cellular access; folks using T-Mobile and Google-Fi phones apparently are left without any way to make calls at all (I guess it requires Voice-over-LTE?)

Google really screwed up with the Pixel 6, it’s been a frustrating phone to own. I’d told myself the next phone I’d buy would be from Samsung but, well, they’re really the root cause of this problem. Apple often does seem to do a better job on building devices that work.

Chromebook first impressions

I got my first Chromebook, a cheap machine just to try it out. I like it! I’ll probably end up getting a fancier Chromebook to replace my 2017 Razer Blade laptop when I travel. I’d love to get one that could also replace the tablet I use for books and videos.

ChromeOS makes a great first impression! I’d not realized it’s basically a whole new desktop OS, a third way other than Windows and MacOS. (And I guess Linux on the desktop, lol.) It’s an interesting middle ground between a full desktop OS and a mobile OS like a phone or tablet.

I can’t quite decide whether I’ll want to use a Chromebook like a desktop computer or like a tablet. ChromeOS seems squarely in the middle. I think it could basically replace what I use a tablet for (reading books, watching videos, light web surfing) if I could find a Chromebook where the keyboard gets out of the way. Assuming the UI works well as a touch screen, which it seems to with tablet mode. These are marketed as “2-in-1” devices.

I ran into a problem with hardware though; no one makes the Chromebook I want as a tablet replacement. Part of the problem is price; Chromebooks tend to be under $400 and so don’t use very high quality screens, etc like the $800 Galaxy Tab S8+ I’d be replacing. (Although see Samsung’s Chromebook 2, 4K Chromebook, HP Dragonfly Pro, or this article). Part of the problem is mechanical. I’d love a “detachable” where the keyboard comes entirely off like the Lenovo Duet 3. But then the keyboard attachment is not a strong hinge, which means you can’t reliably support the weight of the whole machine with the keyboard while sitting or propped up in bed. Maybe one of the 180° folding screens would work better. Really need to get my hands on them to see.

The other big question is CPU type: ARM or Intel. I firmly believe ARM is the future for devices like this. But I’d say 80% of the Chromebooks out there are Intel, a few even AMD. And the ARM systems tend to be the cheaper / lower powered ones. No one is making anything like Apple’s laptops for ChromeOS, Linux, or really even Windows.

The machine I bought is an Acer 311 C722-K4CN, aka N20Q9, aka willow. It cost $120 on Amazon (new!) and is marketed as a school / student laptop. I think these were first introduced in 2020 for $350, mine was built in Feb 2021. It’s definitely not a powerhouse, $120 implies a lot of compromises, but so far the hardware exceeds my expectations other than screen quality. I deliberately chose an ARM system; it’s a MediaTek MT8183 which is maybe 2-3x more powerful than a Raspberry Pi 4 CPU? It seems powerful enough for web browsing at least. No HDMI, microSD, and limited USB ports.

First thing I did was update ChromeOS from v88 or so to v105 and now v111. A little surprised it’s a 32 bit build; the CPU is definitely 64 bit. I also installed Linux via the official route (“Crostini”) it’s a VM, arch reports aarch64. From what I’ve read on ARM the ChromeOS kernel is 64 bit but the userspace is 32 bit. I wonder if that’s partly a RAM savings thing?

Chrome OS is quite big; 14 GB! The Linux install wants another 10 GB (although 3 GB seems sufficient.)

One hassle: there aren’t ChromeOS apps for everything I’d expect. Particularly surprised there’s no Slack app. Slack works in a browser though, and Chrome makes it easy to “Create Shortcut” so it looks more like a separate app in the GUI.

I’m also a little confused: there’s both a “Web Store” and a “Play Store”. I think the Play Store is for Android apps, they run natively on ChromeOS now and many things (like Tailscale) are installed as generic Android apps. The Chrome Web Store is a mix of things for the Chrome browser (like extensions) and then some ChromeOS enhancements like a compose key input method (which is written in Javascript). There isn’t a whole lot on the Web Store.

Google has good docs for building Chrome OS apps. The basic message is “it’s an Android app with special accommodations for Chromebooks” with observations like “every Chromebook has a physical keyboard” and “A system-level back button is a pattern carried over from Android’s handheld roots—one that doesn’t fit as well in a desktop context.” It’s remarkable how many different kinds of systems Android runs on: phones, tablets, laptops, TVs, Android Auto, Android Automotive. That’s a lot of different UI metaphors!

I use Firefox everywhere else but feel like I should be using Chrome as my browser on a Chromebook. I mean, it’s in the name. Also the whole OS is basically one big Chrome instance? Firefox does work but it is the mobile Android app, not a desktop app. Without proper tabs, and the wrong user agent, and... I guess it’s possible to install a Linux version but I haven’t tried it.

The Linux support is interesting. It works via a system called Crostini which seems a bit like WSL2 in its approach; it creates a VM with an LXC container, then installs Debian inside that. See also the wiki here. You can install Arch Linux and Ubuntu, albeit with rough edges. Note Crostini is different than replacing ChromeOS with a full Linux install; that’s also often possible on Chromebook hardware. Crostini supports graphics via both X11 and Wayland. Crostini is an evolution of crouton, an earlier system for running different OSes inside ChromeOS.

The underlying Android system is mostly hidden in Chrome OS but accessible. Ctrl-Alt-T will launch crosh, the Chrome OS shell for the host OS. This isn’t a full Unix shell, it’s got its own weird command set, but ping and top are there.

I thought I would hack the OS a lot more but one joy of a Chromebook is it mostly works just fine and doesn’t need a lot of tinkering. I do want to eventually get a full development environment for Python and web frontend. Between the Linux system and VS.Code it seems entirely doable.

One big caveat: ChromeOS is designed as a cloud-centric system and definitely wants to be online all the time. It’s possible to run things offline but you have to do a little preparation. Honestly computers are mostly useless to me offline anyway, I can’t go 2 minutes without having to look something up on the Internet. As long as I can read a book or watch a downloaded video on an airplane, I’m good.

WinCompose and other ways to type Unicode

I’ve long wanted a good general purpose Unicode input method on Windows. To type so-called “special characters” like ñ or ü or ű. MacOS has a great way of doing this; long-press a key and a popup appears. Both Android and iOS have something similar. Windows doesn’t. I do a lot of cut-and-pasting.

There’s a bunch of Windows solutions that don’t work very well. You can choose an input method that includes more than US English, but that’s intended more for regular typing of one specific character set than the diverse one-offs I need. There’s the ancient numeric keypad method but it requires knowing the Unicode code point number for the character. I’ve tried some Windows programs that emulate the MacOS long press UI but none worked reliably. PowerToys has Quick Accent but the default activation key (space) is too easy to activate by accident.

WinCompose may be the solution I want. It gives you a compose key; you press Right Alt, let go, then type a mnemonic key sequence like ~n to insert ñ. Some of the sequences are pretty arbitrary and there’s a lot of silly macros like TF for “table flip like a boss”: (ノಥ益ಥ)ノ彡┻━┻. But I think I can guess or learn most of the characters I want. One particular thing to remember; a lot of emoji are defined by pressing Compose-Compose and then typing the name of the symbol. Ie Alt-Alt-JOYSTICK to get 🕹️.

One thing missing from the default compose tables is the ʻOkina, the character used in Hawaiian for a glottal stop. Along with ñ it’s an important character for writing US English place names correctly; the state is properly Hawaiʻi, not Hawaii. The character in Unicode is MODIFIER LETTER TURNED COMMA (U+02BB). The question is how to type it.

I’m going with ``, <grave> <grave>, pressing the upper left key that’s also ~ twice. I found that definition on this random site and it seems pretty reasonable.

    <Multi_key> <grave> <grave>                     : "ʻ"    U02BB   # MODIFIER LETTER TURNED COMMA (Okina)

Not sure this is the best choice. <grave> <grave> already has a meaning in WinCompose: “ which is U+201C, Left Double Quotation Mark (also used in kragen’s xcompose configuration). Overriding it causes no problems and anyway there’s other ways to type it: Compose < ” for instance. This X11 man page suggests <grave> <grave> is the beginning of a bunch of Cyrillic characters but those composed diacritics look pretty unusual to me, maybe not essential.. Anyway this is going to work for me.

It’d be nice to have a standard. I filed an issue with kragen’s config opening the question. It seems to be a good place to define some sort of standard.

I should add that the compose key has a long history in Unix computing dating back to the VT220 in 1983. XCompose, the X Windows system for this, is a defacto standard. WinCompose basically implements XCompose and uses the same config file format.

MicroSD card speeds simplified: V30 A2

If you want to buy a decent general purpose MicroSD card in 2022, buy something that says “V30” and “A2”. I’m happy with the Sandisk Extreme. It works pretty well as the primary disk in a Raspberry Pi and will also work for 4K video, maybe even 8K.

In detail.. There’s a confusing array of different class definitions for SD cards. Ignore “Speed Class” (2, 4, 6, 10) or UHS (1 or 3); those are obsolete. Also ignore SDXC, SDHC, and SDUC; those refer to storage capacity and you can just read the size.

The primary throughput rating on a card now is V, for Video Speed, and modern choices are V30, V60, or V90. V30 is 30Mbps and is fine for 4K video. There’s a nice chart here of speeds. Note a V30+ card will also probably be labeled “Speed Class 10” and “UHS 3”. Faster is better but you pay for it, so unless you know you need it save your money.

The only random access rating on a card is Application Performance Class and comes in two ratings: A1 or A2. There’s no real price increase for A2 so get that. This isn’t so important for recording video but means absolutely everything for use as a general hard drive, say in a phone or a Raspberry Pi. A2 isn’t so great; it’s 4000 read IOPS. Compare 600,000 IOPS for a fancy SSD. But at least it’s got a rating. Old fashioned spinning disks are more like 50-200 IOPS, so even that A2 is a big improvement over what we used to use.

The Sandisk Extreme 128GB I like is $20 for 128GB, V30, A2. Some prices for various speeds of 128GB cards from NewEgg

  • V10 A2 $13 - $17
  • V30 A1 $11 - $20
  • V30 A2 $11 - $20
  • V60 A2 $27
  • V90 A2 $100

V30 A2 is the sweet spot for performance; no point getting anything slower for general use. You pay a significant premium for V60 or V90. By all means pay that if you need it, but you probably don’t. 128GB seems to be the sweet spot for storage; 64GB cards cost almost the same.

Windows 11: 22H2 and Memory Integrity woes

More boring Windows sysadmin crap, no satisfactory conclusion.

Windows 11 22H2 came out today. I tried to install it. It gets to 37% and fails with basically no useful error message. “Window Update error code 0x80070001”. Thanks dudes. Searching for that error code is not helpful, with a bunch of cargo cult advice for a zillion different things that might be wrong.

I tried using Get-WindowsUpdateLog to give me a text file log of what went wrong but it’s impenetrably detailed. This looks like the error but I can’t imagine what is the actual problem.

2022-09-20 15:37:00.9942721 16468 23084 Deployment      *FAILED* [80070001] file = onecore\enduser\windowsupdate\client\engine\handler\osdeployment\helper\osdeploymenthelper.cpp, line = 612
2022-09-20 15:37:00.9942763 16468 23084 Deployment      *FAILED* [80070001] file = onecore\enduser\windowsupdate\client\updatedeployment\handler\osdeployment\installer\osinstaller.cpp, line = 1157
2022-09-20 15:37:01.0008701 16468 23084 Handler         Install complete for update ID: 8E409263-45B4-438D-AD01-6E9674AB032A.1 Return code is 0x80070001. Requires Reboot:No
2022-09-20 15:37:01.0008721 16468 23084 Handler         Enter deployment handler NotifyResult
2022-09-20 15:37:01.0009405 20108 24312 Deployment      Deployment job Id 51AE112D-2F4D-46DB-A0A4-381CB450EAAE : Update 8e409263-45b4-438d-ad01-6e9674ab032a.1 failure delegate invoked.
2022-09-20 15:37:01.0009697 16468 23084 Handler         Leave deployment handler NotifyResult
2022-09-20 15:37:01.0010261 16468 23084 Deployment      *FAILED* [80070001] file = onecore\enduser\windowsupdate\client\updatedeployment\handler\osdeployment\installer\osinstaller.cpp, line = 356
2022-09-20 15:37:01.0010271 16468 23084 Handler         *FAILED* [80070001] Leave deployment handler Install

So I started trying to figure out what else might be wrong with my system. One persistent problem is Windows Security claims that Memory Integrity isn’t enabled; that’s some virtualization thing to isolate processes. It wouldn’t turn on because an obsolete driver was blocking it. What driver? Some ancient Western Digital thing; I don’t even have any WD hardware on my system. It just got an update via Windows Update which resulted not only in the old version being installed but a slightly newer version also incompatible being installed. Great jerb. Anyway you can manually remove the drivers by using pnputil on the wdcsam files. I have no idea if this could break a system but I chanced it and it worked.

Well, sorta. Now I could enable memory integrity. Then it reboots to install itself and during the reboot I get a blue screen of death with something about Bug Check 0x7E, which means “System Thread Exception Not Handled”. That’s programmer speak for “shit’s fucked up, yo”. Searching online finds other people with this problem with the usual scattershot advice for fixing things and the occasional malware recommendation.

Just before then the event log had errors about IntelHaxm: “HAXM Failed to init VMX” and “HAXM can’t work on system without VT support”. I’m confused about this. I definitely have virtualization support, I’m using Hyper-V for WSL2. I don’t know about VT support. Also wondering if the Intel thing is a problem; this is an AMD Ryzen CPU. This Windows system started life on an Intel CPU and I transplanted the drive to an AMD system. Everything’s worked fine (it installs new drivers for the hardware it detects) but maybe there’s some weird vestige? Or it could be completely unrelated. I give up.

Windows 11: fixing crackling microphone

My headset plugged into my motherboard (Realtek audio) stopped working on my machine, maybe about when I upgraded to Windows 11? Not sure, but when I talked people would hear noise but just a burst of static. The fix was the re-set the format to 2 channel, 16 bit, 44100 Hz.

Windows sound drivers are an absolute mess. The fancy new Windows 11 UI works fine for basic things, but all the important stuff is still hidden in the Windows 7 Control Panel style settings. Why TF hasn’t Microsoft fully ported all the control panel stuff yet? It’s been 7 years since Windows 10 came out and yet still a lot of important settings are hidden in Windows 7 APIs.

In the end I found this guide most useful, using the local “Listen to this Device” loopback, Discord, and Google Voice to test. The web app for Google Voice bafflingly has no microphone playback / test I could find, but if you place a phone call to +1 (909) 390-0003‬ something will answer that will echo calls back to you. (Sadly this number has been tagged “Gateway to Hell” online enough that you might see that name.)

In the end my problem was the microphone device had somehow been set to 32 bits per sample. (This happened two years ago, too.) Which breaks everything not in some coherent way, but by just playing corrupted staticy audio. Nice. Windows is sure doing no favors to ordinary users letting people choose all these formats. 16 bit 44100 Hz is just fine for anyone who isn’t running a recording studio. (Or 48000 Hz; love having two nearly equivalent choices.)

starship shell prompt magic

It’s been nearly a decade since I indulged in customizing my shell prompt, so here I am. I’m trying Starship, a very nicely engineered solution that’s cross-platform.

Last time I customized things I settled on liquidprompt, a very complicated set of shell scripts that works pretty well. It shows me things like Git status, Python venv activation, whether I have suspended screen sessions.

Here’s the default starship in the same context.

The big difference is that second line; Starship wants to stuff so much stuff in the command line they wrap. (Do I really need to know the Python version?!)

The other obvious difference is the weird symbols; Starship relies on you using a Nerd Font, a regular font patched with like 4000 symbols stuffed in the Unicode private use area. I can’t decide if that’s clever or a terrible idea, AFAICT there’s no graceful fallback so if you don’t happen to have the special font you get a lot of broken glyphs. (Or else you have to have a second nerdfont-free configuation.)

But what I really like about Starship is the very clean implementation. It’s a single 8MB Rust binary. It seems to run very fast. And front-and-center in the config are timeouts for if scanning files or running a command take too long. The last thing you want is a slow prompt! That’s a real problem with liquidprompt in large Git repos.

Configurating Starship

The config file is reasonable; there’s a top level prompt which is basically “combine these modules”. And then lots of modules. For instance Python is defaulting to display

'via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)'

So that’s where the text “via”, the Python verison, etc is coming from. You can both override the format string itself and the values of variables like $style.

When reading through the docs pay particular attention to $format since that’s what actually displays. Also note some modules are $disabled by default. The docs are out of date with the binary I installed; starship print-config shows the current active config. There’s a bunch of other neat commands too; explain, timings, etc.

There’s a strange combination of using lots of extra text (like “via” or brackets around git status). And yet also having everything color coded, so the textual delineation is superfluous.

I can’t find a way to make general conditional behaviors. There’s support for conditionals on the empty string, and some modules are hard-coded to do conditional display (ie: only show hostname if remote). But no general purpose conditioning.

It’s quite voracious about showing language details. If you have a directory with both Python and Javascript files in it, you get “via  v18.7.0” and “via 🐍 v3.10.4” in every prompt.

git status bears some consideration. It often shows up as red !? which to me suggests an error state, but really it’s just saying “you have uncommitted work”.

My configuration

I spent most of an hour reading and tinkering and landed here.

That’s in a git repo with +3/-3 changes pending, a job in the background, and the last command exiting with status 1. This all runs in 1-2ms except for the git_metrics count of lines changed; that’s 10ms for this very small status. (git_metrics is off by default.) That’s a pretty maxi-prompt btw, this is what I get with a new local shell in my home directory

My config is below. Mostly what I did here was remove extra words like “via” or “in” from the various modules, also suppressed language version numbers entirely. No doubt I’ll keep tinkering.

add_newline = false
[line_break]
disabled = true

[username]
format = "[$user]($style)"
[hostname]
format = "[@$hostname]($style) "
[cmd_duration]
format = "[$duration]($style) "
[status]
disabled = false
symbol = ""

[git_branch]
symbol = ""
format = "[$symbol$branch(:$remote_branch) ]($style)"
ignore_branches = [ "master", "main" ]
[git_metrics]
disabled = false
[git_status]
format = '([$all_status$ahead_behind]($style) )'

[python]
format = '[($virtualenv )]($style)'
[nodejs]
disabled = true
[gcloud]
disabled = true

Electron bloat vs RPi 4

Running a Linux desktop on a slowish RPi 4 with 4GB of RAM sure makes you appreciate just how bloated and slow Electron apps are. Should it really take 300MB to run a fancy IRC client or 150MB to grep a password file? Some example memory sizes, as reported by conky’s summary of free system memory and then ps_mem. Bolded numbers are what I think is the fairest measurement.

  • 1password: 181MB, 152MB, 196+124=320MB
  • webcord: 355MB, 308MB, 277+115=391MB
  • chromium (1 blank tab): 265MB, 250MB, 196+136=332MB
  • VS.Code (1 .py file): ?, 550MB, 439+122=561

(For each process I first tested what corky said was memory in use when I ran just that app and no other Chrome stuff. Then launching it with other Chrome stuff in memory. The third set of numbers is what ps_mem.py reports. These measurements are complicated by how you account for sharable memory and the details of that are inscrutable).

Memory aside these things also take enormous amounts of CPU. And are very slow, latency when typing in them is quite apparent in some part of every app. I’ve known Electron was bloated but stopped noticing on high powered desktops. We lose a lot when we give up on optimized native apps.

Raspberry Pi 4 as a Ubuntu desktop

Update this whole post was written using Ubuntu 64 bit with Gnome on an RPi 4. I’m trying a second time now with Raspberry Pi OS (LXDE) and it’s going much better, new post coming.

I decided to give a Raspberry Pi 4 a go as a Ubuntu desktop. It did not go very well. I think the hardware is just too underpowered. Which is a little ridiculous given how much more capable this hardware is than the systems of 10 years ago. I’m using this on a stock RPi4 with 4GB of RAM and the basic boost overclocking enabled. The system is installed to a SSD connected with USB3 that gets 250MB/s in benchmarks. (Which itself is odd; it should be 500MB/s. RPi4 I/O is limited I guess). My screen is 3440x1440.

Installation is remarkably easy and clean. The Raspberry Pi people have a GUI app that installs bootable operating system images. Basically plug and play. Newer RPi4 can boot directly off USB, no need for an SD card at all. Which is good; SD card I/O is slow. Graphics and sound basically worked out of the box. Even Bluetooth audio.

Performance is very rough though. There’s regularly 5 second delays between typing something and it showing up on my screen; here in the Wordpress editor, in the URL bar of a browser, pretty much in any GUI. Sometims keystrokes get lost. It’s much better in a Gnome terminal but even then there’s sometimes a perceptible subsecond delay. I really don’t understand the terrible latency on user inputs, even when several CPUs are idle and I have 1.0GB RAM available (currently allocated to buffers and cache). I wonder if something more serious is wrong?

I’m using the default Ubuntu 22.04 Gnome desktop. I might have luck with lighter GUIs - Lubuntu and Xfce are both recommended. I briefly tried them and they did seem faster but they were also uglier.

Update: I tried LXDE on Ubuntu, the desktop environment Raspberry PI Desktop uses, and it’s much better. The ubuntu install I did is pretty janky but that’s probably my fault, I bet the integrated Raspberry Pi Desktop experience is nicer. Responsiveness is much better and memory usage is much lower although this Wordpress editor still drags. LightDM is a big improvement too; the Gnome Display Manager is a huge hog for something that’s just a freakin’ login box.

Update 2: Raspberry Pi Desktop is indeed better. It’s much lighter weight than Ubuntu Gnome and it’s coherent in the RPi build, much better than my janky LXDE. Bluetooth config works! Youtube audio playback is mostly fine but pauses every once in awhile when something else is happening. The wordpress editor is worse than ever though. Beginning to suspect a bug in their Javascript code exacerbated by the relatively low system.

I started with Firefox which was a mistake; the aarch64 build of that is really slow and memory hungry. Chromium is a little better, apparently someone put some real effort into optimizing it for the RPi. It’s still not good though. Super sluggish, regularly pins all 4 CPUs at 100%, and uses a lot of memory per tab. I can’t watch a single Youtube video at 240p even with nothing else going on and the window minimized (sound, no picture). CPUs aren’t overtaxed but the sound playback is choppy and awful. Again, maybe a symptom of something more serious being wrong than just system load.

Update: the fix for Youtube is apparently the h264ify Chrome extension, which forces Youtube videos to H.264 instead of VP9. Which allows for hardware decoding. Shame YouTube isn’t smart enough to do that for you.

Gnome on Ubuntu 22.04 looks fairly good. But the moment you start pushing on stuff it breaks down. There’s two separate programs called “Software Updater” but what you really want is a third program “Ubuntu Software” which installs Snap apps. 1Password requires a manual install; they haven’t built aarch64 packages (But do have a tarball). Lots of weird off-brand Linux choices for ordinary user apps. I never could get the Gnome system monitor to show up in my task bar.

I had a much better experience using this environment on my fast desktop PC. Ubuntu Gnome does at least work on RPi 4 but it’s so slow that it is a miserable experience. Maybe next time I try this I’ll use the Raspberry Pi OS build instead.

Grub, recordfail, 30 seconds

My new Ubuntu 22.04 system was pausing for 30 seconds every boot in the GRUB menu. Despite GRUB_TIMEOUT=0 being set in /etc/default/grub. The fix is to also set GRUB_RECORDFAIL_TIMEOUT=5 in the same file. (Or set it to 0 if you’re feeling sporty.) Read below for the ugly details or see Ubuntu bug 1918736.

GRUB has a nice thing where if a boot fails then on the next try it gives the sysadmin extra time to figure out what’s wrong. It’s common to have no menu or delay if the last boot worked. But if it fails then you get 30 seconds in a menu to press buttons.

The problem is Ubuntu has been broken for a very long time and every single boot GRUB uses this failure timeout. Check out this charming code from /etc/grub.d/00-header/

if [ \$grub_platform = efi ]; then
  set timeout=${GRUB_RECORDFAIL_TIMEOUT:-30}

What this says is “if your system boots with EFI then ignore the configured timeout and wait for 30 seconds”. They’ve been doing this for 3 years. EFI is the common case for PC hardware and I think every installed Ubuntu system every single time it boots waits for 30 seconds for no reason except someone hacked around some other problem in a clumsy way, then never cleaned it up. I’m not sure but the underlying problem may have something to do with detecting whether a boot failed or not. A similar problem shows up with LVM systems.

Update: I misunderstood; this code only runs when recordfail_broken is set, which happens if GRUB determines the boot media is not writable. The check_writable function says diskfilter, lvm, btrfs, cpiofs, newc, odc, romfs, squash4, tarfs, and zfs are all not writable. I guess that’s for a good reason; GRUB’s not able to record that the boot worked so it assumes it failed. Sure is a kludge though.

I set the timeout to 5 seconds because in the case of a real failure I need that time in the menu. It’s still 5 seconds longer than it should be but at least it’s not 30.

I am sure cranky about this. I’ve been encountering a lot of bugs like this setting up my new Linux system, probably because I’m paying such close attention. Part of being a successful tech worker is ignoring all the broken stuff that’s not a big deal because you’re doing something more important. But I have time to get into the details of GRUB, or fstabs, or whatever and what I find is alarming. I always wonder “why doesn’t the engineer working on this give a shit?”

In the Old Days nerds who installed Linux were very proud of one thing: their system uptime. Later on we started accepting reboots were part of life and so the focus shifted to making fast boots (the primary reason for systemd!). Now apparently Ubuntu developers care so little about EFI boot that no one minds that for three years it’s been wasting 30 seconds every single boot. I suspect that’s because of the shift in focus to cloud computing; the serious work is now all on systems that probably aren’t using GRUB at all, just booting in a VM.

I do wonder what this means for folks on laptops though; Ubuntu still seems serious about desktop Linux Maybe I misunderstand and somehow this bug is avoided in common installs? Update: see above, it only affects some types of boot volume.

Ubuntu 22.04: apt keys

New version of Ubuntu has a massive usability regression in adding third party package repositories. There’s a legitimate security reason for the change but they’ve made no affordance for making it easy for users to migrate or understand the new way. I can’t even find docs on the official help. This is bad usability even by Unix standards; I suspect Canonical doesn’t care because they’re pushing their Snap package store so hard.

There’s good information here. Bottom line; the old way meant that the new key you were adding was trusted for all repositories. Rather than fix that design flaw in some sensible way they’ve just deprecated the feature entirely and left users to run gpg -dearmor or some such nonsense to manage keyfiles themselves. Really. It’s 2022 and Ubuntu thinks “just use PGP from the command line!” is a reasonable thing to tell someone. Some tool to do this file management for me would sure be a better choice.

The change seems for the better but they sure didn’t do anything to build tools for the new way or explain the transition. Pretty sure the Ubuntu devs just told me to go fuck myself.

UEFI, ESP, secure boot, and GRUB

I haven’t really thought about how a Linux system booted in years, back in the old MBR days. (“Load the first block and run the code”, more or less). Modern PCs are much more complicated with secure boot and UEFI. Some notes on what I learned reading about it. I’m cranky about all of this complexity; particularly the idea there’s some security layer in my firmware that prevents me from booting disk images I installed on purpose. I realize this is to protect against malware that installs itself in the boot chain, but I’m not honestly that worried about that risk.

Summary: modern motherboards boot with UEFI. The BIOS looks to mount a drive with an EFI System Partition (ESP) on it. The ESP is a fat32 filesystem with signed .efi blobs that are executed. GRUB’s update tool (run in user space when installing itself or new kernels) creates an ESP with GRUB EFIs on it. When loaded, GRUB in turn loads the Linux kernel and runs it. The rest of these notes are more confused because I took them while I was learning all this.

First off, can you just turn all this UEFI stuff off? Maybe. ASUS motherboards have ways to turn off “safe boot” (which I think means ignore keys) and enable “compatibility support module” which disables UEFI. However CSM mode does not work with Intel integrated graphics. The option to do that is greyed out. I also have no option to just turn off safe boot. I think no CSM means I can’t boot from an MBR, I must have GPT partitioned disks. And no way to turn off safe boot means whatever I want to boot via GPT/UEFI must be a signed binary blessed by the spirit of Ballmer himself. I did see some references that if you deleted all the secure keys in ASUS BIOS that would enable booting anything unsigned, but I was too scared to try.

But I got ahead of myself. What are MBR and GPT? Those are two ways to create partition tables on a PC hard drive. MBR is the old way and partitions are marked with very sparse data (like a single byte for type); see BIOS boot partition for more info. (I can swear in the very olden days you didn’t need a boot partition at all; LILO’s bootstrap was tiny but enough to load the kernel off the root partition). GPT is the modern way. It’s the GUID Partition Table, so everything has verbose GUID names. There’s no reason to use MBR any more on PCs. GPT is some 20 years old, ubiquitous, cleaner, has no weird size limits, and is now required for complicated things. In Linux you can see what kind of partition table you have with parted -l.

I just set up Ubuntu on a new hard drive (USB, spinning) and let it install. It created two partitions. /dev/sdb2 is what I expected, a big disk formatted with ext4 with my Linux root filesystem. /dev/sdb1 is a boot partition; 537MB, FAT32, named “EFI System Partition” with the flags “boot, ESP”. That’s the EFI System Partition.

What’s on the ESP? You can mount it just like any fat32 file system. Inside are directories EFI/BOOT and EFI/ubuntu. Apparently this is all UEFI boot stuff, various .EFI files have signatures checked and then are loaded and run. Some details here. The Ubuntu directory has a couple of small GRUB config files and what I think must be a copy of the GRUB executable itself.

So now we get to UEFI itself. Useful resources for that: Ubuntu docs, Arch Wiki, Arch Wiki: GRUB, Wikipedia, Windows Boot and UEFI, this Stack answer. For something more complex see this proposal for a new secure boot.

Greatly simplified, my understanding is UEFI’s job is to find boot code someone installed and run it. The UEFI BIOS finds a boot manager (perhaps chosen from the BIOS boot menu or set up via a command line tool like efibootmgr), which then finds a boot loader like GRUB, which then loads the operating system kernel. In theory all this stuff works on both MBR and GPT file systems but in practice you usually see UEFI used with GPT. Note that UEFI is basically a whole operating system with its own shell. One fancy thing you’ll see is the BIOS logo on the screen along with the Ubuntu screen and a loading spinner as various parts of the boot process are all drawing on the screen.

One Linux I installed ended up telling the existing Windows Boot Manager on my SSD about the GRUB boot loader for my new Ubuntu install on a USB drive. I think Ubuntu chose that because I already had Windows on the system. The BIOS menu let me choose which of the two OSes to launch but the Windows Boot Manager was in the path of the process. In another case I had no OS at all and Ubuntu just put GRUB directly on the USB drive; I guess it was acting both as boot manager and boot loader? “Manager” vs “Loader” is not used consistently in the stuff I’ve read, so I may have the details wrong.

From Linux’ point of view, all this UEFI rigamarole is to boot GRUB. GRUB is basically a mini operating system whose job it is to launch the Linux kernel. (There was an older GRUB v1; all modern systems are using GRUB 2.) I don’t really understand GRUB very well, it has menus you can configure to do complicated things and behind the scenes has enough code to find and load the kernel from a bunch of different device types. So it loads that kernel and hands off control to it.

If this all sounds overly complicated it is. BIOS picks a boot loader which runs GRUB which picks a Linux kernel to load? It’s possible to bypass GRUB entirely and have Linux load directly with EFISTUB. I find GRUB sort of comforting though and see no reason to remove it. It’s the way Ubuntu prefers to let you choose between kernels when booting.

First practical question; is your Linux system booting via UEFI? These docs have a nice hint; look for the presence of a /sys/firmware/efi directory. Another way to tell is use parted and look at flags; my UEFI boot partition is flagged boot, esp whereas my MPT style boot partition is flagged bios_grub.

Second practical question: how do I update / install UEFI booting? There are procedures for converting a system to boot via UEFI, see the Ubuntu docs. They sound scary. They reference a tool called Boot Repair which is a handy rescue disc. It has a sort of wizard which is basically “fix my boot”. It’s also 4 years old but is apparently still the recommended tool? The Ubuntu Server install ISO also has a repair mode.

Third practical question: is secure boot really an obstacle? I don’t think so. Modern Linux distributions have some signed shim that allows the Linux boot code to pass the security checks. I have no idea how this works or why it’s considered acceptable in the face of malware. But I think in practice if a Linux tool installs an ESP at all, it will have the needed signatures.

Update: an August 2022 update has revoked a bunch of signing keys, rendering some systems signed with older keys unbootable. Including Ubuntu 20.04 (reportedly).

Setting up a second WSL distribution

I want to switch from Ubuntu 20.04 to 22.04 on my WSL system. But I’m cautious, so my plan is to install a second WSL image and move my stuff over. Maybe there’s an easier way, but here’s what I did. Installing a first distribution is easy btw, the trick is getting a second without clobbering the first.

Step 1: install second distribution. I followed the procedure here. It boils down to downloading an Ubuntu cloud tarball and using wsl.exe to install it. WSL’s installer puts distributions in C:\Users\Nelson\AppData\Local\Packages so I put the new one there too.

Step 2: set up a user. The distro from step 1 works fine but you’re root. I followed the procedure here. It boils down to using adduser to create the user, then editing /etc/wsl.conf to make that user the default. Note that WSL configuration changes apparently take 8 seconds to apply.

Step 3: copy over your home directory files. There’s no easy and efficient way to access files from one WSL distro in another. So I went way old school and used tar over netcat for /home/nelson. Sometimes the old ways are the best ways.

Step 4: change default distribution. wsl.exe --default sets this for WSL as a whole; I also had to configure which distribution to launch in Windows Terminal.

It’d be nice if my home directory were a separate virtual disk instead of buried inside the WSL image. Some quick Googling suggests it might be possible but it involves an extra mount process and I worry it might not be 100% reliable. There are ways to access other WSL distributions or files from a Windows folder but they seem to involve localhost network mounts (via 9p) or other inefficient things.

Given WSL2 is just a fancy wrapper around virtual machines it seems like this whole process could be a lot simpler and more explicit. But the WSL team came at this from a different direction; “make a Linux program work just like a Windows program on Windows” instead of “manage a library of virtual machines”.

Windows 11 thoughts: taskbar customization

I upgraded to Windows 11 last night. Finally needed WSLg enough to take the jump. Install went fine and mostly I like the changes. The big visible thing is a UI refresh; nicer File Explorer, cleaned up right click menus on files, etc. It’s mostly good. Apparently rounded corners are in this season along with shorter shorts on men.

And then there’s the taskbar. They completely rewrote it. And stripped out a bunch of features. The one that’s killing me is the taskbar now must be on the bottom; there’s no way to move it to the left. Which is where you want it on a screen that’s much wider than it is tall. Which also means there’s no text labels, something I liked on a wide monitor. Argh!

So that got me looking for customization options. There are a lot. Here’s some I found.

  • RoundedTB: changes the look of the task bar: rounded, and transparent in the empty parts (so it looks like boxes, not a bar).
  • Stardock: Start10 gives you a Windows 10-like start menu (with the Windows 11 task bar). Start11 lets you customize the look of the Windows 11 taskbar and start menu in various ways.
  • StartIsBack: another Start/Taskbar customizer mostly advertising the ability to make it look like Windows 10.
  • ExplorerPatcher is a grab-bag of little changes to various UI elements, mostly to look like older version of Windows. It sounds like this just enables hidden old code, it’s not a rewrite / new Start menu like some of the others. Could be wrong about that.
  • StartAllBack: yet another set of UI tweaks, with Windows 10 style taskbar and start menu. This one is the only one that claims to move the taskbar to the left.

They’re all more similar than different really. Many of these are “bring me back my old Windows 10 GUI” (or even worse, Windows 7). I like Windows 11’s changes in general, I want to go forward, just want to tweak one or two things.

StartAllBack is the only one I installed and tried. And it’s pretty good, I’ll probably keep using it. I’m mainly using it for the “enhanced classic taskbar” which seems to be a rewrite of Windows 10 style task bars. It’s mostly OK and even lets some of the newer features like jump lists through if you want them. I sure missed my text labels for tasks on the left, glad to have them

WSL copy/paste clipboard

Useful command line pipeline tools for WSL, similar to MacOS pbcopy and pbpaste.

To paste the contents of the Windows clipboard into a WSL shell pipeline

powershell.exe Get-Clipboard | wc

To put the outputs of a command into the clipboard

echo foo | clip.exe

That’s the basic version. There’s a nicer version described here or packaged here suitable for installing. It uses sed to strip the DOS newlines and extra newline out of the clipboard content. Also uses tee in front of clip.exe, I think so that it will echo the output back to stdout as well.

Pretty clumsy having to invoke this code! But I believe WSL 2 has no API for accessing the Windows clipboard. It’d be simple enough to imagine in WSL 1’s emulator, but since WSL 2 is more of a VM approach it’d be more work. And then it’d be some weird WSL system call no other Linux understood, anyway. Although... WSL-G must have clipboard support, I wonder if there’s an alternate approach.

Android phone migration doesn’t work very well

I got a new phone, replacing my Pixel 3 (my first Android phone) with a Pixel 6 Pro. So far mostly so good; the new phone is nice. It’s too big IMHO but that’s the trend.

I am surprised at how bad the migration tool was moving data from my old phone to my new one. I think moving from my iPhone to the Pixel 3 worked better than this Pixel upgrade, although perhaps I had low expectations the first time.

The good

It’s simple enough to get the transfer going. Plug the two phones together (USB-C means no bizarro cables), press some buttons, and it’s off. It completed very quickly.

All the Google services moved seamlessly. Gmail, Android backups, Photos... no problems with any of that. Damn well better not be!

Getting Verizon to provision the new phone was also relatively easy. I finally can use an eSIM, so that’s nice, although I never could find IMEI2 in the software settings anywhere. (I had to read the tiny numbers off the box). Verizon basically just has you paste in the IMEI and do some auth stuff and they just transfer phone service over. Slick! (There was a caveat early in the Pixel 6 release you had to tell Verizon to set you up with a non-CDMA phone or else SMS didn’t work. I don’t seem to have needed to do that, and indeed that discussion says this was fixed.)

The bad

Google slammed me out of Firefox, switching my default browser back to Chrome. Funny how that happens. It’s an illegal monopolistic practice, btw, and one we used to complain about loudly at Google when Microsoft did it.

My Google Pay sort of carried over? My credit card is there but I had to reauthorize it. My California vaccination record which I’d laboriously gotten into Google Pay awhile back did not.

Almost no app state copied over. I mean some did; I have all my old text messages, for instance. Aegis also managed to bring all my (encrypted) 2FA tokens over (there’s an explicit preference to enable this). But lots of apps didn’t. For example both dict.cc and Kiwix download 100MB+ databases and cache them to let you read things offline. Those databases did not get transferred over. It seems pretty random what did and what didn’t. I can’t tell if this is just bugs / old design in some apps or if the migration tool is weirdly selective. Given all the changes to Android file semantics over the years I’m gonna guess old design.

No app logins carried over. Everything - Twitter, my bank, Lyft, etc - all require I log in again. No doubt this is “for security” but it’s a very bad user experience, there’s probably 50 logins I have to do. And really how much security is this providing? Many of these are for services where I don’t really use the app regularly but rely on notifications instead. I’m having to go through every single installed app and log them in one at a time.

Logging in the apps reminds me just what a shitty user experience usernames and passwords are. It’s 2021 and that’s still the best we can do? I’ve got 1Password set up, and in theory it’s integrated in to Android as a keyboard. Some apps prompt me to “fill with 1Password”, but I’d say only 25%. And some of those will only prompt with username or password but not both. Also inconsistently; second time I try the password field will prompt me to press a button for the 1Password fill. Mostly though I am just cut and pasting awkwardly between two Android apps. It’s terrible.

I’m sort of over the hump doing all this. I’m to the Ms in my apps making sure each one works on the new phone. No real surprises along the way, it’s just a terrible chore. Android really could make this better.

I’m grouching about Android but my memory of iOS was it was about the same migrating between iPhones.

Android DNS queries on an idle phone

My phone is a Pixel 3 running the latest Android. It mostly sits idle at home on wifi, I use it maybe 30 minutes to an hour a day at most. A couple of days ago I set it up on NextDNS, an ad blocking DNS provider. One nice thing about NextDNS is it gives you stats about the DNS queries. Here’s some data after about 45 hours.

It’s a lot of total queries! 6000, or about 130 an hour. It gets much quieter at night; the lull in the graph below is between 9pm and 7am. My phone has DND enabled from 10pm to 6am, I suspect that has more to do with the pattern than my actual usage.

31% of the queries were blocked as ads or trackers. Google is by far the biggest surveillance on my phone: Analytics, Ads, and Doubleclick. Urban Airship is second, then Crashlytics. I don’t know if that’s because I’m running Android, own a Google-built phone, or if I just mostly use Google services. Probably some of each, also Google’s monopoly power.

Outside ads the biggest source of DNS queries is still Google; Federated ML is top, Google Play (for the store?), and www itself. The other players are Yelp (geolocated to Japan), something called Rainbow API from the Washington Post (Germany), and Syncthing (India!). No idea why the geographic scattering. These are all services I use regularly, although it’d be nice if they weren’t quite so spammy with DNS. 5 queries an hour for something I don’t directly use seems strange. then again these DNS entries are all set up to expire in 1-5 minutes. And hey, DNS is cheap.

All in all not a lot of huge insights other than the magnitude of DNS traffic. But it’s an interesting view into something I’ve never looked at before.

BTW I like NextDNS. It’s more or less the same as AdGuard’s DNS. But it feels more like a real product. You can also customize exactly what’s blocked with some granularity, there’s a lot of OpenDNS-like features too for safe browsing, parental controls, etc. Blocking Parked Domains is a particularly provocative feature. The free tier gives you 300,000 queries / month which I think is enough for two phones at my current activity level. Unlimited usage for a personal account is only $20/year.

Finding files with weird encodings

I’m working on (finally) converting my Blosxom blog to something modern, probably Hugo. One problem I have is that I was bad and wrote blog posts in different encodings. (These probably render wrong on my blog nowadays). Here’s a Linux command line to find all files that are not ASCII or UTF-8:

find . -print0 | 
  xargs -0 file -i |
  egrep -v '(ascii|utf-8)'

The heavy lifting is done by file -i which prints out MIME types, including a guessed encoding.

I thought all my files were ASCII, UTF-8, or ISO-Latin-1. But in fact a few are CP1252 thanks to Windows “smart quotes”. CP1252 doesn’t seem to be identified by file; it shows up as charset=iso-8859-1. It is a strict superset of ISO-Latin-1 so in my Python code I’m just going to pretend all the files that aren’t ASCII or UTF-8 are in CP1252.

USB charging in 2021

USB charging is even more of a mess than ever before. I thought USB-C and USB Power Delivery was the be-all and end-all of charging. One common protocol, buy a charger that claims 45W and a USB-PD device would charge at 45W. Ha!

I bought a nifty little USB charging tester. It shows you in real time what the current voltage, amperage, and thus wattage of the charging current is. Finally a reliable way to tell what’s going on! Assuming the presence of the tester doesn’t disrupt the USB charging, that is.

The charger Amazon sent me is called a KWS-1902C, there’s a nice review here. It claims to support up to 150W, 4-30V, and 0-5A. The first look on the blog is from October 2018, for a sense of product age. I’m assuming it does not support USB 3.1 gen 2. But it may not need to, maybe it will do that with the right cable actually providing the E-marker chip. It apparently has a display bug if you go over 65.536W.

My Samsung Galaxy Tab S7+ (aka SM-T970) claims to support up to 45W of charging. But when I plug it in via USB-C to an Anker Power Port Atom III, advertised as a 60W charger, I only get 15W. 9V at 1.67A. Actually a little less than that, like 14.3W. I’ve tried two USB-C cables, also an A-to-C cable using the A port on the charger. Always 15W. So what’s going on?

First off, the Anker charging port is not actually 60W. It’s 45W. And that only at 20V. At 9V the max is 3A, or 27W. But still I’m only getting 15W.

Second, Samsung’s support for “fast charging” relies on a USB spec called “Programmable Power Supply” or PPS. That’s a newer thing where the device just requests an arbitrary voltage and amperage and the charger provides it. At least one other Samsung device wants to be charged at 10V and 4.5A. Samsung’s own 45W charger will do PPS up to 11V at 5A. But if it falls back to ordinary USB-PD 3.0 then it maxes out at 9V at 3A.

But that’s still 27W. I don’t know why the Anker charger is only putting out 15W. A failure to negotiate a higher amperage? Even basic USB PD 3.0 supports 9V/3A but I’m not getting it. Maybe the device deliberately charges itself slowly to preserve battery life? I haven’t tried charging from a dead battery.

My motherboard’s USB ports charge the tablet at 5V/1.5A. I believe that’s the minimum to be a USB-C port.

Back to PPS, Anker does make a couple of 65W PPS chargers but they seem to be newer and/or more expensive. This review suggests it’s capped at 3.25A so at 9V you’re limited to 29W. Every charger brand seems to have one or two PPS chargers but most chargers don’t support it.

How about charging other devices?

My Google Pixel 3 phone should support 5V/3A or 9V/2A. I get 9V at 1.2A. So that’s confusing. It’s variable too; 1.1-1.3A. I’m beginning to doubt the accuracy of my tester. Although again, maybe this is a battery preservation strategy? (Not USB, but wireless charging tops out at 10W.)

My PS5 controller can’t be charged by the Anker charger, there’s no orange light. The official specs say it can do 5.1V at 2.8A. When plugged in to the Anker charger I see it’s getting 5V and 0.1A, which is the basic USB 2.0 draw for a low power operating device. Plugged in to the PS5 in rest mode (with the meter) it does charge, at least the orange light is throbbing. But it’s still only 5V and 0.125A, very low power. So it may not be charging well. (Update: after six hours it was still looking like it was charging. Maybe the tester screwed it up?) Also I note the D- data line is at 2.76V; for most devices both D+ and D- have been at 0V when charging. Presumably that’s related to why the controller can’t be charged by the Anker charger, must be some odd protocol.

Bottom line: absolutely none of my devices are charging at the rated spec. Anker in general makes good products, so I’m not inclined to blame the charger. Although at least for the tablet it’s clear I need a PPS charger to get maximum charging.

I wonder if it’s my cable to blame. I’ve tried several decent cables, including an Amazon Basics cable. But they’re a couple of years old. Apparently the new hotness is USB-3.1 Gen 2, which has an active chip in the cable itself for negotiating USB-PD and supports 10Gbps data, 20V/5A charging. (Keyword: E-marker chip.) I am going to buy this one and see if it makes a difference. Amazon Basics makes one too. Not clear it will make a difference, from what I’ve read it only becomes important when you want to go over 5A.

Update: the new cable makes no difference.

Update 2: there’s been some controversy over Google Pixel Pro 6 charging, see Google’s explanation. I just measured charging my phone at 30% battery and got 8.7V/2.14A, or 18.6W. Google says their max is 23W. I tend to leave the phone on my original Google wireless charging stand so don’t much care.

SourceSinkVoltsAmps
Anker Power Port Atom IIIGoogle Pixel 391.2
Anker Power Port Atom IIISamsung Galaxy Tab S7+91.67
Anker Power Port Atom IIIPS5 Controller50.1
PS5 Console (with meter)PS5 Controller50.125
Anker Power Port Atom IIIGoogle Pixel Pro 68.702.14

Ubuntu 20.04 motd

I was trying to figure out how Ubuntu systems print the Message of the Day at login. In ye olden days this was a static file, /etc/motd. But it’s dynamic now.

The online references I found talk about the update-motd package. That was indeed how it worked in 2008 or so but is no longer the case in 2021. I don’t even have it installed on my Ubuntu 20.04 system.

The newer Debian docs seem to be correct. The motd is being created and shown by pam-motd. PAM is the code that defines what all happens when a user logs into a Linux system. It has this configuration:

# Print the message of the day upon successful login.
# This includes a dynamically generated part from /run/motd.dynamic
# and a static (admin-editable) part from /etc/motd.
session    optional     pam_motd.so  motd=/run/motd.dynamic
session    optional     pam_motd.so noupdate

That first line means “run the scripts in /etc/update-motd.d and write their output to the file /run/motd.dynamic. Then display the output.” The second line means “don’t run anything, just display the contents of the default file /etc/motd.”

The actual messages come from scripts in /etc/update-motd.d. You can use run-parts to run them all dynamically. This most fork like 100 processes every login shell, what a waste! But it’s sure flexible. 10-help-text is the one that prints the URLs advertising Ubuntu stuff. I removed mine.

There are some other motd things too.

sshd has an option for PRINTMOTD. The docs say it only prints /etc/motd.

systemd does not have any MOTD code, surprisingly. Ubuntu does have a systemd timer configured to run 50-motd-news a couple of times a day.

login has a couple of options for .hushlogin files to suppress the MOTD.

The ubuntu package show-motd drops a script in /etc/profile.d which will display the MOTD once a day. It does this using update-motd, not PAM, but it seems to work the same way with the /etc/update-motd.d scripts. It has various triggers to stop it from printing the MOTD:

  • .hushlogin
  • a MOTD_SHOWN environment variable (PAM sets this.)
  • Timestamp on $HOME/.motd_shown: only show if it’s the first shell after 00:00
  • If the shell is not interactive. (It does not check if it’s a login shell.)

WSL doesn’t run login or PAM for shells so some of this stuff doesn’t happen in the WSL context. But WSL seems to install show-motd by default and so you get a MOTD once a day.

Joplin notes

I switched note-taking apps to Joplin. It’s total overkill for what I do, all I really want is a markdown editor that doesn’t require me to remember to press “save”. Joplin has a zillion more features than that. Also it’s a 200MB Electron download, so that’s a bit much. But it seems to work well and simply.

Originally I was using SimpleNote. It’s really nice! The only reason I switched away is because it doesn’t support encrypting notes on their cloud storage and I was doing things like pasting passwords into my notebook.

Then I used Standard Notes for a few years. And paid for it. But they hiked the price to $50/year and that seems like a lot of money for something so simple that I use occasionally. It also reminded me just how bad and klunky so much of Standard Notes is. Its reliable on Markdown plugins for the editor, none of which quite work right. Mediocre cross-note search and no in-note search at all (except with one plugin). It often feels slow. Just overall not excited to be paying so much for it. (Base Standard Notes is free but you need to pay to use even the most simple advanced features like a decent Markdown plugin.)

Joplin is free software and free to use, including a variety of self-hosted syncing options. (Which are encrypted). They do offer a cloud sync service at 24€/year but they also have a robust set of free sync options you can set up yourself. You’re mostly paying for convenience. And they don’t lock other basic features behind the price.

I’m using SyncThing for sync. Joplin will sync via files in a directory; it is then the user’s problem how to sync those files. SyncThings works great for that. The sync is a little delayed (5 minutes?) and getting it set up on Android was awkward because of the opaqueness of the file system. But it all worked.

There’s a zillion note-taking apps out there. Unfortunately most of them seem to be too complex and offering too many features, just like Joplin does. Everyone’s like “Evernote is bad and too complex” and then is going down the road to becoming Evernote. To Standard Notes credit they are not doing that; neither is SimpleNote. Anyway some of the other options I didn’t try are QOwnNotes, Cryptee, and SilentNotes. Joplin seems to be the nerdy consensus for the best so I didn’t even try the rest.

Migration wasn’t too bad btw, thanks to Standard Notes for having an export feature. (Which reminds me; data portability matters, don’t ever use an app that traps your data.) There’s a way to convert Standard Notes exports into Evernote format, which Joplin can then ingest. Lost a bunch of metadata, most importantly which notes had been archived. So I had to go in and re-sort my notes. It was time well spent actually, but if I had thousands of notes that would have been a problem.

syncthing and WSL 2: running in the background

I’ve been using syncthing a couple of years now and finally trust it to manage all of my source code. Part of that is getting it to sync files on my WSL Ubuntu images. They’re more or less like standalone Linux VMs and need their own syncthing, it won’t work to just sync files on the Windows host system.

Syncthing mostly just works in WSL, no drama. The challenge is that WSL doesn’t have a systemd or cron so there’s no easy way to start syncthing at system boot. Also syncthing itself is not really written as a daemon; if you just run “syncthing” it writes to stdout and listens to signals and stuff. Awkward.

There’s lots of advice on how to deal with this problem and most of it doesn’t work. The real problem I ran into is something weird about WSL, at least the WSL 2 I’m using. This GitHub issue discusses it: even with nohup and other efforts, background tasks launched by wsl.exe will sometimes disappear. You can write a script that looks like it runs a background process fine and test it in Linux and it works. But if you invoke the script via wsl.exe whatever processes it spawned disappear. No, nohup doesn’t help. This is all very mysterious and it’s worth remembering that WSL only started supporting background tasks a couple of year ago.

The solution that worked for me is to use the daemonize program. There’s an Ubuntu package for it. It’s pretty straightforward, it does all the Unix stuff you’re supposed to do for a daemon but don’t bother with (like cd / so that filesystems can be unmounted.)

Here’s the Linux shell script I use to run syncthing. The weird GUI port is because I also have Syncthing running on my Windows host.

#!/bin/bash
OPTS="
        --no-browser
        --home=/home/nelson/.config/syncthing
        --gui-address=http://127.0.0.1:2103
        --logfile=/home/nelson/.config/syncthing/syncthing.log
"
daemonize /usr/bin/syncthing serve $OPTS

The way I launch this at Windows boot time is I have a shortcut in shell:startup that has a target of

C:\Windows\System32\wsl.exe --exec /home/nelson/.bin/syncthing-server-wsl

A batch file might work too.

It’s not ideal. If I’m logged in and just launch the shortcut it works pretty nicely. A command shell window briefly pops up and disappears; if that annoys me enough there’s kludges to workaround that.

There’s a bigger problem on system startup: the console window pops up and hangs for ~30 seconds. I thought it was broken at first but it eventually goes away on its own. While that was going on I also tried to launch a WSL terminal window to see what was happening; that hung too, until the syncthing starter window closed. My guess is that WSL 2 actually has a significant hidden startup time at Windows boot. Normally a WSL window pops up the moment you ask for it, but maybe Windows actually sets up the VM first time in the background and hopes no one notices. Not really sure though, will need to keep an eye on it.

Update: I asked on Reddit and this delay at startup does seem to be a thing that happens to others.

It’s real nice having my source code auto-synced. I sure hope SyncThing never breaks and deletes all my files. (I do have backups.)

Scripting Windows sound and display settings

I have my TV plugged in via HDMI to my Windows machine for occasional gaming. When I want to play games I need to swap the display resolution to one for the TV and also change the sound output device to the HDMI device. I’ve got it set for display mirroring; gaming as a second display sorta works but gets confusing and can require trips back to the mouse and keyboard.

Anyway I got tired of doing it by hand so I scripted it. The key is Nirsoft’s program NirCmd. It gives you a command line interface for doing all sorts of Windows desktop and system manipulations. Here’s the batch file I use to get into desktop mode:

nircmd.exe setdisplay 3440 1440 32
nircmd.exe setdefaultsounddevice Speakers

There’s both a nircmd and a nircmdc. The former pops up a window for error messages, the latter shows them on the console.

Windows and High DPI / Retina

It’s better than it used to be!

I’ve been thinking how nice it’d be to have a higher DPI screen. My current monitor is 109 dpi which is just low enough that I can run things at 100% scaling and it’s all readable. (Sometimes I bump the font size up +1 on things). But I’d love to get a 200 dpi or higher screen so everything looks crisper. This works great on MacOS but historically has been a mess on Windows, in large part because sometimes you are running 20 year old code that is rendering pixels on its own and is totally DPI unaware. But things have improved.

The testing below is with Windows 21H1. I learned a lot from this blog post which explains how to configure Windows high DPI, in particular how to override settings on a per-app basis. I haven’t needed to do that but it’s nice that it’s an option.

I set Windows to 125% scaling and tried a bunch of things. For me my metric of “works OK” is “readable” and “works right” is “readable and not blurry”. Example blurry window to the right. (Note that the app itself works right; only the installer is blurry.)

Most of the apps I use just worked right. A few had to be restarted; they were blurry or in the case of Steam just didn’t work right at all. A few apps were slightly blurry: not “pixel scaled 125% blurry” but more like “awkward font size”, maybe just something not quite optimized. A few older apps worked but were blurry like 125% pixel scaling: Audacity 2.3.3, NZBGet 21.1 (Win UI), SFTP Net Drive. The only thing that was consistently blurry was NSIS, the Nullsoft installer system a lot of software use. There might be a fix package builders can use. Don’t much care anyway, you run an installer once and forget about it. I didn’t test very many games, most games are fully doing their own thing with rendering anyway so I expect they are unaffected by the DPI setting in Windows.

I was honestly surprised at how much did work perfectly. So that impressed me. 125% scaling works almost everywhere in Windows now. None of it feels quite perfect and there are some rough edges but then that’s typical of the Windows UI experience in general. It’s fine and totally usable.

Microsoft has put more thought into display scaling than I reazlied. This helpful developer doc shows the evolution; there was reasonable support starting in Windows 8.1. Windows 10 1703 stabilized on “Per-Monitor V2” with various APIs. The part that surprises me is “Desktop applications must tell Windows if they support DPI scaling”: without that Windows just bitmap-scales and makes for bluriness. I’m surprised almost all the apps I tried are apparently DPI scaling aware. It seems to work even with very old Win32 APIs, you don’t have to use fancy new UWP apps to get scaling. This guide makes it sound not very hard to write basic scaling-aware apps although it does take some extra work to do it nicely.

There is a way to inspect the scaling-awareness of running apps. Oddly a couple of apps (Everything, the PowerToys launcher) say they are “System” status which means basically unaware and yet they look right on my screen. There are a few apps that are fully “Unaware” but they are mostly things like Steam that seem to have their own bizarre rendering for everything.

One thing I can’t tell easily is if the apps are non-blurry because they aren’t scaling at all. I think PingInfoView may be like that; it says it’s “System” scaling but the window was non blurry and the font seemed too small. But the difference from 125% to 100% is not easy to be sure about. I’d care a lot more if I’m running at 200%.

I wish I had a simple program that called the various APIs for inspecting display characteristics and just showed me the info. I guess I could write one.

Higher DPI monitors

Anyway the software mostly seems to work. Now I need the hardware. I currently have a 34″ 3440x1440 monitor that I bought for about $1000. I like it very much. It’s 31 x 13 inches for 109 dpi. There are a bunch of higher density displays but they get pretty pricy.

The Dell UltraSharp 32″ 8K gives you 7680 x 4320 at , the calculator says that’s 275 dpi. $3750 is a little more than I had in mind though.

5K monitors may be more reasonable. Here’s a couple, the first is pretty much a straight DPI upgrade on my existing screens ize.

LG 34″ 163 dpi, 5120x2160, 32″X14″, $1224.
LG 27″ 218 dpi, 5120x2880, 24″x15″, $1600.

Newegg has a lot of choices for 4k gaming monitors, some 16 at 3840x2160 (for a 16x9 aspect ratio).

Looking at this another way... a 43″ 3840x2160 monitor is a pretty common size for $1300 or so. That’s 105dpi, so basically I’d get a bigger monitor at the same dpi. Not interested. To go higher density there’s 32″ 3840x2160. That gives 138 dpi, or about 25% more pixel density. These monitors are 27″x15″ and I’d definitely the loss of width.

What would be a clear DPI upgrade on what I have now is a 5120 x 2160 monitor. That gets me back to that LG 34, I think it’s the closest to a direct dot density upgrade. It’s one of only two monitors in this size; the other is the MSI PS341WU.

The other thing I should consider is pixel depth; 10 bits is common now although I don’t know of any software supports it. And also refresh rate; I like my GSync up to 100Hz. The LG 34″ that looks like a good match for me is 10 bit and supports 75 Hz. No indication of GSync or FreeSync support though. The MSI monitor is 60Hz only.

Just for fun, Apple’s Pro Display XDR is 6016 x 3384 for 218 dpi at $5000 (!). The screen is 28 x 16″. I can’t find anyone selling another brand with this panel.

Bottom line, the LG 34WK95U-W looks like the best option for me and a fairly unique one at that. $1224 on Amazon is not a lot but I don’t think it’s a big enough upgrade to warrant replacing my existing monitor.

ez Share hacking notes (WiFi SD cards)

tl;dr: I found a way to download arbitrary files off an ez Share, but no way to list the files. Also ez Share only runs as an access point with a DHCP server which makes it super awkward.

I’m trying to get a working WiFi SD card. This is a thing that acts like a normal SD card, typically for a camera, but also has an embedded system so you can download files from it over WiFi with the card sitting in your camera. I want to use this to get data off a device that writes to an SD card and has no network interface.

Eye-Fi pioneered this tech way back in 2005. They’re gone now. Transcend made a line of WiFi SD cards for awhile. So did Toshiba with their FlashAir. They’re all off the market or only buyable for ridiculous prices. The only thing left on the market is a Chinese product called ez Share.

Long story short, ez Share is not suitable for general file usage. It’s got a very restricted design that makes it only good for photos and only in an awkward WiFi way. I’ve got some detailed notes below on my hacking attempts. Meanwhile I fond a FlashAir I could get from Germany (via eBay) for $50 so I’ve ordered that, it should be more amenable.

ez Share limitations

The WiFi only runs as an access point. You can’t make the card act like a client on your existing WiFi network. That means you have to swap your WiFi adapter to its network to download from it.

The other big problem is the card only presents a Web UI. And that web server seems hellbent on making sure you only download images from specific directories. It only wants to serve files in directories named DCIM/100CANON or DCIM/EOSMISC. And those files need to have image or video extensions. See below for a partial workaround to download arbitrary files. But I can’t get a file listing.

I couldn’t find any sign of a firmware update capability. Too bad, that might be a way to hack the thing to be more useful. Update: Biorn says there’s a way to update firmware via USB and some details here.

ez Share resources

These ez Share cards have been around for 8 years or so, but surprisingly there’s precious little information in English from folks trying to hack them. Either because they weren’t sold in to the US/Europe or because they’re so inflexible. Here’s some links I did find:

  • A download script in bash. Seems to be written for a different firmware than I have, the methods don’t work.
  • GitHub repo for that download script.
  • A clever hack to use the card with a microscope that writes to another directory. He corrupts a FAT32 filesystem to create the equivalent of a hardlinked directory.
  • Hardware notes on using the card without a camera. Doesn’t address software problems.
  • Game console hackers at GBA Temp have tried using it to run games without much success I could find.
  • An official manual.
  • The default root password is “admin”.
  • The ez Share creates a WiFi access point with SSID “ez Share”, password “88888888”.
  • My card is version 4.4.0. In detail:
    LZ1001EDPG:4.4.0:2014-07-28:62 LZ1001EDRS:4.4.0:2014-07-28:62 SPEED:-H:SPEED

Download files

I poked around at the web server trying to coerce it to give out more info than it wanted to. The big success is I was able to download arbitrary files with URLs like this:

http://ezshare.card/download?fname=2071A5~1.EDF&fdir=..\DATALOG\20210719

Note the ..\ in the path name, to get out of DCIM. The filename has to be the 8 character version; it’s a FAT32 filesystem but the firmware doesn’t seem to know it. Also there’s no ftype specified; that’s needed to avoid the “file extension must be a .jpg or other image/movie format” code.

Unfortunately trying similar tricks to get a listing of files via the web interface at /photo did not work. Neither did trying to download a whole folder; you can do that with images in the DCIM directory but apparently not with arbitrary files.

Below are some very detailed notes on exactly what I tried / learned

ez Share file and directory URLs

List photos
http://ezshare.card/photo?
http://ezshare.card/photo?vtype=0&fdir=100CANON&ftype=0&devw=320&devh=356&folderFlag=0

List videos
http://ezshare.card/photo?vtype=0&fdir=100CANON&ftype=1&devw=320&devh=356&folderFlag=0

Alternate file list? From another firmware:
http://192.168.4.1/dir?dir=A:

Download an image
http://ezshare.card/download?fname=MESQUA~1.JPG&fdir=EOSMISC&ftype=0&time=1391742389

Hack to download any file:
http://ezshare.card/download?fname=2071A5~1.EDF&fdir=..\DATALOG\20210719

Download selected photos:
http://ezshare.card/download?num=2&fdir=EOSMISC&folderFlag=0&fn1=MESQUA%7E1.JPG&fn2=202107%7E1.JPG

Download folder:
http://ezshare.card/download?fdir=EOSMISC&ftype=0&num=2&folderFlag=0

Doesn’t work but looks like it should: hack to download any folder
http://ezshare.card/download?fdir=..\DATALOG&ftype=0&num=2&folderFlag=0
http://ezshare.card/download?fdir=..\DATALOG\20210719&ftype=0&num=2&folderFlag=0

other ez Share URLs

First page:
http://ezshare.card/publicdir/welcome.htm?

Redirects to /publicdir/sendir
Redirects to
http://ezshare.card/photo

Change config screen (password)
http://ezshare.card/publicdir/index.htm

Admin page:
http://ezshare.card/config?vtype=0

Cloud Lab advertisement
http://ezshare.card/i-share/res/clab_en.htm

Version request (reported)
http://192.168.4.1/client?command=version
LZ1001EDPG:4.4.0:2014-07-28:62 LZ1001EDRS:4.4.0:2014-07-28:62 SPEED:-H:SPEED

TPM 2.0 and Windows 11

Windows 11 news came out today with a big surprise: it’s going to require TPM 2.0 support in your system. What the heck is that? “Trusted Platform Module”, a bit of extra hardware that’s used to store secrets for security and encryption. And a lot of Windows PCs don’t have it. But it can be added.

The easiest way to see if your system will run Windows 11 is to run Microsoft’s health check app. It’ll give you a simple yes/no. If it says “no” it’s likely it’s because your system doesn’t have TPM 2.0. To test for TPM specifically try running “tpm.msc” from the start menu (Win-R): it will tell you the status of TPM on your system.

Neither of my desktop PCs have it, neither my fairly new and fancy Asus X570-Pro nor my older cheaper Asus Z270-P. It seems pretty random whether a desktop machine has it or not. Hopefully most newer laptops do? I don’t know, I think my 2017 Razer Blade does.

You can add TPM hardware to some motherboards. There’s a 14 pin header for that purpose if you’re lucky. My X570-Pro has one, the Z270-P does not. If you have the header can then buy a little motherboard specific add-on module like this Asus one for pretty cheap, $15 or $20. I bet those are about to get scarce!

Some motherboards also support something called “fTPM” or “firmware TPM” (AMD) or PTT (Intel). This implements TPM in other parts of the motherboard’s hardware rather than a specific dedicated TPM. Perhaps that’s less secure, I don’t know. My X570-Pro has that ability. I turned it on in the BIOS and now my system is cleared as ready to run Windows 11. Not sure about the older Z270-P system, the manual has no info on TPM in it.

I’m curious why Microsoft is requiring TPM; given it’s not universal or may only exist behind an obscure BIOS setting this choice has to cut deeply into their market. They use TPM for BitLocker, their hard drive encryption product. I’ve never seen the need to use that myself so never looked in to TPM before. I wonder if TPM is good for anything else in practice? Linux supports it and can use it for some things like generating ssh keys.

Android Tablet: Samsung Galaxy Tab S7+

A little over a year ago I bought an Android tablet on a whim. I liked it so much I’ve already upgraded it, trading up from an Samsung Galaxy Tab S5e to an S7+. It’s kind of a dumb time to be buying this, Samsung is likely to announce the S8 line in a few weeks. But I got a good price on the 256GB storage model.

Really what I wanted was a bigger screen. The S5e has an excellent 11″ screen (245x160mm) but the S7+ has a 12.4″ screen (285x185mm). iPad Pro size, not iPad size. They’re both excellent AMOLED screens but the extra inch in each direction is great for media consumption. The real thing that put me over the top was reading comic books; juts a little small for old eyes on the 11″.

Other than that the S7+ is just an upgrade all around. More storage, more RAM (get the 256GB storage at least; the 128GB has less RAM), faster CPU (8 cores, good lord). Great battery; lasted 5 days with 8 hours of the screen being turned on. Fingerprint sensor hidden under the screen which is a nice improvement. Really it’s just a great piece of hardware. There’s a common meme that the Android tablet market is dead. It’s true there are fewer manufacturers than there used to be but Samsung is doing such a great job it’s fine.

Still reasonably happy with Samsung’s software, or rather the way it gets out of the way when you don’t use it. I switched to Nova Launcher again for the launcher and the rest of Samsung’s stuff mostly disappears. Except the parts I want, like the facial recognition unlocking. Samsung’s a little slow with Android releases, I think about 6 months behind? But they do get there and have a decent track record of support longevity.

And then there’s the S-Pen. I don’t know what to say about the S-Pen. This is Samsung’s big innovation, they’ve been at stylus support for a lot longer than Apple. It’s quite good at drawing, the pressure sensitivity is nice. Mostly it seems to serve to augment the UI, there’s all these gestures you can make with the pen both on screen and in the air to do magic things like take screenshots and scribble on them, zoom the camera, etc. I guess it’s kind of neat? But it requires you hold a pen in your hand; I’m perfectly happy with the touchscreen, thanks. And the pen gets in the way. It magnetically attaches nicely to the back of the screen but there it is sitting out. I have a case that holds the pen on the side and that’s OK too only the pen is thicker than the tablet, so everything’s unnecessarily bulky. I’ve already put the pen away permanently and now am looking for a case that doesn’t make any effort to leave room for it. Maybe if I were drawing art on my tablet I’d be excited to use it.

Android Scoped Storage, SyncThing, GPSLogger

I’m trying to synchronize data from Mendhak’s GPSLogger to other devices. I’m running the latest Android (11?) on a Pixel 3. GPSLogger supports a nice variety of sync options but none are quite right for me, so I thought I’d try using SyncThing on the data files on the phone instead. But I ran into a confusing permissions / security thing in Android where SyncThing couldn’t see GPSLogger’s data files. Here’s what’s going on.

First off, where are the files? The GPSLogger docs say they are in a folder with a name like /sdcard/Android/data/com.mendhak.gpslogger/files/. The first confusing this is that /sdcard prefix: apparently this is different on different devices. But the path from Android on down should be consistent.

If I access this files via the SolidExplorer Android file browser it shows up as a storage named “Internal Memory”, the default. (Presumably this could also be an SDcard or something). From there I can click Android and get three choices: data, media, and obb. Click data, search the giant list for com.mendhak.gpslogger, and there I am. Bottom line: GPSLogger stores its files in /sdcard/Android/data/com.mendhak.gpslogger under the root directory, at least on my phone. It’s just where the root is can be confusing.

If I plug in my phone and access it on my Windows machine as a USB drive, I can find my data with this path:
This PC\Pixel 3\Internal shared storage\Android\data\com.mendhak.gpslogger
Seems logically consistent; get to the root of the internal memory, then drill in on Android.

Unfortunately as of Android 11, ordinary apps can no longer access the data folder of other apps. This is presumably a security update, I guess the assumption is most of the time those files are private to the app and shouldn’t be visible. There’s an elaborate new system called “Scoped Storage” where apps can explicitly choose to share files but a lot of apps haven’t really caught up to that. It’s great that Android has a filesystem you can just access at all but over time they’ve complicated it.

There’s a couple of workarounds to the Android restrictions. A bunch of file explorer apps (including Solid) have hacked around it somehow to show you all the folders. Not sure how, I wonder if they’re using the opt-out procedure which is listed as “temporary”, a compatibly measure, and comes with other restrictions.

But this doesn’t help me with SyncThing; it doesn’t seem to support the workaround. All it shows me under “Android” is “media”, a sign that it’s stuck inside the scoped storage sandbox. Which is a little weird because I think it’s supposed to work thanks to including this patch. In particular there’s a “Use advanced Folder Picker: Select any folder on the device for syncing” that sounds like it should enable the workaround. It just doesn’t seem to work.

I also tried SyncThing-Fork, an experimental version. It has a little wheel next to the directory picker that gives you some “advanced” picker. It shows a data folder but that folder is empty. There’s so much drama getting Google Play Store approval I’m not sure it even can work. I briefly tried the FDroid version too (which is a bit more up to date) and it didn’t work there either. Anyway not thrilled at the idea of the fork, particularly if I have to install it via FDroid! So not pursuing that option further.

I finally gave up; the SyncThing app just can’t access that folder. Which is too bad. But fortunately there’s an easy other solution, which is just to get GPSLogger to write files to a different place instead. I chose to put them in /Documents/GPSLogger. Near as I can tell this directory is world-accessible. At least SyncThing can get at it, although IIRC I had to give it one-time permission to access it.

And so now I have SyncThing syncing GPSLogger’s files to my Linux server. Yay! Honestly it would have been a lot easier just to use SFTP or something from GPSLogger but I didn’t really want to set any of the GPSLogger options up. SyncThing seems to be working.

WSL Ubuntu: essential developer packages

I just rebuilt my WSL Ubuntu environment and had forgotten how little is installed by default. Big help if you are a software developer:

apt-get install python3 python-is-python3 python3-venv python3-dev pkg-config build-essential

No doubt I forgot something, but that was most of what I needed to be able to build pycairo-dev which apparently doesn’t just have a wheel?!

Modern USB devices

Today I spent 30 minutes trying to get the exact right USB cable. I bought a USB 3.2 gen 1 external hard drive I want to plug into a Type-C port on a PS5. The best match cable I could find is a USB 3.1 gen 2 cable.

Here’s where it gets complicated. The cable is Micro-B Superspeed to Type C. That’s the big Micro-B with basically two cables; not the single small one. The cable has “SS 10” printed on it which is a promise it’ll do 10Gbps. I’m guessing the drive is USB 3.2 Gen 1x1, which is SS 5 or 5Gbps. There’s a chance it’s USB 3.2 Gen 1x2 which is 10Gbit but is not called SS10. In that case the USB 3.2 Gen1x2 device is probably not 10GBps compatible with the USB 3.1 Micro-B SS/10 cable. It should presumably fall back to 5 Gbps.

Given the drive is spinning rust, a 5 Gbps interface is about 50x faster than necessary.

Windows 10 sound output devices

Windows’ model of sound output has always confused me but I think I finally figured it out. Particularly how it interacts with apps like Zoom and games like World of Warcraft. Here’s some notes.

Jump down to the section on “Application output device” for the juicy bits on “why isn’t sound playing where I want?”

Output devices

Your Windows system has a set of output devices; placees it can put sound out on. Typically these correspond to hardware devices you own like headphones or speakers, but can also be virtual sound devices for capturing audio, modifying it on passthrough, etc.

The easiest way to see your sound devices is to open the Sound settings. Right click on the volume / speaker icon in your taskbar, or open Settings, click System, then click Sound. You’ll see something like this:

The drop down (“Speakers”, here) lets you choose what your system default output device is. Most apps will play sound to that device. This notion of “default” is the cause of much confusion, read on for more.

Clicking through to “Manage sound devices” gives you a couple of extra options:

There’s a “test” option for each device. Also the ability to disable sound devices. This is useful for annoying devices you never want to use. Like the Acer X34, which is the option to send sound out my video cable to my crappy monitor speakers. Never ever want to do that, so it’s disabled.

Windows has like ten options for setting the sound volume. The most complete one I know is “App volume and device preferences”, you can get there by pressing the Win key and typing “mixer”.

The “Master volume” is the output level for the current selected default output. Each output device has its own remembered master volume that you can change by switching output devices first. Also there’s a per-app mixer available for some but not all apps. I don’t know what populates that list but it’s obviously not very complete.

Application output device

Every app gets to choose which device it sends sound output on. Most apps just send to the system default and you have no control over that. A few specialty apps like Zoom or games with voice chat let you control the output device, typically in the System settings.

Zoom outputs
World of Warcraft sound

Choosing a new sound output can be handy particularly for voice communication systems. Maybe you want most system sound out the speakers but your friend’s voice on zoom in an earpiece. But for most apps “System default” is what you want. But here’s the gotcha:

The system default device can change while the app is running. Most apps will detect that change and switch sound to the new output device. You turn on your Bluetooth headphones and now sound is going out those headphones. Neat! But World of Warcraft is an exception. If “System Default” is selected it will not switch to a new output device even if the system default has changed; it will keep playing to whatever was the default when the game was launched. I suspect other apps do this too. It’s a bug IMHO.

Changing default output device

When you plug in a new device it usually becomes the default output magically for you. Often that’s what you want. But it can become confusing, particularly when you then unplug a device and the default output switches back to something. If you’re not hearing sound, first thing you should check is what Windows thinks your default output device is at the moment. 9 out of 10 it’s that HDMI monitor you plugged in.

I’ll say it again: if an app is playing to the system default and you change the system default, most of the time the app will switch to that new output device. But some apps don’t detect the change. It’s very confusing.

A special note about wired headphones. The headphones I have are implemented as a separate output device. Both my speakers and headphones are plugged into separate motherboard jacks and the Realtek S1220A sound chip implements genuine separate devices for each. Other motherboards do something special with headphones where when you plug them in they electrically intercept the speaker output and divert sound to the headphones. But Windows is 100% unaware of this diversion. My old Realtek ALC887 motherboard did this. If yours does, you will not see a separate headphone device and there’s no way in software to switch between them.

Sound input devices

For the most part, all the notes I wrote about output devices apply to input devices as well. There’s multiple input devices, there’s a default input device, switching between them is a little confusing.

Except: Windows 7 had an idea that there were two default input devices; “default device” and “default communication device”. You can still change the latter if you go to the old Control Panel. In theory that communication device was for voice chat and the other default device was.. your high end microphone for studio recording? No idea. This default communication device concept also applies to output devices. I don’t think many apps ever used the idea much and it seems deprecated in Windows 10.

Also except: some microphone devices have a “Boost” option to make them sound louder. And/or a separate input gain control. I’ve never understood why, it has something to do with line levels or something. Anyway if no matter how loud you talk you’re too quiet, the boost can help you. Only my Realtek headphones have this (not the Microsoft LifeCam), I get there via Settings / System / Sound, then clicking “Device properties” on the microphone, then Additional device properties. That puts me in an old Win7-style app, where the Levels tab has a boost option. I suspect every sound driver is different.

Also also except: you have your choice of sound format that a Realtek microphone puts out. Bitrate, bits per sample, etc. Mine got set to 32 bit output somehow and no other apps worked; the mike was responsive but all you could hear was static. Setting it to 44.1kHz, 16 bit fixed it. I’m not sure what’s required to have 32 bit audio working in Windows, but I sure don’t need it for my voice chat.

Steam Link tricks: keyboards, tablets

In this post: how to play PC games on your TV or tablet computer.

Steam Link is Valve’s half-abandoned technology for streaming PC games. The original product idea was you’d install PC games on your fancy gaming PC, then stream them to a cheap streaming video device on your TV so you could play on your couch. They got it working reasonably well at 1080p on a wired home LAN, but it never succeeded in the market and you can’t buy the hardware anymore.

For me the real problem was the Steam Controller which was not only a bad game controller, but also a really bad fit for PCs keyboard-and-mouse user interfaces. They did their best but it sucked.

But what if you don’t use the Steam Controller and use a regular keyboard and trackpad instead? Turns out that’s pretty easy, particularly with the excellent Logitech K830 wireless keyboard/trackpad. I’ve now been playing games like Dicey Dungeons and Crusader Kings 3 three different ways.

A long HDMI cable is by far the easiest way. Just set your TV up as a second display for your PC, no Steam Link required. Use the K830 as a second keyboard/mouse for the PC. Obviously only works if you’re in range to run the cable. HDMI 2.0 (required for 4k) only works to 35 feet or so; beyond that you need some sort of expensive fiber or ethernet conversion cable. Or wireless.

Steam Link hardware. You can’t buy this new anymore, but if you have one lying around or buy a cheap used one it still works perfectly well for 1080p display. You can plug the K830 wireless adapter into the Steam Link’s USB ports and control it from there. Works a lot better on wired LAN but wifi is possible. Resolution matching is a little fiddly but I’ve had good luck if I run my PC at 1920x1080 first, Steam Link will sync to that pretty well.

Steam Link on a tablet. Just tried this on my Samsung Galaxy Tab 5e and it’s pretty brilliant; there’s Steam Link clients for both iOS and Android. No easy wired LAN option but the WiFi seems pretty good other than some minor graphics and sound glitchiness. The mixed bag is the control; with no other hardware, Steam emulates a simple gamepad with touch controls. But it also emulates a mouse with touch controls which is all you need for playing a fully mouse-UI game like Dicey Dungeons. For more complex UIs like Crusader Kings 3 I’m back to keyboard-and-mouse. Pairing the K830 via bluetooth to the tablet works great, it becomes fully usable in the Steam Link Android client.

I’m amazed how well all this works. But in retrospect it’s pretty simple. The only drawback is that while the K830 is a nice portable keyboard/trackpad, it’s really not a gaming mouse. Not even a full size keyboard. Not great for faster games that require precise mouse input. One alternative is a Corsair lapboard with matching wireless keyboard and mouse of your choice. That gives you a full size desk-like setup, but be aware it’s pretty big.

Android phone migration experience

My 18 month old Pixel 3 had a hardware failure; the battery swelled, apparently a common problem. To Google’s credit they got a replacement to me in 36 hours at no cost to me. So now I have the experience of transferring my life from one Android phone to the other.

This was a transfer from a Pixel 3 running Android 11 to a Pixel 3 running Android 10. No idea if the downlevel OS caused a problem; I didn’t see any option to upgrade first.

Top line: it’s not a great experience compared to an iPhone. Apple has very simple one button backup and restore. Android does not. Instead it has like six different things you might want to back up, some of which are automatic and some are not.

I mostly had the data and settings stuff configured for backup to Google, so I figured I was OK. I also made a backup over USB of all the files on the phone, although I haven’t restored those.

Setting up the new phone at first was easy. You turn it on and it prompts you to plug a cable in to the old phone to transfer everything. Great! Go go go! It only took a few minutes, too. But the fact it only transferred 7GB of stuff was a clue something was wrong; I’ve got 30+GB on the phone.

A big part of what didn’t transfer were my apps. Instead the phone decided to redownload all the apps from the Internet. That’s not a terrible choice but it’s slow and possibly expensive and seems a little unnecessary. It took over an hour to redownload 150 apps, many of which I honestly don’t want.

Then the phone is mostly like before. Except.. all sorts of settings and configurations aren’t carried over. Many are, but not everything, and it’s quite confusing. Some things not restored:

  • Notification customizations. All these apps are back spamming me with noisy notifications.
  • Most logins. Almost every app demands I log in again. Fair enough. Happily, 1Password transferred over with little problem.
  • Authy auth state. I ended up having to delete Authy from the new phone, change the backup password on the old phone, then reinstall it on the new phone to get my login tokens back.
  • App permissions. Have to completely re-set-up which apps get access to location services, etc.
  • Random app preferences. Like my weather app forgot that I want weather for where I am right now, now Tokyo. Tapet seems to have remembered I want a new background every hour and that I’d paid for the app, but forgot my color preferences. GSAM Battery Monitor totally lost its state. Golf on Mars kept everything.

I think what I find most baffling is the app inconsistency, the way some settings carried over and others didn’t. Logins too. I have 4 gay hookup apps on my phone (go ahead and judge; I would). 2 of them made me log in again, 2 didn’t! So weird.

None of this is a catastrophe, but it’s definitely a nuisance.

Update: see the discussion here. Particularly the link to data backup docs for developers. I guess since Android 6 auto-backup for apps is on by default but limited to 25MB / app. There’s also a more manual backed up Key/Value store for properties, etc.

RCS messaging works!

For the first time I was able to verify that RCS messaging between two Android devices (a Pixel 3 and a Samsung 20) worked. Even better, my friend with the Samsung was using Samsung’s messaging app and I was using Google’s. Interoperability!

Here’s how to tell if your messages are being sent via RCS or SMS:

SMS are light blue and have the “SMS” tag. RCS are dark blue and say “Delivered”. They also have read status, and notification, and nice handling of longer messages and multimedia and stuff. When you’re sending a message it’ll tell you if it’s going out RCS. Not sure how to tell when messages you receive are RCS vs SMS, but my friend says on his Samsung app there was a blue dot next to my messages.

Basically RCS has all the nice things Apple has had in iMessage for 12+ years now. Only RCS is an open standard and not Apple proprietary. I’m hoping someone makes a nice native desktop app for RCS at some point. Google has clever browser-hosted access to your phone’s Messages app, but it’s kind of a hack.

Google and the carriers rolled out RCS for most people about a year ago. But looking back at my phone I could only find one other RCS message so far. Most of my friends are Apple captives so that may be why; Apple will presumably drag its feet in ever supporting the open standard.

One big drawback is RCS doesn’t support end to end encryption right now. I thought this was a political concession to various oppressive nation’s spy agencies. But more recently it looks like Google may be adding encryption support. I still prefer Signal for all messaging, really, but it’s hard to convince others to use it.

Separate speakers and headphones, take 2

My old system was annoying in that it only had one audio device for speakers and headphones. If I plugged in the headphones, the speakers would be disabled. It worked OK but it meant I was regularly plugging and plugging a fragile cord.

The new motherboard seems to have genuine separate audio devices for Speakers and Headphones. I can play to one or the other or both. I can set speakers for my default audio device and headphones for my default voice chat device. The Windows UI for switching between them is not awesome, but the functionality does work.

I wonder why this works now. The old motherboard has a “Realtek® ALC887 8-Channel High Definition Audio CODEC” (with LED lighting!). The new one has a “Realtek® S1220A 8-Channel High Definition Audio CODEC featuring Crystal Sound 3” (no LED lighting.) The old system was capable of treating the two outputs separately but I could never make it work reliably.

Now if I can just convince Windows to never, ever re-enable the crappy monitor speakers at the other end of my DisplayPort cable...

PC RAM speed: JEDEC vs XMP/DOCP/EOCP

I had one hiccup on my new machine: the RAM wasn’t running as fast as it should. Long story short: I enabled DOCP (aka XMP) on my Asus X570-Pro motherboard and it runs right now. No detailed overclocking or anything, just one setting. The tech behind all this is fascinating so I’m going to write more.

First, a shout out to the bros at Corsair who branded my RAM with the name VENGEANCE. I feel more deadly already. You can also buy DOMINATOR memory with flashing LEDs on it. No, really.

VENGEANCE Platinum RGB RAM all lit up

Memory timings

Modern PC memory is defined by a complex set of memory timings. I bought two CMK32GX4M2Z3200C16 modules, the specs of which are DDR4-3200 CL16 (16-18-18-36). WTF do all those numbers that mean?

The most important stat is the DDR4-3200. That’s the basic speed of the RAM I/O channel and bigger is better. The actual clock is half the number so it’s 1600MHz or 0.625ns cycles. You get two 64 bit words through per cycle, so that results in 25,600 MB/second throughput. Modern memory tends to vary from DDR4-2400 to DDR4-4800, with my DDR4-3200 being typical. (That’s the spec fastest memory my Ryzen 3700X can drive, although many folks overclock to DDR-3600 at least.)

The second most important stat is the CL16. That’s the cache latency, the delay between when a column is selected and the bits can be delivered. 16 means 16 cycles of 0.625ns, or 10ns. That’s a significant amount of time; RAM is much slower than CPUs run. Which is why CPUs have such big caches now. Smaller CL is always better; DDR4-3200 comes in CL14 to CL22.

What about the 16-18-18-36? The first number is the cache latency, the CL16. The other numbers in the 16-18-18-36 describe the rest of the RAM latency. 16 is the best latency you’ll get accessing a new memory cell; the second number 18 means you need to tack on another 18 cycles if you have to change rows, too. I’m not sure what the last two numbers exactly mean but in all cases lower is better.

One last number I didn’t mention; the RAM voltage. DDR4 RAM is standardized at 1.2V. But modern motherboards can overvolt (or undervolt) RAM to try to juice more reliability out of them. A lot of RAM works better at 1.35V.

SPD: JEDEC, XMP, DOCP, and EOCP

So, you buy a RAM module with a bunch of speed, timing, and voltage requirements. How does the motherboard know what to do? It figures it out by reading the SPD, the Serial Presence Detect. That’s a little side channel that RAM uses to tell the motherboard what it can do. Your system BIOS will tell you what the SPD of your RAM is saying. Or you can use a program like CPU-Z to tell you.

My RAM has at least 4 advertised timings; three JEDEC timings at 1333MHz, and one XMP timing at 1600MHz. So my motherboard could choose to run the RAM at any of those settings. But I paid for 1600MHz RAM, I want it!

Unfortunately only the JEDEC timings are “standard”. The X in XMP literally stands for “Extreme” (because again, RAM is made by bros). To run at 1600MHz the RAM module wants a little more voltage than is officially allowed. Fortunately the motherboard can provide it nicely. But a motherboard playing by all the rules will only use JEDEC timings.

In an Intel motherboard you enable the XMP timings by turning on the XMP setting. This is 99.99% safe to do. Unfortunately the XMP term or technology, is Intel proprietary. So AMD systems have other names for these things: AMP (AMD’s name), DOCP (ASUS’ name), and EOCP (Gigabyte’s name). That’s why I couldn’t find any mention of XMP anywhere in the motherboard manual or BIOS. It’s called DOCP on my ASUS board.

So back to the bottom line. Once I turned on DOCP, the motherboard said “oh we can run this RAM much faster”, and I got a ~10% performance boost out of my computer. Technically this is a little bit overclocking but it’s all within published specs of the parts and the motherboard sets it all automatically, so I’m not worried. And now I’m running proper DDR4-3200, the maximum that this CPU officially supports.

But it’s possible to go further, to overclock more. Hardcore nerds buy DDR4-4800 RAM and slap a liquid cooler on their CPU and push everything 10, 20% past what it’s rated to do. I have no interest in doing that myself.

Firefox GPU RAM leak

Update: upgrading from Windows 10 version 1903 to 2004 solved this problem. It looked like 2004 solved the problem, and it might have helped, but my computer just barfed again with Firefox holding on to 25GB of VRAM. And with only like 6 tabs open.

Update 4: after several more months I can say Windows 10 2004 didn’t help anything. The really maddening thing is I have two nearly identical systems (same hardware, slightly different software install history). The problem occurs on one and not the other.

I’m chasing down a problem on my Windows system. Every few days it crashes, the GPU acts like its out of memory. I have a fancy 1080 Ti graphics card with 8GB of video RAM and don’t run things long term that use VRAM, so what’s the problem?

Firefox.

First trick was finding out what system processes were using video RAM. Process Explorer won’t show you. But the built-in task manager will. The “Performance” tab gives you a graph of GPU memory usage over time. And the “Details” tab will show you per-process if you add the display columns “Dedicated GPU Memory” and “Shared GPU Memory”.

When first launched Firefox allocates about 100MB of Dedicated GPU RAM. Then as I watched during the day it climbed; 2GB, 4GB... Even closing all tabs but one tab open to about:memory (as simple and passive a page as you could imagine) all that RAM was still open. After 24 hours it was 4GB. After 48 hours it was 17GB. (neat trick, since I only have 8GB of actual video RAM. I guess it pages?) Closing Firefox entirely does release the VRAM.

I’m still not sure what’s wrong with Firefox that it’s doing this. There are reports from users of this problem over the years: this bug is the best match, also this bug and that one. Not much resolution there. I also can’t find any tools to figure out what inside Firefox is holding the VRAM. That about:memory page is only for CPU RAM, not VRAM.

The most likely theory I’ve seen there is that hardware accelerated decoding of HTML5 video is the culprit. That the video decoder is somehow not releasing VRAM. FWIW my system has media.hardware-video-decoding.enabled set to true, the default. I think I can sort of reproduce that as a bug by watching Twitch and then closing it repeatedly. But not Youtube. I think a real culprit might be me browsing meme videos on Reddit using the Imagus extension (which opens media in a popup window). Another possibility is Reddit’s previews of RPAN streaming video. But I’ve not been able to reproduce it consistently in a way I understand.

Another theory I had was that it was related to the webrender experimental feature. But I have gfx.webrender.all set to false, so that’s not it. Also the leak seems to be triggered only by some kinds of pages, not all, and my impression is webrender would affect all pages.

One last bit of cargo cult advice gleaned from the Firefox bug reports is that Windows 1903 fix KB4497935 might improve things. Reading the Microsoft notes for that I don’t see how it’s related. But I am running 1903 without that patch. I think that’s the next thing I’ll try; install that patch and see if the problem goes away. (Also why am I not running a newer version of Windows?!)

Update: joke’s on me, I can’t install KB4497935 standalone. Installer refuses to run and says it’s not for my system. Maybe it was superseded by a later patch? In general I keep my systems updated, that seems likely. Anyway I’m going to just jump to Windows 10 version 2004 now, that’ll definitely mix everything up.

Update 2: I ran for a couple of days on 2004 and it definitely fixes the problem. At least, mostly. Firefox regularly returns big chunks if video RAM as soon as I close a tab. More importantly I kept it running for two full days and at the end it had maybe 500MB allocated. A bit more than the 100MB or so it started with, but well below the 8+GB that resulted in system crashes before. I don’t know what in particular fixed it, but something in the transition from Windows 10 1903 to 2004 either fixed or papered over the problem.

Update 3: I swear 2004 has helped. But just now I was playing World of Warcraft (uses 2GB of VRAM) with Firefox in the background with about 8 tabs. And WoW complained it had no RAM and when I checked, Firefox had 25GB of VRAM allocated to it. Quitting Firefox fixed it.

Computers are complicated.

Simple Unix file encryption

I want to password encrypt some Unix files. In the very old days you’d have used crypt(1) for this, but that’s deprecated now because the algorithm is junk. So many tools are deprecated now. The key thing is I need a simple tool that I can likely get working again in 10, 20 years. Also I want a file encryption tool, something that manages timestamps and deleting old versions and stuff.

I settled on using ccrypt. I don’t love that its on SourceForge but it was at least updated in the last couple of years, and the underlying cipher is good. Ubuntu 20 has it. One drawback is that it doesn’t compress files first, you’re on your own to do that.

Some other options:

  • mcrypt: the consensus choice for a crypt(1) replacement for a long time. Supports multiple algorithms. But it hasn’t been updated in 10+ years and is considered my many to be obsolete.
  • bcrypt: I used this for years, and it still works, but Ubuntu 20 stopped distributing it entirely. Still works when compiled from source. Not sure if the algorithm is still considered secure.
  • gpg: I’m not positive this has a symmetric file encryption mode but even if it does GPG has been such a hairball for so long, forget it.
  • openssl: apparently there’s a way to use this to encrypt files? No thanks.
  • zip: the original zip encryption algorithm is garbage, but various zip versions have replaced it. I don’t know there’s a standard one though.
  • 7z, rar, other archivers: same concerns as zip about being solid encryption and yet also being standard / stable.

Android Tablet: Samsung Galaxy Tab S5e

I just got a new Android tablet to replace my 2017-era iPad. Since moving to an Android phone last year (Pixel 3) I’ve come to realize I just like Android more. For ordinary stuff ordinary people do, Android is good, just as good as iOS. Sure there’s nits to pick with both systems, but they’re both great.

What I like about Android is that it also allows a level of more sophisticated stuff. There’s a brilliant capability for apps to interact with each other, for instance, setting things up like Unix pipelines. Android out of the box lets you customize the keyboards, the launcher, really most aspects of the system UI; no jailbreaking required. And a fair number of the Android apps seem more hacker friendly than their iOS equivalents.

Android’s ecosystem also does seem genuinely more open. Firefox integrates as a browser way better on Android than Apple ever allowed. Want to add more storage? There’s an SD card slot. (Why the F has Apple never allowed that?) Want to buy a book in the Kindle app? Of course you can; it’s not like iOS where Apple demands their 30% cut. Want to sideload an app from some random site? No problem, just disable the security check and you can. (A double edged sword, to be sure.)

The big downside to Android is that the vendors don’t distribute vanilla Android, they hack and munge and add crap. Worse they subtract value, particularly in how they sit on operating system versions for months, years, forcing folks to run out of date buggy versions. Google really needs to get more control of this problem.

Hardware

Another problem with the Android ecosystem is the hardware quality varies. I dorked around with an Amazon Fire 7 briefly but the hardware is such garbage there was no joy in using it. (To be fair, it was super cheap.) And tablets are seen to be a losing market for some reason, particularly on Android, so there’s not a lot of options.

I read a bunch of guides online (this one was the best) and landed on the Samsung Galaxy Tab S5e. It has an excellent screen (2560x1600 AMOLED), is very thin and light, and at $350 is cheap enough to feel like an accessory / toy, not a whole laptop. The Galaxy Tab S6 is the new flagship, better in most every way, but at $650 it’s awfully pricy. The only thing it’s really missing is S Pen support but I had no desire to have that anyway. There’s an S6 Lite coming but it seems worse than the S5e for the same price, I don’t quite get it.

The S5e hardware seems great. Very solidly built. Nice camera I’ll never use, a working fingerprint reader for unlocking, wifi seems good. Screen is lovely although there’s some weird white balance software at work that’s not helping. Only complaint so far is I can’t find a magnetic cover just for the screen; all the cases are wraparound and cover the back too. Oh well.

Software

So, what about the software? First, the big problem; it’s still only running Android 9. Android 10 came out eight months ago. Being on 9 puts me well ahead of a lot of crappier Android devices, but I hate being beholden to Samsung to get around to putting out an OS release.

Still it works nicely as a stock Android system, there’s none of the lockdown shenanigans that Amazon Fire does trying to keep you from customizing. The GBoard keyboard installs fine, including local voice recognition. Samsung’s launcher is OK but I switched to Nova Launcher mostly because it alphabetizes the apps tray view. Also it’s nicely customizable.

Samsung does install a bunch of its own crap, but it mostly stays out of the way. Bixby was the biggest annoyance but Nova Launcher mostly hides it. For some reason there’s two Clock apps and two Calendar apps and the like, one Google and one Samsung. Meh, I can live with it. It’s annoying Samsung won’t let me remove their preinstalled stuff.

But Android is hacker friendly, so you can install them! I followed this guide to uninstall a bunch of apps using adb to get a command line shell on the tablet. (Try that on an iPad, lol.) Another option is to use a guide like this one along with an app and config files which debloats the device for you. I wanted to control it myself, so I did it by hand.

I already had adb on my system thanks to having Android Studio. The adb.exe executable is in /Users/nelson/AppData/Local/Android/Sdk/platform-tools for me. Here’s a list of stuff I uninstalled by hand:

  • com.microsoft.skydrive
  • com.microsoft.office.officehubrow
  • flipboard.boxer.app
  • com.samsung.android.calendar
  • com.samsung.android.contacts
  • com.sec.android.app.popupcalculator
  • com.samsung.android.email.provider
  • com.sec.android.app.kidshome
  • com.sec.android.app.samsungapps
  • com.sec.android.app.samsungapps
  • com.sec.android.widgetapp.samsungapps
  • com.sec.android.app.sbrowser
  • com.sec.android.gallery3d
  • com.samsung.kidsplay
  • com.samsung.android.app.notes

Special GSAM bonus notes

I use the GSAM Battery Monitor to track battery usage for apps. It works fine by default, but it can work better if you grant extra permissions to the app to let it get at some debugging APIs. There’s multiple conflicting instructions online about how to do this, including a very nice tutorial in the app itself that works right until the final crucial command. I think this worked fine on my Pixel 3? But it didn’t on this tablet, what finally worked was at the bottom of this discussion:

adb -d shell pm grant com.gsamlabs.bbm android.permission.BATTERY_STATS

Better NVidia driver updates

NVidia makes excellent graphics cards with decent drivers.

They also make shitty marketing-ware bloated with crap you don’t want. I’m referring to GeForce Experience, the wrapper around the drivers that runs on Windows. It claims its primary job is updating your drivers. But somehow it needs 100s of megabytes to do that, has a bunch of stupid features in it you don’t want, and requires a login to an NVidia website account to work. Worse, the login requires a CAPTCHA. Right there on my Windows desktop. Stupidest damn thing. Of course the real reason for all this is building ad profiles and marketing and blah blah blah. See also: “NvTelemetry”.

One option for GeForce Experience is simply not to use it. You can still manually download drivers online and install them by hand. For now. But that’s a hassle.

A better option is TinyNvidiaUpdateChecker, a very minimal app for updates. It looks at your machine for the installed version of the drivers, looks online for newer versions, and will install an update for you. It runs super fast, requires no login, and just does its job without getting in the way.

The one drawback is it really is minimal. The default setup is to run once and display its UI in a console window (lol). There’s a guide for making it run at system startup instead, which boils down to “make a shortcut with the --quiet argument and make it run at startup”. It’d be nice if it had an installer and an optional system tray mode.

There’s also an advanced feature called the minimal installer. That breaks apart the NVidia update and only installs some pieces. The goal is to avoid GeForce Experience and NvTelemetry, which are laudable. But the docs makes it sound like you might also not get PhysX, HD Audio, etc. That doesn’t sound great to me, but maybe I misunderstand.

Amazon Fire 7 first impressions

My switch to an Android phone has gone so well I wanted to get an Android tablet, too. Only to learn Android tablets are universally considered to suck. OTOH they are also very cheap. So I picked up a brand-new Fire 7 9th generation. For $49. 16GB storage, 1GB RAM, two cameras, a full WiFi multitasking computer with a decent touchscreen display for less than the price of a fancy dinner. We live in an age of wonder. (Note 16GB storage is not enough, but it has a microSD slot. More wonders: 256GB of SD storage for $40.)

So how is the tablet? OK I guess. It seems fine for reading books and watching videos, which is what Amazon sells this for. The screen doesn’t feel quite responsive to my touches all the time but I’m not sure if that’s a hardware or software problem. 1GB of RAM really isn’t enough. CPU may be a bit sluggish. Camera quality is appalling. It comes with a bunch of adware (you can pay $15 to remove it). Did I mention it’s $49? Amazing.

The OS is FireOS 6.3.1.2, an Android 7.1 / Nougat variant. It’s ugly. It only supports the Amazon Fire store which has an anemic collection of apps. (No Firefox! No Kiwix!) The Amazon versions of apps aren’t great, like apparently the Silk browser is doing some MITM attack to try to save you bandwidth. However the device is unlocked, or at least it’s not hard to install the Google Play store and from there a bunch of normal Google Play apps. (One caveat; be sure to install the Google APKs to internal storage. Don’t format the SD card as an extension of internal storage and let the apps install to it, because then they can’t be updated via the Google Play store.)

So 30 minutes of installing later and I have a good generic Android device. Firefox for the browser. GBoard for the keyboard. Evie for the launcher, (which requires more work to launch via the launch button). Alles bueno.

I can’t find some things via the Google Play store even though they’re there for other devices; Tapet, 1Password, etc. Maybe these apps don’t explicitly mark they’re compatible with the Fire and so are excluded? I’ve been able to sideload these from APKMirror but I’m a little nervous about that, I like my trusted app stores. Particularly 1Password, brrr. All the apps I’ve sideloaded seem to work fine, so I’m not sure why Google Play isn’t giving me the choice to install them.

All in all I’m reasonably impressed. It’s not as nice as an iPad, nor even really as nice as my Pixel 3 phone. But it’s literally $49 and it works pretty well. And now I have an Android device to tinker with.

WSL access to Linux files via Plan 9

Microsoft shipped Plan 9 filesystems! Starting with Windows v1903, the Windows Subsystem for Linux now includes the ability to access your Linux files. To a casual user it’s very simple; you just open paths like \\wsl$\Ubuntu-18.04\home\nelson\.bashrc in explorer.exe or VS.Code or whatever and it all just works. Quite well too, I’m impressed. So far the only hiccup I’ve noticed is it doesn’t support symlinks, not even ones internal to the Linux filesystem.

Behind the scenes there’s a Plan 9 network filesystem involved. That’s not as weird as it sounds, I wrote some notes on it awhile back. Now Microsoft has released a technical overview video. Here’s some highlights:

  • Plan 9’s filesystem is a very simple network filesystem protocol to share files between systems. They are specifically using 9P2000.L.
  • They considered using Samba and SMB instead but can’t rely on Samba being installed and usable in the Linux guest OS and didn’t want to ship it because Samba is GPL licensed.
  • They picked Plan 9 because it’s much simpler to implement. Also Microsoft already had Plan 9 server code for some other Linux container project they’d done.
  • The \\wsl$\ path is handled in the Windows system by the MUP, an existing hook for network-like filesystems. They added a new one for Plan 9.
  • The $ is in the name so that it can’t be confused with a computer whose hostname is wsl.
  • The Plan 9 server in Linux communicates with the Windows Plan 9 client via a Unix socket. (Windows supports Unix sockets; who knew?)
  • Windows can access your Linux files even if no Linux is instance is running. There’s a new Windows service called LXSManagerUser that mediates user identity and permissions.

I continue to be impressed with the quality of WSL; it’s like a real Linux system in almost every way that matters. Microsoft has big plans for a second implementation now called WSL2 that will run a full lightweight VM. I’m not as excited about that but they say it will help improve filesystem performance, something that WSL definitely could use.

SMS vs iMessage vs Android Messages

I sure wish Android and Apple would get together and unify their messaging apps. The business with iMessage being different from SMS causes all sorts of problems. I mean mostly it’s great, it’s cheap/free to iMessage and it’s faster and more featureful. Right until the moment it fails and you really want SMS instead. Or you switch away from iOS. Apple has finally made it easy enough to de-register from iMessage, but now all my old Apple friends are sorta mystified how to message me. (Derp, the same way, it’s just green now.)

I’m more confused about what Messages from Google for Android is. It seems to be a lot like iMessage, including proprietary non-SMS transport for two users who are both using it. It does SMS too. It also has a webapp version that seems to work pretty well. (So does iMessage, a desktop app, but it’s MacOS only because Apple.) The webapp sends SMS if necessary; does it do that via my Android’s cell plan somehow? Directly? It is all a mystery.

Mostly it just feels like both companies have inserted them in front of standard SMS/MMS. And they’re adding value but in competitive ways that make it worse for consumers. No one wants that.

Android new user notes

After twelve years of iPhone use I made the jump last week to Android phones. I’ve been curious to see how the other half lived and Google had a one day sale on the Pixel 3 that was enough to make the jump. (The new Pixel 3a just released is a hell of a good price.) This marks a slow migration for me away from Apple products. They aren’t quite the quality innovator they used to be, and their closed approach to ecosystems has always bummed me out.

So far I like the Android quite a bit. Everything I expect from a fancy phone works. And I’m enjoying discovering new things. I think part of the fun here is just I’m revisiting how I use my phone from the bottom up; maybe I’d think it was juts as neat if I were switching to iOS for the first time.

Anyway, here’s a bunch of thoughts I collected as I learned the new platform

Software

The first setup where it copies from the iPhone is slick. Particularly like how it matches the apps you have. Sadly it can’t copy app data or state like logins.

Pretty much every single app I cared about on my iPhone also had an Android version. About 75% of those were found by the migration tool, the rest I had to install by hand. I only had to buy one app; Paprika, the recipe software. Most software I pay for has an account subscription model like Spotify, not a one-time app purchase model. The one app I could not get on Android was Overcast, no surprise given its author’s Apple fanboy status. Fortunately there’s lots of other podcast players for Android. PocketCasts is probably the best choice. I’m trying Podcast Addict for now but it’s a pretty rough UI to love.

It’s nice being in Google’s loving embrace; Gmail, Photos, Drive, etc all well integrated. Apple’s policies are better for users since Apple isn’t an advertising company. But their services like iCloud are not very good, I’m really glad to not be living under iCloud anymore. Google’s services are good and I’ve been using them for years, nice to have a phone that wants to integrate with them.

I like the home screen! I particularly like the ability to have widgets from apps draw little decorative things on the home screen. I also like the back button. This bit of UI is a source of confusion for many, and often myself, because it can both go back in a single app and also go back between apps. But it mostly seems to do what I mean when I press it. The shortcuts for switching between apps are good too.

Android apps are small! They are 1/3-1/5 the size of their equivalent iOS apps. For an extreme example, Facebook is 450 MB on iOS and maybe 50MB on Android. It’s common to see many Android apps < 10MB download. I haven’t read a completely convincing explanation why, but see here for some ideas. There’s also a new tool to make builds even smaller. The smaller size definitely results in noticeable bandwidth and storage savings; maybe RAM too.

The 1Password integration in the OS is terrific, particularly with apps. Way better than what iOS has tried to kludge together. More generally the integration between apps in general is quite nice on Android, it’s fairly easy to share data from one app to another in a way that never seems to work on the iPhone. The “intents” system lets apps publish APIs for other apps to use. There’s even complex automation for chaining apps together. iOS has something similar now in Shortcuts, but I’ve never used it.

Android has a file system! You can browse it with Amaze File Manager. Apps naturally share files through it, like Sonos playing files Podcast Addict downloaded. You can also bridge out to Google Drive fairly simply and then have the same files on your desktop computer. iOS has always had a notion of files too but they are well hidden and seldom (never?) cross-app.

I can run a real Firefox! With real Firefox addons! None of this “must use Apple’s embedded WebKit” crap. Firefox on iOS is a heroic effort and has a lot of useful Firefoxy features, but when you pull the mask away it’s still Old Man Smithers underneath. There’s something to be said for platform unity, but there’s something to be said for competition too.

Notifications are awfully spammy. Every app (say, Amazon Store) wants to send you notifications all the time. Even with something where it could be useful (say, Washington Post) it’s mostly annoying. It takes some looking but you can extensively customize notification behavior. Some apps have an in-app bunch of settings. And the system has Notifications settings on a per-app basis. Each app has notifications one of many channels (often only one) and for each channel you can configure whether it makes sounds, vibrates, etc.

The phone definitely feels more hacker-friendly. In particular there’s a reasonable chance interesting apps are open source, like GPS Logger. I can’t think of the last open source iOS app I saw. Also I like that I can realistically write code for my Android phone using any computer, not just MacOS. My brief look at Android Studio is encouraging, it seems like a solid IDE.

I gather Android version proliferation is a real problem. I’ve got Pie, which is version 9 of the OS. The development kit tells me if I write code for this version less than 1% of users will be able to be run it. Version 6 only has 63% of users! Also from what I see online the UI changes radically between versions. Always improving, hopefully, but change has a cost.

I also gather vendor Android modification is a real problem. Carrier-sold phones in particular have all sorts of crap on them, as do a bunch of the cheaper Android phones. Some of that crap is locked and hard to remove. I bought a Pixel because I definitely didn’t want to mess with Verizon or Xiaomi’s idea of how they could make an extra $20 off me. The only other brand of phone I’d consider buying is a Samsung Galaxy Note.

I haven’t gotten too deep into lower level system hacking, but it’s nice that Android lets you do it. Even without rooting the device. The is pretty good if you want a quick look at the (non-root) filesystem and some easy upload / download. The GSam Battery Monitor is amazing if you want low level battery watching stats. Even includes using some just-short-of-root debugging interfaces for extra detailed stats.

Android Auto seems fairly good. Not quite as slick as Apple CarPlay, but then not as proprietary either. (Apple for years prevented any other maps from displaying in CarPlay, for example.) One nice thing is you can run Auto even when you’re not plugged into a car display, it has a car-optimized display right on the phone screen. Good for testing or using in an older car without the ability to plug a phone in.

Pixel 3 hardware

In general the hardware is lovely. Flat slab of glass, no distinguishing features except an ugly bright orange button (a feature of the pink-backed phone). Under the hood the Pixel 3 has gotten some criticism for being underpowered for the price but I don’t have any perception of that. The camera is as lovely as people say. Coming from an iPhone I don’t notice the lack of an SD card although in retrospect I wish I had one. Also baffled why there’s no dual SIM; so useful! The new eSIM alternative is proving to be an inadequate kludge.

Cables continue to be a problem. The Pixel 3 has one USB-C port and nothing else (like a goddamn Macbook.) Worse though is I don’t have a USB-C port on any computers here, and they don’t ship with an adapter to a male USB-A connector. They do have an adapter for a female USB-a port, which you use when syncing two phones together, but I had to order the rest. Nevermind that most every USB charger, automobile port, radio port, etc is not USB-C. Argh. At least it’s not fully proprietary like Lightning.

It gets trickier with charging. For wired charging Pixel 3 supports 18 Watt “rapid charging” which apparently is USB-PD, an open standard only now being implemented (Apple’s new phones use it too). AFAICT USB-PD is a USB-C only thing in practice, older type A cables don’t allow USB-PD 2.0 or above. Older fast chargers on a type A cable use Qualcomm’s Quick Charge or some other proprietary thing; the best I’ve been able to do is 8W from them, maybe 10.

It gets more confusing with wireless charging. Google has a proprietary system that allows 10W wireless charging. Other standard wireless chargers (there are such things?!) are limited to 5W. In theory third parties can build 10W compatible wireless chargers but there aren’t any yet.

Of course there’s no analog headphone jack, which is as obnoxious as I feared. But I can live with it. Also the Pixel 3 apparently has no capacity to send HDMI out a wire. The USB-C adapter for headphones works OK but has different wiring from Apple’s proprietary, so I can’t use a full Apple headset with it. The supplied wired headset is fine, the fit sure is better for me than Airpods. Also the sound output is way louder than the iPhone’s ænemic headphone out.

I don’t much care for the fingerprint sensor in back. It means you have to pick the phone up to unlock it. Also the sensor is not accessible on the Pixel Stand; you have to pick up the phone. Don’t miss not having a hardware button in front for the home screen though. And the sensor itself works well. It doubles as a shortcut for “show notifications” too if you turn that feature on.

Conclusion

I like my new Android phone! I was going to spend weeks migrating; I ended up switching over the day I got it set up and haven’t missed the iPhone once. In most ways it seems to be fuctionally equivalent to an iPhone. I’m surprised the UI polish is better than I feared. And I like the relative openness and hack-friendliness of the Android.

My next goal is to start writing apps for the thing. Will no doubt have lots of notes when I get to that.

Plan 9 rides again; WSL file access

There’s a handy new feature planned for WSL in Windows 10 v1903: “Accessing Linux files from Windows”. Previously there was no way to get to your WSL Linux files from Windows, the host Windows OS didn’t know how to interact safely with the LXFS files in the WSL system. Now you’ll be able to mount the Linux files as a network share.

The cool part is how it works: “a 9P protocol file server facilitates file related requests, with Windows acting as the client”. Before they edited the announcement they called this “a Plan 9 file server”, which is accurate if a bit overstated. 9P (aka Styx) is a Plan 9 network filesystem technology.

It makes sense to use a network filesystem to bridge Windows and Linux. I’ve been doing something similar, network-mounting the Linux files via SFTP. You could also imagine running a Samba server inside WSL that the host Windows system accesses. Either way the Linux process gets to mediate the file access, at the expense of a network file system.

Plan 9 is the wacky part. There’s been a little discussion about why, hopefully Microsoft will write a blog post explaining the tech. My guess is they chose 9P because it is very simple to implement. IIRC part of the Plan 9 design is that many applications implement a filesystem as their API, so they built a simple embeddable filesystem any program could control. Wikipedia’s summary of the protocol certainly looks straightforward, roughly what a FUSE filesystem implementation has to implement. Still, a tiny bit surprised they didn’t go with their own SMB, or NFS, or something new and proprietary and super simple.

There’s obscure precedent for using Plan 9 this way, see this discussion. QEMU’s VirtFS uses 9P to share files between guest and host operating systems. (Which led to at least one security issue in a QEMU user.) And there’s some 9P code knocking around: the old u9fs code presumably hasn’t entirely rotted, there’s v9fs (looks abandoned?), someone took a crack at 9P in GoLang, and there’s probably useful 9P code in this Plan 9 port. Also Wikipedia mentions Styx on a Brick which looks like a way to control a Lego Mindstorms robot via something that looks like a filesystem.

Update: Chromium OS also contains a 9p server, I think also used to bridge over VM boundaries.

ssh: Resource temporarily unavailable

I got a weird error message today:

ssh: connect to host example.com port 22: Resource temporarily unavailable

In my case I had an open ssh connection working from my Windows box running WSL to my machine at home running native Linux. Then it dropped unexpectedly. When I tried to reopen it I got this error message. The connection had a few ports forwarded, but nothing weird. It normally works fine.

A bit of Googling around finds lots of instances of this error but all happening to WSL users. Then it gets confusing. Half the messages are from people running an SSH server on WSL, the other half are an SSH client. A lot of folks with permanent problems like a bad firewall setup. I have a transient error.

I still don’t really know what the error means. I’m wondering if port forwarding is related, maybe the Windows’ listening port is stuck in a half-closed state and isn’t available to be re-bound? I also don’t know what’s causing the drops, it’s a new problem. It’s happened twice now, both times I’ve had active SSH sessions get dropped when my SSH server completely flooded its 250MBps Internet link with a parallel download. I wonder if my cable modem or router are doing some thing dumb, or if ssh is sensitive to 3s of bufferbloat delay.

mintty/wsltty: Ctrl+Shift+Letter

TIL; mintty, the venerable Cygwin terminal emulator, has an option so you can use Ctrl-Shift-C to copy and Ctrl-Shift-V to paste. mintty has been around forever and has a second life as wsltty, a very specifically adapted to easily launch Microsoft’s WSL environment. No cygwin required.

To enable it, right click a mintty window, go to keys, and tick on the box “Ctrl+Shift+letter shortcuts”. The full list of shortcuts is in the mintty man page.

– Ctrl+Shift+A: Select all
– Ctrl+Shift+C: Copy
– Ctrl+Shift+V: Paste
– Ctrl+Shift+N: New
– Ctrl+Shift+H: Search scrollback buffer
– Ctrl+Shift+W: Close
– Ctrl+Shift+R: Reset
– Ctrl+Shift+D: Default terminal size (rows/columns)
– Ctrl+Shift+F: Full screen (not zooming font despite Shift)
– Ctrl+Shift+S: Flip screen
– Ctrl+Shift+O: Toggle scrollbar
– Ctrl+Shift+P: Cycle pointer styles
– Ctrl+Shift+T: Cycle or tune transparency levels

Some of those are insane (“close window”?!), but the copy/paste shortcuts are lifesavers.

(I finally figured this out after finally mustering the encourage to install Windows 1809, which includes Ctrl-Shift-C for stock WSL consoles. A whole OS update for a keybinding! Then I realized I don’t use stock WSL consoles anyway. oops.

Update: while I’m here, mintty has a nifty feature I’d never heard of before.

Flip screen
Applications such as editors and file viewers normally use a terminal feature called the alternate screen, which is a second screen buffer without scrollback. When they exit, they switch back to the primary screen to restore the command line as it was before invoking the application.

The Flip Screen menu command and Alt+F12 shortcut allow looking at the primary screen while the alternate screen is active, and vice versa. For example, this allows to refer to past commands while editing a file.

30 years of using ttys as my user interface and I’d never heard of this. You know how you run less or emacs or whatever and lose whatever was on the screen to the fullscreen program? Alt-F12 shows what’s hidden. Amazing!

The virtual tabs feature is neat too. The mintty authors don’t want to add a full tab UI, but they do have a quick session switcher built in via Mouse Button 5, Ctrl-Shift-I, or the menu.

It also supports SIXEL graphics. Sadly, no Tektronix 4014.

Edit WSL Linux files from Windows with SFTP

I just hit on a way to edit files in WSL that in retrospect seems really obvious. I’m wondering if there’s some reason it’s a bad idea. It seems to work!

The problem I’m trying to solve is editing files in the Linux partition of WSL from Windows. Ie: editing $HOME/.bashrc with Notepad. We’re told to absolutely never change the Linux filesystem files from Windows because things can break.

So my solution is to run the sshd daemon under WSL. Then use that to connect to my Linux files via SFTP running as a Windows app. I’m using SFTP Net Drive to mount my Linux files as a Windows drive, there are other options. Then use any Windows program to edit the files in that drive, like Notepad or Sublime Text.

All the actual file I/O is happening under WSL thanks to SFTP, so it should be safe. SFTP imposes some overhead but it’s not a big deal for just editing files. One nice thing is SFTP seems to do a pretty good job at preserving Unix file permissions even when editing from Windows.

Update: I’m now doing this regularly, all the time, with the Linux partition mounted as W: in Windows. It’s great! Makes a big difference having easy access to the files over there.

Update 2: this trick works but is no longer necessary. WSL in Windows v1903 includes support for accessing your WSL files via Windows paths like \\wsl$\Ubuntu-18.04\home\nelson. Underneath the scenes it’s using a Plan 9 network filesystem to bridge things.

(originally posted to Reddit)

Standard Notes

I’ve been using SimpleNote for a long time. It’s a great simple cloud-synced notepad and a very nice free service Automattic maintains. Type some text at it and it remembers, you can access it with a nice desktop app or a nice mobile app or any website. The problem is SimpleNote isn’t built for much security. They store your notes in plaintext on their servers. That’s probably OK but if they ever have a security breach we’re in trouble. And oddly, my notes turn out to have some pretty secure content in them. In particular I often temporarily save a password or SSH key to them. Not permanently, but with undo it’s not clear you can ever really delete anything.

Enter Standard Notes. It looks to be very similar to SimpleNote in concept, but it has end-to-end encryption built in, so it’s more secure. (Also you can never recover your notes if you lose your password.) It’s free and open sourceish, looks like they have a Freemium business model where you pay for extra features like fancier editors with formatting, reskinning the UI, etc.

Notes are tagged; in that way it’s a little like Notational Velocity / nvAlt.

The Windows desktop app is Electron and looks to share code with the web interface. The UI is a bit funky, it does not look like a native app, but it’s totally usable. Not sure how the iPhone app is implemented (I’m guessing Javascript as well) but it looks fine.

Trying it out is easy, there’s an import from SimpleNote that works OK, main wrinkle is all my deleted SimpleNotes showed up again.

I love the voice of their help page. Someone very opinionated (in a good way) is building this product. I particularly like this quote:

Your data is a liability to us, not an asset.

 

Easier archived article access

I’m liking the Get Archive Firefox extension. It adds a toolbar button and some other UI for easily getting an archived copy of a web page from the Wayback Machine or from archive.today. It’s not doing anything fancy, just makes it one-click to do something that previously would be several steps.

I mostly use it for bypassing paywalls like at the Wall Street Journal or the Washington Post. But now that I have it installed I’m finding I’m using it pretty frequently, particularly for Wayback history on pages.

The addon is a bit over-featureful IMHO, it has a lot of keyboard shortcuts and other hooks that seem unnecessary to me. But you can turn those off and strip it back to just being a toolbar button.

Cellular data tracking on iOS

My Wanderings app has a problem; when it’s running it sometimes induces iOS to consume a lot of data in the Time & Location service. Like 30MB a day. Because the data usage isn’t in our own app, but rather the iOS, it’s hard to figure out what’s going on. I ended up setting up a second iPhone with a prepaid account just to have a phone that is running nothing but Wanderings to try to figure out what is going on.

Still tricky to monitor cellular data usage on an iPhone. The Settings / Cellular page does give info but you have to think to look at it regularly to record data. Not sure there’s any good way to automate that, but I’ve tried a couple of apps that are aimed at helping people monitor their cellular contract usage.

MyDataManager is the most promising so far. It has a graph of hourly data usage. What’s promising is it sets up some sort of VPN config on the phone that it uses for monitoring. They promise your traffic isn’t actually routed through a network VPN, so my guess is it’s a local-to-iPhone thing that gives them more monitoring ability. Just set it up. Update: not impressed with the app. It only measures when you launch the app, so no graph of history. And it seems to consume a lot of data itself.

MobiStats is what I tried first. It also has an hourly graph but near as I can tell the data is only populated when you launch the app, not regularly in the background. That may be an iOS limitation, dunno.

Both apps also have a feature to record where you are using data, not just when, using location services. Neat idea! But because I’m testing iOS Location Services myself I don’t want to muddy the water turning that on.

Update: neither app seemed to track usefully, they both only recorded new data when I ran the app in the foreground. A little surprised that was the case with MyDataManager, I’d hoped the VPN would give it more logging ability. Also that app used a bunch of data on its own.

 

Copying music to an iPhone in 2018

I tried to copy some new music I bought to my iPhone. In 2018 this is apparently impossible if you want to use iTunes / Apple Music on the phone to play it.

Well it is possible, if you happen to be sitting in front of the One True Computer that has been managing your iPhone sync all along. You can just add some new music and press the sync button again and it works. But if you have the temerity to have a second computer and try to copy music from that computer via iTunes sync, it will fail. Because iTunes will first insist you delete all the music on your phone that’s not present on this second computer. Apple doesn’t deign to let you keep your music. I’m not sure if this is because they assume you are a criminal or if they are just incompetent at multi-way sync.

There used to be a variety of hacks to work around this. For awhile you could clone the library key and fool iTunes into thinking two computers were the same; this no longer works. Some advice has you clicking “manage music manually” in iTunes; I think this sort of helps, but only still if you have access to the full original music library on the second computer. Finally there’s a bunch of third party programs that claim to be file explorers for iTunes that let you copy in music in an unsanctioned / flexible way. I tried several of these for Windows and literally none of them worked. Also none seem really free; they want to charge $40 for the ability to copy a few files. (I fear I may have gotten Computer Herpes installing all this sketchy software.)

Anyway, the only solution I’ve really found is VLC Mobile. It’s back on the App Store, or maybe it never left. And it will play files you copy over via the iTunes File Sharing tab. You won’t be able to play them in the usual Apple Music app, but you will be able to play them. I also fear VLC Mobile doesn’t support CarPlay, another Apple lock-in system, but I haven’t tried it.

While I’m here; playing video files has the same library problem. For that I use Infuse, a third party movie player which is excellent and has its own file store.

(The music in question is Autechre NTS Sessions: 8 hours of glorious bleepy bloopy glitches from Bleep / Warp. Good stuff.)

NTFS filesystem corruption in practice

I unplugged a USB drive without unmounting it first and got burned for my troubles. Windows was able to repair the disc and I think recover all my files, but I had to do it manually.

I use a hard drive to sync files between two Windows desktops with FreeFileSync. I now just unplug the drive whenever I want it; Windows can’t unmount it properly, always says it’s in use, maybe by the backup subsystem? Anyway, I just pull the plug.

So I went to sync the files from the drive to the other disc and it acted wonky. A few files disappeared during the sync. Some other files I expected to exist didn’t. Windows prompted me to run a check or repair via a notification but clicking that did nothing. Manually right clicking the disc and doing Tools / Check and Repair did work though. And afterwards the files I was expecting to find came back. At least I think so, I don’t have a complete audit.

I’m confused how Windows NT is willing to mount a USB drive that wasn’t unmounted cleanly without immediately recommending a check & repair. Also a bit confused about the pattern of what files went missing; it wasn’t just the newest stuff.

 

Windows 10 fail, safe mode, reboot

My Windows 10 box failed, hard. Well maybe soft, who knows? It would boot and log me in as a user, then the system graphical shell would hang, little spinny cursor. One window is visible on screen, Razer Central. That’s some nonsense to turn off the stupid light on my fancy gaming mouse and is notoriously bad software, so maybe it caused the whole system to hang? But even after killing it (Task Manager worked) the system was still hung. FileExplorer seemed to be spinning at 100% of a single CPU core, that’s not a good sign.

Anyway it took me a couple of hours to get the system back. Booting into Safe Mode or accessing other recovery tools on Windows 10 is not at all clear; these docs finally helped me. I tried restoring to a System Restore Point first and that didn’t help, the system was just as broken as before. Fortunately I’d made a full system backup yesterday (using the old Windows 7esque deprecated tool) and restoring that fixed it.

Not sure what really was wrong. The computer had been off for about two weeks, then failed after it rebooted itself to apply some Windows 10 system updates. There were also some Razer updates to install and given that it was on screen when the rest of the system was broken and their reputation for broken software, I’m inclined to blame it. This isn’t even the Razer laptop, this is just a normal Windows machine that had a Razer mouse and I’d installed the software to, like I said, turn off the stupid light on the mouse. Anyway now I’ve excised that software, turned off a lot of other third party services that want to launch at boot (screw you Adobe updater), and will reboot with my fingers crossed.

Update: a few days later I finally worked up the courage to try rebooting. And it worked. I’m 90% sure that the Razer update had some interactive thing it had to do that failed and blocked the rest of the upgrade boot.

Razer Blade 2017 opinions

I bought a laptop for my trip to Germany. Difficulty level: ultrabook, but able to play Windows games. Turns out you don’t have a lot of options. I ended up with a 2017 Razer Blade. Some thoughts:

It’s accomplished its goal, I like the machine. In ordinary use it’s a quiet nice laptop. Good keyboard, nice screen, and it’s silent. Light 2d games (Necrosphere, Heat Signature) also run silently on the Intel GPU. When I engage a demanding game (XCOM 2 mostly these days) the NVidia GPU kicks in and soon after, the giant ridiculous loud fans.

The fan noise is really awful. Like don’t make a phone call in the same room awful. it seems to mostly be turbulence sucking air in from the 1/8″ gap under the laptop. But with earplug-style headphones and in a different room from other humans it’s OK. Heat is acceptable. This is the compromise one has to live with putting a GPU this big in a laptop. I kinda wish I could have bought a lower power / cooler GPU. Or maybe figure out a way to underclock this one. Games autodetect highest settings and when i turned them down it’s a bit quieter.

My main complaint as a sorta-Ultrabook is the weight. 4 lbs is noticeably heavier than my old 3 lb Macbook Air. But then the machine is much more powerful, too. I also wish the screen didn’t have such an enormous bezel. I think most laptops are now sized to the panel, but I suspect this Razer machine is sized to something else and they picked the biggest panel that’d fit and it’ about an inch shy. The speakers in the machine aren’t great either, another unappreciated thing Apple does.

But pretty much this Razer Blade is a nice machine. I think I chose right. I continue to wish someone made a true ultrabook with just a slightly nicer GPU in it than stock. At this rate Intel’s gonna catch up before that happens.

Windows: typing European on American keyboard

Apple has this great way to type non-ASCII characters like Ö or ß or € on both MacOS and iOS. You long-press the key that looks similar to what you want (an O, or an S, or a $) and then wait a bit and a UI pops up and you choose what you want from a UI picker. It’s not great for fast touch typing but for that you’d want a full language keyboard. But for wanting to type the occasional non-English word, it’s great.

Windows, not so much. The frequent advice is type it by character code as if I’m going to memorize 153 and 128 and 223. Not to mention my laptop doesn’t have a numeric keypad. The advice to use the Character Map in that post is not so awful, it works OK, but it’s pretty clumsy.

The best bet seems to be the US international keyboard. It’s an alternate American keyboard where ’ ” ` ~ ^ are dead keys; they’ll modify the next letter to be accented, or else insert themselves if that makes no sense. It works pretty well. Even better the right Alt key can be used to type a bunch of other stuff like ß or €. It’s not perfect but it’s pretty good. Note the Windows 10 anniversary edition moved this; it’s now listed as an “Option” on the English (US) keyboard, not a separate keyboard.

I also tried Holdkey which promises to add an Apple-like typing UI. But it didn’t work very well, the way it grabs onto the keyboard is problematic. There’s some other options along these lines I didn’t try.

Update: if I type y’all I get yáll which I think is hilarious.

Update 2: by default Ctrl-Shift switches between keyboard layouts. That’s obnoxiously easy to press by accident. You can turn that off or change the key mapping.

Alfred replacements for Windows

I loved Alfred on MacOS. 95% of the time I used it to launch apps with the keyboard, but I also liked its clipboard management, access to Google searches, etc. What about Windows? Turns out there’s lots of options. I cribbed these from this Reddit discussion, also see this article. Many of these are cross-platform and work on Mac and/or Linux.

Hain is pretty slick and what I just chose to switch to. It feels almost exactly like Alfred to me, the only thing it’s missing is number key shortcuts to pick items. It’s not very configurable (no skins for instance) but the defaults are good. I added some plugins: Clipboard (to replace Ditto), Google. The terrible / great thing about Hain is it’s implemented in Electron so there’s a full HTML5 shell running. Or several maybe. I see four hain.exe processes total about 200 MB of RAM. And 0.02% CPU which is small but not zero.

Zazu is newish and open source. It seems OK but not as polished as Hain; configuring it requires editing a JSON file, for instance. It’s also HTML5 based (Chrome?), 240MB in memory and 0.02% CPU.

Wox is popular and pretty solid. The install is strange; it says it requires you also install both everything (a file indexer) and Python3. But I think those are both optional upgrades. It’s a little ugly out of the box, Hain is nicer. Wox is 125 MB of RAM and 0.12% of CPU. It’s built in .NET.

Launchy is what I used to use. It’s old and ugly and doesn’t really do anything but launch apps. And that, not very well. Nothing to love but it does work and is free.

FARR is another option with a long history. I couldn’t figure out how to rebind the hotkey, and it’s kinda old and ugly too, but it seems very capable. Also quite small; 20 MB RAM and 0.00% CPU when idle, like it should be.

 

While I’m here, a shout-out to Seer which gives a space bar quick-preview to the Windows Explorer, like MacOS finder has. It’s about $12. Lightshot also seems like a nice improved screenshot-taker. It’s free, I think they’re trying to drive ad traffic to prntscr.com. (Speaking of which my Apple keyboard has no PrntScrn button. It does have an F13 though which you can bind in Lightshot, even if the UI shows a blank key when you bind it.)

Windows sshfs clients

I want to access a remote machine’s Unix filesystem via ssh, the way you’d do with sshfs and FUSE in Unix. There’s a lot of options for it.

  • SFTPNetDrive, what I’m using now. Works simply out of the box. Free for personal use, $100 for commercial use.
    Seems fine, Y: is now my remote disk. Has some reasonable customization options but nothing overwhelming. There’s an option to mount the disk as “Network, Removable, or Fixed”. I was hoping that could fake out WSL so that I could see the remote disk in the Ubuntu-on-Windows subsystem (which now supports removable disks). No such luck.
  • NetDrive, the big daddy commercial system. This provides interfaces for a whole bunch of cloud storage options: S3, OneDrive, etc. 30 day eval, then you pay $50
  • ExpanDrive, another multi-service commercial option. $50
  • sshfs-win using WinFSP. Open source FUSE-like solution. Looks promising.
  • win-sshfs, a fork of an older project (keyword: Dokan). No commits for 9 months, but does have Windows 10 support so it’s not totally dead.

 

Canon MX850 and Windows 10

tl;dr: reinstall the Windows 8.1 driver to get the scanner working.

I have a Canon MX850 I bought 8 years ago. It’s one of those cheap multifunction inkjet printer/scanner/fax things, the ones that cost $20 but each ink refill costs a small part of your immortal soul. The printer has been pretty reliable, but the scanner keeps failing. I’m not certain but my guess is that Canon’s network scanner driver isn’t smart enough to follow the scanner through IP address changes from DHCP. But the printer keeps working, huh.

Anyway, the simple fix is to download and reinstall Canon’s driver. No need to uninstall first. Windows 10 is not supported by Canon, but the 8.1 (x64) driver seems to work fine. At least scanning does, via Windows Fax and Scan. Haven’t tried the fax side.

Synchronizing Windows directories

I’ve been using Allway Sync to keep my two new Windows machines in sync. It’s pretty good. I sync one machine to an external hard drive, then sync that drive to the other machine. So really it’s three copies. Allway Sync also supports various Internet services for syncing, like Dropbox or its own cloud service.

The sync algorithm seems relatively robust. It’s a bidirectional sync, so changes on both sides can propagate at the same time. There are safety features like a sanity check if too many files changed. It tracks metadata and deleted files so deletes can propagate. It also keeps old versions of things in a hidden _SYNCAPP folder. I haven’t delved into details of how it handles a single large binary file that’s only partially changed, I don’t know if it has binary diffs or if it just copies the whole file over.

The UI is pretty awkward. Mostly it’s just ugly. But it’s also a bit confusing. I believe you have to define a new job for each folder you want to sync. (There is a way to sync one source folder to multiple destinations.) I finally found that if you enable the toolbar, there’s an icon for “sync all jobs at once”. I haven’t tried the automatic syncing yet, it seems to rely on a service watching for change file events and/or on a timer.

The trick now is figuring out what all in Windows I can safely sync. My Steam apps folder is safe to sync, and saves me from having to download a 30GB game twice. Syncing my Documents folder seems to work too and propagates some app settings, game save files, not to mention my actual work output like source code and text documents.

The part I’m on the fence about is syncing my Roaming profile. That should keep many more app settings in sync, and my first time copying it seems to have worked OK. But there’s a lot of random stuff in there that doesn’t quite seem like it should be copied, like Slack’s cache files. OTOH the Roaming profile was designed to be copied from one machine to another, so it should work? Edit after trying it I think syncing the whole Roaming profile is a bad idea. Parts of the folder, like Microsoft, seem to be treated specially. Also it makes the most sense to sync when nothing is open that writes to that directory, ie before you log in, and that’s awkward.

It’s free, but there’s a limitation on the number of files. The license is $26 but that’s for a single machine. $16 for a second one.

There’s a bunch of other sync options too. For a long time I used Unison to sync file systems. It works great and I’d still use it for a Unix command line. There are Windows build but I couldn’t get the GUI version to work. I also get nervous using Unix tools to manipulate Windows filesystems.

 

Windows: backing up a failing disk

Ken’s Windows 7 machine has a hard drive failing. Some errors, a few corrupted / lost files. We’ve already bought a replacement drive but are having a seriously hard time getting useful data off the old disk. The disk mostly works; he runs it with Windows for hours at a time (I know, bad idea). But it has some bad sectors.

Simple task: just make a backup. Copy all the files off of it. Windows Backup doesn’t seem to work with no useful feedback why. Casper, a third party disk imaging tool, gives up the moment it encounters a read error. Acronis True Image, another cloner, is free for Western Digital drive owners but the installer doesn’t even run. PCmover isn’t really a backup tool and isn’t backing up complete data. It’s a fucking clown show. I’m about to bust out a Linux system just to run ddrescue. I did find a suggestion that HDD Raw Copy Tool might work.

Hard task: set up the new PC. Ken would very reasonably like to migrate his own data and settings from Windows 7 to a new Windows 10 install on a new disk. This proves to be very difficult from a working disk and nearly impossible from a failing machine. Windows 10 abandoned Easy Transfer. Microsoft did a deal with PCmover but the software is a joke, most of what it moved doesn’t work on the new system. A specific problem is his username changed on the new Windows system and everything seems to have hardcoded the pathname of his old username, not just %user%.

Windows is such garbage.

 

Windows metered network connections

My ISP is down again so I’m back to Verizon tethering. Setting up the network connection I noticed Windows has a metered network option. The docs are very vague, but basically it’s a flag to tell the OS and applications “hey, this network isn’t free”. Windows itself will be a bit more careful; only downloading priority updates for example. There’s also configurable options to not sync OneDrive or download device drivers.

In theory third party apps could also inspect this setting and be smarter on a metered connection. Specifically apps on the new “Universal” platform. In practice I wonder if many apps are that smart. Dropbox isn’t, apparently. It’s all a bit confusing really, and most of the search results you see on Google about metering are “why isn’t stuff updating how do I turn off this metered connection thing?”

Also TIL that Windows 10 enrolls your computer as a peer to peer server in uploading Windows updates to other Windows computers. Yes, by default Microsoft assumes you want to use your upstream bandwidth to serve other customers. That’s some fucking bullshit.

 

Ah, Windows, ye olde errors

Bloom is off the rose with Windows. Or at least, Civilization 6, one of the games I switched to Windows to be able to play well. (It runs on Mac but 50% slower, and I wanted higher end graphics hardware.)

The whole system often freezes when exiting the game to desktop. Well that’s not quite right, Ctrl-Alt-Del still works and you can reboot or log out. But Alt-Tab doesn’t work to switch apps, which is odd because it works fine while the game is running.

GSync also doesn’t work. That’s the fancy variable framerate stuff. All sorts of screen tearing unless I enable VSync.

Both of these bugs could be specific to Civ 6. But it’s the kind of thing you’d think the OS and its graphics drivers would take care of uniformly for all games. Ha, as if.

 

Windows S.M.A.R.T.

Windows doesn’t seem to have built in S.M.A.R.T. support! After reading this guide and this Stack question I think the best option is CrystalDiskInfo. It used to have some bundled adware but the author promises he removed it all, and there’s a portable version for download (ie: no installer). I took a chance and it seems to work.

Capture.PNG

That’s my USB drive. Ignore all the junk and focus on “Health Status: Good”. Its heuristics seem reasonable; at least it shows my two new drives healthy and identifies errors in a failing drive that look plausible.

Gripe

Why the fuck doesn’t Windows have basic SMART error monitoring and notification? It’s the first line of detection for a failing drive, popping up errors for the user would save countless amounts of lost data. (And ignore the advice to try Windows’ wmic; at least on the drive I know is failing, it shows “OK” even though it’s not.)

And why are SMART tools so bad? Note the same user-hostile display table at the bottom as every other SMART tool in the world shows. What’s the temperature? 123? 111? No, it’s 00000000001D, which for some reason is being displayed in hex with leading zeros. At least this program translates it to 29C. No idea what the spin up time might mean though. I don’t even know what “Current” and “Worst” are supposed to mean. Linux smartmontools shows the same nonsense.

Speaking of smartmontools, I tried installing like four versions of it for Windows from dodgy SourceForge binaries. They all sucked, many couldn’t even find my drives. So much terrible Windows software out there.

Ken’s computer is showing signs of a failing hard drive. Last CHKDSK randomly found about 30 files corrupted. The machine is about five years old, just in time for a shitty consumer hard drive to fail. Ugh.

 

An example ugly Windows font

I’ve complained about Windows font rendering but was hard pressed to have a good example. Well here’s one, from a Bloomberg articleCapture.PNG

Look at how ugly that is! The kerning in “To” is wrong. The “m” and “r” and “u” and “n” are all broken, by which I mean literally broken like white pixels in the middle of the letter. The tail on the “9” has visible jaggies. I’m not just nitpicking, I find this really difficult to read.

The font is a web font, TiemposTextWeb, at 18px. Maybe it’s just a spectacularly bad choice? But Bloomberg is a big publication, clearly someone thought it was a good font. That sample is rendered in Chrome; it looks the same in Edge. I have ClearType turned on with more or less default settings in Windows 10; I used the tuner to pick a very slightly heavier rendering at some point but I don’t think that’s the problem.

It looks much better in the PDF specimen. Here’s some sloppily-made images of the PDF and then Chrome / webfont rendering the same text, to show the spindly nature of Windows’ rendering.

pdf.png

ttf.png

Another example

Another example, Gentium Basic, an SIL font popular because it has support for a lot of scripts. The lowercase “a” is entirely broken, even at 30px.

Capture.PNG

I mean that’s some fucking garbage right there. It looks a bit better if install a TTF and render it with Paint.  It still looks bad, but at least it’s not broken, just ugly-ass.

Capture.PNG

On the same page there’s a “Gentium Plus” that looks a little better still. It’s not great, but it’s at least not embarassing. So maybe font quality is part of the story, but something very bad is also happening in Windows’ font rendering.

Windows customizations

I’ve now set up a second Windows box. I was in a hurry and didn’t take notes, but from memory here are some of the specific tweaks I made in addition to installing normal application software.

I sure wish Windows had a clean way to store these customizations and copy them to a new machine. MacOS is much better; almost everything is localized to your home directory and Time Machine will help you set up a new Mac.

I thought I’d be clever and copy my roaming profile over to the new computer. That worked for some things like Discord and Slack. But lots of configurations are stored in other places. Cmder still stores its config files right in the program directory for instance, which seems like a good idea if you’re using it as a portable app but otherwise is not a good thing. And some applications settings are buried in the registry and I don’t know of an easy way to extract the ones you can safely copy over.

Windows 10: separate speaker and headphones

I have both headphones and speakers plugged into my motherboard’s analog output jacks. It’s a pretty standard Windows desktop setup, the motherboard does HD Audio which has 5 analog jacks which can be programmed to do different things like speakers, headphones, line-in.

Also pretty standard, my computer had the RealTek HD Audio Manager installed, an ASUS skinned one. This does a nice job of popping up a dialog when the user plugs in new speakers and asking them to configure it. Unfortunately it also seems to have a behavior where when I plug in headphones it automatically silences the speakers. In fact both analog outputs show up as a single “Speaker” device in Windows, there’s no way to use them independently.

In theory the Realtek driver has option settings to reconfigure this behavior, to let you use the rear and front jacks as separate devices. But my version didn’t have those settings, no “Playback Device” section at all.

Following some cargo cult advice I solved this problem by just uninstalling Realtek entirely. Goodbye 500 MB of stupid reverb effects I’ll never use. Turns out Windows 10 itself can manage the audio hardware with no problems. I did have to unplug and re-plug the devices for Windows to detect them, but now my speakers and headphones show up as separate sound devices.

Capture.PNG

While I’m here, a little theory on how this all works in Windows. Each sound device is an independent output channel for apps to play to. Most apps just play to the “Default App”, which you configure in the Sound control panel or with a program like SoundSwitch. But some apps let you choose a specific output device, particularly games, and you can use that to play different sounds simultaneously through different apps. There’s also a notion of a “Communications device” separate from the usual default, I think for VOIP apps like Skype to use a headset always.

I’m still confused about what drivers are involved. Device Manager tells me stuff is being managed by Microsoft’s Driver 10.0.14393.0, which I think is just Windows 10. But Sound tells me that there’s also a RealTek Controller which a RealTek Driver 6.0.1.7910. I wonder if Microsoft ships that, or if I didn’t uninstall that driver when I uninstalled the Realtek Audio Manager?

Update: this stopped working after I rebooted.

Update 2: a reader wrote to suggest

The problem is that Windows 10 reinstalls the Realtek driver automatically (in the background without asking no less...). To stop that you can open the device manager and open the “Sound, video and game controllers” list (not “Audio inputs and outputs”, there it doesn’t work). There you will see that your audio device is a Realtek device again. Open properties, go to the driver tab and click on “Roll Back Driver...”. Now you will get the Windows driver and it wont reinstall the Realtek driver.

rsync to exFAT USB

Ran into a weird bug trying to rsync my music collection to a USB drive on a Linux box.

mkstemp function not implemented

This blog post has an explanation for the problem; rsync -a wants to set file owner, group, etc and exFAT doesn’t support those filesystem features. And apparently the Linux FUSE driver doesn’t just fail gracefully? Also not clear why it shows up as an error for mkstemp, except I imagine that libc function is also trying to set permissions.

Anyway trying the cargo cult solution which is not to use rsync -a, but instead just the options you really need, which are -rltD.

 rsync  --delete -rltDW --info=progress2

The -W is a bit of lagniappe, it’s supposed to help USB speeds. info=progress2 is a reasonable display for rsyncing 120GB of music files.

I’m seeing roughly 30±10MBytes/sec writing large files, . The destination is a USB 3.0 adapter for an SD Class 10 card. The card promises 80MB/sec reads and “somewhat slower write speeds”, so that seems reasonable.

 

34″ ultrawide monitors: Asus vs Acer

I’ve had occasion to try out two fancy gaming monitors recently; the Asus ROG Swift PG348Q and the Acer Predator X34 bmiphz. They are nearly identical. Both are great. Buy whichever one is cheaper. Last few times I’ve looked one has been $1100 and one has been $1200. If it’s a coin flip, I think the Acer X34 is slightly better.

Both monitors have identical panels and specs, as you can see in this comparison. They’re both 3440 x 1440 monitors in a 34″ package (109 ppi), they both support NVidia GSync, they’re both IPS panels. They both have an “overclock” feature to run up to 100 fps. I think there’s no meaningful difference in the display. This one review found slightly better color fidelity in the Asus but given it’s the same panel I think that’s probably individual item variance or testing error, not a real thing. They sure look the same to me. The difference is in the extra electronics and details.

For electronics, they both have speakers that can be driven via USB, but the Asus PG348Q has absolute garbage 2W speakers whereas the Acer X34 has merely awful 7W speakers. Also the Acer is 100% better in that it has 4 USB outputs, not just 2. The Asus has slightly nicer buttons and OSD menu UI but you will use those things once at setup and never again.

I like the Acer stand better; it came preassembled and doesn’t have an unusable cable management feature. Also it’s not some ugly asymmetric weirdo thing like the Asus. Both monitors have stupid decorative LED lights shining down that you will immediately turn off. The Acer monitor has the word “PREDATOR” prominently on the front bezel which is sort of sinister, but it’s easy enough to ignore it or put some tape over the branding.

They’re great monitors. The 34″ 21:9 form factor is the first monitor big enough I haven’t felt any need to have a second monitor. The screen quality looks very good to me and I haven’t missed my old iMac screen at all. But I don’t have exacting color fidelity requirements. I will say both the Asus and Acer screens look a bit hot to me, even after fiddling with color calibration. They also both have suspiciously garish default color settings and weird “gaming modes” I don’t understand.

ConEmu + ubuntu on windows: bell

I’m pretty happy with how my Unix setup on Windows is working. But there’s one horrible thing; the awful bell sound in the terminal emulator. Every time I hit tab in bash to complete it plays a good old ASCII 0x7 BEL, and it’s some earth-farty three tone loud sound that is just awful.

The solution is simple; go to the volume mixer and set the volume for “Console Window Host” to 0. Now your shells won’t make any audible noise. Of any kind. Peace and quiet.

What I really wanted was to reconfigure the bell sound. PuTTY has a whole set of options for this. I think it’s not really possible though. ConEmu can’t or won’t do it, as the author angrily keeps telling users. Apparently his code isn’t playing the bell at all, it’s being passed through to a lower level Windows console handler of some sort. There is an option for intercepting the bell but it’s not working for me for some reason, at least not on Ubuntu-on-Windows. It does seem to work for msys.

Another option often suggested is to configure your Unix programs not to use a bell for alerts. You can set it in bash, and GNU readline, and vim, and less, and... that way lies madness.

It turns out the sound is actually being played by Microsoft’s software, somewhere deep in their version of Bash or WSL or something. And it’s apparently not configurable. But you can find it in the volume mixer and cut off its air supply.

God that sound was awful.

Keeping time, time, time,
In a sort of Runic rhyme,
To the tintinnabulation that so musically wells
From the bells, bells, bells, bells,
Bells, bells, bells --
From the jingling and the tinkling of the bells.

Update: the plot thickens. The sound that’s being played is supposed to be a honest-to-good beep, the one generated by the motherboard with its integrated trashy speaker. Not your fancy stereo sound system. Modern hardware doesn’t have speakers, and starting in Windows 7 there was a special “beep driver” written to intercept this low level beep system ability and replace it by playing a wav file.

The sound Windows 10 seems to be playing is the sound event “Critical Stop” which is set to play “Windows Foreground.wav”, that horrible sound. I replaced it with “Windows Ding” and it’s better.

Modern screen refresh: beyond 60hz

One of the fun things about my new gaming setup is it can render at frame rates other than 60Hz. I’ve now got it set up to run at 3440x1440@75 and it seems to be working well. Of course it won’t matter much for desktop work, but it does have an effect on game rendering. Can a human perceive it? Lots of folks say so, and this blind test confirms it.

The hardware I have is an NVidia GTX 1080 graphics card hooked to a Asus RoG Swift PG348Q display. It’s hooked up via DisplayPort 1.2, the 2009 standard. In theory there’s enough bandwidth to run 3840x2160@75, but for some reason my monitor only will show up to 60Hz unless I enable “overclocking”, where it will then display up to 100Hz. The overclocking didn’t work with the first decent quality cable I tried, but it did work with the cable included with the monitor.

The neat thing about this setup is it doesn’t have to be a constant 60Hz or 75Hz. The hardware all supports Adaptive Sync, a technology where the graphics card tells the LCD when a new frame is ready to be displayed. So games, etc can run at any speed; 20fps, 27fps, 60fps, 75fps and it displays without screen tearing. This is way better than the Vsync hack that we’ve been stuck with since the ancient days of CRTs. No more triple buffering required, no awkwardly being stuck with display rates that share common factors with the number 60, no tearing or stuttering. Just draw a frame when it’s ready.

gsync

Unfortunately this variable sync rate comes in two flavors, G-Sync and Freesync, and monitors seem to only one or the other. NVidia does G-Sync so that’s what I’m using, and fortunately the higher end monitors seem to favor G-Sync as well. G-Sync requires that an expensive NVidia scaler be installed in the monitor (and may not technically be DisplayPort Adaptive Sync at all.) Freesync is the open / cheaper standard DisplayPort, but only AMD video cards support it so far, and AMD is way behind. Hopefully this will all get better in a couple of years.

Unix environments for Windows

One thing I miss about my Mac is having a usable Unix environment. Now I have two on my Windows machine, with different significant flaws. MacOS isn’t a great Unix, but it’s perfectly adequate for basic stuff. And it’s really handy having tools like rsync and command line ssh around. Windows has its own command line world with the venerable CMD.EXE (DOS) and the newer PowerShell. But screw that, I want Unix. Here are options.

Ubuntu-on-Windows (WSL)

This is the new hotness from Microsoft and is very nice. It feels like a legitimate Ubuntu environment. Except so far it doesn’t support networked filesystems.

WSL sits as its own OS on top of the NT kernel, just like Windows is an OS on the NT kernel. There’s not a proper Linux kernel running, instead Microsoft has emulated the Linux kernel at the syscall interface. The userspace then runs stock Ubuntu, actual Ubuntu x64 binaries unmodified. It’s an impressive piece of work.

The drawback is not everything works. ping doesn’t work unless you run bash as Administrator. (Some docs I’ve read say ICMP isn’t implemented at all.) Filesystems are limited. USB drives don’t work. Network file shares don’t work. There’s no NFS support in the Linux image, nor is there FUSE support. The view of the underlying Windows filesystem (in /mnt/c) is a bit strange too, like I can’t see a proper view of my Desktop folder. In general stuff that works seems to work right, and the Microsoft team is moving fast in adding new features. I’m tempted to join Windows Insider just to start running betas, but I think I have to get a whole new Windows version, not just an upgrade to WSL.

There is an honest /sbin/init process running in WSL, PID 1, but its only child by default is the bash shell you start the thing with. So no init scripts / systemd running services. You can open multiple bash processes that can all see each other and share a filesystem. But if you close the last bash, you lose the whole WSL environment, which makes daemons a bit awkward.

Other names for this system are Windows Subsystem for Linux (aka WSL) and “Bash on Ubuntu on Windows”. Note these make for awkward search terms on Google.

Cygwin

The granddaddy of Unix emulation for Windows. I haven’t tried it in a few years, but I used to hate its package manager and its approach to Windows integration. Weird path names and environment. But it works pretty well and has a significant set of tools. MobaXterm bundles Cygwin in with an X server and terminal emulator.

msys2

The other venerable Unix option for Windows, some evolution of msys / msys2 / MinGW / mgwin32 / MinGW-w64. It has some Cygwin roots in it too, I’m not sure how much, but the mingw philosophy is to make things more like Windows and less like Unix. The result is a lighter weight Unix environment with some compromises. For instance symlinks aren’t supported because they wouldn’t work in Win32 apps. So instead creating a symlink makes a copy of the file, which is pretty damn broken but you can live with it. The crazy neat thing is the Unix programs like make are actually Windows executables like MAKE.EXE and will work fine in Windows, without bootstrapping a Unix environment. Handy for ssh.

There’s no visible init process, you just have a naked bash running according to ps, although its PPID shows as 1. Software is managed via pacman (as used in Arch Linux), there’s a large variety of packages and a toolchain for building your own. I’m not wild about the package and software versions and a bunch of basic stuff isn’t installed by default (like tar). Also some of the tools have idiosyncracies. And I have some problems like Ctrl-C not interrupting IO bound bash scripts. But it’s definitely a usable Linux environment, just not Ubuntu.

Git for Windows (aka msysGit)

This shows up as a recommended Unix option. It’s a tight, easy to install bash shell plus enough related utilities to run git. It is based on msys2, some of the history is here. It does not include much though, like there’s no rsync. And no compiler toolchain, no package manager for installing more stuff. It’s great for providing a git command line though.

Terminal window

Unix programs really want to be running in an xterm/vt100 emulator. There’s a bunch out there. I’m liking Cmder, which is an enhancement wrapper for ConEmu. mintty is another option, that’s what msys2 uses by default. wsltty is a customization of mintty for WSL. MobaXterm is also popular. Note that PuTTY/SecureCRT is not really needed any more. They are a combination of terminal emulator + ssh, but now you can just use a simple emulator plus OpenSSH command line. Still working on a good ssh-agent solution though.

History

As a historical footnote, WSL is not the first unmodified Ubuntu to run on Windows. There’s also andLinux, based on coLinux, a cooperative VM. There’s some other Unix-alike Windows options out there too, I think mostly abandoned. See also Interix and Windows Services for UNIX.

Windows 10 gripes

I’m now a week into switching from Mac to Windows and have mostly settled in. Here’s a list of gripes I have about the Windows experience. Compare to a similar post I wrote in 2011 when I switched to the Mac. Honestly mostly the Windows machine is fine and I think this change will take permanently. But you notice things when you try something new.

Operating system problems

Windows is actually not a bad operating system, the NT kernel is pretty good. But there’s still a lot of warts.

File paths are still broken in Windows. Stuff installs and writes files all over the filesystem: Program Files (two versions), root directory, various user directories. The fact that I need to know about a pathname like C:\Users\Nelson\AppData\Roaming\Sublime Text 2\Settings is terrible.

I have two GPUs: the motherboard and a fancy gaming card. It’s really unclear to me which GPU is used when. In theory I can use the motherboard plug but it still uses the card? I couldn’t make that work reliably, so I just used a plug on the card.

There’s no way to make Windows re-open programs you had open when you reboot and log in. And if you want a program to start when you log in, it’s a hideous process of opening one of two magic folders and creating and dragging shortcuts. Seriously, I have to make a shortcut and put it in C:\Users\Nelson\AppData\Roaming\Microsoft\Windows\Start Menu\Programs. That’s handy.

Legacy problems

It’s remarkable how 30 year old DOS software still works on Windows 10. But that legacy support comes at an increasing cost.

There’s an uncomfortable mix of Windows 7 and Windows 8 philosophy in Windows 10. For instance there’s two overlapping sets of system settings: Control Panel (Windows 7) vs Settings (Windows 10). Also there’s too many backup options. The Windows 10 things are better, but they aren’t complete so you need the legacy Windows 7 sometimes too.

Windows still comes in a 32 bit version! That’s nuts. Worse, applications are also distributed in both 32 bit and 64 bit builds. OMG why? I wonder how many users choose the right one? And they’re installed in separate folders. “Program Files (x86)” is a very awkward name for a folder. There’s uglier stuff hiding under the covers too, like file system redirection.

Windows 10 still expects DOS newlines in files. Files have both CR+LF to end a line, and tools like Notepad won’t display a file correctly if it only has LF like everyone else in the world. This continues to cause headaches when using Windows tools to edit Unix files.

UI problems

Windows 10 is ugly. MacOS is so calm and harmonious.

The biggest problem is the UI still seems designed for 75ppi screens. Modern LCDs are 100+ppi, so everything is too small. System tray icons are 16x16! A lot of apps default to 8 or 9 (points? pixels?). I get a headache from squinting and leaning close.

Microsoft has created display options to scale everything; 125% does look more or less the right size. But apparently every single app has to be smart about scalings; if they don’t, it goes blurry like it was up-sampled with a bicubic filter. Many apps are OK. But Electron apps like Slack and Discord have this problem right now, apparently a fix is on its way. Also Chrome up-scales all the images in a web page to 125% as well, which is entirely unacceptable and makes the scaling setting useless.

The fonts are ugly. They look spindly, thin. I’ve tried tweaking ClearType to make things better with not much success. Font rendering for CJK fonts is so bad a bunch of users have created alternate font renderers like MacType. But their installation is spooky and the English documentation is not great so I’m not using them.

So many apps play sound notifications. For instance, social apps like Adium and Discord love to make noise when people join/leave. You can turn these off in each app. But it’s hard to find which app is making noise. The Volume Mixer program will show you but the window is small and modal and not really practical to leave running all the time.

The default sound set in Windows 10 is goofy, too light and ethereal. I’m particularly missing a way to have a good clean beep sound for the BEL character in ttys.

The mouse scrolls backwards! This is actually Apple’s fault; they were the ones to reverse things in the first place. But now I’m used to it and switching back is annoying. There’s hacks to reverse it in Windows, but I’m soldiering on.

Mouse scrolling doesn’t feel good on Windows. The “scroll 3 lines at a time” hack in the driver seems dumb. And sometimes the wheel scrolls backwards at the end of a gesture, either through hardware flakiness or my fingers being inaccurate. Either way I never noticed a problem on a Mac.

It’s awkward that Windows uses Ctrl-C for copy and Unix uses it for terminate process. In general I prefer the Mac’s use of the Cmd key and wish Windows used Alt the same way. And don’t get me started on Windows’ apps love of Ctrl-Shift-Win-X type hotkeys.

Missing features

Here are some things from my Mac I miss on Windows.

I miss auto-correct for typos. I’m confused because this is built in to Windows 10, and does work for me in MSIE Edge. But it doesn’t work in Notepad, or in Chrome, or many other apps. Apparently Chrome does its own thing. Also autocorrect only works for UWP apps, ie new things. Notepad seems like a strange oversight.

I miss the MacOS/iOS way of entering “special characters”. Hold down the E key and instead of uselessly repeating the E, it pops up a little GUI for you to choose É or the like. Windows doesn’t really have this (I wonder if Apple has a patent?). The best alternative I’ve found is the Touch Keyboard, which has a similar UI with the mouse.

I miss the emacs editing keys in text areas, particularly Ctrl-E for end of line.

I miss Keychain. I didn’t use it much on the Mac, but having a central system for secrets is really smart. The specific thing I miss using is the SSH agent.

I miss iMessage. It was great getting my phone text messages on my desktop. Apple seems uninterested in opening iMessage to anyone else.

I miss having a brightness control for my monitor from software. There’s no volume hotkeys either. Actually I miss everything about how the iMac integrates display, etc in to the computer. I now have no webcam and no microphone. OTOH my new external monitor is lovely. Better be, it cost half as much as an iMac!

Good things

So those are the gripes. Here’s good things about the Windows switch.

Gaming. That was the #1 reason I switched back to Windows, I wanted to dip back into PC gaming. Apple is simply not competitive in desktop gaming, not in hardware and certainly not in software. Microsoft’s lock-in strategy with DirectX succeeded.

The hardware itself is better and faster. Apple has neglected the iMac line and fallen behind. The GPU is the main thing I have that a Mac can’t do. But it was also nice being able to build a machine with Kaby Lake parts the second week they were available retail. I was also surprised that it was relatively easy to spec a clean, quiet piece of hardware; that used to be a big PC drama. It wasn’t much cheaper than Apple hardware though, particularly when you consider the display.

Network file shares work better. I gave up on using SMB on my Mac when Apple dumped Samba for their own broken SMB implementation. Of course SMB is quite nice on Windows. NFS worked on the Mac but was awfully slow and didn’t include an authentication solution. SMB is grody but seems to work.

My Network printer just worked. I had to do literally zero setup; it was discovered and configured automatically. Not so lucky with the scanner though.

Ubuntu-on-Windows is shaping up to be a good Unix environment, certainly better than MacOS. Here’s a post about it.

 

 

Verizon tethering for real

I’m glad I did that tethering experiment; I had to use my cell phone for Internet in anger today after yet another local WISP outage. Big storm, power outages, but also some robustness problems in equipment and/or service. I do have sympathy, the ISP depends on $300 wireless devices installed in trees scattered all over the county.

Anyway my iPhone worked fine for tethering. I put it in an east-facing window. Only one or two dots of service, but my Mac through it was reliable and seemed fast. I didn’t measure but it felt 10Mbps fast, at least. I quickly forgot I was tethered.

Doing my ordinary daily routine my iMac alone seems to use about 100 MB / hour. Call it 1GB a day. My data plan is only 2GB, but with another 2GB carryover that’s good for 3-4 days before it costs money. Overage charges at Verizon are $15/GB, but you can also avoid overage by adjusting your data plan size; no switching cost and it’s retroactive for the whole month. The plan price is about $5/GB.

It’d be $135/month if I wanted to just buy 30GB a month. But I really use more like 100GB / month once you factor in other devices, discretionary downloads, etc. That’d be $450/month (!).

The plan flexibility makes Verizon a pretty good low cost backup option.

 

Windows 7 update fixes

I dusted off the old Bootcamp partition to run Windows to play Civilization VI, impatient for the Mac release. Every time I do this I’m reminded how bad Windows is. This time around it was 90 minutes spent trying to install and run the game and failing. I gave up and went to bed, then fixed it in the morning.

The symptom was the installer would hang while installing the Microsoft VC 2015 redist. Cancelling the installer didn’t help. Manually killing the wuas.exe process that was hung did allow the install to complete. But then the game wouldn’t run; you’d launch it and it’d quit immediately with no error. Launching the program manually (bypassing Steam) revealed the error, “api-ms-win-crt-runtime-l1-1-0.dll is missing”.

So then begins the cargo cult debugging. Googling for answers and trying various incantations to fix the mysterious problem.

The first thing I tried was manually installing the VC redists. These installers have always sucked. The end result is it’s copying 20MB worth of shared DLLs into a system directory. Why does it take five minutes? Why does it hang entirely? Running by hand (as opposed to via the game installer) sometimes helps. It didn’t this time, it kept hanging.

So the second thing I tried was fixing that error about the crt-runtime. There’s a consensus in the cargo cult about how to fix this; run Windows Update. But Windows Update wasn’t working for me. This is the moment I confess my copy of Windows 7 isn’t registered with a valid license, I’ve been using the grace period for the very rare times I want to run Windows. My bad. So is it the lack of activation that’s causing the problem? Windows is popping up a nag when I try to run the installers. But there’s no explicit error, the installer just hangs. Trying to install it manually didn’t work either, same hanging on Windows Update stuff.

And then the scales fell from my eyes. Windows Update is broken. A fix was released in April 2015; or maybe not until July 2016. Not sure. Anyway the first step in installing that fix is to stop the Windows Update service. Once I did that the crt-runtime installer worked, copying it’s 800kb file successfully without hanging. Congratulations, l’il fella! And that was enough to fix the problem.

So let me rant and describe all the failure-by-design, from top down:

  • The game crashes on startup with no message.
  • The game installer hangs with no explanation. You can quit the install, but then it’s broken.
  • The underlying VC distributable installers hang with no explanation. Its job is to copy 20MB of files, but it can’t do this.
  • The underlying underlying CRT runtime installer is hanging with no explanation. Its job is to copy 800KB of files, but it can’t do this.
  • The root cause is Microsoft screwed up Windows Update somehow and fixing it is awkward, because it requires Windows Update to install the Windows Update update.
  • And worming its tendrils through all this is Windows Activation DRM, which may or may not be interfering and causing problems. With no explanation.

It really is an awful system.

 

Apple UI geniuses at work

I accidentally clicked something Keychain related in my menu bar and this popped up

Screen Shot 2016-05-24 at 4.28.06 PM.png

Notice the lack of a red close button? Cancel causes the window to respawn middle of my screen. Over and over again. Did I mention the window floats on top of everything else?

I particularly like that apparently the only way to get this to go away is to type my password to it. That’s good training for users; “type your password even if you don’t know what it’s for because it’s the only way to make the dialog go away”.

Update oh god it’s reproducing. A second one just popped up

Screen Shot 2016-05-24 at 4.34.16 PM.png

Update 2: apparently I’d locked my login keychain by accident. That’s cool, rebooting unlocked it without me ever having to type my password.

MacOS third party graphics drivers

I did something I never thought I’d do and installed third party graphics drivers for my Mac, which has an NVIDIA GeForce GTX 660M graphics card. I was motivated to do that because the new game Stellaris was crashing frequently. The cargo cult advice for another game from the same publisher was that the third party drivers seem to have helped and I’ll be damned, they do.

NVIDIA couldn’t make it more confusing what these drivers are for, saying “This driver update is for Mac Pro 5,1 (2010), Mac Pro 4,1 (2009) and Mac Pro 3,1 (2008) users.” I don’t have some ancient Mac Pro with a video card, I have a modern iMac with a stock apple GPU. But the fine print indicates that really these drivers are for pretty much any Mac with an NVIDIA GPU. Also it’s called the “Web Driver”, which is an insane name for a kernel module. Note that there’s no index for all NVIDIA releases; you have to go this reseller page to find all the versions. And don’t be confused by the CUDA drivers; those are for high end number crunching, not graphics and gaming.

The installer seems well behaved. Worked fine on reboot for me, and the drivers have only seemed to be an improvement so far. Also it includes a control panel where you can switch back to the default MacOS drivers or uninstall the NVIDIA stuff entirely.

No idea what’s going on with Apple and MacOS that the stock El Capitan drivers aren’t good enough. Or with Paradox, the game publisher, that their games are sold for Macs without testing on standard machine configs. The whole point of paying the Apple premium is this stuff is supposed to work out of the box.

Update Dec 2016: the NVidia drivers are responsible for some graphics lag in League of Legends. With them installed, when Thresh drops a lantern my FPS drops from a solid 60 to 45 FPS or so. With the stock OS X drivers there’s no FPS drop. I don’t know if this is a bug in LoL or the drivers or an unfortunate interaction between the two. It may also be related to vsync.

MacOS unzip is ancient and busted

Tracked down an OpenAddresses problem with our primary data product, a 3GB zip file. MacOS unzip can’t unzip it, producing errors like this:

skipping: us/il/macon.vrt         need PK compat. v4.5 (can do v2.1)

The underlying problem is MacOS El Capitan (10.11.4) distributed the ancient unzip version UnZip 5.52 of 28 February 2005. This version does not work correctly on files > 2GB big. The usual recommended solution is to install p7zip via Homebrew and use that to unzip the big archive. A lower impact option is to install the Homebrew dupe for unzip, which is UnZip 6.00 of 20 April 2009. That’s a bit awkward since being a dupe, Homebrew won’t symlink the binaries by default.

This is not the first time I’ve wasted working around Apple’s awkward user space tools. The less file reader is also an outdated version, and last I checked was compiled with weird options like not respecting the LESSKEY environment variable.

I really should just stick to Ubuntu.

MacOS 10.9 to 10.11 upgrade

I upgraded my 2011 iMac from Mavericks to El Capitan. Partly on a whim, partly because a lot of apps no longer work with 10.9. Mostly pleased with the result, Apple really does a nice job on not breaking systems on upgrades, migrations, etc. Still some notes:

  • Apple removed my fucking software. As part of the new security model Apple decided it was OK to delete all my files in /usr it didn’t approve of. Including my Homebrew install. Thanks, Apple! I found my purloined programs in /Library/SystemMigration/History/. I was going to rebuild Homebrew anyway because reasons, so meh, but... Weird to also find stuff from /System put there, stuff I never created.
  • MenuMeters broke. No surprise, it was using a weird hack. There’s a port of MenuMeters to 10.11 which works fine and no longer needs the hack, at the expense of losing the ability to rearrange the menu bar.
  • Seil didn’t break! That’s a funky kernel driver that lets me override CapsLock, was sure it was going to stop working.
  • I can no longer move the Dock to a corner. Thanks Apple.
  • The alt-tab popup  now shows on my secondary monitor. Apparently it shows up where the Dock is. I want the Dock on my secondary, but the Alt-Tab on my primary along with the menu bar. Sources: 1, 2
  • League of Legends isn’t running completely smoothly. I see occasional 0.1s pauses. It’s not unplayable, but it’s not right. It’s mysterious, not easy to reproduce / isolate.
  • Ever since my iMac got a hardware repair something made noise in the case when high contrast stuff scrolled on the screen. Weird, I know, I assumed it meant something wasn’t properly shielded anymore and EM was leaking into the speakers. That problem is now gone!?
  • Every time I plug in my phone to charge it, the unwanted Photos app launches. Found a solution which requires running the photos app enough to uncheck a thing. Remember when Microsoft used to exploit their operating system to promote their other products and everyone got angry, up to the federal government? Why does Apple get away with even more aggressive self-promotion?
  • my sshd stopped running. I had to renable it via Sharing Preferences
  • Despite the trend to flat design, Yosemite added some tacky transparency effect that makes menus harder to read. Here’s how to disable it.

Homebrew. For my own notes, the output of “brew leaves” from my old system. I’m installing fewer of these things; in particular no octave or gcc. Installing this time to /usr/local/homebrew. I don’t like it installing in /usr/local/bin, etc; been burned by that going wrong.

bash-completion bcrypt clens cloc cloog duti exiftags fdupes ffmpeg
homebrew/fuse/fuse4x gcc homebrew/science/ggobi gist git grc icu4c
iftop iperf iperf3 jbig2dec jq homebrew/dupes/less homebrew/dupes/libpcap
libvo-aacenc mg mobile-shell mp4v2 mtr nmap node homebrew/science/octave
optipng ossp-uuid p7zip par2 pgdbf postgis pv pyqt python python3
q homebrew/dupes/rsync s3cmd homebrew/fuse/s3fs sshuttle unison
unrar wget wireshark

Packages to install this time:

bash-completion bcrypt exiftags ffmpeg gist git grc iftop iperf iperf3 jq homebrew/dupes/less mg mp4v2 mtr nmap optipng p7zip par2 pgdbf postgis pv homebrew/dupes/rsync s3cmd unison unrar wget

Everything installed with no drama except for postgresql (and postgis). It has some bug building in Homebrew related to libreadline and doesn’t seem to build with just the command line tools. Installing the full Xcode via the App Store fixed it.

osxfuse and sshfs didn’t install right via brew cask; simpler to download the installers and run them myself.

Xiaomi Yi Action Camera notes

I bought a Xiaomi Yi camera. It’s a GoPro-knockoff, a small HD camera that takes amazing high quality video and is only $70. Unfortunately it’s also not really made for the US market and is poorly documented and I can never remember how to use it.

Quick use notes:

  • Press front button to turn it on: it beeps and light in front starts flashing.
  • Wait for beeping / flashing to stop. Front should glow blue (full battery).
  • Press shutter button on top to start recording. Beeps once, lights flash while it records. press shutter button on top again to stop recording. Beeps several times.

Status lights:

  • Front ring: battery indicator goes from red (low) to purple to blue (full)
  • Top/bottom/back: flashing red LED indicates video recording, photo taken
  • Side: blue LED indicates WiFi is on

Sounds:

  • One beep: turning on. Also acknowledging image capture start.
  • Two beeps: still turning on.
  • Three beeps: connected to USB.
  • Four beeps: video recording finished.
  • Seven? beeps: turning off

Buttons and controls:

  • Front button: power. Short press to turn on, long press to turn off.
    Can also be used to swap between photo/video mode.
  • Top button: shutter control / start recording
  • Side button: turn wifi on. This takes awhile, wait for flashing blue.

For more complex control the camera connects to an iPhone app. The camera can be put in WiFi access point mode, at which point your iPhone connects to its private WiFi network and can control it. (Default password: 1234567890). Lots of settings, the main thing I did was be sure the camera defaults to video mode when turned on.

IIRC you can also download video this way but it’s unreliable, I ended up popping the SD card to copy my recordings over. Or maybe I used the device as a USB drive.

The phone is hackable, there’s a world of custom firmware etc. Also lots of stories of people bricking their cameras.

Mac sound capture, take 2

Awhile ago I wrote up some notes on recording League of Legends videos using OBS. I still mostly follow that horribly manual workflow, but I was having a hard time getting sound to work reliably. I think I have it sorted out now.

  1. Install Matt Ingalls’ SoundFlower 2.0b2 from GitHub
  2. Reboot. Not clear this is necessary, but I think it may be.
  3. Follow these instructions for configuring audio. However, Soundflowerbed is no longer included. Fortunately you can ignore that if you Audio MIDI Setup yourself (standard Mac software)

The key thing here is you use Audio MIDI Setup to create a new “Multi-Output Device”. That’s a virtual sound device that can send output to more than one place, in this case both “Built-in Output” (your speakers) and “Soundflower (2ch)” (the capture device).

Then you use the Sound preference panel to tell the Mac to play output to that new Multi-Output Device. Now every sound your Mac plays will both come out the speakers and be sent to SoundFlower.

Then you set up OBS to accept audio input from the SoundFlower device.

Unfortunately setting the default sound output to Multi-Output Device will break the volume control from the Mac keyboard. You can still set the volume for each output in the Sound panel though, just be sure to leave Multi-Output Device selected when you’re done. You want to modulate actual volume using Internal Speakers’ control. Set the Soundflower and Multi-Output Device volume to maximum, so that sound is passed through at full volume to OBS.

In previous versions of this setup I found cases where OBS could record audio correctly, but only if it was launched after the program playing the sound. No idea what that was about. I don’t think that’s happening any more.

If you’re serious about doing more fancy audio routing, the commercial Loopback program is pretty good. At $75 though it’s a bit pricy for what I’m doing.

3d touch on iPhone 6S

I was curious how the 3D Touch feature worked on the iPhone 6S. Here’s a reasonable explanation based on a iFixit teardown. tl;dr: low resolution capacitive sensors measure the distance between your finger and the base of the phone. The glass bends a bit.

I can’t say I find the UI gesture very useful. The lack of true tactile feedback makes it hard to know which gesture you’re making, and the lack of much in the UI using the sensor means often nothing happens. We need someone to figure out a great use for it, and that in turn probably requires more market saturation.

Notes on an iPhone upgrade

I just upgraded my iPhone 5S to a 6S. The basic backup-and-restore process works remarkably well, as did Verizon’s activation. However a bunch of stuff didn’t carry over. Some of this is my own fault, some of it is security, and some of it is just dumb.

  • Logins. I had to log back in to all these apps like Twitter, Gmail, etc. I’m not using the iCloud Keychain, perhaps that would have solved this. Some apps like Uber, Nest, and TriMet Tickets seem to not work after the restore to new device; the login hangs. It’s not consistent, some apps worked fine. Uber even asked for a password, then hung. I had to delete and reinstall it.
  • Authenticator tokens. I have three MFA tokens on Google Authenticator as well as a separate authenticator from Blizzard. Had to manually set those up again on the new device, which in many cases requires access to the old device’s authenticator. Again I think iCloud Keychain might have helped with this.
  • Music. None of my music copied over. That’s probably because I got hit with another iTunes debacle at some point and iTunes on my computer didn’t have access to my music library. Apple refuses to copy music off of an iPhone, I guess because they think that’s a meaningful piracy prevention mechanism.
  • Cached app data. Some apps cache data locally, like Overcast’s podcasts. That cache seems to have not been copied over. That’s not terrible, but mildly inconvenient.
  • Application data. iOS has a sort of per-app filesystem you can find, where some apps like Wiki Offline store data they downloaded. None of that data was saved or restored. This seems like a serious flaw to me; oftentimes that data is irreplaceable, or at least inconvenient to restore. I ended up copying it over manually.
  • OpenVPN setup. The basic “enable VPN” button still works, so something carried over. But the OpenVPN app was not installed correctly; greyed out for some reason. Also the OpenVPN app has a file in the per-app filesystem I need.

Rant: Apple Store Stonestown shoddy repairs

My second time trying to repair my iMac, my second failure.

I took my 2011 iMac in for extended warranty repair after a hardware crash related to the video card. I got the machine back a week later with a new video card. And a new logic board, which I didn’t ask for, but their testing indicated a problem and they replaced it for free. OK, thanks!

But they’d screwed up the repair. Specifically the WiFi didn’t work at all, which is unacceptable. Also a new problem, a weird chirping noise coming from the right side of the machine when high-contrast areas on screen were scrolled, like in Sublime Text black text on white background. I could live with that but it suggested maybe something wasn’t grounded or shielded right.

So I took it back for the WiFi problem. And got it back a week later, along with a sheepish admission that they plugged the antenna in to the logic board this time. OK, mistakes happen. Then I get the machine home and plug it in and surprise! There’s a big wodge of dust under the screen, about 7 x 4 pixels big. Nice job, Geniuses! The screen chirping noise is still there too.

dirt

Now I don’t know what to do. And Apple makes it difficult enough to get through to a human I’m not confident my problem will get fixed. Any reasonable fix will at the least involve me not having the machine for a few days and probably having to lug the machine in again to the Apple store, which takes about an hour each way.

The whole premise of Apple’s high prices is they get stuff right. Their repair folks in Stonestown sure didn’t succeed.

Update: took 20 minutes but talked to a repair manager at Stonestown. No explanation for how they’d screw up a repair twice, but at least polite acknowledgement that it isn’t right. Best they can offer me is I make an appointment to bring it in again and they’ll make it a priority repair, hopefully same day.

Project idea: open stuff with VLC

VLC doesn’t install itself as the default handler for media files like .m3u or .mkv or whatever. Not sure why, but the documented process is tedious.

I should write a simple script / program to set VLC to be the default app for a bunch of types that VLC supports. Maybe absolutely everything that would otherwise open in iTunes is a good start :-P The program duti is a good start on how to set associations in MacOS. It seems to work by using the Launch Services API.

MacOS directory permissions

Macs have this weird problem where the Unix file permissions for things get corrupted. Not just a couple of top level directories either. Things like the Finnish localization file for iBooks, an app I have literally never run, is marked group writeable and shouldn’t be. How does this happen?

The thing that’s most alarming is my root directory, /, is mode 0777. World writeable. And owned by my user account, not root. Literally any program running on my computer can come in and hijack the whole system because of that. Not the first time that’s happened either. I’ve read somewhere that a bunch of bad Mac install scripts like to just recursively make things world writeable “to make it work” and they work their way up to /. Also there was that one time when iTunes kept making /Users world writeable. Quality programming there, Apple.

The problem is so common Disk Utility has a special GUI app just to “repair permissions” by comparing the filesystem to records of what should be there left behind by installers. Only that’s a little scary because what if it breaks something? Helpfully there’s an audit mode just to see what’s changed. Run from the GUI or via diskutil verifyPermissions /.

At the bottom of the page is the audit of what all the tool finds wrong on my Mac after filtering out 3000+ lines of iBooks.app garbage. Mostly not too scary, although libruby.dylib being world writeable sure seems like a potential security disaster. The most terrifying one is

Warning: SUID file “System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAgent” has been modified and will not be repaired

What, a setuid root executable that’s part of a remote management system that’s been modified? Why that’s not suspicious at all! But have no fear: Apple itself says that’s one of roughly 100 messages from the audit you can “safely ignore”. So yes, the security audit tool prints a lot of false positives. Fucking garbage.

Note that the root directory is not one of the reports in the audit.

I felt lucky and ran the tool and it changed a bunch of things. Then ran the audit again and it found three problems, including the setuid root file I’m supposed to ignore.

It did not repair my root directory. I manually set that to 0755, owned by root.wheel.

Started verify/repair permissions on disk0s2 Macintosh HD
Permissions differ on "System/Library/CoreServices/Feedback Assistant.app"; should be drwxr-xr-x ; they are lrwxr-xr-x 
Permissions differ on "usr/lib/libruby.2.0.dylib"; should be lrwxrwxrwx ; they are lrwxr-xr-x 
Permissions differ on "usr/lib/libruby.dylib"; should be lrwxrwxrwx ; they are lrwxr-xr-x 
Warning: SUID file "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAgent" has been modified and will not be repaired
Permissions differ on "Applications/Safari.app/Contents/Resources/Safari.help/Contents/Resources/index.html"; should be lrwxr-xr-x ; they are -rw-r--r-- 
Group differs on "Library/Printers"; should be 80; group is 0
Group differs on "Library/Printers/Icons"; should be 80; group is 0
Group differs on "Library/Printers/InstalledPrinters.plist"; should be 80; group is 0
Permissions differ on "Library/Printers/InstalledPrinters.plist"; should be -rw-rw-rw- ; they are -rw-r--r-- 
Group differs on "Library/Java"; should be 0; group is 80
Permissions differ on "Library/Java"; should be drwxr-xr-x ; they are drwxrwxr-x 
Group differs on "Library/Preferences/SystemConfiguration/com.apple.Boot.plist"; should be 80; group is 0
Group differs on "Library/Preferences/com.apple.alf.plist"; should be 80; group is 0
Group differs on "Library/Printers/PPDs"; should be 80; group is 0
Group differs on "Library/Printers/PPDs/Contents"; should be 80; group is 0
Group differs on "Library/Printers/PPDs/Contents/Resources"; should be 80; group is 0
Permissions differ on "System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.2.0.dylib"; should be lrwxrwxrwx ; they are lrwxr-xr-x 
Group differs on "private/var/db/GPURestartReporter"; should be 0; group is 80
Permissions differ on "private/var/db/GPURestartReporter"; should be drwxr-xr-x ; they are drwxrwx--- 
Finished verify/repair permissions on disk0s2 Macintosh HD

New Mac logic board: system identity

I brought my 2011 iMac in for repair, to replace a video card under an extended warranty program specific to my hardware configuration. (Reading between the lines, a cooling problem.) Once they got it on the testbench the tech decided to replace the system board as well because it tested faulty. At no charge! Despite the machine being a year+ out of warranty. Nice of them.

Anyway, a new system board means a new CPU, a new ethernet MAC, and a bunch of other small things. Which changed my machine’s identity for various things. I had to re-log in to all Apple online services. Time Machine also expressed concern but offered to “inherit” the backup I had, which seems to have worked. Had to set up a new IP assignment on my router for the MAC address of course.

I’d also logged Chrome out of Google and wiped all local state, for my security. Happy to report that logging back in to Chrome restored everything pretty well. I got all my Chrome extensions back but lost the extension configuration state. Also my browser link history is gone forever, I’d sort of hoped that would sync through Google too.

2011 iMac crash: vertical lines on screen

My iMac just crashed hard. Watching a video in VLC one second, dead machine with mostly black screen the next. Some strange light colored vertical lines.

Googling around this is apparently a known problem, a hardware failure of the GPU. This Apple support page notes a particular known problem for exactly my model of video card and CPU. (2011 iMac, AMD Radeon HD 6970M GPU, 3.4GHz i7 CPU). Sounds like they have a repair program.

discoveryd vs mDNSresponder

Good news; Apple is jettisoning the broken terrible discoveryd from MacOS and going back to good ol’ mDNSresponder. Not that I have any love for that stuff either, why can’t MacOS just use the same things the BSD and Linux crowd use? Why reinvent NAT port forwarding requests, etc? Anyway, at least they recognize their mistake in switching to a new broken version of the thing,

Back from January, here’s a good description of what these daemons do. Basically it’s ypbind for a modern age, once again trying to solve the problem of resolving names to addresses in various dynamic environments.

Cyberduck is responsible for my bad SSL certificate

I figured out what put the rogue SSL certificate on my system, the one that breaks MacOS Mavericks. It came back yesterday 2015-04-27 between 15:38:32 and 16:41:02. The system Console helped me narrow it down to the application Cyberduck, version 4.6.3. I use it sporadically to browse S3 buckets. It’s just the right kind of unusual application that would cause a bug like this that some small group of users on the Internet finds but not everyone.

Cyberduck 4.6.3 placed a bunch of errors in the console, including the smoking gun “4/27/15 3:42:05.621 PM Cyberduck[54126]: Error adding certificate to Keychain”. I also manually verified the login keychain entries show up again as soon as I run Cyberduck after deleting them. (For completeness I should add Cyberduck also complains about an SSL hostname mismatch when connecting to S3, but I think that’s a legitimate and expected error and unrelated to the Verisign certs.)

Version 4.7 (17432) is the latest version of Cyberduck. It doesn’t cause the problem any more. There was a reported and fixed bug in Cyberduck. I’m not sure the Cyberduck authors understand the magnitude of the problem though, or that users of old versions now have broken Macs. We now have a bug report on file, my report text below.

I also don’t understand the root cause of the problem. Cyberduck says they were taking a certificate offered by the server; Amazon S3, in this case. Were they verifying it was a valid cert first? If so, then why is it no longer a valid cert? And why did MacOS security update 2015-004 break it? I’m content to let that all remain a mystery, but I’m curious.

Update: this AWS discussion contains complaints about S3’s SSL certificate. Apparently it’s a key that is weakly signed and various software is deciding it’s no longer valid as they update to stricter requirements. That may explain why 2015-004 changed things.

For the search engines: one of the two bad certificates placed on my keychain by Cyberduck was “VeriSign Class 3 Public Primary Certification Authority – G5”

Bug report for Cyberduck

Prior to version 4.7, Cyberduck had code where it wrote some SSL certificates to the user login keychain. This behavior is documented in ticket #8741 and the code was changed to no longer do that.

However, the certificates old versions of Cyberduck wrote to the Keychain are now causing fairly serious problems with MacOS. Affected Macs can no longer verify Verisign-signed SSL certs in any application. Symptoms are the App Store refuses to load, MacOS software updates won’t get installed, Chrome refuses to load websites and Safari throws errors. It’s pretty bad. The problem seems to be triggered by Mavericks security update 2015-004 (released last week).

The fix is pretty simple: manually delete the spurious entries in the login keychain (so that the system entries are used instead). But users aren’t going to figure that out on their own. There’s no indication to the user there’s a problem with their keychain or that Cyberduck was the app that created the problematic entry. I only figured it out thanks to some lucky timing and a message on the system console.

While Cyberduck 4.7 no longer causes the problem, anyone who used an older version of Cyberduck may still have a broken Mac. Could Cyberduck do something to notify affected users? Maybe a new version of Cyberduck that checks for the bad entries and warns the user, pointing them to a help page?

It’d also be nice to figure out exactly what entries Cyberduck might have written. For me and a bunch of other users it’s two Verisign certs, one named “VeriSign Class 3 Public Primary Certification Authority – G5”. They seem to have come from Amazon S3.

Some references:

http://apple.stackexchange.com/questions/180570/invalid-certificate-after-security-update-2015-004-in-mavericks

https://discussions.apple.com/thread/6984765

https://trac.cyberduck.io/ticket/8741

https://nelsonslog.wordpress.com/2015/04/25/mavericks-security-update-2015-004-has-a-serious-ssl-bug/

Mavericks security update 2015-004 has a serious SSL bug

My Mac suddenly started throwing SSL errors when connecting to various sites, like search.twitter.com or support.apple.com. The App Store application refused to load content, too. Long story short, MacOS Mavericks 2015-004 has a bug where an incorrect certificate named “VeriSign Class 3 Public Primary Certification Authority - G5” is placed on the user’s login keychain. The fix is to run Keychain Access and remove it. Note: remove the one in the login keychain, not the System Roots.

Update 2: 2015-004 doesn’t put the entry on the login keychain, something else put it there earlier. 2015-004 does seem to change something though that triggers the verification problem. The fix is still to remove the key from the login keychain, I just don’t know what put it there in the first place.

Update 3: turns out it’s Cyberduck that’s writing the certificate entries.

This error seems really serious to me. Macs that are affected can’t get new software updates. Also Chrome will refuse to load any websites with SSL certs signed by that VeriSign certificate, including Apple’s own sites. Safari will load the site but will display SSL errors. Apparently Chrome is more strict in enforcing SSL security.

(I thought it was particularly interesting that it was impossible to get Chrome to visit Twitter. Twitter only serves HTTPS, not HTTP. And they have HSTS enabled which means Chrome will refuse to load a page without a working SSL certificate. Well that all succeeded, but boy was that a bad experience.)

Here’s some links with more discussion: Ask Different, Security StackExchange, Apple forums. I exported the two Verizon certs that were on my login keychain that were the problem, there’s a zip file here along with some screenshots of failed SSL certs. (That file won’t be online forever.)

I seem to be hitting a serious bug like this in MacOS every couple of months. Along with some broken-by-design things like their SMB client and I really am tempted to try going back to a Windows desktop. Or maybe Linux, if it weren’t so damn ugly.

Update 1: thanks to Ned’s suggestion in the comments I tried figuring out how those VeriSign certificates got in my keychain in the first place. I still don’t know, but looking at backups in Time Machine I can see it was placed there sometime between 2015-01-17 and 2015-02-23 13:48 (the two backups I have from before and after.)
$ grep -i verisign */Macintosh\ HD/Users/nelson/Library/Keychains/login.keychain

The Mac was turned off from 2015-01-08 until 2015-01-17 and again for 2015-01-21 until 2015-02-23. It seems likely the VeriSign entry ended up on my keychain when I turned the Mac back on. But it would have happened quickly; I entered the house at 13:42 and it’s in the keychain at 13:48. And my network is very slow. It could also have happened sometime between 2015-01-17 and 2015-01-21.

FWIW there’s a bunch of updates that installed a few hours after the keychain update, 2015-02-24 04:00 AM, including Security Update 2015-001 and Safari. But the keychain entry precedes those. Between 2015-01-17 and 2015-02-23 I only have a bunch of updates from “Google Voice and Video” and one from Seil, a keyboard kernel hack. Also FWIW I’m not given to manually tampering with my keychain nor blindly approving requests to manipulate it.

Mac fan control

My ~3.5 year old iMac is making noise. Just a small noise, but it’s high pitched and annoying. Something mechanic, presumably a fan bearing. So I started trying to isolate the source of noise. It isn’t the internal spinning drive, you can turn it off by unmounting all the volumes. I’m not using the optical drive. So maybe a fan?

The tool to test a Mac’s fans is smcFanControl, a simple tool to read the temperature and fan speed settings and alter fan speed. When you run it it requires root access, then goes into your menubar. You can set the minimum fan speed for each fan separately. It works pretty well. I used it to run each fan at full speed and crikey, my Mac sounds like a vacuum cleaner. Never heard those fans run before! Didn’t really notice a change in the sound but it’s hard to be sure. Maybe my optical drive fan is to blame. Unfortunately you can’t set turn the fans off entirely; the apps docs say this is possible but not enabled for safety. A quick search didn’t turn up any easy hacks, either.

On a side note, apparently there’s no good CPU/GPU/Memory burn-in tool for Macs. At least not a free one. The #1 suggestion from Google searches is “run yes > /dev/null”. Which, well, that works a tiny bit but it’s not even exercising the whole core of a single CPU, much less the whole system. There’s a bunch of good tools that run under Windows, too bad no one’s bothered to port one. The core load generator doesn’t need to change (much?) but the GUI is a problem.

MacOS security update only for Yosemite

Apple designed MacOS with an API that lets you escalate privileges from any user to root without proper authentication. No, really. This leads to CVE-2015-1130, details not yet published. It’s a pretty severe bug from the looks of it; not quite a remote exploit, but once an attacker can run code on your system they are root. Apple pushed a patch for it this week. But only to Yosemite.

The shape of the bug is really ugly too. It looks like Apple put in some weird backdoor API for stuff to escalate to root, so you can run Preferences or the like as a normal user. And they tried to lock that down in various ineffectual ways, like userspace binaries checking if they are running as root, but left the API in the kernel. Ugh.

iPad charging vs Air

I plugged my iPad into my Macbook Air to charge and it says “Not Charging”. WTF? Turns out that iPads (sometimes?) only charge when asleep, particularly when plugged in to computer USB ports. That leads to a sort of quantum paradox where the act of observing the thing charging stops it from charging. Stupid.

MacBook Air ports are apparently capable of providing the 2 amps of current an iPad wants to charge. The way to know for sure is to look for “Extra Operating Current” in the USB part of System Information. Oh except the Air won’t put the current out if it’s asleep.

More detail in this article. USB charging is too complicated.

sshfs / SublimeText = lost file

I had a bad experience with my Mac yesterday. I was trying to edit a .py file in SublimeText which was saved via sshfs, while also reading it on the local machine with the disk. Something went wrong with the save and before I knew it I had a 0 byte file on the disk and an empty buffer in SublimeText. File completely gone. (And in this case about 30 minutes of work lost; was just about to git commit, too :-().

I made it worse by not thinking carefully and closing the tab in Sublime. I think if I’d not done that, I could have hit undo and gotten the file contents back. For that matter I may have told Sublime to reload the file myself which was a mistake.

Still no idea why sshfs screwed up so badly. Or if it was an interaction with SublimeText.

MacOS sshfs: improving Finder performance

I’ve been using sshfs to access a Linux volume about 30ms away from where I am. I don’t expect this to be lightning-fast, but Finder was acting very slowly. Like 10 seconds to open $HOME, a directory with 143 files in it. Every directory took a few seconds the first time it was opened in Finder, even though network traffic was tiny. Presumably lots of little synchronous reads.

Long story short, the solution is:

-o noappledouble,noapplexattr

Using this in OSXFUSE sshfs is a lot faster. Maybe 2 seconds for that Finder window, not 10. The key feature is “noappledouble”. This tells sshfs to completely deny all access to any ._ and .DS_Store files. Not only does that keep this garbage out of your Linux filesystem, it avoids lots of network round trips as Finder tries to open them. (Not sure why a client cache doesn’t fix that, but oh well.) That option can cause Mac system calls to fail, and while I’m not certain I think the noapplexattr may help with that.

The advice to use these options is scattered all over the net, most of it seems to be a cargo cult inspired by this 2008 post. I did not find good docs for what we should be doing here in 2015, the best I could find are these old docs for MacFUSE which at least explain what the options do. I’m too lazy to read the source.

 

Ancient shell aliases

My .bashrc includes some shell aliases that I’ve been using for 20+ years now.

alias h=history
alias ls='ls -F'
alias cp='cp -i'
alias mv='mv -i'
alias pd=pushd
alias rotd='pushd +1'
alias ll='ls -l'
alias jobs='jobs -l'
alias type='type -a'

alias nethackb='nethack -B -u Elric'
alias nethackp='nethack -P -u Innocent' 
alias nethackv='nethack -V -u Zzrt'

Zzrt was the first character I ever ascended on.

MacOS: sshfs and FUSE

When I first started using Macs the situation with FUSE, the user-space filesystem shim, was a mess. But it’s stabilized now and it appears OSXFUSE is the winner. Their binary packages for OSXFUSE and sshfs work just great. Here’s some very n00b friendly instructions.

sshfs -C ub:/home/nelson /Volumes/ub

I’m not sure if it’s possible to automount. sshfs needs my ssh credentials which aren’t available at login. probably not worth the hassle.

Unfortunately git prompt does not work well with sshfs; if you’re in a git-controlled directory it tries to do a whole bunch of file stats over sshfs, which is slow even though sshfs has some caching.

unset PROMPT_COMMAND

Even better, I use liquidprompt which lets you disable git in certain paths via LP_DISABLED_VCS_PATH, for just this reason.

The other drawback with sshfs is Finder is very slow. MacOS seems to do a lot of work on every single file, even when all it ends up displaying is the filename.

Ubuntu 14.04: converting m4a audio to mp3

I want to convert a bunch of .m4a files that youtube-dl created to MP3 files. The files are audio only, 128kbps, AAC encoding. They play in VLC but a lot of AAC-supporting software like Sonos can’t read the .m4a files and I don’t care why, just want to convert it to the shitty 18 year old format that works everywhere.

First challenge is that ffmpeg has completely disappeared from Ubuntu 14.04. It’s been replaced with avconv. There was some nerd fight and a fork, no idea what or why or which fork is better. Sigh. Ubuntu went with the fork avtools, so I will too. (There is an ffmpeg PPA). “ffmpeg” is now “avconv”, and “ffprobe” is now “avprobe”.

sudo apt-get install libav-tools

for f in *; do
  avconv -i "$f" -metadata album="Album Title" "${f%.m4a}".mp3;
done

I realize this is all very basic, but every time I try to do any AV codec stuff I get very confused. I wasted a lot of time playing with quality options before deciding avconv was choosing a reasonable setting that I couldn’t really override, probably based on the source material. (Although apparently there’s at least two MP3 codecs buried in there being autoselected.) Also I tried using “-threads auto” to speed things up but no luck, maybe the MP3 encoder is single threaded or maybe it’s all IO bound anyway. It’s re-encoding about a megabyte a second, fast enough for my small job. GNU parallel is another solution here.

Sadly the source tracks have no useful metadata in them like song title or artist. I did throw in an album name at least.

Did MacOS 10.9.5 break SMB again?

I had Samba working more or less right between a Linux server and a Mac client. But recently all the files are showing up as permission 700 on the mac client, creating symlinks makes bogus files on the server, etc.

Unfortunately I don’t know what broke it. I upgraded Ubuntu 12.04 to 14.04 and kept my old smb.conf file. I also updated to MacOS 10.9.5. Either could have broken it.

On the Linux box, I started with a clean fresh default config file from 14.04 and just added some minimal stuff for myself. The old config file had some cruft like “map archive” that may or may not have been good. I mean, it used to work, but who knows. Anyway the new config file looks correct, but with Samba you can never be sure.

On the Mac, 10.9.5 includes an ominous patch note “improves the reliability of accessing files located on an SMB server.” Given how badly Apple has broken their Samba client in the past, I don’t trust any changes.

My work around now is to mount the fileshare as “cifs://ub/” on the Mac instead of “smb://ub/”. Apparently this forces MacOS to use an earlier protocol and implementation that’s not as broken in Mavericks.

Windows is worse than MacOS

I bitch about MacOS a lot, complaining about the rough edges in what is mostly a good product. But MacOS really is bad at one thing: desktop gaming. Some times I’m tempted to switch back to Windows just so I can play game. This week I was desperate to play Civilization: Beyond Earth before the Mac port is finished. So I booted my Bootcamp partition into Windows for the first time in two years.

Wow, what a terrible experience. Pretty much all the badness centers on software management, installs and upgrades. I was prepared for the initial thing to take forever; it was a two year old Windows 7 image, after all. Some 60+ updates and a few reboots later and all was set up. That wasn’t so bad really.

What was bad was installing software with Steam. In particular, the way you have to “install VC redist”. Steam makes the wise choice to require a separate install for every game, basically the 2014 solution to the 1995 problem of DLL hell. But the installers are fucking ridiculous. It takes 30+ seconds to do the install. What the hell is it doing? Copy a few files, maybe update a registry key or two, and you should be done. And for some reason I had to install like 15 of these for Steam the first time, then another 4 for Civ:BE.

The Bootcamp experience is not good either. The display drivers don’t work perfectly, for instance the sleep mode doesn’t shut the back light off. And I’m scared to try updating the 3 year old driver. You can’t use the vendor display driver, you have to use Apple’s, and all Apple ships is one giant install disc every once in awhile. Two, actually, you have to pick the release based on knowing what model iMac you own. Only iMac’s don’t have model numbers, so you have to remember the year you bought the thing instead.

Windows itself is still mostly, well, Windows. It’s funny how much I’m used to the Mac way of doing things now. I miss my menu bar. I can never tell if Chrome is running and just has no windows, or what. I even hacked the registry to enable reverse mouse wheel. And the stupid system is still prompting me for urgent reboots by switching me out of my full screen game, interrupting me with a popup dialog.

Apple hates signals

Why do so many MacOS apps fail to quit in response to a simple kill command? softwareupdated, mtmd, I think ocspd and maybe even mdsworker. kill doesn’t kill them, have to kill -9. That doesn’t help anything.

Today’s mess: I deleted 20 old files from my Downloads folder. So now Time Machine is insisting on pegging one CPU at 100% and running the battery down, preparing another backup or something. The backup drive isn’t plugged in, this is the local backup thing which I generally like when it’s not being stupid. Even better; after the kill -9 launchd spawned the process again. Of course.

 

MacOS file sharing and CPU usage

Why does MacOS file sharing take so much CPU? I’m rsyncing 30GB of files from one Mac to another. Using MacOS file sharing, 10.9.4 server and 10.9.2 client. The client is a MacBook Air and the fan is whirring away. Some kernel_task associated with the copy is taking 50% of one CPU; the rsync processes are taking another 13%. It’s not awful, but that’s a shitton of CPU for doing something that should be low impact. The iMac server is using 15% of a CPU to serve the files too.

MacOS dd timings

I need to clone a 2TB USB disk on my Mac. Going to use dd. What’s the right block size?

The bigger the better, apparently, but there are diminishing returns. “bs=128k” is good; reading from USB and writing to /dev/null that gives me 38Mbytes / second, which IIRC is about the rate for a 5400 RPM disk. 16384 gives about 20Mbytes / second. The default 512 byte blocks gives 1.2Mbytes / second.

I love that the default is 30x slower than maximum. The legacy of SysV’s 512 byte disk blocks is never going to end.

$ dd if=/dev/rdisk2 of=/dev/null bs=128k count=10000 skip=1m
10000+0 records in
10000+0 records out
1310720000 bytes transferred in 34.233990 secs (38287094 bytes/sec)

Update: that was for timing disk reads. Disk writes were slower, a test copy from one USB disk to another on my iMac showed 17 MB/s, which would take 32 hours to copy a 2TB disc. I thought at first that was because writes are slow but then I remembered the iMac is USB 2.

My Linux box has USB 3 and can read the disk at 100 MB/s. Shouldn’t have trusted my memory about disk speeds! And a copy from disk to disk on my Linux box is showing 117 MB/s, or about 5 hours to do the copy. Bonus: I trust Linux not to be doing something weird behind my back with the disks.

The full 2TB copy ended up taking about 6.5 hours, for an average rate of 85 MB/s. I forget slow the end of a disk is.

softwareupdated (MacOS sucks)

I’ve lost track of all the confusing ways MacOS updates itself. But one of them that keeps biting me is that it insists on updating iTunes. I don’t want iTunes, I’ve set it to mode 000, I don’t want to waste my limited bandwidth downloading copies of it. Sometimes a popup appears in the upper right saying “updates available Install?” and there’s no way to see what it will install. So as a sucker I click Install, and suddenly here I am downloading iTunes.

The best part of all this is there’s no way clean to cancel the update. The App Store program will show the update progress bar, but the Cancel button does nothing. Using MacOS’ excellent Activity Monitor I can see the process doing all the downloading is softwareupdated. It ignores or catches ordinary kill signals. My only option seems to be a kill -9. Awesome.

WebGL vs Shutdown (MacOS sucks)

I went to a WebGL test page that warned it might crash your machine by drawing lots of polygons. Boy it wasn’t kidding. Locked up Chrome, locked up the Mac graphical shell. I could log in via ssh and the machine was fine, not even anything spinning CPU, but couldn’t kill the Chrome processes. kill -9 did nothing. So then I rebooted. It didn’t reboot either, the best MacOS could do was to shut down sshd so I couldn’t even log into my machine.

It’s pretty awful that some Javascript can kill all of MacOS. Chrome should know better. V8 should know better. WebGL should know better. OpenGL should know better. The Mac graphical shell should know better. The Mac kernel really should know better, because you really can’t count on anything else to. All fail.

Remote file system bad display (MacOS sucks)

Finder’s access to remote filesystems will sometimes show stale data. I’m copying a 2.5GB file to an SMB share (Linux samba). While copying I look at a folder, then click the little down arrow to open the subfolder in the window. It shows no contents, it must be an empty folder! So go to delete, and then it pauses saying “deleting 5 items”. Ha  ha, joke’s on me. Cancel the delete, try again. This time wait 3–5 seconds for the file content to list, and poof there are the files now. At least I cancelled the delete in time.

I’m not complaining that the remote filesystem is slow, particularly when a big copy is happening. No. I’m complaining that Finder is showing incorrect information.

 

Directory symlinks (MacOS sucks)

Try this on a Mac

cd /tmp
ln -s ~/Docum <press TAB>
ln -s ~/Documents/ .
ln: ./: File exists

Trollface

 

Yes, MacOS “ln” is too stupid to understand that if something has a trailing slash you probably meant to symlink the directory with that name, not the implicit “Documents/.” name. And bash completion is just helpfully providing slashes because 99% of the time you want them when talking about directories. Of course this works fine on Linux; another legacy of MacOS being based in SysVile.

(To be fair the with/without trailing slash thing has always been ambiguous in Unix. rsync even assigns different semantics to the two names, confusing me every single time.)

 

MacOS finder is garbage

I’m looking at a Finder window for the folder /Applications/League of Legends.app/Contents/LOL/Logs/Network Logs. It looks like this

Screen Shot 2014-05-18 at 8.18.07 PM

Then I open a shell in that folder and run ls -l. It looks like this

Screen Shot 2014-05-18 at 8.18.16 PM

Notice how there are files from May 18 that don’t show up in Finder? Yes, the fucking Mac interface can’t even list the files in a local folder correctly. I see this garbage all the time, the Finder window caches some sort of state and doesn’t resync correctly. There’s not even a Refresh option. Perhaps in this case it’s complicated by the fact that some game is writing new files to the directory, maybe it’s using some odd API? But then that’s what the Unix kernel is for; one single creat() system call. And Apple can’t get it right.

Forcing a Finder relaunch fixes it, of course.

Fundamental stuff in MacOS is broken. It’s really awful.

 

Why does Apple hate Unix?

I upgraded an iMac to Mavericks, just so I could share binaries with the other Mac I have. Now I’m undoing the damage the upgrade did.

I have to download and reinstall the compiler. With the mysterious “xcode-select --install”. Because according to Apple, Unix computers don’t come with compilers. And if you have one they go in and delete it on upgrade. At least there’s a standalone command line compiler now, it’s better than having to get the whole Xcode IDE bloat.

I have to download and reinstall the X server. I don’t begrudge Apple not shipping X11 by default, it’s pretty awful and dated. But I have a fully working XQuartz on my system. Why delete it when I upgrade?

I’m starting to flirt with the idea of giving up on MacOS on my desktop. It’s bad at games, and it’s bad at Unix development. It is good at ordinary consumer use though, web browsers. I kind of wish I had a way to run Windows for games, ChromeOS for web browsing, and Linux for development. All on one machine with transparent interaction.

MacOS binary incompatibility

I keep forgetting this; MacOS binaries are not compatible with earlier MacOS versions. I built a bunch of Homebrew stuff on 10.9 and copied the binaries to a 10.8 machine. And get awesome errors like

dyld: lazy symbol binding failed: Symbol not found: ___strlcpy_chk
Referenced from: /usr/homebrew/bin/rsync
Expected in: /usr/lib/libSystem.B.dylib

Some sort of library / linker design choice, I guess. It’s as baffling as Apple’s decision not to allow static linking, because the kernel API may change so you must dynamically link to libc to mediate.

Homebrew has a way to build with --universal, but I think that’s more for 32 bit compatibility than minor OS revisions.

 

Homebrew observations

You can’t move a Homebrew binary directory. I installed Homebrew in /usr/homebrew2 and then renamed that to /usr/homebrew and a bunch of stuff broke because it had the path /usr/homebrew2 baked into it. bash-completion, also python.

Many Homebrew packages don’t compile cleanly. I ran into three: mg, unison, and ggobi. I filed bugs and got prompt responses (and a patch for ggobi in 12 minutes!), which is pretty great. OTOH it feels to me like Homebrew doesn’t have any sort of automated build-and-test setup for packages, these were all really simple bugs that anyone installing the code would hit. Some basic integration testing would go a long way.

I’m very grateful to Homebrew but the whole project feels pretty ad hoc and brittle to me. No surprise since it started out being such a simple thing. And simple is good! But I think at this point it’s evolved into needing to be a serious package manager, but hasn’t yet evolved all the serious package management. I wish we’d just use dpkg on MacOS instead. Fink is exactly that, but my experiences with it have been bad.

Starting anew with a clean homebrew install. Note I’ve already set PATH and BREW to use /usr/homebrew, the non-standard location

sudo mkdir /usr/homebrew
sudo chown nelson /usr/homebrew
cd /usr/homebrew

git clone https://github.com/Homebrew/homebrew.git
mv homebrew/* homebrew/.git* .
rmdir homebrew

brew tap homebrew/dupes
brew install atk autoconf automake bash-completion cairo clens cloog faac ffmpeg fontconfig freetype freexl gdal gdbm gdk-pixbuf geos gettext gfortran ggobi giflib git glib gmp gobject-introspection gpp graphicsmagick grc gtk+ harfbuzz icu4c iftop isl jpeg jq json-c lame less libffi libgeotiff liblwgeom libmpc libpng libspatialite libtiff libtool libxml2 lzlib makedepend mp4v2 mpfr nmap node objective-caml openssl optipng ossp-uuid p7zip pango pgdbf pixman pkg-config postgis postgresql proj pv python readline rsync sqlite texi2html unrar wget x264 xvid xz yasm

brew install mg
brew install unison

fixing iTunes corruption

iTunes corrupted my MP3 files. Not sure what happened, but I mounted my carefully-groomed 300GB of music via SMB on my Mac, imported the music, and suddenly a bunch of my MP3 files no longer play on the Sonos system. Particularly the music I bought from Amazon. Not sure what the corruption is. The file lengths are the same but the ID3 tags are different, maybe it wrote album art in? That’s worked in the past, but iTunes 11 is such a clusterfuck maybe they finally screwed it up. Or maybe it’s Apple’s broken SMB implementation causing filesystem level corruption. Either way I have to restore from backup. iTunes will no longer have write access to my music library. Screw you, iTunes.

I didn’t want to just rsync everything from a backup; was not positive that wouldn’t do some harm, and at first I had a concern that the 300GB directory might take too long. (Which is dumb; rsync is very smart.) In the end I just did an rsync, trusting the way it doesn’t delete / overwrite stuff it doesn’t need to. But first I did a bunch of verification of the files. The good news is the mtimes on the files at least got set, so it’s relatively easy to find the damage. I have to be a bit careful because the directory names are full of all sorts of messy Unicode, spaces, etc that shell programs don’t like. Also it’s 300 gigs of files, so I don’t want to just rsync the whole thing.

# find all files modified in last 20 days
$ find . -mtime -20 > /tmp/mp3.txt
$ wc -l /tmp/mp3.txt
369 /tmp/mp3.txt

# get just the directory names (ended up not using this)
$ cat /tmp/mp3.txt | while read l; do echo `dirname "$l"`; done | sort | uniq > /tmp/dirnames.txt

# make a list of what's restorable from backup
$ cat /tmp/mp3.txt | while read f; do o=/mnt/sdb1/BACKUPS/rsnapshot/monthly.1/localhost/home/nelson/Music/"$f"; [ -f "$o" ] && echo "$f"; done >| /tmp/restore.txt
$ wc -l /tmp/restore.txt
339 /tmp/restore.txt

# check what rsync would do
$ rsync -avn /mnt/sdb1/BACKUPS/rsnapshot/monthly.1/localhost/home/nelson/Music/ /home/nelson/Music/
# visual inspection
$ rsync -avn /mnt/sdb1/BACKUPS/rsnapshot/monthly.1/localhost/home/nelson/Music/ /home/nelson/Music/  | grep / | wc -l
344
# meh, close enough

# restore from backup
$ rsync -av /mnt/sdb1/BACKUPS/rsnapshot/monthly.1/localhost/home/nelson/Music/ /home/nelson/Music/

Mavericks broke SMB

Apple broke file sharing in MacOS Mavericks. I started finding the problem when I got a new iPhone and was going through the hell of setting up music on it via iTunes. Nothing worked and I finally started over with a new iTunes library, only to find I couldn’t add songs from my SMB network share (an Ubuntu box running Samba). The files showed up fine in Finder, and if I copied them to my desktop I could add them to iTunes. But trying to add them right off the fileshare resulted in nothing happening; no errors, no console logs, nothing.

A lot of research later and I learned that Mavericks has a brand new SMB2 implementation, and apparently it’s broken. In complex and subtle ways, maybe worse using Samba as a server than Windows. Awesome! As usual there’s a lot of cargo cult thinking for bugs like this, but this Apple discussion and this ZDNet article were particularly useful.

The recommended fixes are two ways to fake out MacOS to not use the new broken SMB2 implementation and instead fall back to the slower-but-stable SMB1 implementation. I found I also had to add “log level = 0” to my SMB server configuration to make this work (previously no log level configured). Yeah, there’s no way that makes sense, but it only started working when I had debug logs on (level 2) and then if I removed the line entirely it stopped working, but level 0 works. I’m too angry to spend more time trying to figure out what’s really going on.

It is so, so frustrating when Apple breaks basic Unix services that have been working in the past. Doubly so if there’s absolutely no error logging, and triply if the bug only shows up in some awful piece of client software like iTunes. Just terrible all around.

iTunes repeatable crash

Trying to sync my music to my new iPhone 5S, Track 4 of Autechre’s Quaristice (“plyPhon”) consistently causes iTunes 11 to crash, spinning at 390% CPU. I’m guessing it’s failing trying to transcode the 320kbps MP3 source (from Bleep) down to 128kbps AAC as requested. It’s killed iTunes dead twice now, have to Force Quit. Awesome.

 

Building unison on homebrew/mac

I thought I’d try Unison out, it’s a directory sync system that’s a bit like rsync but specifically targeted at keeping filesystems in sync in both directions. May solve my problem trying to keep two Macs together with no reasonable Internet to just Dropbox or whatever. OTOH, Unison hasn’t had much development in years. And it’s written in OCaml, oy.

Anyway, it doesn’t build right in Homebrew. Turns out the Makefile is trying to be clever with the variable $NAME and it was picking up my shell environment variable. A simple “unset NAME” before installing seems to have fixed it. Details at https://github.com/mxcl/homebrew/issues/11862

1090MHz antenna

Finally managed to take my software radio outside and watch airplanes overhead. Lots of fun stuff there. Also I built a crappy 1090MHz dipole antenna. I have no idea what I’m doing, but it seems to work reasonably well. I wonder if I can measure how well?

Thanks to @lemonodor I learned about http://www.airframes.org/ which lets me look up those 6 digit ICAO codes. For instance ae2923 flying at 16,300 is a US Air Force registered B350 King Air. I’m wondering if it’s a chase plane for drones. COUGR11 (ae2f5f) at 14,325 and SPARTA53 (053977) at 15,300. Neither of those show up in airframes, although ae2f5f may be another King Air and 053977 is a bogus code, 1234567 in octal.

MacOS ._* garbage

MacOS has this terrible habit of littering filesystems with ._ files (for the search engines: “dot underscore files”). Apparently Apple uses these files for some sort of extended metadata, extending Apple’s track record of overcomplicating file systems that goes back to the bad old days of Resource Forks. (Remember BinHex? Good times.)

OK, to be fair, having some out of the way place to put extra data around files is sometimes useful. What I hate is the way the ._ garbage breaks other tools. My latest example is rsync --delete; it won’t delete a directory with a ._ file in it. Somehow in my trying to sync up directories between two Macs via a USB disk I’ll end up with some stray ._ files that then escalate to whole stray directories full of ._ files.

 

MacOS doesn’t support static binaries

clang -static -g -o dump1090 dump1090.o anet.o -L/tmp/rtl-sdr/build/src/ -L/usr/homebrew/Cellar/libusb/1.0.9/lib/ -lrtlsdr -lpthread -lm
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

/sadtrombone. Or what’s the emotion for “Apple’s kernel team is laughing at you”?

Apple has a reasonable explanation:

A statically linked binary assumes binary compatibility at the kernel system call interface, and we do not make any guarantees on that front. Rather, we strive to ensure binary compatibility in each dynamically linked system library and framework.

So basically they moved the guarantee of compatibility from the kernel interface down into the library interfaces. I guess that sort of makes sense, only it’s different from every other Unix ever and makes simple things hard. Too bad. I have some 10 year old Linux binaries I can still run because I thought to statically link them at the time.

Next best thing is to statically link everything but the system library.

$ otool -L dump1090
dump1090:
	/tmp/rtl-sdr/build/src/librtlsdr.0.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)

OK, so librtlsdr was dynamically linked. I’m not sure how to tell clang to statically link just this library. I bashed around listing .a files on the linker command line and ended up here:

$ clang -g -o dump1090 dump1090.o anet.o /tmp/rtl-sdr/build/src/librtlsdr.a /usr/homebrew/Cellar/libusb/1.0.9/lib/libusb-1.0.a
Undefined symbols for architecture x86_64:
  "_CFDictionaryCreateMutable", referenced from:
      _usb_setup_device_iterator in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFDictionarySetValue", referenced from:
      _usb_setup_device_iterator in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
...
  "_objc_registerThreadWithCollector", referenced from:
      _event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)

Apparently linking by naming the .a suppresses the linker’s walking of library dependencies, so now I’m not getting some of the basic system stuff expected by libusb. I tried exploring what libraries were needed with otool -l and failed. I’m doing this wrong.

software radio playing

I bought a cheap software radio to plug into my Mac. I have no idea what I’m doing and no proper antenna, but just bashing around with gqrx I’m able to listen to FM radio and understand roughly what’s going on.

Even better, I just got dump1090 running; it’s a decoder for 1090S airplane transponder signals. Even better I happened to catch Air France 083 from San Francisco to Paris, a flight I’m happy to say I’ve been on myself a few times! I’m amazed at how fast they send data, many reports a second.

Getting the software working on my Mac wasn’t too hard. I installed libusb via Homebrew, then compiled librtlsdr from sources. Didn’t install that, just hacked the dump1090 Makefile to find stuff in /tmp or wherever it happened to be. My modified Makefile plus some sample output below.

Update libusbx may be a better choice than libusb. And rtlsdr is packaged in a HomeBrew fork you can tap for GNU Radio.

CFLAGS=-O2 -g -I/tmp/rtl-sdr/include/ -Wall -W `pkg-config --cflags librtlsdr`
LIBS=-L/tmp/rtl-sdr/build/src/ -L/usr/homebrew/Cellar/libusb/1.0.9/lib/ -lrtlsdr -lpthread -lm

$ ./dump1090 --interactive
Hex    Flight   Altitude  Speed   Lat       Lon       Track  Messages Seen .
--------------------------------------------------------------------------------
ac4d44          0         0       0.000     0.000     0     5         48 sec
a78dd7          0         0       0.000     0.000     0     28        17 sec
a8b805          10950     0       0.000     0.000     0     146       3 sec
3965a9 AFR083   11875     346     37.890    -122.348   48    608       23 sec

$ ./dump1090
CRC: c3e472 (ok)
DF 0: Short Air-Air Surveillance.
  Altitude       : 11300 feet
  ICAO Address   : a26fc9

*00c1879c1bd991;
CRC: 1bd991 (ok)
DF 0: Short Air-Air Surveillance.
  Altitude       : 11300 feet
  ICAO Address   : a26fc9

*00c6079cc3e472;
CRC: c3e472 (ok)
DF 0: Short Air-Air Surveillance.
  Altitude       : 11300 feet
  ICAO Address   : a26fc9

*59a26fc99c4306;
CRC: 9c4306 (ok)
DF 11: All Call Reply.
  Capability  : Level 2 (DF0,4,5,11)
  ICAO Address: a26fc9

$ ./dump1090 --raw
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001 (currently selected)
Found Rafael Micro R820T tuner
Max available gain is: 49.60
Setting gain to: 49.60
Exact sample rate is: 2000000.052982 Hz
Gain reported by device: 49.60
*8d4005e2583d0135f7fdf5514966;
*02c18790ae0146;
*8d4005e2200815f2e37820027da5;
*02c18790ae0146;
*8d4005e2583d04ca30ac60c73091;
*02c18790ae0146;
*20000790eda525;
*02c60790763ca5;
*5d4005e2dd7ccb;
*02c18790ae0146;
*02c18790ae0146;
*8d4005e29900c99d28060e63ed38;

Here’s a screenshot of GQRX while tuned to 1090MHz. I think there’s at least one airplane transmitting when I took this; hard to be sure. There’s some horizontal lines that I’m guessing are the signal. It’s so faint above the noise floor, I’m sort of amazed it works.

Screen Shot 2013-04-24 at 8.48.13 AM

case insensitive filenames on Macs

What clown decided to make a Unix with case insensitive filenames? Oh, Apple, that’s who. I mean seriously? It’s tripped me up twice in the last day. To be fair there is an option to make a case-sensitive filesystem on Macs, but so much application software breaks if you do that it’s not a viable option.

I happen to think case-insensitive systems are generally better for humans to use than case sensitive. But Unix file systems have been case sensitive for over 40 years. Grawr.

MacOS broken build between versions

Well this is fun; MacOS binaries built on MacOS 10.8 don’t necessarily run on 10.7. I tried copying some homebrew binaries between machines and got the useless error message “Illegal Instruction: 4”.

Turns out this is working as intended; by default clang is happy to build binaries that only work on the current OS, not older versions. Good discussion here. The fix is to build with -mmacosx-version-min=10.5 (or however far back you need to go). Homebrew doesn’t build with this flag, I imagine because their idea is you recompile code on every machine. That gets tedious with multiple macs on a slow network.

Breaking binary compatibility is a stupid thing.

 

Installing CHDK on a Canon S100 on a Mac

I wanted to install custom camera firmware CHDK on my Canon S100, using my Mac. It’s a bit tricky; basically you format the SD card with some funky proprietary byte set, then put a special DISKBOOT.BIN file on the card and the camera will load it on top of the baked in firmware. But setting up the card that way is tricky, you have to get the exact right CHDK version for your firmware, and there’s a bunch of conflicting instructions for the Mac. Here’s what worked for me. These are Java programs, they may work on any OS?

  1. Get ACID, a program to identify your camera firmware version by looking at any JPEG file. Run it and drag over a JPEG from your camera to identify the firmware. Then check “download stable CHDK fill build” and press “Download stable CHDK” to get the right CHDK version for your firmware. (There’s other ways to identify firmware version, but they didn’t work for me. It is essential you get the exact right CHDK version for your firmware. My camera is apparently 1.00E).
  2. Download SDMInst. If you’re on Mountain Lion get the special zip that runs sudo first.
  3. Run SDMInst. Drag over the “Stable CHDK” and select “Copy all files from”. Turn on “Make FAT32 bootable”, turn “debug on”.
  4. Press “Prepare Card”. Double check the volume name, then do the format and copy.
  5. Eject the card, flip the write protect switch on the card on, put in camera.
  6. Turn on camera. Be patient; hold down the on button for awhile. You should see the CHDK boot splash.
  7. Press Play and then Menu to see the CHDK menu. 

Having done all this, CHDK doesn’t do the one thing I really want; override Canon’s obnoxious requirement that any exposure over 1s is at ISO 80. Actually you can override it using the CHDK menus to set an exposure override but it’s a PITA; I just want my firmware patched so it doesn’t have that restriction.

I may still use CHDK just to set the camera up with a script to take continuous photos. (“Interval shooting”, I think they call it?)

Uninstalling Evernote on a Mac

The official uninstall instructions for Evernote on a Mac are incomplete. They just say “trash the Application”. But that leaves behind a launchd entry that every 10 seconds tries to launch EvernoteHelper, now missing, and spams the syslog and creates lots of useless crash reports.

Anyway, the fix is to run launchctl remove com.evernote.EvernoteHelper as the user you installed Evernote as. (Not root!)

launchctl/launchd is a total mystery to me. It seems awfully complicated. “launchctl list” and “launchctl bstree” are helpful commands for inspecting the state of what’s trying to launch.

MacOS bullshit

I just had to reboot my Mac because a remote filesystem mount failed. I mounted a disk on my iMac via AFP from another Mac last night, over my WiFi network. Then my iMac went to sleep. This morning the remote disk was still mounted, so I went to open it and then Finder locked up, the lovely spinning wheel of death. (Do they still say “beachball”?) But at least all my other apps were working. Then I tried to force quit Finder (er, relaunch), and the entire fucking Mac locked up.

The big fail here is that Finder still has its talons in the graphical shell of the Mac, and file system browsing can lock up the whole machine. The small fail is it’s nearly 2013 and we still don’t have remote filesystems that are robust to failure. I miss the async option on NFS; it caused some problems, but at least it didn’t lock up your whole computer.

Update: after rebooting I remounted the file system and then copied a single 800 megabyte file over by dragging it in finder. I then tried to drag a second file over and had to wait, mouse button held down, for 45 seconds while Finder’s little wheel spun. Because apparently the entire UI locks up while waiting for some buffer to drain in a bulk, low priority file copy. Apple’s handling of remote mounts, even AFP mounts from other Macs, is absolutely terrible.

 

Preview.app’s signature capture system

I love how MacOS’ PDF viewer has the ability to add images of signatures to documents. I’ve been signing a lot of forms with it lately and it’s great.

The capture algorithm is interesting. Here’s a “signature” it generated when it had a view of the other side of my office, with a desk and a bunch of crap piled on it. Heavy edge detection! The cylinder just to left of center is a metal water bottle; can also see some electronic equipment (the box on left) and standing file folders (right).

Setting default print options on a Mac

My mostly-nice color inkjet has two tanks of black ink; a big one for B&W documents, a small one for color documents. By default my Mac sends all its jobs in color and the printer isn’t smart enough to realize that the whole document is monochrome so really, the cheaper big tank will work just fine. I want to default printing to grayscale.

Irritatingly, you can’t do this with the obvious way in a Mac. You can create new printer option sets and save them as new profiles, but there’s no way to change the default profile.

But there is a way, via the CUPS web interface hiding underneath MacOS. It never occurred to me that this would be there! The instructions in the linked blog post worked just great for me, I even have the same kind of printer. Two wrinkles.. I had to choose the second of the two printers, the first had no print options associated with it. And the “Greyscale Printing” option appears twice, I had to set both to make it work.

This may save me literally dollars a year.

 

GeekTools to show iTunes current song

I wanted to display the current song playing on my desktop using GeekTools. I found some info on accomplishing this with AppleScript here. Pretty straightforward, but their script is clever in that I think it only runs if iTunes is running. I modified the script a bit, here’s what I have:

tell application "System Events"
	set powerCheck to ((application processes whose (name is equal to "iTunes")) count)
	if powerCheck = 0 then
		return ""
	end if
end tell
tell application "iTunes"
	try
		set playerstate to (get player state)
	end try
	if playerstate = stopped then
		return "Stopped"
	end if
	set trackID to the current track
	set trackName to the name of trackID
	set artistName to the artist of trackID
	set albumName to the album of trackID
	set totalData to artistName & "
" & albumName & "
" & trackName
	return totalData
end tell

MacOS top: “stuck” means “uninterruptible”

MacOS’ version of “top” reports a weird process state; “stuck”. According to top many of my processes are “stuck” including Postgres while it’s completing a table scan, and Growl, and many Google Chrome subprocesses. But checking the top sources indicates “Stuck” really means TH_STATE_UNINTERRUPTIBLE, which I believe is what ps reports as process state “U”. I’m guessing this is what Linux calls “D” for “Device Wait”. In which case, in most cases the process is fine, it’s waiting for some I/O to complete.

While I’m here, is there any good reason MacOS top defaults to sorting by process ID? I have to type “ocpu” every time to get it to sort by cpu.

 

IDE, the obsolete standard

My home Linux server died. We had an ugly power outage and when the power came back up and when I turned on the computer, out came the magic smoke. I hope that just the power supply fried, or maybe the motherboard, because I don’t have a backup of the data on the hard drives. 15 years of data, programming, photos, financial records, email, writing. It’s very unlikely that the data is gone; worst case, I send the platters to a data recovery service. But it sucks.

I’ve ordered the parts to build a fancy new computer. It’ll be an awesome fast upgrade based around Sandy Bridge parts. My plan was to install Ubuntu on the fancy new SATA drives, get things sort of working, then plug in the old IDE/PATA drives to copy the data over.

The motherboard doesn’t even have IDE ports.

When did that happen? When did IDE become so obsolete they don’t even put ports for it on a motherboard? I mean, the motherboard still has PS/2 keyboard, old school serial, parallel. No IDE. Ugh. I’ve ordered a USB adapter to get data off the old drive. Amazon is full of these jobbies for $7, complete with 10+ one star reviews saying “the power supply is junk and fried my drive”. Awesome. The one I picked has the most reviews and almost all are positive.

I’m not so stupid as to not have any sort of backups of the data. I have a complete rsnapshot mirror. On a second drive, in the dead machine, the one that might have sent a surge of death through every plugged in component. Yeah, didn’t think through all failure modes. I am committed to doing real offsite backup of all my computers now. I have CrashPlan on the Mac already; something for Linux will be coming.

While I’m waiting for the adapter I tried playing with an old USB drive enclosure I had lying around, thinking I could put the drives in and plug them into my Mac to reassure myself the data is still there. Turns out mounting ext3fs on MacOS is a clusterfuck. fuse-ext2 is the recommended way but MacFuse doesn’t work on Lion and is abandoned and all the Fuse folks have scattered every which way. This blog post claims that OSXFuse + Fuse-ext2 will work on Lion, but I don’t have enough confidence in all this jury rigging to bother trying it. I’m much more comfortable recovering data in a Linux system.

Notes on getting TileStache renders working on MacOS

Personal work notes for this project I’m working on. Mac DLL hell included. Unlikely to be of interest to any unfortunate reader who found this post.

I’m trying to run some tile generation software that generates odd TIFFs. The TIFFs have two separate images in one single file. This is a legitimate TIFF but it’s unusual and I’m having a hard time producing it on my Mac. The exact same end code works fine on Linux.

There’s a bunch of software involved here. Python, gdal, boost, MapNik, Cairo, swig, TileStache, ... When it’s all mashed up the code I’m running is basically a Python program with a lot of bindings to geo and image C libraries, using boost and swig. Ie: a big fucking hairball.

If I use MacOS Lion’s version of libtiff, the code all runs fine but the images it produces are corrupted. Same error as this discussion. gdalinfo can’t load them:

gdalinfo out/10/000/163/000/395.tiff
ERROR 1: out/10/000/163/000/395.tiff:Failed to allocate memory for to read TIFF directory (0 elements of 12 bytes each)
ERROR 1: TIFFReadDirectory:Failed to read directory at offset 52744
gdalinfo failed - unable to open 'out/10/000/163/000/395.tiff'.

If I use homebrew’s default libtiff (3.9.5) the code hangs. Poking at it with gdb I see the program is spinning at 100% CPU deep inside some error binding between libtiff, Python, and either Boost or Swig. Yuck!

If I build my own tiff-4.0.0beta7 in homebrew and use it, it runs and produces the same corrupted TIFFs as Lion. (To build in Homebrew, you have to edit the libtiff.rb formula and add an option to configure, “--x-includes=/usr/X11/include”. Otherwise, it can’t find some of the GLheader files when compiling.). tiff-4.0.0beta5 is no better.

A big confounding issue has been getting the Python environment right in Homebrew. More notes on that here. I think everything’s working anyway, various Python and gdal programs do, but you never know.

Another confounding issue has been compiling things correctly. The transition in C compilers on Lion makes a mess. Homebrew gamely tries to use LLVM but some stuff only works with gcc-4.2 (including Numpy). I was worried that mixing the two compilers might have been causing problems, so finally rebuilt everything with just gcc using this environment:

export HOMEBREW_USE_GCC=true
export CC=gcc-4.2
export CXX=g++-4.2
export FFLAGS=-ff2c
export HOMEBREW_BUILD_FROM_SOURCE=true

Extra notes: “man dyld” is very useful for manipulating shared libraries. In particular the DYLD_INSERT_LIBRARIES and DYLD_PRINT_LIBRARIES environment variables let you see and control which versions of libraries are being used.

Ubuntu 11.04 notes

Time for my yearly experiment running Linux as a Desktop OS. I installed Ubuntu 11.04 beta1 (“Natty Narwhal”). And immediately hit graphics corruption and system crashes. To be fair I have a weird graphics card that Windows hates too, a Radeon HD 2400 PRO AGP.

So first order of business was switching from the ATI binary driver to the open source VESA driver. There are no docs on this I could find anywhere; there’s no longer an xorg.conf to edit. I finally just used apt-get to uninstall xserver-xorg-video-ati; happily, Ubuntu is smart enough to drop back to the VESA driver if the ATI driver is not around.

The second problem is Unity, the fancy new GUI, doesn’t run on the VESA driver. Too much GL or something. The old UI is there but if you want Unity the solution for that is to install unity-2d, a simpler UI.

With that all done, things sorta work. As with every time I try to use Linux as a desktop, it was a disaster. I can’t really blame Ubuntu for not handling my weird graphics card well, but I can blame it for there being no clear path to diagnose and fix the mistake. Also I’d say unity-2d ought to be a default option, not some weird thing to install.

 

using git on Windows via SMB

I keep my source code on a Linux machine, but I develop on Windows. The cross-platform thing is a nuisance. I mostly prefer to work in the Unix way, and make Windows cope.

msysgit seems to be the Windows git client of choice. (Cygwin is too foreign an environment). To make it play nicely with Unix systems:

  • core.autocrlf=false
    Don’t ever modify line endings, just accept what’s there. Every Windows editor I use can handle Unix line endings just fine.
  • core.filemode=false
    Don’t mess with file modes. Works around the problem that Samba doesn’t really handle Unix file modes right, particularly +x.  Avoids the problem of “old mode 100755 new mode 100644”.  This probably means you can’t meaningfully set file modes from Windows.
  • gui.encoding=utf-8
    Not strictly a Windows thing, but a good idea.

These can be set via the msysgit bash shell with “git config core.filemode false”. You can see your settings with “git config -l”. There’s something confusing I don’t understand about system/global/local settings that I’m ignoring.

Binding CapsLock in Windows

I wanted to re-use my useless CapsLock key to search Google. I started by modifying WinUrl, an old program I’d used forever. Seemed easy enough, just RegisterHotKey(..., VK_CAPITAL). It even seemed to somehow suppress the capital locking function, all done! Except not, some confusing thing happened where caps would be on in some windows, off in others.

I went down a rabbit hole trying to disable caps locking. It’s buried deep in the drivers somewhere in Windows. The recommended work around is to use SendInput() to fake a new CapsLock keystroke to toggle it back, or maybe SetKeyboardState() to obliterate the CapsLock bit. But about the time I was putting 2 second delays in my code to prevent recursion from triggering my own functions, I gave up on that approach.

I ended up using AutoHotKey instead with this script. I don’t like AutoHotKey, it’s way overengineered. Custom scripting language, custom compiler to native code?! But it’s also very capable. And it knows how to override CapsLock.

Chumby, the difficult alarm clock

I bought a Chumby. An “Insignia”, to be specific, from Best Buy for sale $50. Totally on a whim, but I bought two with the idea the other is a gift. What’s a Chumby? It’s an Internet-enabled alarm clock. Really it’s a tiny little hacker-friendly embedded system (Linux?) with WiFi, a 320x240 touchscreen, and a small form factor. It’s a toy.

Pretty bad user experience out of the box. Here’s the horror so far on first use. My goal was to see what time it is.

  • Plug it in, first thing you do is calibrate the touchscreen. Despite my dragging the little circle into the ring (visually), it doesn’t seem to register until the third try.
  • Second thing you do is set it up on your WiFi. It doesn’t see any networks. I type my SSID manually. It’s still lost. I type my WEP key in manually on the terrible touchscreen, unsure if it is even the kind of key it’s looking for. Press connect, 60 seconds later a timeout and no joy. Set up a second wifi network with no password. Chumby can’t find it either, even manually. Go online, read support, try rebooting the device. It finds the network! It’s online! Including a charmingly nerdy screen full of info about MAC addresses, Tx packet counts, etc. Lol.
  • Eager to move along my one page quick start manual, I find I’m not being asked to set the time. Which makes sense; it’s online afterall, but then why does the manual say it should?
  • Asked to register my device online. Have to create yet another @#*$#$ website account, with another username that’s unique, with another password, with another email verification step, with another “click here to not get spam” choice. I’m tired of Internet accounts. Fortunately, the device pairing goes smoothly, including a nice little AJAX notification in the browser.
  • Start the device. Maybe I can see a clock now? No, I get some headline scroll of TUAW feeds, including the word “RSS” prominently featured in the Chumby UI.
  • Stuck, not sure how to get to the clock, I randomly hit buttons. Suddenly presented with the option to upgrade the Chumby. OK, sure, and now for 5 minutes I’m being admonished “Do not disconnect the power at any time.”
  • Chumby finally reboots. I’m treated to a scrolling slideshow of apps I don’t want. What time is it?!
  • Find the button on top of the device (not the touchscreen), which lets me choose apps. Scroll through “featured apps” to 10 of 16, which is a clock. Find it’s 15 minutes after I started, then the app disappears.
  • Sometime later my Chumby starts scrolling apps again, including one to a page with ads selling me more crap from the manufacturer. Charming.

I think I’ll be setting up the other Chumby at home before presenting it as a gift. I like to troll my Apple-loving friends with how pretentious, closed, and expensive Apple devices are. But I’ll give Apple this, they have an excellent first-time user experience. OTOH their equivalent device, the iPod Touch, is 5x as expensive.

Snark aside, it’s not a bad device for $50. The main UI is “scroll through a bunch of Flash apps”. That doesn’t work for me, so I’ve set it to run a single app, the Flickr + clock app. It’s also able to play Internet radio streams in the background. That’s pretty slick.