Skip to content

Instantly share code, notes, and snippets.

@amejiarosario
Last active October 6, 2015 03:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amejiarosario/2930348 to your computer and use it in GitHub Desktop.
Save amejiarosario/2930348 to your computer and use it in GitHub Desktop.
aliases
# bash
alias b='vi ~/.bash_login'
alias u='source ~/.bashrc'
#ls
alias l='ls -CF'
alias ll='ls -alFc'
alias la='ls -A'
alias lt='ls -lart'
#color
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
#cd
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
#Prompt colors
export CLICOLOR=TRUE
export COLUMNS
#rails
alias brake='time bundle exec rake'
alias brails='time bundle exec rails'
alias migrate='bundle exec rake db:migrate && bundle exec rake db:test:prepare'
# Git
source ~/git-completion.bash
alias gl="git log --graph --format='%Cred%h (%cr) %Cgreen%cn: %Cblue%s' --all --decorate"
#IP
export IP=`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
# prompt
# A two-line colored Bash prompt (PS1) with Git branch and a line decoration
# which adjusts automatically to the width of the terminal.
# Screenshot: http://img194.imageshack.us/img194/2154/twolineprompt.png
# Michal Kottman, 2012
RESET="\[\033[0m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"
YELLOW="\[\033[0;33m\]"
PS_LINE=`printf -- '- %.0s' {1..200}`
function parse_git_branch {
PS_GIT_BRANCH=''
PS_FILL=${PS_LINE:0:$COLUMNS}
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
PS_GIT_BRANCH="(${ref#refs/heads/}) "
}
PROMPT_COMMAND=parse_git_branch
PS_INFO="$GREEN\u$RED@$IP$RESET:$BLUE\w"
PS_GIT="$YELLOW\$PS_GIT_BRANCH"
PS_TIME="\[\033[\$((COLUMNS-10))G\] $RED[\t]"
export PS1="\${PS_FILL}\[\033[0G\]${PS_INFO} ${PS_GIT}${PS_TIME}\n${RESET}\$ "
# wget https://raw.github.com/git/git/master/contrib/completion/git-completion.bash
echo ".aliases"
alias be="time bundle exec"
alias ber="time bundle exec rake"
alias rake="time rake"
#alias res='../stop.sh && ruby ../setup.rb'
alias brake='time bundle exec rake'
alias brails='time bundle exec rails'
alias migrate='bundle exec rake db:migrate && bundle exec rake db:test:prepare &'
#alias serv='ps auxw | egrep "(redis|thin|rails|beanstalkd|service_listener)" && ps auxw | egrep "(redis|thin|rails|beanstalkd|service_listener)" | wc'
#alias rthin="sudo kill -9 `ps auxww | grep 'bin/thin' | grep -v grep | awk '{print $2}'` && bundle exec ~/symphony/service_manager/bin/service_listener restart && tail -f /home/blueserver/symphony/manager/log/development.log"
#alias rsm="bundle exec ~/symphony/service_manager/bin/service_listener restart"
#alias vwlan='vwlan.pl';
#alias vwlanb='vwlan.pl -b';
#alias ap='ap.pl';
#alias apr='ap.pl -u root';
#alias dt='cd /home/blueserver/.rvm/gems/ruby-1.9.2-p290@symphony/gems/data_tables-0.1.5/lib/'
#alias blog='cd /home/blueserver/Dropbox/octopress-blog-1986/source/_posts'
#alias m='cd /home/blueserver/symphony/manager/'
#export RUBY_GC_MALLOC_LIMIT=60000000
#export RUBY_FREE_MIN=200000
#export LD_PRELOAD=/usr/lib/libtcmalloc_minimal.so.0.0.0
# For git
alias gp='git push'
alias ga='git add'
alias gaa='git add .'
alias gp='git push'
alias gpp='git push production'
alias gl='git log'
alias gs='git status'
alias gd='git diff'
alias gc='git commit -m'
alias gca='git commit -am'
alias gb='git branch'
alias gco='git checkout'
alias gra='git remote add'
alias grr='git remote rm'
alias gpu='git pull'
alias gcl='git clone'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment