Skip to content

Instantly share code, notes, and snippets.

View dotysan's full-sized avatar

Curtis Doty dotysan

View GitHub Profile
@dotysan
dotysan / find-my-gh-rulesets.sh
Last active July 2, 2025 23:49
Find all my GitHub rulesets
#!/usr/bin/env bash
#
# Find all my GitHub repositories that have rulesets.
#
# as a oneliner: `gh repo list --limit 1000|while read -r repo rest;do gh ruleset list --repo "$repo"|while read id rest;do gh ruleset view --repo "$repo" "$id";echo;done;done`
#
# If you have more than 1000 repos, adjust!
#
gh repo list --limit 1000 |while read -r repo rest
@dotysan
dotysan / Makefile
Created June 6, 2025 20:56
Bootstraps Node.js inside a local Python virtual environment.
SHELL:= /usr/bin/env bash
PYVER:= 3.13
venv:= .venv
vb:= $(venv)/bin
nm:= $(venv)/lib/node_modules
HERE:=$(notdir $(CURDIR))
# Bootstraps Node.js inside a local Python virtual environment.
$(vb)/npm: $(vb)/nodeenv
@dotysan
dotysan / uv-install.sh
Last active June 24, 2025 18:00
Simple non-POSIX UV installer.
#! /usr/bin/env bash
#
# Simple non-POSIX UV installer.
#
# You can download and run it. Or just run it off the web with:
# $ curl --location https://gist.github.com/dotysan/fdbfc77b924a08ceab7197d010280dac/raw/uv-install.sh |bash
#
# If you want to see what it does, before running:
# $ export DEBUG=yes
#
@dotysan
dotysan / ammo-page2file.py
Last active May 27, 2025 16:26
Convert USPCA certified ammo list to spreadsheets.
#! /usr/bin/env -S uv run --verbose --script --managed-python --python=3.13
"""
USPSA Ammunition List Scraper
This script downloads the USPSA Certified Ammunition webpage, parses ammunition
entries including manufacturer, caliber, velocity, and bullet weight, and saves
them as CSV files. It also separates data into per-caliber files, including
Major-classified and PCC ammunition.
Debugging prints are included to help validate parsed content.
@dotysan
dotysan / lab2hub.sh
Last active April 21, 2025 15:17
Copy a GitLab repo to GitHub, keeping only the default branch.
#! /usr/bin/env bash
#
# Copy a GitLab repo to GitHub, keeping only the default branch.
#
set -x
set -euo pipefail
GL_SITE=https://gitlab.flux.utah.edu
#GL_OWNER=emulab
#REPO=geni-lib
@dotysan
dotysan / hello-uv.sh
Last active April 22, 2025 02:09
Bootstrap a Python project from scratch.
#! /usr/bin/env bash
#
# Bootstrap a Python project from scratch.
#
# optional
# DEBUG=yep
# VERBOSE=--verbose
# mandatory
@dotysan
dotysan / merge-gh-projects.sh
Created March 21, 2025 16:21
Move all items from one GitHub Project to another.
#! /usr/bin/env bash
#
# Move all items from one GitHub Project to another.
#
# edit these as needed
OWNER=example
SRC_PROJ_NUM=1
DST_PROJ_NUM=2
@dotysan
dotysan / SHd.sh
Created February 5, 2025 18:46
Wrapper around Synology_HDD_db
#! /usr/bin/env bash
#
# Wrapper around Synology_HDD_db.
#
set -o errexit
set -o nounset
set -o pipefail
PS4func() {
local lineno="$1"
local i f=''
@dotysan
dotysan / iperf-install.sh
Created December 12, 2024 22:58
Standardized install of iperf
#! /usr/bin/env bash
#
# Standardized install of iperf.
#
set -o errexit
set -o nounset
set -o pipefail
PS4func() {
local lineno="$1"
local i f=''
@dotysan
dotysan / .gitignore
Last active November 21, 2024 22:32
Installs latest docker "desktop" buildx & compose, with support for cloud builders.
.env*