You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zsh/alias

63 lines
1.8 KiB

if [ $BSD_MODE = true ]
then
alias ls='ls -G'
alias ll='ls -lGh'
alias lla='ls -lGha'
alias md5sum='md5 -r'
else
alias ls='ls --color=always'
alias ll='ls -lh --color=always'
alias lla='ls -lha --color=always'
fi
alias df='df -h'
alias du='du -h'
alias mv='mv -v'
alias cp='cp -v'
alias rm='rm -v'
alias vi='vim'
alias grepout="grep -v '^$\|^\s*\#'"
alias diga='dig +noall +answer'
alias digs='dig +short'
alias ssu='sudo su -'
# Some handy tool functions
function getcert () {
openssl s_client -servername ${1} -host ${1} -port 443 < /dev/null 2> /dev/null | sed -n '/BEGIN CERTIFICATE/,/END CERTIFICATE/p'
}
# Generate a 14-character random password that is MySQL and PostgreSQL friendly (just letters/numbers)
function sqlpass()
{
export LC_ALL=C
export LC_CTYPE=C
ranpass=`cat /dev/urandom | tr -dc '[:upper:][:lower:][:digit:]' | fold -w 14 | head -n 1`
#printf '%b\n' "Random SQL-Friendly Password:\n$ranpass"
printf '%b\n' "$ranpass"
unset ranpass
}
# Generate a 63-character random password that is IPSec PSK friendly
function pskpass()
{
export LC_ALL=C
export LC_CTYPE=C
ranpass=`cat /dev/urandom | tr -dc '[:upper:][:lower:][:digit:][!#$%&()+\-./:;<=>@\\^_{|}]' | fold -w 63 | head -n 1`
#printf '%b\n' "Random IPSec PSK-Friendly Password:\n$ranpass"
printf '%b\n' "$ranpass"
unset ranpass
}
# Generate a 14-character random password that is NOT SQL friendly, as it also includes punctuation/special characters
function rpass()
{
export LC_ALL=C
export LC_CTYPE=C
ranpass=`cat /dev/urandom | tr -dc '[:upper:][:lower:][:digit:][!#$%&()+\-./:;<=>@\\^_{|}]' | fold -w 14 | head -n 1`
#printf '%b\n' "Random Password (NOT SQL-Friendly):\n$ranpass"
printf '%b\n' "$ranpass"
unset ranpass
}