forked from amalakar/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_bashrc
executable file
·155 lines (123 loc) · 4.53 KB
/
_bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
os=`uname -s`
host=`hostname | cut -d. -f1`
# Host specific settings
case $host in
'wifeforget-lm' )
export ANT_HOME=$HOME/bin/apache-ant-1.8.4
export FORREST_HOME=$HOME/bin/apache-forrest-0.9
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/
export HADOOP_HOME=$HOME/bin/hadoop-0.20.205.0
export PIG_HOME=$HOME/bin/pig-0.9.2
export M2_HOME=$HOME/bin/apache-maven-3.0.4
export PYTHON_HOME=/Library/Frameworks/Python.framework/Versions/2.7
export ANDROID_HOME=$HOME/bin/android-sdk-mac_86
export ARCANIST_HOME=$HOME/bin/arcanist
export PATH=$ANT_HOME/bin:$FORREST_HOME/bin:$JAVA_HOME/bin:$HADOOP_HOME/bin:$M2_HOME/bin:$PYTHON_HOME/bin:$PATH:$ANDROID_HOME:$ARCANIST_HOME/bin
alias vim="mvim -v"
alias mysql_start='sudo /opt/local/bin/mysqld_safe5 &'
alias mysql_stop='/opt/local/bin/mysqladmin5 -u root -p shutdown'
alias mate="open -a TextMate"
;;
'gsbl90240' )
export JAVA_HOME=/home/y/libexec64/jdk1.6.0/
export HADOOP_HOME=/home/gs/hadoop/current
export HADOOP_CONF_DIR=/home/gs/conf/current/
export HCAT_URI=thrift://gsbl90249.blue.ygrid.yahoo.com:9080
export HCAT_PRINCIPAL=hcat/[email protected]
export PATH=$HADOOP_HOME/bin:$JAVA_HOME/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/y/lib/ora11gclient/
export TNS_ADMIN=/homeome/y/lib/ora11gclient/
export PATH=/home/y/lib/ora11gclient/ora11gclient:$PATH
;;
esac
# OS specific settings
# enable color support of ls and also add handy aliases
case $os in
"Darwin" )
alias ls='ls -G';;
"Linux" )
alias ls='ls --color=auto'
if [ -d '/home/y/bin/' ]
then
export PATH=/home/y/bin64:/home/y/bin:$PATH
fi
export ANT_HOME=/home/y/libexec/ant
export PATH=$ANT_HOME/bin:$PATH
esac
export PATH=$HOME/bin:/opt/local/bin:/opt/local/sbin:/usr/local/mysql/bin/:$PATH
export MANPATH=/opt/local/share/man:$MANPATH
alias desktop="ssh freshmember.corp.yahoo.com"
export XMLLINT_INDENT=" "
# hostname tab completion for ssh/ping
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ping
svnhttp() {
if [ "$#" -eq 1 ]
then
path=$1
else
path=`pwd`
fi
url=`svn info $path | grep URL | sed -e 's/URL: svn+ssh/http/g' | sed -e 's/svn.corp.yahoo.com/svn.corp.yahoo.com\/view/g'`
if [ -f "$path" ]
then
url="${url}?view=markup"
fi
echo "$url"
}
# Don't show . files in bash completion
bind 'set match-hidden-files off'
#FileMerge as diff viewer
export GREP_OPTIONS="--exclude=\*.svn\* --color"
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
export HISTFILE=$HOME/.bash_history
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
#case "$TERM" in
#xterm-color)
# PS1='\u@\h\[\033[00m\]:$YROOT_NAME \[\033[01;34m\]\w\[\033[00m\]\$ '
# ;;
#*)
# PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
# ;;
#esac
parse_git_branch ()
{
git branch 2> /dev/null | grep '*' | sed 's#*\ \(.*\)#(git::\1)#'
}
PS1="\w \$(parse_git_branch)\$ "
# more: http://jonisalonen.com/2012/your-bash-prompt-needs-this/
#PS1="\[\033[G\]$PS1"
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
;;
*)
;;
esac
###########################################################
export SVNROOT=svn+ssh://svn.corp.yahoo.com/
export SVN_EDITOR="vim --noplugin"
# yssh and yscp
if [ -x $HOME/bin/yssh ]; then
alias ssh='yssh'
alias scp='yscp'
export SVN_SSH=$HOME/bin/yssh
fi
alias rm="rm -i"
alias cp="cp -i"
alias mv="mv -i"
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting