Skip to content

Instantly share code, notes, and snippets.

View smxlong's full-sized avatar

Scott Long smxlong

  • Neural Northwest, LLC
  • Bend, OR
  • 13:03 (UTC -07:00)
View GitHub Profile
@smxlong
smxlong / biggest.sh
Created October 12, 2025 01:09
Find biggest stuff first
#!/bin/bash
# Breadth-first, biggest-first du -bs on each directory in current dir
queue=()
for d in */; do
[ -d "$d" ] && queue+=("$d")
done
while [ ${#queue[@]} -gt 0 ]; do
# Get sizes for all dirs in queue
#!/bin/bash
set -euo pipefail
# actversion - Get the latest version of a GitHub Action
# Usage: actversion <owner>/<repo> - Get latest version of an action
# actversion --list <owner> - List all repos under an owner
# actversion --list - List well-known action owners
# Example: actversion actions/checkout
# actversion --list actions
@smxlong
smxlong / petname.md
Last active January 18, 2025 17:50
Generate a petname using Dustin Kirkland's golang-petname, in a single command
go run github.com/dustinkirkland/golang-petname/cmd/petname@latest -words 3

Or set -words for a different number of words.

@smxlong
smxlong / gist:e57bf20c04ee9870435db376fb3fe2e9
Created December 9, 2024 22:41
Dump vault secrets to json
#!/bin/bash
# This script recursively dumps the contents of a secret store in Vault to a
# tree of .json files.
set -euo pipefail
dump_secrets() {
local path=$1
for secret in $(vault kv list -format=json $path | jq -r '.[]'); do