Posted by Cameron Stokes
on January 27, 2009
geek,
script /
No Comments
I’ve hosted a photo gallery in some form or fashion on my site for about as long as I’ve had my own domain. I first used Gallery and switched to zenphoto sometime last year for reasons I can’t remember now. Having close to 7,000 photos as of this post I was using up a lot of disk space on my host and was close to running out of available space. 7,000 photos isn’t an excessive amount but when each full-size photo is roughly 2 MB, it adds up. I decided the best way to free up space was to resize all of the photos down to the default view size of zenphoto and not allow the full-size versions to be viewed online. A quick test showed this would reduce the average photo down to about 100 KB, a significant reduction.
Having several thousand photos, I needed to find a way to batch resize them all. A quick googling found that convert from the ImageMagick software suite could do exactly what I needed. Using convert, find, and xargs I was able to put together a string of commands that found all of my images and converted them to the size I wanted:
find . -type f | xargs -i convert -size 480x480 {} -resize 480x480 {}
This command finds all regular files under the current working directory and calls convert on each file, resizing the photo, and replacing the original file. Be sure to have a backup of your photos in case you mistype any part of the command. Since convert is replacing your files you won’t be able to undo any files that are processed before you stop the command from running.
convert outputs an error when it encountered video or PNG files but kept processing the JPEGs normally. I found that when I ran this on images that had already been resized, convert wouldn’t resize them again or if it did the new file wasn’t affected as the file sizes before and after were the same.
I freed up over 9 GB on my host by running this. Going forward I’ll just run this on every new album I upload.
Tags: geek, script
Posted by Cameron Stokes
on December 25, 2008
geek,
travel /
No Comments
I’m in Smithfield, NC for the next day or so visiting my grandmother for Christmas. We’re in the Holiday Inn Express down the road which unfortunately does not have wireless internet even in 2008 even though it says it does. This has not stopped my brother and I from creating our own wireless internet by plugging in his laptop and using Mac OS X’s easy Internet Sharing configuration. I’m now surfing wirelessly and watching The Office from my Netflix Watch Instantly queue despite the hotel trying to keep us down. Oh yea…Merry Christmas!
Tags: geek, travel
Posted by Cameron Stokes
on November 28, 2008
geek,
random,
rant,
sun /
No Comments
I’ve had a geek crush on Sun Microsystems for several years now. Sometimes I find myself just browsing the Servers section of their website configuring different servers and imagining what I would do with ridiculous mounts of CPU power or storage. They make many cool products and technologies that continue to fascinated me:
- UltraSPARC T2 Processors – Highly scalable, energy efficient processors with Chip-Level Multithreading (CMT).
- Unified Storage Systems – Storage systems that scale up to 576 TB.
- Enterprise Class Servers – Systems that scale to 256 CPU cores and 2 TB of ram.
- Modular Blade Systems – Blade systems capable of running SPARC, AMD, and Intel blades all in one blade chassis.
- Sun Rays – True thin clients providing low cost, low footprint virtual display clients.
- OpenSolaris – An open source operating system proving to be a serious contender to Linux.
- DTrace – An open source dynamic tracing application giving insight into any running process with little overhead.
- ZFS – An open source “next generation” filesystem.
- Java – An open source, machine independent development platform.
- GlassFish – An open source Java application server.
Given all this, I am amazed at how poorly they do quarter after quarter, year after year. They bring in over $10 billion a year in revenue but make marginal income and little to no profit. I don’t see HP, Dell, IBM, or even Microsoft innovating in all these areas yet they’re all making money. So…what is wrong with Sun?
Tags: geek, random, rant, sun
Posted by Cameron Stokes
on August 29, 2008
geek,
google,
openbsd,
technical /
No Comments
I’ve been running my own email server for several years now and the biggest issues have certainly been dealing with spam. For the longest time I just put up with it and filtered manually. Then about 2 years ago I put in place an anti-spam gateway using OpenBSD and the excellent guide over at flakshak.com. This worked great. I was able to configure the anti-spam settings using SpamAssassin and tweak to my heart’s delight.
The biggest issue with this was managing the box(es) running the anti-spam software. We (I was running a hosting company at the time with two other people.) ended up filling up the various disk partitions with either massive email log files or SpamAssassin data as we added more and more users to the server. If we didn’t keep an eye on it, the disk would fill up, and the server would then die in strange ways. (Fortunately, we were running redundant OpenBSD servers with pf and carp so we often didn’t notice the server had died until we tried to login to it later.) Anyway, after shutting down the anti-spam servers and moving my personal server I had to figure out another way to deal with the spam.
I ended up using the same email server software as before and setup some forwarding rules following Using Gmail as a Spam Filter. This worked great as well but sometimes caused a delay in getting emails and given my setup I had to reconcile email in both gmail and my mail server. That is, marking items as read in my email server didn’t mark them as read in gmail as well, so I had to do it in both places…not a big issue but mildly annoying.
Fast forward a year or so and I’ve now moved my email hosting to Google Apps entirely. The process was a piece of cake though not as fast as I would have liked. After signing up, you have to prove that you own the domain you’re wanting them to host, either by uploading an html document that they specify or creating a sub-domain on your DNS server that they specify. This process seems to take about 30 minutes to an hour for them to verify though they claim it can take 24-48 hours. After this you have to enable E-mail for your domain which again takes about 30 minuts to an hour as they enable their email servers to accept email for your domain. Once this is done you just need to change your DNS settings so that your MX records point to Google’s servers. The process takes a couple hours, but it’s mostly waiting.
I left the email server running on my personal server for the next several days so that I could still get email while the DNS changes propagated out to everyone. About 7 days later I was still getting email to it, but when I checked who was sending it was mostly spam and the number of emails had dropped considerably. I decided to go ahead and shut it down and not worry about any other email coming in.
All in all, the setup process was painless. I no longer have to worry about running my own email server or dealing with anti-spam software. It’s no wonder why Google provides this, they now gets tons of information about me as they offer ads based on the content of my email. I may be paranoid, I don’t like Google knowing so much about me (certainly a topic for a future post), but they’ve made their services so enticing that it’s difficult to justify running my own server or paying someone else to do it.
Tags: email, geek, google, openbsd
Posted by Cameron Stokes
on August 10, 2008
geek,
update /
No Comments
Disaster! I plugged my BlackBerry in the other day and the glue around the 3.5MM adapter didn’t hold and the plug pushed right through the hole in the dash. After another trip to Home Depot I picked up some Loctite Superglue which seems to be holding strong.

Loctite Superglue
Tags: geek, howto, mp3 player, update