Command Reference

The flags/usage summary below is generated from each script’s -h output by gen-docs.sh. Do not edit it by hand: change a script’s Help()/GetArguments and re-run bash src/scripts/gen-docs.sh.

Backupsrc/scripts/backup.sh
Running backup.sh
Description: Backup documents on Linux machine

Show this help  : backup.sh -h
Run this script : backup.sh
Preview only    : backup.sh -n

  -h, --help     Show this help and exit
  -n, --dry-run  Print intended changes; make no filesystem change
  -y, --yes      Skip the confirmation prompt before mutating

Configuration is read from <repo-root>/.env (see .env.example).
BACKUP_LOCATION is required; per-section variables are optional.
Decrypt Env Filessrc/scripts/decrypt-env-files.sh
Running decrypt-env-files.sh
Description: Decrypt backed-up project env files (.env.enc/.env.rb.enc)

Show this help  : decrypt-env-files.sh -h
Run this script : decrypt-env-files.sh
Preview only    : decrypt-env-files.sh -n
Clean only      : decrypt-env-files.sh -c

  -h, --help     Show this help and exit
  -c, --clean    Remove the .decrypted plaintext files (no decryption)
  -n, --dry-run  Print intended changes; make no filesystem change
  -y, --yes      Skip the confirmation prompt before mutating

Configuration is read from <repo-root>/.env (see .env.example).
BACKUP_LOCATION, PROJECTS_DESTINATION_FOLDER_NAME and
ENV_FILES_PASSWORD are all required.
With --clean only BACKUP_LOCATION and
PROJECTS_DESTINATION_FOLDER_NAME are needed (neither
ENV_FILES_PASSWORD nor openssl is required).
Dev Setupsrc/scripts/dev-setup.sh
Running dev-setup.sh
Description: Development setup for git

Show this help  : dev-setup.sh -h
Run this script : dev-setup.sh -nu 1 -na "Example issue name"

  -nu, --number   Issue number (required)
  -na, --name     Issue name (required)
Generate Passwordsrc/scripts/generate-password.sh
Running generate-password.sh
Description: Generate strong and secure password
Minimum length is 8 and must be divisible by 4.

Show this help    : generate-password.sh -h
Generate password : generate-password.sh -l 20
Git Copysrc/scripts/git-copy.sh
Running git-copy.sh
Description: Copy all differences between two git commits

Show this help  : git-copy.sh -h
Run this script : git-copy.sh

  -s, --start_commit_hash      Start commit hash (optional)
  -e, --end_commit_hash        End commit hash (optional)
  -t, --target_directory_path  Target directory path (optional)

Defaults are computed at runtime: start is the penultimate commit,
end is the last commit. When -t is omitted the target defaults to
$GIT_COPY_TARGET_DIRECTORY_PATH/<repo-basename> (see .env.example);
when -t is given its value is used verbatim.
Hash Filenamessrc/scripts/hash-filenames.sh
Running hash-filenames.sh
Description: Renames files in a directory to random hash names

Show this help   : hash-filenames.sh -h
Hash a directory : hash-filenames.sh -d /path/to/dir
Verbose output   : hash-filenames.sh -d /path/to/dir -v
Move into batches: hash-filenames.sh -d /path/to/dir -m
Preview only     : hash-filenames.sh -d /path/to/dir -n

  -h, --help       Show this help and exit
  -d, --directory  Directory to process (defaults to current directory)
  -v, --verbose    Enable verbose output
  -m, --move       Move hashed files into hashed_00X folders
  -n, --dry-run    Print intended changes; make no filesystem change
  -y, --yes        Skip the confirmation prompt before mutating

Target extensions are read from HASH_FILENAMES_FILE_EXTENSIONS in
<repo-root>/.env (see .env.example).
My Scriptssrc/scripts/my-scripts.sh
Running my-scripts.sh
Description: List the custom commands provided by the shell-scripts
and python_scripts repositories, each with a one-line description and
whether it currently resolves on PATH.

Show this help  : my-scripts.sh -h
Run this script : my-scripts.sh

  -f, --filter  Only list commands whose NAME contains this text
                (case-insensitive substring match, optional)
  -h, --help    Show this help

The shell-scripts location is derived from this script's own path and
is never configurable. The python_scripts location comes from the
EXPORTED environment variable MY_SCRIPTS_PYTHON_REPO_PATH (default:
$HOME/repos/python_scripts). It is NOT a .env key - this script never
reads .env, so setting it there has no effect. When that repository is
missing, its section is skipped with a warning.

python_scripts commands are console entry points installed inside that
repository's virtualenv, so they read as [not on PATH] unless the
virtualenv is active. Shell commands read as [not on PATH] until
install.sh has linked them onto PATH.
PHP Switchsrc/scripts/php-switch.sh
Running php-switch.sh
Description: Switch main version of PHP on OS

