changes
[docs.git] / ti / .bashrc
blobe44229f8f7e34e7b24aa7ea8e77b775f9a1cafb6
1 # .bashrc
3 # User specific aliases and functions
5 # Source global definitions
6 if [ -f /etc/bashrc ]; then
7         . /etc/bashrc
8 fi
9 EDITOR=vim
10 set -o vi
11 OS=`uname -s`
14 function getXserver()
16         case $TERM in
17                 'xterm')
18                         XSERVER=$(who am i | awk '{print $NF}' | tr -d ')''(' )
19                         XSERVER=${XSERVER%%:*}
20                 ;;
21                 'aterm')
22                 ;;
23         esac
26 if [ -z ${DISPLAY:=''} ]; then
27         getXserver
28         if [[ -z ${XSERVER} || ${XSERVER} == $(hostname) || \
29                 ${XSERVER} == "unix" ]]; then
30                 DISPLAY=":0.0"
31         else
32                 DISPLAY=${XSERVER}:0.0
33         fi
36 export DISPLAY
38 case "$OS" in
39     'Linux')
40         PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/X11R6/bin"
41         PATH="/usr/local/bin:/usr/local/sbin:${PATH}"
42         case "$HOSTNAME" in
43         'ubtdsk2') # TI's linux
44                 #PATH="/usr/sbin:/usr/bin:/sbin:/bin/:/usr/local/sbin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin:/work/CodeSourcery/Sourcery_G++_Lite/bin"
45                 PATH="/usr/sbin:/usr/bin:/sbin:/bin/:/usr/local/sbin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin:/work/CodeSourcery/arm-2010q1/bin"
46                 #alias zoom2='export ARCH=arm && export CROSS_COMPILE=arm-none-linux-gnueabi-\
47                         # && export NFSROOT=/work/zoom2/nfsroot'
48                 PATH="/work/ti/chromium/depot_tools:${PATH}"
49                 source ~/.zoom2rc
50                 alias p1271='export NFSROOT=/work/zoom2/1271_nfs'
51                 alias p1281e='export NFSROOT=/work/zoom2/nfsroot'
52                 alias p1273e='export NFSROOT=/work/zoom2/1273e'
53                 alias p1273='export NFSROOT=/work/zoom2/1273'
54                 alias pbb='export NFSROOT=/work/bb/1273'
55                 alias pbba='export NFSROOT=/work/bb/Angstrom'
56                 #alias arm1='export PATH="/work/CodeSourcery/arm-2010q1/bin/:$PATH"'
57         ;;
58         'ub102666') # 32-bit
59                 PATH="/usr/sbin:/usr/bin:/sbin:/bin/:/usr/local/sbin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin:/opt/CodeSourcery/arm-2010q1/bin"
60                 source ~/.zoom2rc
61                 alias pz3e='export NFSROOT=/opt/rootfs/z3e'
62                 alias pz3e3='export NFSROOT=/opt/rootfs/z3e3'
63                 alias p1273='export NFSROOT=/opt/rootfs/z3'
64                 alias pbb='export NFSROOT=/opt/rootfs/beagle'
65                 alias ppanda='export NFSROOT=/opt/rootfs/panda'
66                 alias pblaze='export NFSROOT=/opt/rootfs/blaze'
67                 alias parm='export PATH="/opt/CodeSourcery/arm-2010.09/bin/:$PATH"'
68                 #export http_proxy="http://wwweuproxy.itg.ti.com:80/"
69                 #export https_proxy="http://wwweuproxy.itg.ti.com:80/"
70                 #export ftp_proxy="http://wwweuproxy.itg.ti.com:80/"
71         ;;
72         'ub102667') # 64-bit
73                 PATH="/usr/sbin:/usr/bin:/sbin:/bin/:/usr/local/sbin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin:/opt/CodeSourcery/arm-2010q1/bin"
74                 source ~/.zoom2rc
75                 alias p1273e='export NFSROOT=/opt/rootfs/z3e'
76                 alias p1273='export NFSROOT=/opt/rootfs/z3'
77                 alias pbb='export NFSROOT=/opt/rootfs/bb'
78                 alias pbba='export NFSROOT=/opt/rootfs/bbA'
79                 alias ppanda='export NFSROOT=/opt/rootfs/panda'
80                 alias parm='export PATH="/opt/CodeSourcery/arm-2010.09/bin/:$PATH"'
81         ;;
82         'nikkei')
83                 eval "`dircolors -b ~/dircolors`"
84                 export IRP_SRC=~/scopus
85                 export IRP_PLATFORM=irp
86                 export IRP_BUILD_ARCH=ppc
87                 alias bml='export IRP_PLATFORM=ml && source $IRP_SRC/irp/linux-add-ons/scripts/env-pro-ppc-405'
88                 alias birpd8='export IRP_PLATFORM=irp && export IRP_NO_DEBUG= && export IRP_STANDALONE= && export IRP_8INPUTS=1 && source $IRP_SRC/irp/linux-add-ons/scripts/env-pro-ppc-405'
89                 alias birpd='export IRP_PLATFORM=irp && export IRP_NO_DEBUG= && export IRP_STANDALONE= && export IRP_8INPUTS= && source $IRP_SRC/irp/linux-add-ons/scripts/env-pro-ppc-405'
90                 alias birp='export IRP_PLATFORM=irp && export IRP_NO_DEBUG=1 && export IRP_STANDALONE= && source $IRP_SRC/irp/linux-add-ons/scripts/env-pro-ppc-405'
91                 alias birps='export IRP_PLATFORM=irp && export IRP_NO_DEBUG= && export IRP_STANDALONE=1 && source $IRP_SRC/irp/linux-add-ons/scripts/env-pro-ppc-405'
92                 alias irpp='echo $IRP_PLATFORM'
93                                 export P4USER=geryk
94                                 export P4CLIENT=ForGery
95                 export USE_NEWWAY=1
96                 export MINICOM="-m -c on"
97                 export ANT_HOME="/opt/apache-ant-1.7.0"
98                 export JAVA_HOME="/opt/jdk1.6.0_07"
99                                 PATH="/home/gxk/prjs/scripts/libsh:/usr/local/p4:/usr/local/firefox:/opt/apache-ant-1.7.0/bin:\
100 /home/gxk/prjs/scripts:/home/gxk/prjs/pBuilder:${PATH}"
101                                 #alias xil9='source /opt/Xilinx91i/settings.sh && source /opt/EDK/settings.sh && source /opt/chipscope/settings.sh'
102                                 #alias xil10='source /opt/Xilinx10.1/ISE/settings32.sh && source /opt/Xilinx10.1/EDK/settings32.sh'
103                 ;;
104                 'gery-lnx')
105                 PATH="/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin:/opt/mv_pro_5.0/montavista/pro/bin:/opt/mv_pro_5.0/montavista/common/bin:$PATH"
106                 ;;
107                 'smiley.scopus.net')
108                 export IRP_SRC=~/scopus
109                 export IRP_PLATFORM=irp
110                 export IRP_BUILD_ARCH=ppc
111                 alias bml='export IRP_PLATFORM=ml && source $IRP_SRC/irp/linux-add-ons/scripts/env-pro-ppc-405'
112                 alias birpd8='export IRP_PLATFORM=irp && export IRP_NO_DEBUG= && export IRP_STANDALONE= && export IRP_8INPUTS=1 && source $IRP_SRC/irp/linux-add-ons/scripts/env-pro-ppc-405'
113                 alias birpd='export IRP_PLATFORM=irp && export IRP_NO_DEBUG= && export IRP_STANDALONE= && export IRP_8INPUTS= && source $IRP_SRC/irp/linux-add-ons/scripts/env-pro-ppc-405'
114                 alias birp='export IRP_PLATFORM=irp && export IRP_NO_DEBUG=1 && export IRP_STANDALONE= && source $IRP_SRC/irp/linux-add-ons/scripts/env-pro-ppc-405'
115                 alias birps='export IRP_PLATFORM=irp && export IRP_NO_DEBUG= && export IRP_STANDALONE=1 && source $IRP_SRC/irp/linux-add-ons/scripts/env-pro-ppc-405'
116                 alias irpp='echo $IRP_PLATFORM'
117                                 export P4USER=geryk
118                                 export P4CLIENT=ForGery
119                 export USE_NEWWAY=1
120                 export MINICOM="-m -c on"
121                 export ANT_HOME="/opt/apache-ant-1.7.0"
122                 export JAVA_HOME="/opt/jdk1.6.0_07"
123                                 PATH="/home/gxk/prjs/scripts/libsh:/usr/local/p4:/usr/local/firefox:/opt/apache-ant-1.7.0/bin:\
124 /home/gxk/prjs/scripts:/home/gxk/prjs/pBuilder:${PATH}"
125                                 alias xil9='source /opt/Xilinx91i/settings.sh && source /opt/EDK/settings.sh && source /opt/chipscope/settings.sh'
126                                 alias xil10='source /opt/Xilinx10.1/ISE/settings32.sh && source /opt/Xilinx10.1/EDK/settings32.sh'
127                 ;;
128                 'bashful.scopus.net')
129                                 PATH="/home/gxk/prjs/scripts/libsh:/usr/local/p4:/home/gxk/prjs/scripts:${PATH}"
130                 export IRP_SRC=~/scopus
131                                 export P4USER=geryk
132                                 export P4CLIENT=forgery
133                 ;;
134                 'gxk-dt-lnx.softier1.local')
135                                 PATH="/usr/local/mozilla:${PATH}"
137                                 export CVSROOT=":pserver:gxk@linux-s:/cvs"
139                                 alias tmsgcc='tms320c6-coff-gcc'
140                                 alias tmsld='tms320c6-coff-ld'
141                                 alias tmsar='tms320c6-coff-ar'
142                                 alias tmsnm='tms320c6-coff-nm'
143                 ;;
144                 *) echo missing HOSTNAME.
145                 ;;
146                 esac
147                 export PATH Path EDITOR
148     ;;
149     'CYGWIN_NT-5.1')
150                 PATH=".:/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/X11R6/bin"
151                 PATH="/usr/local/bin:/usr/local/sbin:${PATH}"
152     ;;
153     *) echo missing OS name. check "uname".
154     ;;
155 esac
157 alias difff='diff -pbBwuN'
159 # FIND
160 alias findf='find `pwd` -type f -follow'
161 alias findd='find `pwd` -type d -follow'
162 alias findg="find `pwd` -type f -follow | xargs grep \!*"
163 alias findch="find `pwd` -type f -name '*.[c|h]'"
164 alias findchg="find `pwd` -type f -name '*.[c|h]' | xargs grep \!*"
165 #GREP
166 alias g='grep'
167 alias gk='grep -r --exclude-dir=.git --exclude={tags,*~,*.swp,*.o,*.ko,cscope.out}'
168 alias gkl='grep -rl --exclude-dir=.git --exclude={tags,*~,*.swp,*.o,*.ko,cscope.out}'
169 #GIT
170 alias gb='git branch'
171 alias gba='git branch -a'
172 alias gc='git commit -v'
173 alias gd='git diff'
174 alias gl='git pull'
175 alias gp='git push'
176 alias gst='git status'
178 alias j='jobs'
179 alias l='less'
180 alias rm='rm -i'
181 alias mv='mv -i'
182 alias cp='cp -i'
183 alias ls='ls --color=auto'
184 alias ll='ls -l'
185 alias lla='ls -la'
187 # screen sessions
188 alias mscr='screen -U -S main'
189 # terminals
190 alias scrix='xterm -geometry 140x75 -e "screen -U -S main"'
191 alias work='xterm -geometry 209x75+0+0 -e "screen -U -S main"'
192 alias vix='xterm -b 1 -ms red -geom 101x54 -e ${EDITOR}'
193 alias tsb3='xterm -T root -b 1 -bg SkyBlue3 -fg black -ms red -geom 80x45 -e sudo bash&'
194 alias mail='xterm -bg black -fg white -geom 90x70 -e mutt&'
195 alias tg20='xterm -bg grey20 -fg white&'
196 alias tsb1='xterm -bg SkyBlue1 -fg black&'
197 alias tlsb1='xterm -bg LightSteelBlue1 -fg black&'
199 #alias win='rdesktop -u geryk -d ivirtus -g 95% 192.168.1.36 &'
200 alias win='rdesktop -u a0387671 -d ENT -g 95% 137.167.20.87 &'