#!/usr/bin/env python import string, cgi, os, whrandom, pickle, sys import cgitb; cgitb.enable() #sys.path.insert(0, '/home/mu.org/home/gus/fm/fmblog') #import fmbloglib,fmblog print 'Content-type: text/html\r\n' print ''' gus mueller
Here are some unix commands and things that I seem to run into often. I thought I would share them with you. (Actually, I put them here because I can never seem to remember them, and here is as good a place as any, but enjoy anyway...)

Need to get rid of those pesky ^M in java files on unix boxen?
Just cut and paste the follwing script into a file (call it dos2unix or something) and then make it executable (chmod 755). Call it like: dos2unix myfile.txt

#!/bin/sh

tr -d "\015" < $1 > $1.tmp
mv $1.tmp $1 


How to delete files in the current directory, and below that contain the string "foo":

find . | grep "foo" | xargs rm


This one is a request from Jamie. How to tar and unzip a foo.tar.gz (or foo.tgz) file and keep the archive around. It\'s super easy, and just one line. (This is also assuming that the tar you are using is gnutar)

tar xvzf foo.tar.gz


Here\'s how to read packets going to your local webserver. You can use a little unix program called tcpflow to do this, which compiles fine on Mac OS X.

sudo chmod 775 /dev/bpf*
tcpflow -csu -i lo0  port 80


Print out your environment variables in tcsh format.

perl -e \'foreach (sort keys %ENV) { print "setenv $_ $ENV{$_} \n"; }\'
All things copyright © 2001, 2002 August Mueller

gmdc:
flying meat
contact
resume
photos
images
free font
cocoa bits
java bits
unix bits
osx bits
cvsdist
my words
mcommand
ja
links
my rss feed
book list
who\'s linken\'
login
wishlist
theories

people
andy
byron
jeff
jeremy
joe
kory
lynn
mary
murphy
ryan d

when bored
slashdot
maccentral
y! most viewed
cars
there gus
explodingdog
the onion
dotw
tonypierce
prior art
chimera

resources
Cafe au Lait
Cafe con Leche
design patterns
anitpatterns
java r.o.t.d
c.l.c
c.l.j
c.s.m.p.h
c.s.m.p.c



'''