Skip to content

Instantly share code, notes, and snippets.

View andrewhamon's full-sized avatar

Andy Hamon andrewhamon

View GitHub Profile
@andrewhamon
andrewhamon / configuration.nix
Last active January 1, 2023 05:28
Demonstration of how to run a nix service in an isolated network namespace with internet access only via VPN.
{ config, pkgs, ... }:
{
imports = [
./hardware-configuration.nix
./namespaced-wg.nix
];
# Set up wireguard + a new network namespace using the module defined in hardware-configuration.nix
services.namespaced-wg.enable = true;
services.namespaced-wg.name = "seedbox"; # Name this whatever, but keep it short
@andrewhamon
andrewhamon / keybase.md
Created December 7, 2016 22:40
keybase.md

Keybase proof

I hereby claim:

  • I am andrewhamon on github.
  • I am ahamon (https://keybase.io/ahamon) on keybase.
  • I have a public key ASB1xfomaJo4OZQJxUtk0C8LSP1srVOF4T4RwnwviU8rvQo

To claim this, I am signing this object:

@andrewhamon
andrewhamon / Caddyfile
Last active June 12, 2016 05:07
Reproducing the bug described in https://github.com/mholt/caddy/pull/880
localhost:80
proxy / server_1:8080 server_2:8080 server_3:8080 {
policy round_robin
health_check /healthcheck 1s
}
@andrewhamon
andrewhamon / rubodiff
Last active August 29, 2015 14:22
Rubodiff! Diffs the rubocop results of your current branch with the results of develop
#!/bin/bash
GREEN='\033[0;32m'
# The ampersand at the end of this line makes this command run in the background...
rubocop --format simple --out ~/rubocop_results_current_branch.txt &
# ...while all this runs in the foreground...
mkdir -p ~/rubodiff_temp
rm -rf ~/rubodiff_temp/*
git archive develop | tar -x -C ~/rubodiff_temp
rubocop --format simple --out ~/rubocop_results_develop.txt ~/rubodiff_temp