HMC Homepage      CS Home

Handy Commands and Tips


Netscape Cache Removal

foreach i (`ls /export/home/user`) 
rm -rf ${i}/.netscape/cache/*
end

How to Take Care of a Fork Bomb

bash
for PS in `ps -fu jhyu | awk '{print $2}'` ; do kill -STOP $PS ; done
for PS in `ps -fu jhyu | awk '{print $2}'` ; do kill -9 $PS ; done

Getting Contact Info from Whois

I'm sure several of you have noticed that NSI has messed around with the whois database several times over the past year. The latest change is that you can't get important info like contact information unless you use whois.networksolutions.com as your whois server.

so, for example, to get Andy Davenport's phone number, I would have to use "whois -h whois.networksolutions.com hmc.edu" instead of just "whois hmc.edu"

I guess this is just part of allowing competing dns registrars. Probably for any domain registered with someone other than NSI, you'd have to use that other company's whois server to get full information. Luckily, the default whois server now tells you what server has the full information.

Sending Mail from Command Line

In order to send the mail on the command line without any other intervention,

cat foo | /usr/lib/sendmail recipient1 recipient2 ...

To set a subject or other headers, just include the headers at the top of the file, with a blank line between the headers and the body.

Printing double sided from Acrobat

change

/usr/bin/lp -c
to
/usr/bin/lp -o duplex
For specs on which signals are what, look in either
man -s5 signal

or

/usr/include/sys/signal.h
Printing to slides on cso
use psoptions script:

 cat presentation.ps | psoptions slides > presentation.slides.ps

use lpr to send file to cso

 lpr -P cso presentation.slides.ps

all at one time:

cat slideCurrentWarnings.ps | psoptions slides | lpr -P cso

ncpmount stuff:

ncpmount -s name mountpt -U guest -n

-n is no passwd from command line

Other useful commands:
slist
tksmb

Tarring stuff

tar cvf latex2html-99.2beta6.tar latex2html-99.2beta6

Pulling columns from files

awk ' BEGIN { FS = " " } { print $1, $2, "\t", $6 }' retreatmealcards.txt

To change permissions on all files or dirs in a tree:

77 > foreach i (`find . -type f`)
foreach? chmod 644 $i
foreach? end

78 > foreach i ( `find . -type d` )
foreach? chmod g-s $i
foreach? end

To view unformatted man pages, use

groff -Tascii -man manpage.1 | less

What NOT to do while logged in to turing on console

Do not change init state to S (single-user, no mounted filesystems) while logged in as anyone else but root - turing will kill your session, and pop up an infinite loop of dialog boxes that say user logins are disabled. You cannot get to console, and can't ssh in to fix it from another machine.


Copyright (c) HMC Computer Science Department. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License.''

HMC Computer Science Department
Contact Information
Last Modified Tuesday, 22-May-2001 16:49:51 PDT