Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
chain_pem="${1}"
if [[ -z "${2}" ]]; then
ssl_flags="x509 -noout -text"
else
ssl_flags="${2}"
fi
echo "SSL Flags: ${ssl_flags}\n"
Diagnosing Shutdown Problems
Just like with boot problems, when you encounter a hang during shutting down, make sure you wait at least 5 minutes to distinguish a permanent hang from a broken service that's just timing out. Then it's worth testing whether the system reacts to CTRL+ALT+DEL in any way.
If shutdown (whether it be to reboot or power-off) of your system gets stuck, first test if the kernel itself is able to reboot or power-off the machine forcedly using one of these commands:
sync && reboot -f
sync && poweroff -f
If either one of the commands does not work, it is a kernel bug, not systemd.
@rcoup
rcoup / blocksync.py
Last active January 17, 2023 03:25
Block device sync between remote hosts. Based off http://www.bouncybouncy.net/programs/blocksync.py
#!/usr/bin/env python
"""
Synchronise block devices over the network
Copyright 2006-2008 Justin Azoff <justin@bouncybouncy.net>
Copyright 2011 Robert Coup <robert@coup.net.nz>
License: GPL
Getting started: