Skip to content

Instantly share code, notes, and snippets.

View tbnorth's full-sized avatar

Terry Brown tbnorth

View GitHub Profile
@tbnorth
tbnorth / disable_all_workflows.sh
Last active October 13, 2025 16:53
disable all GitHub workflows on all repos. with gh CLI
# Get a current list of repos.
gh search repos --limit 1000 @tbnorth | sed 's/\s.*//' | tee repos.list.202510
# Get a list of workflows including repo. names.
< repos.list.202510 xargs -IF bash -c 'echo REPO F ; gh workflow list --repo F' \
| tee workflows.list.202510
# Disable all active workflows.
@tbnorth
tbnorth / README.md
Last active October 2, 2025 19:46
Multi-host execution util.

The script assumes:

a) you have something like defined:

export maindev=maindev
export bkupdev=bkupdev
export mainstg=mainstg
export bkupstg=bkupstg
export mainprod=mainprod
@tbnorth
tbnorth / debranch.py
Last active September 9, 2025 19:32
Clean up merged branches in a repo.
#!/usr/bin/env python3
"""Local repo cleanup"""
import re
import sys
from subprocess import run
specified_permanent = []
for arg in sys.argv:
if arg.startswith("--permanent="):
specified_permanent = arg.split("=", 1)[1].split(",")
@tbnorth
tbnorth / table.hef
Last active May 5, 2025 03:04
Hyperwood table
Hyperwood Exchange Format
Version 1
hyperwood.org
SimpleTable
{"width":14,"depth":23,"height":11}
{"x":0.035,"y":0.016,"z":0.035}
{"width":0.489,"depth":0.3651,"height":0.3842}
4
Leg
Top
@tbnorth
tbnorth / bkup.sh
Last active March 27, 2025 13:51
Backup / log "rotation" keeping more more recent files
TARGET=trilium-data
BKUP_DIR=/home/tbrown02/data/trilium-backup
mkdir -p $BKUP_DIR/cull
OUTFILE=$(date '+%Y-%m-%d-%H-%M-trilium_bkup.tar.xz')
cd ~
nice tar caf $BKUP_DIR/$OUTFILE $TARGET
# After https://unix.stackexchange.com/a/669081/319850
# but using sort to handle multiple bkups per day.
@tbnorth
tbnorth / mkchart.py
Last active December 19, 2024 16:46
drawsvg experiment, draw a fish timeline chart
"""Draw a simple SVG timeline chart with Python."""
import sys
import drawsvg as draw
w = 1200
h = 800
ox = -100
oy = -400
@tbnorth
tbnorth / shell_tricks.md
Created June 17, 2024 21:32
Collection of git / sed / command line tricks

jira tickets referenced between two commits

PROJ=factotum ; git log ^staging dev | sed -E 's/'$PROJ'-[0-9]+/\n&\n/gI' | sed -En '/'$PROJ'-[0-9]+/I p' | tr a-z A-Z | sort -u | sed 's%.*%https://jira.example.com/browse/&%'

@tbnorth
tbnorth / getdeps.md
Last active June 14, 2024 12:21
Get list of actual dependencies for a Python project

If you're requirements.txt file is the output of pip freeze then it's really a lock file, not a list of project dependencies. To get just the actual dependencies:

find . -name \*.py -type f | xargs sed -En '/^(import|from)/ {s/\S+ //; s/ .*//; s/\..*//; p}' | sort -u >reqs

This extracts foo from all import foo.bar... and from foo.bar import... lines, dropping local imports (starting with '.').

@tbnorth
tbnorth / citrix_i3.md
Last active January 14, 2025 10:51
Making Citrix Workspace client run in i3 window manager

Citrix Workspace client with i3 window manager

Update: works with 24.04(beta) too, and problem still exists in 24.04.

This is how I got the Citrix Workspace client to run in Ubuntu 23.10 in Jan. 2024

Prior to version 2311 Citrix client, this patch was unnecessary, but at 2311 Citrix stopped launching successfully at all in i3.

In XFCE Citrix runs with "proper" full screen support, covering three monitors but

# TNB mods
# bind -n == bind -T root == no prefix
set -g lock-after-time 0 # Seconds; 0 = never
bind -n C-Left select-window -p
bind -n C-Right select-window -n
bind -n M-S-Left swap-window -t -1
bind -n M-S-Right swap-window -t +1
bind C-a select-window -l