Skip to content

Instantly share code, notes, and snippets.

View plmercereau's full-sized avatar

Pilou plmercereau

  • Brussels, Belgium
View GitHub Profile
version: '3.1'
services:
reverse-proxy:
image: traefik # The official Traefik docker image
command: --api --docker # Enables the web UI and tells Traefik to listen to docker
ports:
- "80:80" # The HTTP port
- "8080:8080" # The Web UI (enabled by --api)
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
@plmercereau
plmercereau / benchmark.sh
Created October 19, 2022 09:21
Benchmark different Node package managers
#!/usr/bin/env bash
output=result.csv
> $output
benchmark () {
echo "Benchmarking $1"
pnpm run clean:all
# * `date` does not support milliseconds in macos
from=$(perl -MTime::HiRes=time -e 'printf "%.9f\n", time')
eval $2
@plmercereau
plmercereau / raspberry-pi-zero-2.nix
Last active November 3, 2024 12:29
Nix module to create SD images for Rasperry Pi Zero 2 W
{ config, lib, pkgs, ... }:
{
imports = [
<nixpkgs/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix>
./sd-image.nix
];
system.stateVersion = "23.11";
# Pi Zero 2 struggles to work without swap
sdImage.swap.enable = true;