Skip to content

Instantly share code, notes, and snippets.

View davegallant's full-sized avatar

Dave Gallant davegallant

View GitHub Profile
davegallant /
Created December 3, 2023 04:06 — forked from Xenthys/
A helper for Proxmox's "pct enter" to use containers' hostnames and enter them from any cluster node.
id=$(grep "$1" /etc/pve/.rrd | cut -d'/' -f 2 | cut -d':' -f 1)
[[ "$id" == '' ]] && echo "The specified LXC does not exist." && exit 1
node=$(grep "^\"$id\":" /etc/pve/.vmlist | cut -d'"' -f 6)
[[ $(hostname) != "$node" ]] && pre="ssh -t $node "
echo "Entering LXC $id on node $node..."
${pre}pct enter $id
davegallant /
Created November 13, 2022 18:18 — forked from ladinu/
NixOS install with encrypted /boot /root with single password unlock


  1. Encrypt everthing including /boot and /root
  2. Enter password once
  3. Support UEFI

Installation media setup

Download NixOS minimal iso and copy to USB stick. For example on Mac OSX

$ diskutil list
$ diskutil unmountDisk /dev/disk1 # Make sure you got right device
davegallant /
Created November 13, 2021 21:35 — forked from triangletodd/
k3s in LXC on Proxmox

On the host

Ensure these modules are loaded

cat /proc/sys/net/bridge/bridge-nf-call-iptables

Disable swap

sysctl vm.swappiness=0
swapoff -a
davegallant /
Last active October 28, 2021 04:50
AWS Access Key Rotator
#!/usr/bin/env python3
# This script will collect all existing access keys of the current caller identity,
# create a new access key, update your credentials file, and then delete all previously existing access keys.
# This only works if the caller identity is an IAM User because if you're using AWS SSO or temporary session credentials,
# you probably don't need this.
#!/usr/bin/env bash
# This script clones all repos in a GitHub org
# It requires the GH CLI:
# It can be re-run to collect new repos and pull the latest changes
set -euo pipefail
USAGE="Usage: gh-clone-org <user|org>"
davegallant /
Created May 2, 2021 17:50 — forked from martijnvermaat/
Installation of NixOS with encrypted root

Keybase proof

I hereby claim:

  • I am davegallant on github.
  • I am dgallant ( on keybase.
  • I have a public key ASATIxHvjXCo818oTrF6RcvN9lPOBABk39SjNtSOLdPF7go

To claim this, I am signing this object:

// This is now maintained at