Skip to content

Instantly share code, notes, and snippets.

View StaticRocket's full-sized avatar

Randolph Sapp StaticRocket

  • Texas Instruments
View GitHub Profile
@StaticRocket
StaticRocket / unstow.sh
Last active April 13, 2024 21:45
Unstow a package by replaceing all symbolic links with a copy of the files they were pointing to.
#!/bin/sh
HELP_TEXT="
Usage: $0 [PACKAGE]...
Unstow a package by replacing all symbolic links with a copy of the files they
were pointing to.
This script currently assumes the 'stow dir' is the current dir and that the
'target' is the parent directory. These are the current default values for
@StaticRocket
StaticRocket / rapid-clone.sh
Last active October 13, 2023 00:19
Quickly backup and deploy bootable SD cards with variable size ext4 root partitions
#!/bin/sh
[ -z "$PART_PREFIX" ] && PART_PREFIX=''
DD_ARGS='status=progress conv=fsync'
backup() {
src="$1"
dst="$2"
sfdisk -d "${src}" > "${dst}-table.txt"