Friday, November 14th, 2008
If you’re running any moderately busy mail server you’re probably using spamassassins spamc/spamd to check for spam because its tons more efficient than piping the mail through the spamassassin cli. Assuming that you do, and that you plan on adding DKIM proxy to the mix to verify and sign emails you need to put things [...]
I’ve always wanted to write my own simple shell in php. Call me a glutin for punishment, but it seems like something that a lot of people could use to be able to do… If your web app had a command line interface for various things… like looking up stats, or users, or suspending naughty [...]
This is something that has always annoyed me about bash scripts… The fact that it’s difficult to run /path/to/script.sh –foo=bar -v -n 10 blah -one=’last arg’ So I decided to write up a bash function that let me easily (once the function was complete) access this type of information. And because I like sharing, here [...]
Thursday, June 19th, 2008
We use dirname() a lot in php to make relative paths work from multiple locations like so. The advantages are many: require dirname( dirname( __FILE__ ) ) . ‘/required-file.php’; $data = file_get_contents( dirname(__FILE__).’/data/info.dat’); But in bash we often dont do the same thing, we settle for the old standby “../”. Which is a shame because [...]
Wednesday, June 18th, 2008
Using some stuff I’ve covered in the past on my blog here’s a simple way to put up a daytime server (well to put any service onto a tcp port. I haven’t looked into its bi-directional capabilities yet, this was just sort of a proof-of-concept… $ apt-get install ipsvd $ wget http://blog.apokalyptik.com/files/daemonize/daemonize.c $ cc daemonize.c [...]
Andy bogged a piece of advice that I have him which I got from Barry… and if you want to know how to get the true absolute path to the real location of the current script is from inside of it (like phps realpath and __FILE__) I suggest you check it out
I’ve written a little something which is gaining some traction internally, and I always intended to share it with the world. So… Here. daemon-functions.sh What it does is allow you to write a bash function called “payload” like so: function payload() { while [ true ]; do checkforterm date sleep 1 done } source path/to/daemon-functions.sh [...]
Thursday, April 24th, 2008
I work in linux a lot… not bsd. So the OSX (bsd style) implementation of sed really throws me for a loop when I go text-file-spelunking, whats worse is that my scripts using sed aren’t portable between the two OSs. A quick googling this morning landed me here: http://wiki.octave.org/wiki.pl?OctaveForMac which gives perfectly good instructions on [...]
Tuesday, April 22nd, 2008
I keep marking this as unread in google reader so that Its there when I need it… which probably means I should just blog it… automating firefox via telnet
Thursday, April 10th, 2008
I hacked together this little C program from this other little c program. Basically acts as an execution wrapper that lets you fork() and detach and run a command in the background with a pidfile and log file for program output. So far I havent had any problems with it… but then I’m not a [...]