Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
[env]
TERM = "xterm-256color"
[terminal.shell]
program = "/usr/bin/bash"
args = ["-l", "-c", "zellij"]
[window]
dimensions.columns = 100
dimensions.lines = 34
@pythoninthegrass
pythoninthegrass / macos_terraform.md
Last active December 10, 2024 03:31 — forked from gwarf/MacOSX_terraform.md
Using terraform in macOS to manage KVM-backed VMs.

Using Terraform on macOS to manage KVM-backed VMs

Installing

Terraform

brew install terraform
@pythoninthegrass
pythoninthegrass / install.sh
Last active November 26, 2024 00:00
(Un)install pw cli password manager
#!/usr/bin/env bash
set -e
BASE_URL="https://github.com"
ORG="sschmid"
REPO="pw-terminal-password-manager"
BIN_NAME="pw"
SUBDIR="src"
@pythoninthegrass
pythoninthegrass / vector.yml
Created November 19, 2024 21:50
Basic macOS compatible Vector telemetry w/redis + prometheus
sources:
docker:
type: docker_logs
auto_partial_merge: true
docker_host: unix:///var/run/docker.sock
exclude_containers:
- exclude_
partial_event_marker_field: _partial
retry_backoff_secs: 2
@pythoninthegrass
pythoninthegrass / cleanup.sh
Last active November 13, 2024 19:16
Cleanup ubuntu servers (non)interactively (cf. no disk space left)
#!/usr/bin/env bash
set -euo pipefail
# $USER
[[ -n $(logname >/dev/null 2>&1) ]] && logged_in_user=$(logname) || logged_in_user=$(whoami)
# $UID
# logged_in_uid=$(id -u "${logged_in_user}")
@pythoninthegrass
pythoninthegrass / deploy.sh
Last active October 19, 2025 01:42
Spin up a kind cluster with jupyterhub
#!/usr/bin/env bash
set -e
# Clean up function
cleanup() {
echo "Cleaning up existing cluster..."
kind delete cluster
}
@pythoninthegrass
pythoninthegrass / Earthfile
Created November 11, 2024 02:32
Multiplatform rust build and containerization using earthly
VERSION 0.8
ARG --global APP_NAME="hello_rust"
ARG --global PROFILE=release
all:
BUILD \
--platform=linux/amd64 \
--platform=linux/arm64 \
+docker
#!/usr/bin/env bash
set -eo pipefail
# Default values
PACKAGE_NAME=""
USER_NAME=""
DRY_RUN=false
VERBOSE=false
@pythoninthegrass
pythoninthegrass / archive.sh
Last active January 16, 2025 19:51
Clean up git directories (.venv, .terraform, node_modules, and target). Then archive repos.
#!/usr/bin/env bash
# shellcheck disable=SC2155
# Environment variable overrides with defaults
OUTPUT_DIR="${OUTPUT_DIR:-${HOME}/Downloads/git_archive}"
ARCHIVE_FORMAT="${FORMAT:-zip}"
MAX_DEPTH="${MAX_DEPTH:-2}"
# Create output directory if it doesn't exist
@pythoninthegrass
pythoninthegrass / hello_docker.py
Created October 23, 2024 22:09
Use the python docker sdk to run a container in detached mode
#!/usr/bin/env python
import docker
client = docker.from_env()
container = client.containers.run("ubuntu:latest",
command=["echo", "hello", "world!"],
detach=True,
remove=False,