Skip to content

Instantly share code, notes, and snippets.

Overview

When you reboot a remote machine with sudo reboot now for example, some machines come back up within :20 seconds. Others, it might take a minute or two. Well, instead of hitting up arrow, Enter and seeing:

ssh: connect to host server.example.com port 22: Connection timed out

Instead of using ssh user@host, this function is sshw user@host, as-in "SSH Wait". You'll see a message like this:

@robertsinfosec
robertsinfosec / supabase-selfhost.sh
Created January 27, 2025 07:54
Script to easily set up an instance of Supabase with a Reverse Proxy and FQDN.
#!/bin/bash
# Supabase Setup Script
# This script sets up a fresh machine with Supabase by asking configuration questions.
# This script will perform the following actions:
# 1. Install Docker and Docker Compose.
# 2. Create an unprivileged 'supabase' user with appropriate permissions.
# 3. Clone the Supabase repository into /opt/supabase/.
# 4. Configure environment variables with provided values.
@robertsinfosec
robertsinfosec / LOGIN.COM
Last active January 19, 2025 03:52
A default `LOGIN.COM` to start with when working with OpenVMS
$ LS :== "DIR"
$ LL :== "DIR/SIZE/DATE/OWNER"
$!
$ CD :== "SET DEFAULT"
$ DEFINE/PROCESS "~" SYS$LOGIN
$!
$ ADD_LOG_TO_FILE_OPERATIONS:
$!
$ BAC*KUP :=="BACKUP/LOG"
$ COPY :=="COPY/LOG"
@robertsinfosec
robertsinfosec / ram-upgrade-check.sh
Last active November 21, 2024 02:37
For a Linux machine, attempts to see how much RAM is installed and what kind, and determine what the maximum number of sticks and amount of RAM the current machine can support. If you want to run this on-the-fly and trust this source, from your Linux machine you can run: `curl -L https://tinyurl.com/ram-upgrade-check/raw | bash`
#!/bin/bash
# Script to determine maximum supported RAM, current RAM configuration,
# and specifications for upgrading RAM to maximum capacity.
set -euo pipefail
# Define color codes
RED='\033[0;31m'
GREEN='\033[0;32m'
@robertsinfosec
robertsinfosec / .bashrc
Created September 29, 2024 06:16
Bash support for quick AES-256 encryption/decryption with a prompted password. Add to the end of your `~/.bashrc`
# Other .bashrc contents here...
encrypt() {
# Read password from /dev/tty
echo -n "Enter password: " > /dev/tty
read -s PASSWORD < /dev/tty
echo > /dev/tty
if [ -t 0 ]; then
INPUT="$*"
else
@robertsinfosec
robertsinfosec / remove-proxmox-web-banner.sh
Last active April 29, 2024 03:33
In ProxMox, when you change your APT repo from enterprise.proxmox.com pve-enterprise to download.proxmox.com pve-no-subscription, the UI shows a "warning" message about not using the enterprise version. This removes that popup.
#!/bin/bash
# Set color codes
INFO='\033[1;36m' # Cyan
SUCCESS='\033[1;32m' # Green
ERROR='\033[1;31m' # Red
NC='\033[0m' # No Color
echo -e "${INFO}[*] Changing directory to /usr/share/javascript/proxmox-widget-toolkit/${NC}"
cd /usr/share/javascript/proxmox-widget-toolkit/ || { echo -e "${ERROR}[-] Error: Failed to change directory${NC}"; exit 1; }
@robertsinfosec
robertsinfosec / revert.sh
Created March 2, 2024 05:58
Revert ProxMox from orphaned cluster node, back to standalone server.
systemctl stop pve-cluster
systemctl stop corosync
#Start the cluster file system again in local mode:
pmxcfs -l
#Delete the corosync configuration files:
rm /etc/pve/corosync.conf
@robertsinfosec
robertsinfosec / fix-prompts.sh
Created June 7, 2023 15:33
Change the non-privileged user prompt to show the FQDN. Copy that in place for root, and make roots prompt red instead of green.
#!/bin/bash
echo "[*] Show the full hostname in the prompt unprivileged prompt."
sed -i 's/\\h/$(hostname -f)/g' ~/.bashrc
source ~/.bashrc
echo "[*] Copy this file to /root/"
sudo cp ~/.bashrc /root/
echo "[*] Change the root prompt to be red."
@robertsinfosec
robertsinfosec / update.sh
Last active January 26, 2025 18:42
Default update scripts for Debian-based Linux distributions.
#!/bin/bash
Black='\033[0;30m'
DarkGray='\033[1;30m'
Red='\033[0;31m'
LightRed='\033[1;31m'
Green='\033[0;32m'
LightGreen='\033[1;32m'
Brown='\033[0;33m'
Yellow='\033[1;33m'