This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ip4="$( dig +short "$( hostname -f )" | tail -n 1 )" | |
sed -nEi \ | |
-e '/^[[:space:]]*'"$ip4"'[[:space:]].*|[[:space:]0-9.]*('"$(hostname -s)|$(hostname -f | sed 's/\./\\./g')"')([[:space:]#]|$).*/ {' \ | |
-e ' s/.*/'"${ip4} $(hostname -f) $(hostname -s)/" \ | |
-e ' p' \ | |
-e ' :noappend' \ | |
-e ' n' \ | |
-e ' /[[:space:]]*'"$ip4"'[[:spa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# | |
# Sync a mirror to a local directory using wget, optionally assisted by | |
# rsync. | |
# | |
# If the source mirror supports rsync, or an alternative rsync mirror | |
# is supplied via $MIRROR_RSYNC_URL, wget is only used to download | |
# files (directories, hard and symbolic links, file list and deletions | |
# are generated with rsync). | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml | |
# Converted on 2022/01/23 | |
# NOTE: services that don't specify a transport protocol are excluded | |
1ci-smcs: | |
tcp: | |
- 3091 | |
udp: | |
- 3091 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# Run this on an air-gapped computer with an encrypted hard drive to set up GPG keys on your yubikey. | |
# Derived from https://github.com/drduh/YubiKey-Guide | |
# Assumes OS has already been prepared (packages, services, etc) -- see dr duh guide. | |
# Does not configure PINs on the yubikey. If no admin pin is provided, the default 12345678 is used. | |
# | |
# Usage: gpg_add_yubi.sh gpg-backup.tar.gz gpg_passhrase [yubikey_admin_pin] | |
######################################################################## | |
# Safety and portability |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# WARNING: THIS SCRIPT WILL AGGRESSIVELY DESTROY ALL DATA ON ALL DRIVES | |
# ON THIS SYSTEM!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
# | |
# This script assumes 3 drives (sda sdb and sdc) are present and the | |
# first 2 are identical in size. The majority of the operating system | |
# is installed onto a mirror of sda and sdb. Home is installed on sdc. | |
######################################################################## | |
declare adm_user='o0-o' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Archive data to tape and cloud storage with log and email alert. | |
# | |
# Usage: tape-cloud-bu.sh /mnt/data /mnt/ltotape/path rclone_remote:/path | |
# | |
################################################################################ | |
# safety first | |
set -euo pipefail |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
#raspberry pi config WIP | |
set -euxo pipefail | |
declare EMAIL= #[email protected] | |
declare SMTP_PW= | |
declare RECIPIENT= | |
################################################################################ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### WORK IN PROGRESS ### | |
#!/usr/bin/env bash | |
set -euo pipefail | |
################################################################################ | |
### DEFINE THE NETWORK ######################################################### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# We assume the system is installed with: | |
# | |
# 1. Minimal software | |
# 2. No root user login | |
# 3. The following partitions: | |
# / | |
# /boot | |
# /home |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env expect | |
set timeout 720 | |
set host [lindex $argv 0] | |
set user [lindex $argv 1] | |
set password [lindex $argv 2] | |
set url [lindex $argv 3] | |
set ftp_pw [lindex $argv 4] |
NewerOlder