Alexander Bakker's Blog

Notes on PCI Passthrough on NixOS using QEMU and VFIO

With the release of the Ryzen 3000 series CPUs, I decided it was finally time to upgrade from my good old Intel i5 2500K. It served me well for nearly 8 years, but its age was starting to show. While doing the upgrade, I also wanted to address the other two main pain points I had with my previous setup. Long story short: I ended up installing NixOS and setting up PCI passthrough.

Did cosmic rays break my Linux build?

I think I experienced a random bit flip while updating Linux on one of my machines today. My laptop was humming along happily during compilation until GCC suddenly aborted with an error: invalid preprocessing directive #lefine; did you mean #define?.

Insecure seed generation in the Nano Android wallet

On the 21th of June 2018, the release of the new wallet applications for Nano was announced on Reddit. Shortly after that, another announcement was made telling users of the Android app to transfer their funds to a wallet with a seed that was not generated by the app. I quickly looked up the source code and found that the app was using a random number generator that is not cryptographically secure. Let’s analyze how bad this really is. Spoiler: it’s bad.

Mutating immutable strings in Go

As most Go programmers probably know, strings are immutable in Go. This has its advantages, but there are times when one might want to make changes to a string. Using reflection, we can obtain the underlying StringHeader struct of strings and modify the contents.