uuid() {
uuidgen | tr -d '\n' | pbcopy
}
rand() {
# Define the set of characters to choose from
charset="[:alnum:]"
# Get the length parameter (default to 16)
length=${1:-16}
# Use /dev/urandom for randomness and LC_ALL=C to force ASCII encoding
random_string=$(head /dev/urandom | LC_ALL=C tr -dc $charset | fold -w $length | head -n 1)
# Return the random string
echo $random_string
}
function killp()
{
PORT="$1"
kill $(lsof -t -i:$PORT)
}