Show this help : php-switch.sh -h
Switch version : php-switch.sh -v 8.1
Interactive    : php-switch.sh
Restore VSCode Foldersrc/scripts/restore-vscode-folder.sh
Running restore-vscode-folder.sh
Description: Restore the .vscode folder from backup into the current
directory (only when it has no .vscode yet).

Show this help  : restore-vscode-folder.sh -h
Run this script : restore-vscode-folder.sh

Configuration is read from <repo-root>/.env (see .env.example).
Reuses BACKUP_LOCATION and PROJECTS_DESTINATION_FOLDER_NAME; both are
required. Restores from <BACKUP_LOCATION>/
<PROJECTS_DESTINATION_FOLDER_NAME>/<current-dir-basename>/.vscode.
Shutdown Guardsrc/scripts/shutdown-guard.sh
Running shutdown-guard.sh
Description: Gate a shell-initiated shutdown/restart behind .env guards

Show this help  : shutdown-guard.sh -h
Run this script : shutdown-guard.sh -s
Preview only    : shutdown-guard.sh -n -s

  -s, --shutdown  Power off when every guard passes
  -r, --restart   Reboot when every guard passes
  -n, --dry-run   Run the guards; print the power command, never run it
  -y, --yes       Skip the confirmation prompt before powering off
  -f, --force     Bypass ALL guards (use with care)
  -h, --help      Show this help and exit

Exactly one of -s/--shutdown or -r/--restart is required.

Configuration is read from <repo-root>/.env (see .env.example):
SHUTDOWN_GUARD_<i>_CMD / _DESC / _MODE declare the guards (scanned from
1 until the first missing _CMD); modes are status, empty, match:<ERE>
and nomatch:<ERE>. SHUTDOWN_GUARD_TIMEOUT (default 10 seconds, fail
closed) and SHUTDOWN_GUARD_STRICT (default 0) tune the evaluation.

Exit codes: 0 proceeded, 1 usage/configuration error, 3 BLOCKED by a
guard (nothing was shut down).

This gates only shutdowns routed through this script. It cannot stop
the desktop power menu, the power button, sudo poweroff, --force,
or remote/cron-triggered shutdowns.
Splice Imagessrc/scripts/splice-images.sh
Running splice-images.sh
Description: Splices images horizontally using ffmpeg

Show this help    : splice-images.sh -h
Splice given imgs : splice-images.sh -i a.jpg b.jpg
Splice 3 images   : splice-images.sh -i a.jpg b.jpg c.jpg -n 3
Random 2 from cwd : splice-images.sh
Fixed scale height: splice-images.sh -i a.jpg b.jpg --height 200

  -h, --help     Show this help and exit
  -i, --images   One or more input image files
  -o, --output   Output filename (only its extension is used)
      --height   Target scale height (default: auto from first image)
  -n, --number   Number of images to splice (default: 2)
      --dry-run  Print intended changes; make no filesystem change
                 (long form only; -n stays bound to --number)

Valid extensions are read from SPLICE_IMAGES_FILE_EXTENSIONS in
<repo-root>/.env (see .env.example).
Splice Videossrc/scripts/splice-videos.sh
Running splice-videos.sh
Description: Splices random clips of a video into one output video

Show this help    : splice-videos.sh -h
Splice 12s output : splice-videos.sh -i clip.mp4 -d 12
Custom segment    : splice-videos.sh -i clip.mp4 -d 12 -s 4
Preview only      : splice-videos.sh -i clip.mp4 -d 12 -n

  -h, --help       Show this help and exit
  -i, --input      Input video file (Required)
  -d, --duration   Output video duration in seconds (Required)
  -s, --segment    Random clip duration in seconds (default: 3)
  -n, --dry-run    Print intended changes; make no filesystem change
  -y, --yes        Skip the confirmation prompt before mutating

Valid extensions are read from SPLICE_VIDEOS_FILE_EXTENSIONS in
<repo-root>/.env (see .env.example).
Tampermonkey Installsrc/scripts/tampermonkey-install.sh
Running tampermonkey-install.sh
Description: Build a GitHub userscript URL and open it for Tampermonkey

Show this help  : tampermonkey-install.sh -h
Run this script : tampermonkey-install.sh -d <domain> -s <script>

  -d, --domain   Domain-name folder (required, e.g. youtube.com)
  -s, --script   Script name, no extension (required, e.g. video-speed)
  -r, --repo     Override the configured GitHub base URL (optional)
  -h, --help     Show this help and exit

Base URL(s) read from TAMPERMONKEY_REPO_BASE_URLS in
<repo-root>/.env (see .env.example). A comma-separated list is
probed with curl (redirects followed); the first URL answering
HTTP 2xx is opened, else the first entry. Private GitHub repos
need GH_TOKEN/GITHUB_TOKEN or 'gh' for the probe to see them.

This site uses Just the Docs, a documentation theme for Jekyll.