Make devcontainers work on Fedora with SELinux / rootless podman

I needed to add the following to my .devcontainer.json to get it going: "runArgs": [ "--userns=keep-id:uid=1000,gid=1000", "--security-opt=label=disable" ], "containerUser": "vscode", (Assuming your user ID is 1000. Find it by running …
Read more →

List only the most recent SemVer version number per major.minor branch

Here's a handy snippet to show only v1.3, v2.1 out of a range like v1.0, v1.1, v1.2, v1.3, v2.0, v2.1: git tag -l "v*.*.*" --sort=-v:refname | awk -F. '!seen[$1,$2]++' (Input does not have to come from git, it can be any newline-delimited list of ve…
Read more →

Generating random data with OpenSSL

One way to produce lots of seemingly random, hard to compress data is to leverage AES encryption through OpenSSL. This can be faster than just reading data from /dev/urandom as modern CPUs typically have dedicated AES instruction sets which openssl c…
Read more →

Resetting USB devices on Linux

Usbutils has a usbreset command that will reset a given USB device: # usbreset 046d:0843 Resetting Logitech Webcam C930e ... ok lsusb can be used to find the right device ID. This awk snippet may help with scripting (using the same Logitech webcam a…
Read more →

Using hardware security tokens (Yubikeys) to log in to Azure AD with Firefox on Linux

Microsoft currently doesn't support FIDO2 logins with Firefox on Linux (they do support Chrome) and actively disables this in their login flow. Despite this, I have been able to make it work using the following steps: Enroll a new key via Chrome. Re…
Read more →

Google Chrome web USB serial socket permissions issues

Trying to use ESPHome Web to flash some firmware using Web Serial with Chromium, I got an immediate error when selecting a USB serial device: Failed to open serial port: FILE_ERROR_ACCESS_DENIED. The issue had to do with ownership of the /dev/ttyUSB0…
Read more →