Skip to content

Instantly share code, notes, and snippets.

@skirsten
skirsten / auto-format-mount.py
Last active March 7, 2024 15:29
Small script to automatically format and mount virtio disks
#!/usr/bin/env python3
import glob
import json
import os
import subprocess
prefix = "/dev/disk/by-id/virtio-"
for disk in glob.glob(f"{prefix}*"):
@skirsten
skirsten / aws-ping.sh
Last active October 10, 2020 18:27
Pings all AWS regions and sorts by RTT.
#!/bin/bash
# Usage: `./aws-ping.sh` prints all regions sorted by lowest latency and `./aws-ping.sh 3` prints the top 3 regions.
declare -A zones=(
[us-east-2]="US East (Ohio)"
[us-east-1]="US East (N. Virginia)"
[us-west-1]="US West (N. California)"
[us-west-2]="US West (Oregon)"
[af-south-1]="Africa (Cape Town)"
@skirsten
skirsten / keybase.md
Last active June 16, 2020 14:47
keybase.md

Keybase proof

I hereby claim:

  • I am skirsten on github.
  • I am skirsten (https://keybase.io/skirsten) on keybase.
  • I have a public key ASD7GmtdoRseKQmEqIqfQOHKU2gvosSFZR9lTuX3-J7j3go

To claim this, I am signing this object:

@skirsten
skirsten / docker-compose.yml
Created June 12, 2019 12:22
Super simple docker-compose automatic tcp load balancer using nginx and docker-gen
version: "3"
services:
whoami: # the service(s) you want to load balance
image: jwilder/whoami # this is an example placeholder (keep in mind that browsers keep connections open)
labels:
publish: "8000" # which port of this server to publish to the load balancer
nginx:
image: nginx
container_name: lb_nginx_frontend