CryptoZSH/zsh_files/crypto.zsh

36 lines
948 B
Bash
Executable File

# Create a temporary file random name and open it with vi
function tmp {
curran=$RANDOM$RANDOM
echo "Temporary file name: /tmp/$curran"
vi /tmp/$curran
}
# HTTP and HTTPS response check
function chkhttpz {
# http response checks from a given host / port
echo "HTTP responses"
wget --spider -S "http://$1:$2/" 2>&1 | grep "HTTP/"
echo "\nHTTPS responses"
wget --spider -S "https://$1:$2/" 2>&1 | grep "HTTP/"
}
# Show certificate of website
function chkcrt {
# check ssl certificate of a server
openssl s_client -showcerts -connect $1:$2
}
# Quickly get random characters
function rnd {
# get some random characters
cat /dev/urandom | tr -dc _A-Z-a-z-0-9.,! | head -c${1:-8};echo;
cat /dev/urandom | tr -dc _A-Z-a-z-0-9.,! | head -c${1:-16};echo;
cat /dev/urandom | tr -dc _A-Z-a-z-0-9.,! | head -c${1:-32};echo;
cat /dev/urandom | tr -dc _A-Z-a-z-0-9.,! | head -c${1:-64};echo;
}