Skip to content

Instantly share code, notes, and snippets.

View tomasbasham's full-sized avatar
🤓
I’d tell you a UDP joke... but you might not get it.

Tomas Basham tomasbasham

🤓
I’d tell you a UDP joke... but you might not get it.
View GitHub Profile
@tomasbasham
tomasbasham / install_cloud_init.sh
Created May 16, 2022 18:50
Install cloud-init if not present on rhel 8
#!/usr/bin/env bash
set -e
# Ensure the script is running as root
if [[ "$(id -u)" != '0' ]]; then
exec sudo "$BASH_SOURCE" "$@"
fi
# Update the system
@tomasbasham
tomasbasham / setup_server.sh
Last active May 17, 2022 12:28
Install Puppet agent and cloud-init on RHEL 8 (CentOS, RockyLinux, AlmaLinux)
#!/usr/bin/env bash
set -e
# Ensure the script is running as root
if [[ "$(id -u)" != '0' ]]; then
exec sudo "${BASH_SOURCE[0]:-$0}" "$@"
fi
try_install() {
local threads = {}
function setup(thread)
table.insert(threads, thread)
end
function init(args)
count_2xx = 0
count_3xx = 0
count_400 = 0
@tomasbasham
tomasbasham / bootstrap
Created May 22, 2023 23:07
Bootstrap Google Cloud Platform for Terraform
#!/usr/bin/env bash
set -eou pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
COMMAND=${0##*/}
DIRNAME=$(dirname "$0")
@tomasbasham
tomasbasham / rdap.sh
Created September 5, 2025 18:40
Naive implementation of a RDAP client.
#!/usr/bin/env bash
set -euo pipefail
# The general approach is outlined in the following StackOverflow approach
# https://stackoverflow.com/a/60584381/1613695
# This script was generated with AI to demonstrate the approach. It is certainly
# not producton ready.
# Configuration