Skip to content

Instantly share code, notes, and snippets.

@sfan5
sfan5 / alpine-container.sh
Last active February 15, 2025 13:49
Create bootable systemd-nspawn containers with Alpine, Arch Linux or Ubuntu
#!/bin/bash -e
# Creates a systemd-nspawn container with Alpine
MIRROR=http://dl-cdn.alpinelinux.org/alpine
VERSION=${VERSION:-v3.21}
APKTOOLS_VERSION=2.14.6-r3
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 protected]"
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"