Installing SQL Server 2022 on newer Ubuntu 24.04

I had a need to install SQL Server 2022 on Ubuntu 24.04. The instructions for Ubuntu 22.04 will work fine, until you start it. While it does install with the Ubuntu 22.04 packages, the dependencies are incorrectly marked*. When you try to set up the new SQL Server instance, it’ll make this error on startup:

Configuring SQL Server...

/opt/mssql/bin/sqlservr: error while loading shared libraries: liblber-2.4.so.2: cannot open shared object file: No such file or directory
Continue reading

Project idea: pkg-config support in compilers

I’ve got a lot of ideas in my head of things I’d like to see, but don’t have the time to see out myself. Perhaps this could be a series. However, unlike many “idea guys”, I’m aiming to explain how you could implement this. And please do – I’m sharing because I think it’d be beneficial, or at least interesting to think about.

Anyways, what I have wanted for a while is pkg-config support in compilers. Perhaps it could simplify smaller build systems for programs without needing to involve something like CMake. Or maybe it’s a bad idea, but we can at least learn along the way.

Continue reading

Common issues with using GnuPG over SSH from a Mac

Usually, I work directly on my Mac, but sometimes, I have to log into it from another system. By default (at least on MacPorts), the GnuPG agent will default to using the graphical pinentry. Normally, this is good, but if you need to enter your key passphrase, it’ll open on the desktop instead. Oops. To fix this part, add this line (adjusting path as needed) to ~/.gnupg/gpg-agent.conf (maybe need to restart the agent too):

pinentry-program /opt/local/bin/pinentry-curses

Remove this line to go back to using graphical passphrase entry.

Sometimes with this, you might get an error like this with the curses version of pinetry:

gpg: signing failed: Inappropriate ioctl for device

It seems GnuPG might not pick up the right TTY, so you may need to explicitly override it:

GPG_TTY=$(tty)
export GPG_TTY

Making mailing lists nicer: Writing a mail extension for macOS with MailKit

As a developer, I need to work with mailing lists a lot. Developer-focused mailing lists tend to have certain conventions most usage of email has moved on from, as have the clients. While some people who trawl mailing lists configure some terminal email client, I tend to not like those. Most of the time, I use the stock Apple mail application (Mail.app). It otherwise works well and has platform integration.

However, I do want to avoid a lot of common mailing list faux pas, like top posting and not wrapping lines. Mail.app can write plain text emails, but it doesn’t push you in the right direction for mailing lists. However, Mail.app does provide an extension API. I figured I could write an extension to make my life on mailing lists easier. Turns out it’s possible!

The extension I wrote is called MailTools (tentative until a better name is found). Feel free to build or download it yourself; this article explains the challenges I faced.

Continue reading

Accessing iPhone photos and media from Nautilus on Linux

If you plug your iPhone (or other iOS device) into your Linux system, you might see in the sidebar the virtual filesystem for app document storage, but not photo/media storage. If you don’t see the photos virtual filesystem, go to the app document virtual filesystem first. Change the :3 at the end in the afc:// URL to :1. (You may need the proper GVFS plugins for AFC and gphoto2 first.)

Is Linux collapsing under its own weight? On Rust for Linux

Recently, one of the developers of the Rust for Linux project, Wedson Almeida Filho, resigned from the project. In his parting message, he linked a video of a filesystem maintainer shouting at him. Afterward, Asahi Lina, developer of the Apple GPU drivers for Linux (which have not been upstreamed yet), posted a series of threads on Mastodon (first one), expressing sympathy for Wedson and her own frustrations with maintainers and Rust from the DRM perspective. While it’s tempting to look at this as just “Rust haters vs Rust pushers” drama, I think these signal deeper issues in Linux, both technical and cultural (which often feed into each other). In this article, I’ll summarize the issues for those unfamiliar and speculate where it could lead.

Continue reading

Notes on installing IBM i over an NFS share

I was trying to install IBM i (mostly) over the network, and ran into some difficulties setting it up. IBM provides some information on netboot, the most important being how you set up an image catalog – that is, an NFS share with a VOLUME_LIST file at its root listing the files. However, it doesn’t mention how the NFS share should be set up (assuming you’re not using IBM i to host it), and what files should be in that volume list.

Continue reading

Updating Core Data object ID URIs on store migrations

I found out recently that Core Data object IDs can change. This usually happens if you migrate a store, such during a heavyweight migration (lightweight migrations don’t count, as they mutate in place). If you were like me and persisting object IDs, then you’ll have to update those URIs, or you will have a very bad day trying to fetch objects from these IDs.

The easiest way to do this is to lean on NSMigrationManager, because it has both the source and destination model versions, and can get the destination object version from the source version. If you’re manually doing the migration for model upgrades, you easily have it already. If you want to update it from a NSEntityMigrationPolicy, then the easiest option is to stash the NSMigrationManager by overriding beginEntityMapping:manager:error:. You provide it the source NSManagedObjects, and out comes the destination version’s managed objects, as shown below, of which you can get the new object IDs to persist in the new version of the model:

var manager: NSMigrationManager!

private func destinationURIsFromSourceObjects(_ objects: [NSManagedObject]) -> [URL] {
    return manager.destinationInstances(forEntityMappingName: "TrackToTrack", sourceInstances: objects).map {
        $0.objectID.uriRepresentation()
    }
}

Note that you need to provide the entity mapping name – regardless if your entities heavily changed or not. For the Xcode mapping model generator, check the name – it’s usually something like TrackToTrack. If you need to get the managed objects from the source version’s URIs, you can use the the sourceContext property in the migration manager to get the source model version’s managed object context.

Fixing the “Not a heap block” error with networking with PCPro

I was trying to get the PC compatibility card (a Gemini II) in my Risc PC (StrongARM, running RISC OS 3.70) onto the network. However, when starting the emulated PC, I would get a “Not a heap block” error, and the emulated PC wouldn’t have its emulated network card.

It turns out this is because the program it invokes to find the most appropriate interface (this is called ScanDCI4) doesn’t actually work. This causes the script to fail, and not actually load the emulated NE2000 support module. To fix this, we’ll need to patch the script that starts the PC card networking support.

Continue reading

Formatting disks and clearing RAID config on Power systems with iprutils

I recently put some spare disks into a Power S814 server, and when I tried installing an OS, be it VIOS or Debian, it would say that there were no disks available to install onto.

It turns out that the RAID configuration on the controller and the disks didn’t match. This is par for the course with any RAID controller, even in the x86 world. It also didn’t help that some of the disks were formatted for IBM i, which uses non-512-byte block disks. We need to use the vendor utility to clear out the RAID config, and format the disks to be usable by commodity operating systems.

The two utilities IBM provides for this are either the diagnostics on the AIX Standalone Diagnostics disc, or using the iprutils set of software. Since netbooting Linux was easier as I don’t have a NIM server, I’m choosing to do the latter here.

Continue reading