Speeding myself up on the commandline

I tend to find myself in the terminal.app on my Mac more often than not, SSHing into servers, checking whois, host, and any number of other things. My most frequent incantation is searching the command history so I don’t have to re-type a previous command, something like this:

grep curl ~/.bash_history

I’ll then copy and paste the command and hit return. It’s pretty quick, and I’ve got the muscle memory right down now… but there’s got to be more elegant commands, right? Or course there are. Continue reading Speeding myself up on the commandline

Taking stock

I have a client with a lot lot lot lot of WordPress sites, and I’m helping them craft a strategy for dealing with WordPress throughout their business. One thing we wanted to do was to take stock of all the plugins they have installed on all their sites, work out how many are in common, understand if any have security issues and so forth. Logging into hundreds of WordPress sites, even if we did have their login details, isn’t my idea of fun so I hacked some of the WordPress plugin functions to output a report on any plugins it finds in a directory. Continue reading Taking stock

Phew. My calendar is synced to my phone again

My phone used to sync with iCal several times a day, but when I upgraded to Leopard it wiped my cron tab file and all that goodness stopped. (Your crontab file is a way of scheduling tasks on your Mac using the Terminal application.) I’ve just googled around for the solution and found it again: Use cron to automate iSync at non-standard intervals. Nice neat solution, to which I would only add the following: 0 8,10,12,14 * * * osascript -e ‘tell application “iSync” to synchronize’ >> /dev/null Whenever a Cron command runs, any output is sent by email to the account handler. This simply builds up as unsendable email in the system, or spams you every time the script runs… either way it’s not good. The >> /dev/null simply sends any output into a black hole so it doesn’t bother me.

Originally I’m sure I had this set so iSync closed down again when it was done… so maybe more to follow.

Exporting from MySQL to CSV

Everytime I need to do this I go into at least five minutes of Googling for a decent solution. The problem is that a lot of people don’t have access to the commandline, so the solutions all reference PHPMyAdmin which is, you know, OK, but I don’t use it or want to install it just to export some quick reports. Other solutions are similarly indirect.

Continue reading Exporting from MySQL to CSV