Created
December 24, 2019 06:47
-
-
Save SaeedSoltoon/b2234663f117423527526236bf00554c to your computer and use it in GitHub Desktop.
useful aliases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ci='composer install' | |
alias c='composer' | |
alias cu='composer update' | |
alias o='open .' | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias ....='cd ../../..' | |
alias gs='git status' | |
alias gsh='git push' | |
alias gll='git pull' | |
alias gc='git commit -m' | |
alias gd='git diff' | |
alias gi='git init' | |
alias gl='git clone' | |
alias ga='git add .' | |
alias gall='git pull; git add .; git commit -m "composer update"; git push;' | |
alias tailf='tail -f' | |
alias .='xdg-open .' | |
alias mynetspeed='curl -s "https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py" | python -' | |
# Public IP address. | |
alias public-ip="dig +short myip.opendns.com @resolver1.opendns.com" | |
# Local IP address. | |
alias local-ip="ipconfig getifaddr en0" | |
function httpless { | |
# `httpless example.org' | |
http --pretty=all --print=hb "$@" | less -R; | |
} | |
# From https://developer.atlassian.com/blog/2015/02/ten-tips-for-wonderful-bash-productivity/ | |
function col { | |
awk -v col=$1 '{print $col}' | |
} | |
# From https://developer.atlassian.com/blog/2015/02/ten-tips-for-wonderful-bash-productivity/ | |
function skip { | |
n=$(($1 + 1)) | |
cut -d' ' -f$n- | |
} | |
# Generate random string with given length. 32 by default. | |
function rand { | |
cat /dev/urandom | gtr -dc 'A-HJ-NP-Za-km-z2-9' | fold -w ${1:-32} | head -n 1 | |
} | |
function timestamp { | |
date '+%s' | |
} | |
how_to() | |
{ | |
where="$1"; shift | |
IFS=+ curl "cht.sh/$where/$*" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment