Skip to content

Instantly share code, notes, and snippets.

@sfan5
sfan5 / alpine-container.sh
Last active April 27, 2024 18:35
bootable systemd-nspawn containers with Linux distributions: Alpine, Arch Linux, Ubuntu
#!/bin/bash -e
# Creates a systemd-nspawn container with Alpine
MIRROR=http://dl-cdn.alpinelinux.org/alpine
VERSION=${VERSION:-v3.19}
APKTOOLS_VERSION=2.14.3-r1
wget_or_curl () {
if command -v wget >/dev/null; then
@ssgtcookie
ssgtcookie / cloudflare-api-synology.sh
Last active October 13, 2022 19:31
Batch: Cloudflare APIv4 dynamic update A-record script. Created for a Synology NAS hosted Wordpress website.
# set shell variables with your contents
email="email@example.com"
authKey=""
zoneid=""
dnsrecord=""
domain="example.com"
# Collect current IP
current_ip=$(curl --silent --show-error --fail ipecho.net/plain) || exit
@joshenders
joshenders / certchain.sh
Last active August 26, 2021 18:19
Simple Bash function to visualize PKI chain-of-trust
function certchain() {
# Usage: certchain
# Display PKI chain-of-trust for a given domain
# GistID: https://gist.github.com/joshenders/cda916797665de69ebcd
if [[ "$#" -ne 1 ]]; then
echo "Usage: ${FUNCNAME} <ip|domain[:port]>"
return 1
fi
local host_port="$1"