Skip to content

Instantly share code, notes, and snippets.

View davegallant's full-sized avatar
🐧
coding

Dave Gallant davegallant

🐧
coding
View GitHub Profile
@davegallant
davegallant / pct-enter.sh
Created December 3, 2023 04:06 — forked from Xenthys/pct-enter.sh
A helper for Proxmox's "pct enter" to use containers' hostnames and enter them from any cluster node.
#!/bin/bash
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
davegallant / encryptedNixos.md
Created November 13, 2022 18:18 — forked from ladinu/encryptedNixos.md
NixOS install with encrypted /boot /root with single password unlock

Requirements

  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
davegallant / README.md
Created November 13, 2021 21:35 — forked from triangletodd/README.md
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
davegallant / aws_access_key_rotator.py
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: https://cli.github.com
# 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
davegallant / nixos.md
Created May 2, 2021 17:50 — forked from martijnvermaat/nixos.md
Installation of NixOS with encrypted root

Keybase proof

I hereby claim:

  • I am davegallant on github.
  • I am dgallant (https://keybase.io/dgallant) on keybase.
  • I have a public key ASATIxHvjXCo818oTrF6RcvN9lPOBABk39SjNtSOLdPF7go

To claim this, I am signing this object:

// This is now maintained at https://github.com/davegallant/rfd-redirect-stripper/blob/main/script.js