A web developing, photo taking, Muay Thai fighting man.

SPL Champions 2009

Posted: May 25th, 2009 | Author: James | Filed under: Photography | No Comments »

SPL Champions 2009, originally uploaded by WeeJames.

Taken at the title party at Ibrox.


Title Party

Posted: May 25th, 2009 | Author: James | Filed under: Photography | No Comments »

Title Party, originally uploaded by WeeJames.


Pushers in the Park

Posted: May 24th, 2009 | Author: James | Filed under: Photography | No Comments »

Pushers, originally uploaded by WeeJames.


Clyde Sunset

Posted: May 17th, 2009 | Author: James | Filed under: Photography | No Comments »

Clyde Sunset, originally uploaded by WeeJames.


Count the Number of Files in a Directory in Linux

Posted: May 15th, 2009 | Author: James | Filed under: linux | Tags: | 3 Comments »

Again, part of the ‘need to write this down somewhere cos i’ll need it at some point in the future’ series – counting the number of files in a directory in Linux.

ls -1 | wc -l

Batch Processing Images in Ubuntu with Image Magick

Posted: May 15th, 2009 | Author: James | Filed under: linux | Tags: , , | No Comments »

The main point of this blog post is so that I have a resource next time I need to do this job. I’ve recently been presented with thousands of images that need to be converted to different sizes and didn’t really want to go to the hassle of installing some 3rd party utility or writing a script.

ls *.png | xargs -I {} convert -thumbnail 200 {} thumb.{}

You can add whatever arguments are required to the convert command.  In this case i’ve specifed a thumbnail with a width of 200px.  The brackets {} represent the file you’re operating on so in the example above the new image has thumb. prepended to the filename.


Hosting Sites with Heavy Traffic on Amazon EC2

Posted: May 8th, 2009 | Author: James | Filed under: Web Development, Work, linux | Tags: , , , , , , , | No Comments »

I mentioned previously that I’d been looking at Amazon EC2 as a solution to host a site that underwent heavy bursts of traffic for only a couple of hours a week. The expected traffic bursts were 10-15k visitors in a 2 hour period and unfortunately a small EC2 instance just wasn’t enough. The next trial was with a large EC2 instance, with Apache tweaked to allow more simultaneous connections. Results went better than first time but I ended up having to bounce Apache a couple of times during the time frame to get it back up and running.

So fast forward to this week and it was time to try again. This time I went with an Extra Large instance running a stock 64-bit Ubuntu 8.04 and Lighttpd instead of Apache. And this time there were no problems. For the full 2 hours the site remained up and responsive, and because I could time the instance to come up just before the additional cost was negligible.

To give you an idea of the kind of traffic it had to deal with, the site took in just over 25,000 unique visitors in a 2 hour time frame. Glad to get the problem solved and now I know what to do next time I need some heavy traffic handled.