Skip to content

Instantly share code, notes, and snippets.

@jon-eric
jon-eric / install-uv.ps1
Created August 21, 2025 21:12
Install uv and Python on Windows for all users
# Share Python interpreters for all users
setx UV_PYTHON_INSTALL_DIR "C:\ProgramData\uv\python" /M # where interpreters live
setx UV_PYTHON_BIN_DIR "C:\ProgramData\uv\bin" /M # where shims/exes go
# Install uv
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Install Python for all users
$env:UV_PYTHON_INSTALL_REGISTRY = '1' # register with Windows (PEP 514)
uv install python --default
@jon-eric
jon-eric / ecr-auth.py
Last active August 25, 2025 15:47
AWS ECR Authentication Script with MFA and Role Assumption Support
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.8"
# dependencies = [
# "boto3>=1.26.0",
# ]
# ///
"""
AWS ECR Authentication Script with MFA and Role Assumption Support
Authenticates to AWS ECR repository and configures Docker for pushing images
@jon-eric
jon-eric / install_exempi.py
Created August 18, 2025 18:10
Build & Install The Latest Exempi From Source
#!/usr/bin/env python3
"""
install_exempi.py — build & install the latest Exempi from source.
- Finds the newest release tarball from libopenraw.freedesktop.org
- Ensures build deps (Boost, Expat, toolchain) via common package managers
- Configures with Boost hints, then make && make install
- Defaults to installing under:
macOS: $(brew --prefix) (e.g. /opt/homebrew) if Homebrew exists, else /usr/local
Linux: /usr/local
@jon-eric
jon-eric / install-speedtest.sh
Last active June 22, 2025 21:57
Install Ookla Speedtest on Linux
#!/usr/bin/env sh
set -uo pipefail
# Base URL for Ookla Speedtest CLI
base_url="https://www.speedtest.net/apps/cli"
# Detect architecture and map to Ookla's naming
arch="$(uname -m)"
case "$arch" in
x86_64) osarch="x86_64" ;;
@jon-eric
jon-eric / install-docker-compose.sh
Created May 2, 2025 20:51
Install docker compose plugin
#!/usr/bin/env bash
sudo mkdir -p /usr/libexec/docker/cli-plugins
sudo curl -SL \
https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m) \
-o /usr/libexec/docker/cli-plugins/docker-compose
sudo chmod +x /usr/libexec/docker/cli-plugins/docker-compose
@jon-eric
jon-eric / install-traefik.sh
Last active March 10, 2025 04:36
Install Traefik to /usr/local/bin on Linux
#!/bin/bash
set -e
set -o pipefail
get_arch() {
local uname_arch
uname_arch=$(uname -m)
case "$uname_arch" in
x86_64)
echo "amd64"
@jon-eric
jon-eric / install-eksctl.sh
Last active February 20, 2025 19:27
Install eksctl to ~/.local/bin on Linux
#!/bin/sh
set -e
set -o pipefail
get_arch() {
local uname_arch
uname_arch=$(uname -m)
case "$uname_arch" in
x86_64)
echo "amd64"
@jon-eric
jon-eric / fan.sh
Last active February 27, 2025 18:31
A quieter fan curve for the Raspberry Pi 5
#!/usr/bin/env bash
# Set a quieter fan curve for the Raspberry Pi 5
cat <<EOF >> /boot/firmware/config.txt
dtparam=fan_temp0=53000 # 53.0°C default: 50.0°C
dtparam=fan_temp1=62000 # 62.0°C default: 60.0°C
dtparam=fan_temp2=70000 # 70.0°C default: 67.5°C
dtparam=fan_temp3=78000 # 78.0°C default: 75.0°C
dtparam=fan_temp0_hyst=9000 # 9.0°C default: 5.0°C
@jon-eric
jon-eric / SuperUserAccess.txt
Created September 7, 2023 18:07
SuperUserAccess IAM Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"NotAction": [
"iam:*",
"organizations:*",
"account:*"
],
@jon-eric
jon-eric / gh-clone-all.py
Last active May 25, 2024 17:25
Clone all repos owned by an organization or user using the GitHub CLI (gh).
#!/usr/bin/env python3
"""Clone all repos owned by an organization or user using the GitHub CLI (gh).
usage: gh-clone-all.py [-h] [--pattern PATTERN] owner [-- <gitflags>...]
"""
import argparse
import json
import re
import subprocess
from concurrent.futures import ThreadPoolExecutor