NSImage is dangerous

Screenshot of an excerpt from Xcode's debug console showing the output of AddressSanitizer, having detected data race involving NSImage.

NSImage is formally documented as largely not thread-safe: The following classes and functions are generally not thread-safe. In most cases, you can use these classes from any thread as long as you use them from only one thread at a time. Check the class documentation for additional details. Apple’s Threading Programming Guide > Appendix A:… Read more

Reminder: macOS system frameworks binaries are hidden (since Big Sur)

Every now and again I’ll go to do something really innocuous with an Apple framework, like disassemble it in Hopper or check the link headers. And every. single. time. I forget that Apple did some really weird shit in Big Sur, and removed the binaries. $ ls -lh /System/Library/Frameworks/AppKit.framework/Versions/Current/AppKit ls: /System/Library/Frameworks/AppKit.framework/Versions/Current/AppKit: No such file or… Read more

cloudinit breaks connections from localhost to Plesk-operated web servers

I don’t know how or why it is even installed – perhaps part of the provided Ubuntu image from my VPS host – but cloud-init (a.k.a “cloud-config”) is a bit obnoxious. At [re]boot time (best I can tell), it resets /etc/hosts based on some random template it has (/etc/cloud/templates/hosts.debian.tmpl in my case, even though that… Read more

How to install ImageMagick 7 for WordPress under Plesk Obsidian on Ubuntu 22.04

The ImageMagick logo: a stout blue-robed wizard, with huge white beard and moustache, point a wand up and to the left where the words "Image Magick" arc across, surrounded by gold stars.

Why should I do this? WordPress relies on either ImageMagick or GD for its ability to read & write images. It prefers ImageMagick, as ImageMagick supports a much wider range of files, tends to be faster, and some assert that it produces higher quality files. ImageMagick 6 was superseded by ImageMagick 7 nearly a decade… Read more

SwiftUI main thread hang detector

Illustration of the MacOS Spinning Pinwheel of Death cursor

This is just a little snippet that is quite useful for reporting when your GUI thread (the main thread / actor) hangs for a significant amount of time. There are numerous heavier-weight tools for analysing this sort of thing, but I’ve found that this simple monitor does what I need most of the time. You… Read more

The most unpopular popular websites

Screenshot of the Kagi Search home page, showing a very clean, simple page with essentially just the logo, the mascot Doggo, a text field, and a Search button. Very reminiscent of what Google Search's home page used to look like a long time ago.

Tonight I decided to give Kagi a try, after hearing John Gruber mention it a few times on Daring Fireball. I’ve used a mix of DuckDuckGo and Bing for over a decade now, and occasionally will still try Google in desperation. What I’ve noticed is a decade-long trend – accelerating in the last year or… Read more