Monthly Archives: June 2008

Bash Coding Convention ../

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 [...]

Simple TCP Daemon Example

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 [...]