Skip to content

Instantly share code, notes, and snippets.

View 0x1618's full-sized avatar

0x1618

  • 05:20 (UTC +02:00)
View GitHub Profile
@0x1618
0x1618 / new-vps-script.sh
Last active June 10, 2024 22:57
My script for configuring a new Ubuntu Proxmox VM.
#!/bin/bash
# Function to generate a random port number excluding common ports
generate_random_port() {
local port
local common_ports=(22 80 443 8080 3306 5432 25 110 995 993 21 20 23 161 162 5060 5061)
while true; do
port=$((RANDOM % 65535 + 1))
if [[ ! " ${common_ports[@]} " =~ " ${port} " ]]; then