Skip to content

Instantly share code, notes, and snippets.

View aarondill's full-sized avatar
💭
Working, probably

Aaron Dill aarondill

💭
Working, probably
View GitHub Profile
@aarondill
aarondill / repro.sh
Last active October 20, 2023 10:33
Repro of alignment bug introduced in https://github.com/eza-community/eza/pull/318
#!/usr/bin/env bash
function verbose() {
echo "> $*"
"$@"
}
tmp=$(mktemp -d)
echo "tmpdir: $tmp"
touch -- "$tmp/a file with spaces"
for i in {1..40}; do touch -- "$tmp/long-file-name-$i"; done
@aarondill
aarondill / install-vmware.sh
Created September 19, 2024 02:54
a script to install vmware on Ubuntu
#!/usr/bin/env bash
set -euC -o pipefail
version=17.5.0
vmware_lib="/usr/lib/vmware/modules/source"
product="$(vmware-installer -l 2>/dev/null | tail -n1 | cut -f1 -d' ')" || true
if [ -n "$product" ]; then
echo "Uninstalling $product"
sudo vmware-installer -u "$product"
#!/usr/bin/env bash
set -euC -o pipefail && shopt -s nullglob globstar
utils=script_utils.sh dir=$(dirname -- "${BASH_SOURCE[0]}") || true
if [ -f "$dir/$utils" ]; then utils="$dir/$utils"; fi
# shellcheck source=./script_utils.sh
. "$utils"
function usage() {
cat <<EOF || true
Usage: $THIS [PATTERN]...
import argparse
import itertools
from pathlib import Path
import subprocess
import json
from argparse import ArgumentParser
from datetime import datetime
def error(text: str):
@aarondill
aarondill / tmpsh
Last active February 19, 2025 05:56
A simple bash program to open a shell in a temporary directory (~/.tmp) by default and remove the directory after the shell closes.
#!/usr/bin/env bash
set -euC -o pipefail
user_shell=$SHELL # This is the user's login shell, or the path to bash if unset. This is usually set by login.
_TMPDIR=~/.tmp
this=${BASH_SOURCE[0]:-$0}
this=${this##*/} # this is the name of the script without the path
log() { printf '%s\n' "$@" || true; }
err() { printf 'Error: %s\n' "$@" 2>&1 || true; }