Skip to content

Instantly share code, notes, and snippets.

@teshanshanuka
Last active April 17, 2023 18:38
Show Gist options
  • Save teshanshanuka/6101344fd8a84d669a9f74a2b123a70e to your computer and use it in GitHub Desktop.
Save teshanshanuka/6101344fd8a84d669a9f74a2b123a70e to your computer and use it in GitHub Desktop.
My zsh aliases
# To hide stderr from command output (e.g. `find -name "something" NOERR`)
alias -g NOERR="2>/dev/null"
# epoch time(sec) to date - `epocht 123456789` or `echo 123456789 | epocht`
epocht() {
if [ -z $1 ]; then read ip; else ip=$1; fi
date -d @$ip +"%Y-%m-%d %T"
}
# find text in directory
alias fgrepr="fgrep -rIn --exclude-dir={.git,.vscode,node_modules,.yarn,.gem,lib,logs,.catkin_tools,build}"
alias publicip="curl -s ipinfo.io/ip; echo"
function weather() {
curl -s "wttr.in/${1:-odense}" # | (head -n7; tail -n3) | sed -n '1,8p' -- for a short mode
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment