# .bashrc # # unified (use bash everywhere): fricka, NMR center, CIMS machines, Mac OSX # # note: if bash set to login shell, will need to remove echo's since ruins # opening ssh connection. # # barnett 1/23/04 updated constantly, eg 7/20/04 # unfortunately echo'ing ruins scp ... not true for .profile # echo 'hello this is .bashrc' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # Rest of file is user specific aliases and functions: alias mv='mv -i' alias cp='cp -i' alias rm='rm -i' alias ac='acroread' # ps2pdf with nice image-hanlding (from prosper users)... alias pdf='ps2pdf13 -dPDFSETTINGS#/prepress -dEmbedAllFonts#true -dEncodeGrayImages#true -dAutoFilterGrayImages#false -dGrayImageFilter#/FlateEncode -dEncodeMonoImages#true -dAutoFilterMonoImages#false -dMonoImageFilter#/FlateEncode -dEncodeColorImages#true -dAutoFilterColorImages#false -dColorImageFilter#/FlateEncode' # dvips with PDF-ready settings... dps () { dvips $1 -o $1.ps -t letter -Ppdf -G0 } # change network settings... w=wireless e=ethernet. Will ask for sudo pwd. alias netw='sudo ln -fs /etc/sysconfig/network.offline /etc/sysconfig/network; sudo ln -fs /etc/sysconfig/network-scripts/ifcfg-eth0.offline /etc/sysconfig/network-scripts/ifcfg-eth0; sudo /etc/init.d/network restart' alias nete='sudo ln -fs /etc/sysconfig/network.dhcp /etc/sysconfig/network; sudo ln -fs /etc/sysconfig/network-scripts/ifcfg-eth0.dhcp /etc/sysconfig/network-scripts/ifcfg-eth0; sudo /etc/init.d/network restart' # Nice prompt with everything... export PS1="\u@\h \$PWD> " # or version without full PWD tree... # export PS1="\u@\h \W> " # Function from uzix.org: findgrep () { # find | grep if [ $# -eq 0 ]; then echo "findgrep: No arguments entered."; return 1 else # "{.[a-zA-Z],}*" instead of "." makes the output cleaner find {.[a-zA-Z],}* -type f | xargs grep -n $* /dev/null \ 2> /dev/null fi } # --------------------------------------- operating system switch # Decyphering machine identification: # machine name: fricka math1 crunchy2 ramanujan # bash OSTYPE: linux-gnu solaris2.9 solaris irix6.5 # uname -s: Linux SunOS SunOS IRIX64 # bash HOSTTYPE: i386 sparc sun4 mips # uname -p: unknown sparc sparc mips # My OS var: linux solaris solaris irix # Therefore choose uname as reliable ident... then change it to standard set OS=`uname -s` # same as default uname case $OS in Linux) # ..................... fricka, and linux boxes @ Martinos OS=linux alias ls='ls -l --color=tty' alias l.='ls -dl .[a-zA-Z]* --color=tty' alias soffice='/opt/OpenOffice.org644/program/soffice' alias scalc='/opt/OpenOffice.org644/program/scalc' # set keyboard repeat rate: (should be done in fricka:/etc/X11/XF86Config-4) alias kbd='kbdrate -r 40 -d 250' alias cims='ssh -l barnett math1.cims.nyu.edu' # secure-copying to CIMS home... scc () { scp $1 barnett@math1.cims.nyu.edu:. } # secure-copying from CIMS home to fricka... scf () { scp barnett@math1.cims.nyu.edu:$1 . } alias chkclk='ntpdate -q cmcl2.nyu.edu' # include all fricka, monte, and node home directories... export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/bin/X11:/usr/local/bin:/usr/X11R6/bin:/home/alex/bin:/homes/monte/1/home/barnett/bin:/home/barnett/bin:/usr/pubsw/bin:/usr/local/PBS/bin:/opt/cisco/bin # Matlab, add local license and NYU's. Need full paths. # (.nyu file taken from math1:/opt/matlab/R13/etc/license.dat) export LM_LICENSE_FILE=$LM_LICENSE_FILE:/usr/local/matlab/etc/license.dat:/usr/local/matlab/etc/license.dat.nyu # prosper for tex... export GS_OPTIONS="-sPAPERSIZE=a4" # where to look for .sty export TEXINPUTS=.:/$HOME/tex/inputs//:/usr/share/texmf/tex/latex//:/usr/share/texmf/tex// # send lpr to 11th floor WWH printer: needed to set up CUPS on fricka/FC3 export LPDEST=nhp17 # also have nhp17s & poster available (set up in CUPS)... alias lps='lp -d nhp17s' # Since I set up CUPS to use dnj650c driver, expect this to give better # color interpolation than using poster printer with PS driver... alias lpbigps='lp -d poster -o PageSize=ArchE' # Old commands taken from NMR Center or CIMS on RH7.2: # send text/PS to CIMS 11fl printer... #alias lpam='lpr -Pnhp17@netsvca-80net.cims.nyu.edu' # convert PS to laserjet driver locally, works better for paper size... #alias lpamps='gs -q -dNOPAUSE -dBATCH -sDEVICE=ljet4 -sOutputFile=\|"lpr -Pnhp17@netsvca-80net.cims.nyu.edu"' # sends single-sided text/PS to our printer... #alias lps='lp -dnhp17s@netsvca-80net.cims.nyu.edu' # HP DesignJet large-format on 11th floor: # GS drivers (seems to use default letter paper size)... #alias lpbigps='gs -q -dNOPAUSE -dBATCH -sDEVICE=dnj650c -sPAPERSIZE=archE -sOutputFile=\|"lpr -Pnhpbig01@netsvca-80net.cims.nyu.edu"' # PS direct to print server... #alias lpbig='lp -dnhpbig01@netsvca-80net.cims.nyu.edu' ;; SunOS) # ..................... Sun machines @ CIMS OS=solaris alias ls='ls -lF' export PATH=$PATH:/usr/local/bin:$HOME/bin export LPDEST='nhp17' ;; IRIX64) # ................... SGI machines @ CIMS OS=irix alias ls='ls -lF' export PATH=$PATH:/usr/local/bin:/usr/freeware/bin:$HOME/bin ;; Darwin) # ..................... Mac OSX OS=osx alias ls='ls -alG' alias fricka='ssh 192.168.1.101' export PATH=$PATH:/usr/X11R6/bin:$HOME/bin ;; *) OS=unknown ;; esac #echo alex bashrc detected $OS operating system. export OS # pass standardized OS to children eg make... # ------------------------------------- Tools specific to various locations # .......................... Harvard Physics alias sleet='ssh -l barnett sleet.harvard.edu' # .......................... Martinos alias gate='ssh -l barnett gate.nmr.mgh.harvard.edu' alias maxwell='ssh -l barnett maxwell.nmr.mgh.harvard.edu' alias monte='ssh -l barnett monte.nmr.mgh.harvard.edu' # execute vnc in spare window (port forwarding), # then vncv in another to open VNC to monte @ Martinos... # (to update vnc display number, change 59?? twice and localhost:??) alias vnc='ssh -l barnett -C -c blowfish -C -L 5909:monte:5909 gate.nmr.mgh.harvard.edu' alias vncv='vncviewer -encoding hextile -bgr233 localhost:09' #export LPDEST='maxwell@maxwell' #export LPDEST='cyclades@bonaire' # attempt to port-forward matlab licencing - fails. #alias flex='ssh -l barnett -L 1700:amaebi:1700 -L 32787:amaebi:33109 gate.nmr.mgh.harvard.edu' # matlab... NMR center # export LM_LICENSE_FILE=1700@amaebi.nmr.mgh.harvard.edu # for NMR Center port forwarding (not working with flexLM... # export LM_LICENSE_FILE=1700@localhost # .......................... Radcliffe # Liz's radcliffe 2nd fl printer... #alias lpliz='lpr -Prad34con2fl_4050tn@rb196.harvard.edu -h' # .......................... CIMS alias ramanujan='ssh -l ab124 ramanujan.acf.nyu.edu' alias cims='ssh -l barnett math1.cims.nyu.edu' # .......................... Liz @ home alias liz='ssh -l alex 192.168.1.100' # end