Skip to content

Instantly share code, notes, and snippets.

@andrebu
Created August 29, 2018 06:58
Show Gist options
  • Save andrebu/7e30934234c3963fa8d40eb637ff4f74 to your computer and use it in GitHub Desktop.
Save andrebu/7e30934234c3963fa8d40eb637ff4f74 to your computer and use it in GitHub Desktop.
# Common command aliases - Andre
alias cdp="cd /var/www/html"
alias gts="git status"
alias gta="git add"
alias gtc="git commit -m"
alias gtp="git push"
alias syslog="tail -f -n 200 /var/www/html/sys_app/sys_log.txt"
alias hilog="tail -f -n 200 /var/www/html/highlife/highlife_log.txt"
alias serverlog="sudo tail -f -n 100 /var/log/apache2/error.log"
# Colorize and add info to CLI - Andre
HOST='\033[02;36m\]\h'
HOST=' '$HOST
parse_git_branch () { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'; }
TIME='\033[01;31m\]\t \033[01;32m\]'
LOCATION=' \033[01;34m\]`pwd | sed "s#\(/[^/]\{1,\}/[^/]\{1,\}/[^/]\{1,\}/\).*\(/[^/]\{1,\}/[^/]\{1,\}\)/\{0,1\}#\$
BRANCH=' \033[00;33m\]$(parse_git_branch)\[\033[00m\]\n\$ '
PS1=$TIME$USER$HOST$LOCATION$BRANCH
PS2='\[\033[01;36m\]>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment