############################ # Akkana's excessive .cshrc ############################ #set debug=1 #set verbose if ($?debug) echo -n "[.cshrc] " if ( ! $?prompt || ! $?term ) then # not interactive -- skip the hard stuff unset debug exit 0 endif # Do case insensitive completion #set complete=enhance # OS-specific stuff set opsys = `uname -s` switch ($opsys) case IRIX: source $HOME/.cshrc.irix breaksw case Linux: # Keep the linux stuff here, since it's most likely to be used set path = ( $HOME/bin/linux $HOME/bin /usr/local/bin /usr/sbin /usr/bin /usr/ucb /usr/java/bin /usr/bsd /bin /usr/bin/X11 /etc /usr/etc . /opt/kde/bin /sbin /usr/local/Acrobat4/bin /var/list/.bin ) # 4.51 gets the java classpath wrong, so we need to set it explicitly # See http://scopus.mcom.com/bugsplat/show_bug.cgi?id=340491 # setenv CLASSPATH /opt/netscape/java/classes:/opt/netscape/java/classes/java40.jar:/opt/netscape/java/classes/jae40.jar:/opt/netscape/java/classes/jae40.jar/jio40.jar:/opt/netscape/java/classes/jsd10.jar:/opt/netscape/java/classes/ldap10.jar:/opt/netscape/java/classes/resource.jar:/opt/netscape/java/classes/scd10.jar setenv PAGER less setenv LESS -E # Make patch actually obey -p0 setenv POSIXLY_CORRECT 1 # ls 4.0.36 changed its sort so that by default, dot and non-dot files # are grouped together. Apparently this is a POSIX misfeature and # can be turned off thusly: setenv LC_COLLATE C # Need to do this so that mutt will properly demoronize punctuation: #setenv LC_ALL en_US.UTF-8 # This may work better: setenv LANG en_US.UTF-8 #setenv LC_CTYPE en_US.UTF-8 # Linux doesn't have enscript, but it has mprint: alias ens 'mpage -2 -f -p \!* | lpr' alias ens4 'mpage -4 -f -p \!* | lpr' breaksw case SunOS: # set path = ( $HOME/bin/sun $HOME/bin /tools/ns/workshop/bin /bin /tools/contrib/bin /tools/contrib/egcs-1.1/bin /tools/ns/bin /usr/local/bin /usr/bin /usr/etc /usr/sbin /usr/bin/X11 /sbin . /usr/java/jdk1.1.3/bin /usr/local/Motif/opt/ICS/Motif/usr/bin/X11 /tools/ns/lib/sparcworks/SUNWspro/bin /tools/ns-arch/sparc_sun_solaris2.5.1/soft/sun-workshop-4.0/run/default/sparc_sol2/SUNWspro/bin /usr/ccs/bin /usr/openwin/bin /usr/ucb ) # setenv LD_LIBRARY_PATH .:../../nspr/lib:/usr/dt/lib:/usr/ccs/lib:/tools/ns/lib:/usr/lib:/usr/openwin/lib:/usr/ucblib:/tools/contrib/lib:/tools/contrib/gtk+-1.1.3/lib # In order to start mwm properly, we need to point to this locale path # setenv XNLSPATH /usr/local/Motif/opt/ICS/Motif/usr/lib/X11/nls setenv OPENWINHOME /usr/openwin breaksw default: set path = ( $HOME/bin /usr/sbin /usr/bin /usr/ucb /usr/local/bin /usr/java/bin /usr/bsd /bin /usr/bin/X11 /etc /usr/etc . ) breaksw endsw # end of switch over different OSes ############################### # Terminal setting: ############################### set standout = "" set standout_end = "" if ( $?COLORTERM && COLORTERM == gnome-terminal ) then # gnome-terminal doesn't colorize bold, so we need a separate clause. echo "Ewwww, gnome-terminal!" setenv TERM xterm-noalt else if ($?tcsh) then #set standout = "%U" #set standout_end = "%u" set standout = "%B" set standout_end = "%b" else if ( $term =~ iris* ) then # Set the prompt to be yellow. This puts the prompt in boldface: # set standout = "" # set standout_end = "" # but this is more reliable, setting the color explicitly: set standout = "" set standout_end = "" # colors: 30-37 Set the text color to black, red, green, yellow, blue, # magenta, cyan or white, respecotively (ISO 6429). # 40-47 Set the page color to black, red, green, yellow, blue, # magenta, cyan or white, respectively (ISO 6429). else if ( $term =~ hp* ) then set standout = "&v2S" set standout_end = "&v3S" else if ($term == "xterm") then set standout = "" set standout_end = "" else if ($term == "vt100") then # a couple of items for pcplus and netcom if ( -x /usr/5bin/tabs ) /usr/5bin/tabs set standout = "" set standout_end = "" else if ($term == "ansi" || $term == 'vt102') then stty -tabs set standout = "" set standout_end = "" endif ############################### # Prompt setting: ############################### # and set the prompt with the correct number of primes in it: if (! $?PRIMES) setenv PRIMES "" setenv PRIMES $PRIMES\' # SunOS has different args for hostname than everyone else, sigh. # It also doesn't have whoami. if ($opsys == SunOS) then set host = `hostname` set me = "akkana" else set host = `hostname -s` set me = `whoami` endif if ($me == 'akkana') then set prompt = "$standout($host$PRIMES)-$standout_end " else if ($me == 'root') then # square brackets in next line cause a "variable syntax" error, so: set prompt = "$standout<$host#$PRIMES>-$standout_end " else set prompt = "$standout($me@$host$PRIMES)-$standout_end " endif unset me unset host unset standout unset standout_end alias update "cvs update \!* |& egrep -v '^cvs' ; echo " alias updaten "cvs -n update \!* |& egrep -v '^cvs' ; echo " alias showmod "cvs -n update \!* |& egrep -v '^cvs' |& egrep -v '^U' ; echo " alias log "cvs log \!* | grep -v '^ ' | more" breaksw # end of company-specific stuff endsw alias sera open_tunnel sera-mv.netscape.com aol031917 alias sera2 open_tunnel -e -n sera-rtc.aol.com aol031917 alias nosera close_tunnel xauth add clavius:0 MIT-MAGIC-COOKIE-1 65354804ad5afa450385a2fe4eab30a1 endif # end of "only if interactive (i.e. prompt set)" # echo "." if ($?REMOTEHOST) then if (($REMOTEHOST =~ *transbay.net) && ($TERM == vt100)) then setenv TERM xterm endif endif ############################### # General aliases ############################### # Alias to set the title on xterm compatibles: alias titlebar "echo ']2;\!*'" # Set some editing bindings for tcsh: if ($?tcsh) then bindkey ^W backward-delete-word set autolist=ambiguous endif set notify set mail = (0 /var/mail/akkana) unset autologout # setenv MORE -cs #setenv EXINIT "set ai sm wm=9" #setenv ENSCRIPT -2r set history=200 set filec alias m mutt alias beep echo  alias pd pushd alias pd2 pushd +2 alias ls ls -aFC alias ll ls -alsF alias llt ls -alsFt alias llth 'ls -alsFt \!* | head' alias j jobs alias ph 'grep -i \!* ~/.../Phones' alias ap man -k alias s suspend alias xx startx alias tirc tkirc akk irc.mozilla.org alias tb ssh transbay.net alias rl telnet -r ############################### # Recursive greps alias gr "find . -type f -and -not -name '*.o' -and -not -name '*.a' -and -not -name '*.pp' | xargs grep \!* /dev/null" alias cgr "find . -name '*.h' -or -name '*.c' -or -name '*.cpp' -or -name '*.cc' | xargs grep \!* /dev/null" alias hgr "find . -name '*.h' -or -name '*.idl' -or -name '*.html' -or -name '*.blx' | xargs grep \!* /dev/null" alias jcgr "find . -name '*.h' -or -name '*.c' -or -name '*.cpp' -or -name '*.cc' -or -name '*.js' | xargs grep \!* /dev/null" alias htg "find . -name '*.*htm*' | xargs grep \!* /dev/null" alias jgr "find . -name '*.js' | xargs grep \!* /dev/null" alias xgr "find . -name '*.h' -or -name '*.c' -or -name '*.cpp' -or -name '*.xul' -or -name '*.html' -or -name '*.js' -or -name '*.css' | xargs grep \!* /dev/null" alias cssgr "find . -name '*.css' | xargs grep \!* /dev/null" alias mgr "find . -name '*akefile*' | xargs grep \!* /dev/null" alias agr "find . -type f | xargs grep \!* /dev/null" ############################### # Shutting down if (`hostname` == 'moon') then # Don't shut the server down! alias off echo "This is moon, you idiot" alias halt echo "This is moon, you idiot" alias reboot echo "This is moon, you idiot" else # halt and reboot don't always work on the Vaio, # and can't be run suid. alias off sudo shutdown -h now alias halt sudo shutdown -h now alias reboot sudo shutdown -r now alias zzz sudo hibernate -F /etc/hibernate/ram.conf endif #################################### # tkdiff on multiple files from CVS alias tdiff \ 'foreach fil ( \!* ) \ tkdiff $fil & \ end' ############################### # Java alias av appletviewer alias jc javac ############################### # Plucker/Sitescooper setenv PILOTRATE 57600 alias pluck /usr/lib/python2.0/site-packages/PyPlucker/Spider.py -s # Sitescooper doesn't let these be configured in sitescooper.cf: #set scoopcmd='$HOME/outsrc/sitescooper/sitescooper.pl -mplucker -debug -filename "Day_Site" -prctitle "Day Site"' #set scoopcmd='sitescooper -mplucker -debug -filename "Day_Site" -prctitle "Day Site"' alias scoop 'setenv LANG C; rm $HOME/.sitescooper/prc/*.pdb; \ sitescooper \!* |& setsid tee $HOME/scoop.out; \ cat /public/shallowsky/xtraurls.html >> $HOME/xtraurls.html; \ rm /public/shallowsky/xtraurls.html; \ ls $HOME/.sitescooper/prc' alias rscoop "rm $HOME/.sitescooper/prc/*; nohup sitescooper >& $HOME/scoop.out &" alias scoopsite "sitescooper -sites \!*" #unset scoopcmd alias piscoop 'pilot-xfer -i ~/.sitescooper/prc/*.pdb' alias pirm 'rm ~/.sitescooper/prc/*' alias pils 'echo "In ~/.sitescooper/prc : "; ls ~/.sitescooper/prc' alias picd 'cd ~/.sitescooper/prc' alias cliebak 'rm -rf ~/Pilot/Clie.bak; \ cp -a ~/Pilot/Clie ~/Pilot/Clie.bak; \ pilot-xfer -s ~/Pilot/Clie; \ pluckmemos; \ cp ~/.plucker/html/xtraurls.html ~/web/xtraurls.html' ############################### # Trn from multiple servers # trn options: add -e -L for screen clearing (but it doesn't work right), # omit -x and -X options for regular non-threaded rn # -q is supposed to ask about new groups, but doesn't. # But doing "a*" gets a prompt for all the newsgroups. setenv TRNINIT "-C7 -I -M -s -x -X15X -m=u -EATTRIBUTION='%)f <%>f> wrote:' -ESAVEDIR=$HOME/Msgs" # Can add "-EXTERMMOUSE=y" to TRNINIT but then you can't # select with the mouse any more # $HOME/.newsrc is for news.mozilla.org. # To use other .newsrcs, change DOTDIR and NNTPSERVER #alias moztrn "setenv NNTPSERVER news.mozilla.org; setenv DOTDIR $HOME/nntpservers/news.mozilla.org; \trn" ############################### # Apache logs # Nifty one-liner from Dana: alias showref 'tail -1000 /var/log/apache/shallow-access.log | fgrep -v shallowsky | cut -d\" -f4 | grep -v ^-' # Even niftier one-liner from ... um, pippin? #alias showref 'awk < /var/log/apache/shallow-access.log \'{print $11 " .... " $7}\' | grep -v -- - | grep -v shallowsky.com | egrep "jpg|gif" ' alias show404 'fgrep " 404 " /var/log/apache/shallow-access.log | cut -d\" -f2 | sed -e "s/GET //" -e "s/ HTTP.*//"' ############################### # Misc. local aliases alias numdel "grep --binary-files=text Subject: Msgs/spam/deletes | wc -l" # Remove the line matching $1 from ~/.ssh/known_hosts. # # Ssh refuses to operate if anything has changed about the host: # # network card, distro it's running, etc. alias cleanssh 'mv $HOME/.ssh/known_hosts $HOME/.ssh/known_hosts.bak; grep -v \!^ $HOME/.ssh/known_hosts.bak >$HOME/.ssh/known_hosts' alias ratings 'links -dump "http://www.amazon.com/gp/product/1590595874" | grep "in Books" | grep -v Explore' alias blogupdate 'cd ~/web/blogfiles; ./pyblosxom.cgi --static --incremental && ~/bin/blogtopics && mv ../blog/topics.html ../blog/oldtopics.html && mv ../blog/newtopics.html ../blog/topics.html; cd' ############################### # We're finally done! if ($?debug) then echo "." unset debug endif