snippets
random network port
as a sysadmin, i usually need new ports fast. my past method was to just keysmash a bit on the number pad till i found something that resembled an unused port, but then i read online about functions like this one, and wrote my own :)
# get a random free port. this is useful for my
# insane sysadmin website woman adventures
portfree() {
while
port=$(shuf -n 1 -i 49152-65535)
netstat -atun | grep -q "$port"
do
continue
done
echo "$port"
}