Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / data_drives.sh
Created November 22, 2023 19:39
Make filesystem then add drives to fstab
# create dirs
mkdir -p /data/{0..2}
# mkfs xfs
mkfs.xfs /dev/nvme0n1
mkfs.xfs /dev/nvme1n1
mkfs.xfs /dev/nvme2n1
# mount partition manually (optional)
# mount /dev/nvme0n1 /data/0
@pythoninthegrass
pythoninthegrass / bfg
Last active December 14, 2023 00:17
Shim for bfg repo cleaner
#!/usr/bin/env bash
# * Download latest bfg bin from https://rtyley.github.io/bfg-repo-cleaner/
# * Copy somewhere in path (e.g., ~/.local/bin)
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
java -jar "${SCRIPT_DIR}/bfg-1.14.0.jar" "$@"
@pythoninthegrass
pythoninthegrass / dl-gh
Last active July 22, 2025 08:05
Download latest GitHub releases by user, repo, and extension
#!/usr/bin/env bash
# shellcheck disable=SC2207
base_url="https://github.com/$user_name/$repo_name/releases"
pkg_path=$(pwd)
distro=$(uname) # Linux / Darwin
arch=$(uname -m) # x86_64 / aarch64 / arm64
help() {
@pythoninthegrass
pythoninthegrass / set_hostname.sh
Last active December 19, 2023 21:59
Set hostname on macOS
#!/usr/bin/env bash
# shellcheck disable=SC2086
IFS="$(printf '\n\t')"
trap 'unset IFS' INT HUP QUIT
help() {
cat <<- DESCRIPTION >&2
@pythoninthegrass
pythoninthegrass / .gitignore
Last active December 28, 2023 00:16
Remove repos from CircleCI via API
repos.txt
@pythoninthegrass
pythoninthegrass / ghcr.md
Created December 28, 2023 18:41 — forked from yokawasa/ghcr.md
ghcr (GitHub Container Registry)

ghcr (GitHub Container Registry) quickstart

CLI

To push container images to ghcr, you need peronal access token (PAT) - see how to create PAT

  1. Get PAT (personal access token)

Personal Settings > Developer settings > Personal access tokens

@pythoninthegrass
pythoninthegrass / GIT_SSH.md
Last active January 4, 2024 17:58
GitHub SSH deploy key

Use SSH deploy key with GitHub

Generate SSH key

ssh-keygen -t ed25519 -C "<email>"

Point to specific SSH key

  • ~/.gitconfig: git config --global core.sshCommand "ssh -i ~/.ssh/id_ed25519 -F /dev/null"
@pythoninthegrass
pythoninthegrass / mojo
Last active January 6, 2024 18:25
Shim for mojo to get around MOJO_PYTHON_LIBRARY not being found
#!/usr/bin/env bash
# shellcheck disable=SC2034
cat <<- 'DESCRIPTION' >&2 > /dev/null
Run Mojo with MOJO_PYTHON_LIBRARY set to the current python version
installed by asdf
INSTALL
chmod +x mojo

microk8s & fluxcd

(optional) prepare the server

# install at https://multipass.run/
multipass launch --name microk8s-flux --mem 2G
multipass shell microk8s-flux

# assume ubuntu with snap installed, if not install it via
apt install snapd
@pythoninthegrass
pythoninthegrass / kamal.md
Last active June 6, 2025 13:58 — forked from huksley/mrsk.md
kamal - the missing manual

kamal

This documentation adds important additions to the docs for kamal deploy tool (see github.com/basecamp/kamal)

Destination flag

You can use kamal deploy --destination staging

This will read config/deploy.yml and config/deploy.staging.yml files, and also will read .env.staging file if it exists.