Kategorie: Hack

  • Using qemu userspace emulation to build Debian packages for other architectures

    In my attempt to avoid overloading my poor new Pinebook (some cheap arm64 laptop) with builds, I tried setting up a build environment on my more powerful x86-64 based machines. For consistency I’m looking for a Debian package builder (since the machine is running Debian), and I know that pbuilder is a reasonable tool for […]

  • „bad listen address format“ docker error on Debian (and elsewhere)

    I just encountered an issue on my Debian sid ("unstable") system where docker wouldn’t start due to incompatibilities between its components. On my search on the net, I found various proposals to just downgrade containerd, but I thought that’s kinda lame (and it’s also tedious to make sure that all the dependencies are still met […]

  • Debian sid, GRUB2, lvm, luks

    One of my systems is running Debian sid with an encrypted root device, incl encrypted /boot. Encryption is unlocked using a passphrase in GRUB2 (before the menu is shown). Since GRUB can’t pass along the key to the kernel, a keyfile is put in the initrd so that the kernel can unlock the disk without […]

  • Random Hack: Identify the mid-point between two git commits

    Francis asked on irc://irc.freenode.net/#coreboot how to find the mid-point between two commits, like what git bisect is doing – just without git bisect. So here’s a bash function that does this: git_midpoint() { local NUM NUM=$(($(git log –pretty=%h $1 |wc -l) / 2)) if [ $NUM -gt 0 ]; then git show $(git log –pretty=%h […]

  • Random Hack: Identify services that use outdated libraries on Linux

    With the GnuTLS bugfixes recently, I faced the issue to restart services that depended on it: After updating the library, daemons still run the old version until restarted. I think I’ve seen this automated in some distribution, but it’s nice to know where those tools fetch their data. I also didn’t want to restart them […]

  • Random Hack: Calculations in GNU make

    I built an efficient algorithm for decimal addition in GNU make last year. While I won’t vouch for its production quality (on the other hand: why not?), it’s too cute a hack to hide from the world. Unlike other implementations, this isn’t using unary encoding, and as such doesn’t suffer from their limitations. While unary […]

  • Freie strdupa Implementierung

    Ohne Gewährleistung auf Funktionalität oder irgendwas, aber nachdem mir heute jemand gesagt hat, dass er einfach strdupa mit strdup #define‚d, dachte ich mir, suche ich lieber mal fix nach einer leak-freien Lösung. #define strdupa(x) (char*)strcpy((char*)alloca(strlen((const char*)x)+1),(const char*)x) Es benötigt natürlich die entsprechenden Header, lt. Dragonfly BSD sind das stdlib.h und string.h Lizenz: ISC, Copyright (C) […]