Thursday, February 12th, 2009
If you’re like me you have an OSX computer or 3 at home, and a debian file server. If you’re like me you hate samba/nfs on principle and want your debian server to show up in finder. If you’re like me you arent using debian 3 which is what most of the walkthroughs seem to [...]
Friday, January 23rd, 2009
I do a lot of things for Automattic, and many of the things I do are quite esoteric (for a php developer anyways.) Perl is not my language of choice, but I’ve never balked at a challenge…. just… did it have to be perl? Anyways. We have more than a thousand machines that we track [...]
Thursday, December 11th, 2008
This is a simplistic use of the pattern that I wrote about in my last post to wait on multiple commands in bash. In essence I have a script which runs a command (like uptime or restarting a daemon) on a whole bunch of servers (think pssh). Anyways… this is how I modified the script [...]
Friday, December 5th, 2008
You know that you can run something in the background in a bash script with ( command )&, but a coworker recently wanted to run multiple commands, wait for all of them to complete, collect and decide what to do based on their return values… this proved much trickier. Luckily there is an answer #!/bin/bash [...]
Tuesday, November 18th, 2008
I’ve been working, gradually, on a project using an sqlite3 database (for its convenience) and found myself missing the clean elegance of wpdb… so I implemented it. It was actually really easy to do, and I figured I would throw it up here for anyone else wishing to use it. The functionality that I build [...]
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 [...]
Wednesday, July 16th, 2008
We use varnish for a lot of our file caching needs, and recently we figured out how to do something rather important through a combination of technologies. Imagine you have backend servers generating dynamic content based on user input. So your users do something that fits the following categories: is expensive to generate dynamically, and [...]
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 [...]