Skip to content

Instantly share code, notes, and snippets.

View dotysan's full-sized avatar

Curtis Doty dotysan

View GitHub Profile
@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 6, 2025 17:12
Simple non-POSIX UV installer.
#! /usr/bin/env bash
#
# Simple non-POSIX UV installer.
#
# optional
#DEBUG=yep
main() {
chk_deps
@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*
@dotysan
dotysan / pypi2git.sh
Created September 14, 2024 18:44
Recreate a git repo from a bunch of PyPI releases.
#! /usr/bin/env bash
#
# Recreate a git repo from a bunch of PyPI releases.
#
set -o errexit
set -o nounset
set -o pipefail
#set -o xtrace
PACKAGE=arcgis