Skip to content

Instantly share code, notes, and snippets.

View davegallant's full-sized avatar
♨️

Dave Gallant davegallant

♨️
View GitHub Profile
@davegallant
davegallant / statusline-command.sh
Last active April 13, 2026 16:08
Claude Code Status Line
#!/usr/bin/env bash
input=$(cat)
cwd=$(echo "$input" | jq -r '.workspace.current_dir // .cwd // ""')
model=$(echo "$input" | jq -r '.model.display_name // ""')
window_size=$(echo "$input" | jq -r '.context_window.context_window_size // empty')
# Sum all current_usage token fields for precise count
input_tokens=$(echo "$input" | jq -r '
[.context_window.current_usage.input_tokens,
.context_window.current_usage.output_tokens,
@davegallant
davegallant / k9s-ghostty-skin.yaml
Created March 30, 2026 18:30
K9s Ghostty StyleDark Skin
# -----------------------------------------------------------------------------
# K9s Ghostty StyleDark Skin
# Based on Ghostty's built-in default (StyleDark) color palette
# -----------------------------------------------------------------------------
foreground: &foreground "#ffffff"
background: &background "#292c33"
current_line: &current_line "#3a3d45"
selection: &selection "#666666"
comment: &comment "#666666"
cyan: &cyan "#95bdb7"
@davegallant
davegallant / Grafana Dashboard - Airthings 325 Corentium Home 2
Created March 26, 2026 02:48
Grafana Dashboard for tracking radon with the Airthings 325 Corentium Home 2
{
"annotations": {
"list": [
{
"builtIn": 0,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": false,
#!/usr/bin/env bash
# pct-enter [container-name]
# If container-name is not provided, a fzf prompt will be displayed.
containers=$(pct list | tail -n +2 | awk '{print $3" - "$1}')
if [ $# -eq 0 ]; then
selected_container=$(echo "$containers" | fzf)
else
@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: