VSCode dev container with Podman and WSL

I have been running VSCode development containers for many years. My main machine running Windows 10, I was using Docker Desktop to inject Docker in WSL. And that has been nothing but slow and steady troubles, so it was time to migrate to Podman. Problems with Docker Desktop Slow to start Not that reliable, it can crash at start, stop or while running rarely It seems to sometimes crash WSL which won’t even stop with wsl --shutdown Why Podman Daemon less so it can’t really crash unless being called for something No need to install it on the host system, installing in WSL is enough Rootless Prerequisites My configuration is as follows:...

March 18, 2024 · 3 min · Quentin McGaw

Nushell: install plugins faster

Nushell is a pretty cool project written in Rust to have a shell working the same on all platforms. It can notably be extended with plugins. But figuring out how to install them from their instructions and, even after this, the many steps required, ruined my excitement. Here’s how I made it exciting again! 🚀 Install once Install Rust, GCC and Git. There are detailed steps below for Windows, OSX and Linux if you need to install any....

January 17, 2024 · 4 min · Quentin McGaw

Open source Docker image tagging strategies

With open source software, it’s not an easy task to strike the right balance between producing stable programs and having a decent base of testing users. This post explains how to best achieve this, and what conclusions resulted from the years I have been developing open source projects. Triggers for image tags The Git main branch (aka master) should be your base branch, and commits added to it should trigger a build with the :latest tag....

June 7, 2023 · 5 min · Quentin McGaw

Signing Git commits with SSH and Github

For a very long time, the only way to sign commits that would be compatibly with Github was by using GPG. Unfortunately, despite GPG being perhaps superior than SSH when it comes to signing, its use is still limited and SSH keys are much more widespread. In this post, I’ll show you how to sign your Git commits with SSH, view signatures in your terminal and configure Github with your key....

August 27, 2022 · 2 min · Quentin McGaw

Go global variables

Let’s face it. Global variables are mostly bad and you should not use them. BUT they are cases where it’s better to use them. This post will explore these. Sentinel errors In Go, you don’t throw and catch errors. You wrap and return them, and check them with errors.Is(err, errSomething). You may wonder what errSomething is? It’s a sentinel error. The error check errors.Is(err, errSomething) will return true only if errSomething is the same error variable as err or as the one wrapped in err....

May 27, 2022 · 4 min · Quentin McGaw

Go errors with codes

In a hurry 🏃? Jump to the conclusion After some discussion on Reddit, I decided to write this blog post on how to have Go errors containing codes you can use in calling layers. This is the case for example if you want to have the HTTP status code contained in an error created in your database package. Let’s start with some base code showing how this works. You have two files:...

September 18, 2021 · 2 min · Quentin McGaw

Wrap Go errors like it's Christmas!

In a hurry 🏃? Jump to the conclusion It took me months if not years to figure out the best way to wrap errors in Go. This was even more critical when developing public Go APIs where a user should be able to check for your (returned) errors. Global variables and errors NEVER USE GLOBAL VARIABLES!… except for errors which are meant to be constants. For example: var ErrUserNotFound = errors....

September 15, 2021 · 4 min · Quentin McGaw

VFIO GPU passthrough on Arch Linux

I have a custom built Arch Linux server running all the time, running mostly Docker containers. In this guide we will approach two situations. The first one will be how to do the initial setup of the Windows virtual machine with GPU passthrough. The second one will be how to change GPU and update the configuration. In both paths, there will be step by step instructions with precise commands and examples....

August 6, 2021 · 11 min · Quentin McGaw

Faster Go development lifecycle with Go 1.16's embed

This post concerns my most popular Github repository: github.com/qdm12/gluetun. This is a VPN client application written in Go and meant to be ran in Docker. Because it is a security and privacy focused application, all VPN servers information including their IP addresses have to be bundled in the program. This is to avoid using hostnames and leak an initial DNS resolution resolving the VPN server hostname. Arguably, because gluetun runs in a container, this information could also be stored in the Docker image and read at runtime....

July 20, 2021 · 5 min · Quentin McGaw

Fast thread-safe randomness in Go

This post is about how to generate uniformly distributed numbers thread safely and as fast as possible. It does involve randomness but we do not aim at generating cryptographically secured random numbers. The use cases vary, but a common example is to pick an element from a slice uniformly for each HTTP request in an HTTP server. Given the way the net/http library is, one cannot fiddle with the entrypoint before the request handling is launched in its own goroutine....

July 10, 2021 · 10 min · Quentin McGaw

Binpot

binpot is the repository holding Dockerfiles and Github workflows to statically build binaries for all CPU architectures supported by Docker. TL;DR ⏩ Usage: FROMalpine:3.14COPY --from=qmcgaw/binpot:helm /bin /usr/local/bin/helm Programs available Search programs on Docker Hub All Docker images and programs are built for every CPU architecture supported by Docker Initial situation 🤔 I developed VSCode development containers Dockerfiles for amd64 only, which covers most machines....

June 28, 2021 · 7 min · Quentin McGaw

Alpine: why wget and not curl?

Alpine is tiny. The alpine:3.14 Docker image is only 5.6MB uncompressed on amd64. Alpine achieves this partly thanks to busybox, which Docker image busybox is only 1.24MB. Alpine comes with wget implemented in its Busybox multi-call binary. You can try it with: docker run -it --rm busybox wget But why isn’t curl implemented as well, or instead of wget?? 🤔 wget vs curl The following table shows some key differences between the two, comparing the two installs on Alpine by using...

June 25, 2021 · 3 min · Quentin McGaw