Last active
March 9, 2024 07:30
-
-
Save ra101/70ea4389ba04bf6d5a172d9a3000e5f7 to your computer and use it in GitHub Desktop.
exhaustive list of aliases that i use for my dev setup
This file contains 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
# Aliases | |
alias 'cd..'='cd ..' | |
alias ls='ls -CF' | |
alias ll='ls -alF' | |
alias la='ls -ACF' | |
alias grep='grep --color=auto' | |
alias fgrep='fgrep --color=auto' | |
alias egrep='egrep --color=auto' | |
alias sag='sudo apt-get' | |
alias sar='sudo apt autoremove' | |
alias cls='clear' | |
alias editbash='nano ~/.bashrc' | |
alias reloadbash='source ~/.bashrc && echo Bash Reloaded!' | |
alias ipi='hostname -I' | |
alias ipe='curl ipinfo.io/ip && printf "\n"' | |
alias 'kore_nani?'='if [[ $((KORE_NANI_COUNT+=1)) -ge 6 ]]; then nyancat; KORE_NANI_COUNT=0; fi;' | |
## Windows Aliases | |
alias psql='psql.exe' | |
alias mongod='mongod.exe' | |
alias mongo='mongo.exe' | |
alias ngrok='ngrok.exe' | |
alias ffmpeg='ffmpeg.exe' | |
alias flutter='cmd.exe /c flutter' | |
alias sqlite3='sqlite3.exe' | |
## Python Aliases | |
actenv() {source "$@"/bin/activate} | |
if command -v pyenv-virtualenv >/dev/null 2>&1; then | |
alias crtenv='pyenv-virtualenv' | |
else | |
alias crtenv='python -m venv' | |
fi | |
alias catjson='python -m json.tool' | |
alias py='python' | |
alias py2='python2' | |
alias bpy='bpython' | |
alias ptpy='ptpython' | |
alias ipy='ipython' | |
alias pi='pip install' | |
alias pir='pip install -r requirements.txt' | |
alias pirc='pip install -r requirements.txt -c constraints.txt' | |
alias pui='pip uninstall' | |
alias pyserve="python3 -m http.server" | |
alias pf='pip freeze | sort' | |
alias pfr='pip freeze | sort > requirements.txt' | |
alias pyclean="find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete" | |
export MIG_DIR='migration-dir' | |
alias alre() {cd $MIG_DIR; alembic revision $@; cd -} | |
alias alup() {cd $MIG_DIR; alembic upgrade $@; cd -} | |
alias aldn() {cd $MIG_DIR; alembic downgrade $@; cd -} | |
export PYPROJ='current_python_project' | |
alias wsgi="gunicorn $PYPROJ.wsgi:application" | |
alias asgi="daphne $PYPROJ.asgi:application" | |
### Django Aliases | |
alias dj='python manage.py' | |
alias djr='python manage.py runserver' | |
alias djmm='python manage.py makemigrations' | |
alias djm='python manage.py migrate' | |
alias djmmm='python manage.py makemigrations && python manage.py migrate' | |
alias djs='python manage.py shell' | |
alias djdb='python manage.py dbshell' | |
alias djcs='python manage.py collectstatic --noinput' | |
alias djt='python manage.py test' | |
alias djdd="python manage.py dumpdata" | |
alias djld="python manage.py loaddata" | |
## Docker Aliases | |
# export DOCKER_CONFIG='docker-compose.yml' | |
export DCON='docker-container-name' | |
alias dcps='docker ps' | |
alias dcbl="docker compose build" | |
alias dcup="docker compose up -d" | |
alias dcdn="docker compose down" | |
alias dcex="docker exec -it $DCON sh" | |
## Git Aliases | |
parse_git_branch2() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/' | |
} | |
alias gbr='git branch' | |
alias gps='git push' | |
alias gpl='git pull' | |
alias gch='git checkout' | |
alias gco='git commit -m' | |
alias gst='git status' | |
gad() { git add "${@:-.}"; } | |
alias grs='git reset' | |
alias grb='git rebase' | |
alias gd='git diff' | |
alias gup="git push --set-upstream origin \$(parse_git_branch2)" | |
# git out, making meme a reality :p | |
git() { if [[ $@ == "out" ]]; then command "exit"; else command "git $@"; fi; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment