Skip to content

Instantly share code, notes, and snippets.

@darkseid4nk
darkseid4nk / ssh_control_socket.sh
Created October 2, 2024 19:54 — forked from wolever/ssh_control_socket.sh
Bash script to start and background an SSH ControlMaster to speed up SSH in the script
# Call `setup_ssh_socket` to setup the control socket (function will return once
# the socket is ready to go), and `ssh_target` will connect using the control socket.
# Assumes TARGET_HOST variable is set.
# The connection is automatically closed when the script exists.
# TARGET_HOST="wolever.net"
# setup_ssh_control_socket
# ssh_target "hostname"
debug() {
echo "DEBUG: $*"
@darkseid4nk
darkseid4nk / mkca.sh
Created October 2, 2024 19:54 — forked from wolever/mkca.sh
Tools for creating private certificate authorities
#!/bin/bash
set -e
nodes="-nodes"
if [[ "$1" == "-des" ]]; then
nodes=""
shift
fi
if [[ ! "$1" || ! "$2" || "$1" =~ "^-" ]]; then