Linux for WordPress Developers – Part 1

David Nash wordpress 0 Comments

I’ve used Linux for years, and I think it’s perfect for any WordPress developer. When the site is live, chances are it’ll be running on a Linux server. So it makes sense to do your WordPress development on the same system that will be running your finished site. Not only does it cut down on nasty last-minute surprises, it also means that when those surprises do arise, you’ll know what to do when they do occur. I’ve run Ubuntu for a while and think it’s pretty good. I use it for the same reason I develop with WordPress – Ubuntu has …

Batch reduce resolution of images in Ubuntu Linux

David Nash bash, linux 4 Comments

Open a terminal window or shell (who needs a GUI!?) sudo apt-get install imagemagick cd image_folder mkdir resized for f in *jpg do convert -resize 30% $f resized/$f done Easier than Photoshop, I reckon! I needed this today for some photos I was uploading. Photos from recent cameras are huge and Australian bandwidth doesn’t cut it. So this really helps. Obviously you only need to do the first line once. I found this in the Ubuntu forums but it took me a while to find the right combination of keywords in Google. View the original thread. I needed to change …

Unix Time in MySQL and bash

David Nash bash, mysql 0 Comments

A quick one today. I was working on a mysql database that used unix timestamp produced by PHP’s time() function. I needed to be able to quickly convert this time to a human-readable format. In bash, date -d @timestamp is a quick way to convert. In a terminal shell eg: # date -d @1224992980 Sun Oct 26 14:49:40 EST 2008 In a MySQL client, you could also use select date(from_unixtime(column_name)) from table_name; Or if you want a little more flexibility in the output, for example outputting 27/02/09, you could do: select date_format(from_unixtime(column_name), ‘%d/%m/%y’) from table_name; This post is one of …