Added more aliases, speedtest, dict etc

This commit is contained in:
JGill
2019-08-21 17:04:58 +09:30
parent caf323b254
commit 9dc22b3ec3
2 changed files with 36 additions and 2 deletions

27
.zshrc
View File

@@ -147,6 +147,7 @@ autoload -U compinit && compinit # zsh-completions
SAVEHIST=50000 #save upto 50,000 lines in history. oh-my-zsh default is 10,000 SAVEHIST=50000 #save upto 50,000 lines in history. oh-my-zsh default is 10,000
#setopt hist_ignore_all_dups # dont record duplicated entries in history during a single session #setopt hist_ignore_all_dups # dont record duplicated entries in history during a single session
alias wip="wget -qO- https://wtfismyip.com/text" # quickly show external ip address alias wip="wget -qO- https://wtfismyip.com/text" # quickly show external ip address
alias l="ls -lah" alias l="ls -lah"
alias x="exit" alias x="exit"
@@ -157,10 +158,34 @@ https() { # make httpie use https
# cheat sheets (github.com/chubin/cheat.sh), find out how to use commands # cheat sheets (github.com/chubin/cheat.sh), find out how to use commands
# example 'cheat tar' # example 'cheat tar'
# for language specific question supply 2 args first for language, second as the question
# eample cheat python execute+external+program
cheat() { cheat() {
curl https://cheat.sh/$1 $2 $3 $4 $5 $6 $7 $8 $9 $10 if [ "$2" ]; then
curl "https://cheat.sh/$1/$2"
else
curl "https://cheat.sh/$1"
fi
} }
# Matrix screen saver! will run if you have installed "cmatrix" # Matrix screen saver! will run if you have installed "cmatrix"
# TMOUT=900 # TMOUT=900
# TRAPALRM() { if command -v cmatrix &> /dev/null; then cmatrix -sb; fi } # TRAPALRM() { if command -v cmatrix &> /dev/null; then cmatrix -sb; fi }
speedtest() {
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -
}
dadjoke() {
curl https://icanhazdadjoke.com
}
dict() {
if [ "$3" ]; then
curl "dict://dict.org/d:$1 $2 $3"
elif [ "$2" ]; then
curl "dict://dict.org/d:$1 $2"
else
curl "dict://dict.org/d:$1"
fi
}

View File

@@ -12,7 +12,16 @@ Quickly install and setup zsh and oh-my-zsh (https://github.com/robbyrussell/oh-
* k (https://github.com/supercrabtree/k) * k (https://github.com/supercrabtree/k)
* marker (https://github.com/pindexis/marker) * marker (https://github.com/pindexis/marker)
* todotxt (https://github.com/todotxt/todo.txt-cli) * todotxt (https://github.com/todotxt/todo.txt-cli)
* cheat.sh (https://github.com/chubin/cheat.sh) just an alias is all we need
Sets following useful aliases:
* l="ls -lah" - just type "l" instead of "ls -lah"
* x="exit"
* https - make httpie use https
* wip - (wget -qO- https://wtfismyip.com/text) what's my ip: quickly find out external IP
* cheat - (https://github.com/chubin/cheat.sh) cheatsheets in the terminal!
* speedtest - (curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -) run speedtest on the fly
* dadjoke - (curl https://icanhazdadjoke.com) terminally sick jokes
* dict - (curl "dict://dict.org/d:$1 $2 $3") dictionary definitions
## Demo ## Demo