Skip to content

Instantly share code, notes, and snippets.

@dschreck
dschreck / generate_short_name.sh
Created February 29, 2024 23:54
Generate some short names for little services, devices, drives, etc etc.
#!/usr/bin/env bash
#######
# https://github.com/dschreck
#
# Generate a short name for a resource, service, disk, container, etc etc.
# Modify the adjs and nouns arrays to customize the name generation.
#
# Examples:
# $ ./bin/generate_short_name
# mystic-link
@dschreck
dschreck / script-template.sh
Created June 1, 2023 12:25 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]