Created
May 12, 2015 21:31
-
-
Save kdiverson/90dc363f95494a425a61 to your computer and use it in GitHub Desktop.
My .bash_profile from axiom
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
# .bash_profile | |
# Get the aliases and functions | |
if [ -f ~/.bashrc ]; then | |
. ~/.bashrc | |
fi | |
# User specific environment and startup programs | |
# Set colors | |
export CLICOLOR=1 | |
export LSCOLORS=GxFxCxDxBxegedabagaced | |
export OMP_NUM_THREADS=16 | |
#command to make a directory and cd right into it | |
mkcd() { | |
mkdir "$@" || return | |
shift $(( $# - 1 )) | |
cd "$1" | |
} | |
#always use the color option for ls | |
alias ls='ls --color' | |
#take me right to my home drive on our new drivespace | |
alias shome='cd /mnt/EXT/Schloss-data/kiverson' | |
#get me my job info without typing all this junk | |
alias qs="qstat -u kiverson" | |
#always use the best python | |
alias python='/usr/bin/python2.7' | |
#show me running jobs | |
alias running="qstat -u kiverson | awk '{if(\$10=="R") {s+=1}} END {print s}'" | |
#I can typing | |
alias mf="echo 'did you mean mv?'" | |
#set my path | |
PATH=/mnt/EXT/Schloss-data/kiverson/sratoolkit.2.4.4-centos_linux64/bin/:/mnt/EXT/Schloss-data/bin:$HOME/bin:$HOME/env/bin:/opt/bioinf/amos/3.1.0/bin/:/opt/bioinf/mummer/3.23/bin/:/opt/bio/hmmer/bin/:$HOME/bin/glimmer-mg/bin/:$PATH | |
#bowtie likes this | |
BT2_HOME='/users/kiverson/bin/bowtie2-2.0.0-beta2' | |
#convert fastq files to fasta: fq2fa reads.fq > reads.fa | |
alias fq2fa="awk '{print \">\" substr(\$0,2);getline;print;getline;getline}'" | |
#a calculator: calc 1+1 etc. | |
calc(){ awk "BEGIN{ print $* }" ;} | |
#fancy history | |
shopt -s histappend | |
#set variables | |
export BT2_HOME | |
export PATH | |
#export HISTTIMEFORMAT="%F %T " | |
#emacs sucks | |
export EDITOR=vim | |
#my super secret r libraries | |
export R_LIBS="/users/kiverson/R/library" | |
#perl, barf | |
export PERL5LIB=$PERL5LIB:/opt/bioinf/mummer/3.23/scripts/:/users/kiverson/bin/:/users/kiverson/bin/PfamScan/:/usr/lib/perl5/vendor_perl/5.8.8/Moose/ | |
#don't store this junk in my history | |
export HISTIGNORE="&:ls *:ls:ls -l:ls -lh:ls -l *:ls -lh *:qstat:qstat -u kiverson:less *:tail *:more *:cd *:[bf]g:exit:pwd:clear" | |
#only store unique commands in history | |
export HISTCONTROL=erasedups | |
#make it big! | |
export HISTSIZE=50000 | |
#fancy history | |
source $HOME/hcmnts | |
export hcmntextra='date "+%Y%m%d %R"' | |
export PROMPT_COMMAND="hcmnt -etl ~/histlog" | |
#add qpeek | |
module add qpeek | |
#fancy git coloring | |
# color prompt to include branch information | |
function color_my_prompt { | |
local __user_and_host="\[\033[01;32m\]\u@\h" | |
local __cur_location="\[\033[01;34m\]\W" | |
local __git_branch='`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`' | |
local __prompt_tail="\[\033[35m\]$" | |
local __last_color="\[\033[00m\]" | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
# Capture the output of the "git status" command. | |
git_status="$(git status 2> /dev/null)" | |
# Set color based on clean/staged/dirty. | |
if [[ ${git_status} =~ "working directory clean" ]]; then | |
state="${GREEN}" | |
elif [[ ${git_status} =~ "Changes to be committed" ]]; then | |
state="${YELLOW}" | |
else | |
state="${RED}" | |
fi | |
export PS1="$__user_and_host $__cur_location ${state}$__git_branch$__prompt_tail$__last_color " | |
} | |
# Tell bash to execute this function just before displaying its prompt. | |
PROMPT_COMMAND=color_my_prompt | |
#motivate me using the power of britney spears...and cows | |
shuf -n 1 b_in_the_mix.txt | cowsay |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment