Bulk Image Resizing with I

I was recently tasked with resizing a large group of images to post online. The original images were to large both in file size (to long to download over dial up) and physical size (images went of the edge of screens).

To do this I went to my trusty command line and used www.imagemagick.org. Image Magick comes with the wonderful convert tool. Using convert I have made jpg’s into gifs and mtiff’s into gif’s. But I have never used to resize and compress before. Lucky me there is a huge list of options. I even thought about watermarking the images (copyright info) using convert but decided against it.

To start I figured out how to resize then how to compress. The final command line option I came up with was:

convert input.jpg -resize 50% -quality 50 output.jpg

I then proceed to do this in a shell script, which took a few minutes to run, but still hours faster than I could ever do with photoshop or the GIMP.

#!/bin/bash
for x in `ls`
do
   IMG=`echo $x | awk -F. '{print $1}'`
   echo $IMG
   convert $IMG.JPG -resize 50% -quality 50 ${IMG}_bp.jpg
done

Now there is a bunch of resized images ready in minutes. The input images were all of form FILENAME.JPG the output were all the form FILENAME_bp.jpg

Questions about hosting images should go to brockp@mlds-networks.com.
The images can be found at the: Michigan Jersey Cattle Club

Xen acm.so: undefined symbol: Py_InitModule4

When doing some updates on a few servers I have that run Xen I ran into a few errors. This is just some notes about how to fix the problem

After doing the updates I noticed that the Xen proceses were not started up and that none of the Xen commands work. The errors being:

  File "/usr/lib/python/xen/util/security.py", line 25, in 
    from xen.lowlevel import acm
ImportError: /usr/lib/python/xen/lowlevel/acm.so: undefined symbol: Py_InitModule4

The reason for this is python, which Xen relies on heavily was updated from 2.4 to 2.5. I had the old Xen source around so I could rebuild xen but I did not want to take the risk of borking the systems which are physically over an hour drive away. Turns out though all you need to update is the xen user space tools and deamon. The hypervisor and kernel do not need to be rebuilt.

cd xen-3.0.4-1
make clean
make tools
make install-tools
/etc/init.d/xend restart

That is all. Quite simple. Note these are old machines used for testing, do not run such an old version of Xen.

Server Failure

Over the weekend I had one of my active servers go into a strange state and take all its virtual machines down with it.  Well no big deal thats why i use Xen and DRBD.  If the active machine dies all data is current up till the failure and all virtual machines can start on the backup.  The problem though is I don’t have any type of fencing.  Fencing isolates a server so that it never tries to access any type of shared disk or claim virtual IP’s that it should not use server bad data etc.  This is needed when a failure is not clean.  Well this failure was far from clean.  ssh was dead to everything (other than the backup) mail would make connections but not show a banner, web was dead but pingable, and database was up just fine.  

Well this means I would not safely bring up the secondary as active or risk corrupting data and all the other badness related above.  In this situation I chose to leave services down until physical access was available to safely fence the server. 

I think now I might do a RFQ for ether a new switch that I can down ports or a power system with switchable power so i can STONITH.

 I think I made the right choice.  Most my customers are dairy based and they had proofs this last week which is a big time of the year, it’s like earning reports for wall street, big deal.  Well those proofs were all tied up in a dead server.

Everything is backup now, you can read the ‘official’ notice at www.mlds-networks.com
 

Libery Names of America

These guys are a scam folks. If you get a letter from these guys saying you need to send them $29.00 don’t do anything. If you really want to be sure call who you did buy your domain name from and ask them but they will tell you the same thing I am ‘don’t do it’.

Now for those of you who don’t know what this is. Domain names are names like ‘www.mlds-networks.com‘ and these names cost money. I get mine via Yahoo for about $10/yr. Now these names can be transfered, I could transfer my domain from Yahoo to Liberty Names if they had a better rate or I had problems with Yahoo (I don’t I love them).

Well this Liberty Names is sending out forms to people who own domains (it’s public record) with forms that looks and are worded as, it’s time to renew here is how much it costs and we want to hear from you by this date.

Well thats fine you have to renew your names every so often and pay the fees but to send these things out is evil. Now professionals like my self have no issue seeing this is fake but as access to such things like domain names because available to the general public these kinds of scams start and some people I am sure are being ripped off. Now not to toot my own horn but the best way around this is to not do it all your self but to find a pro to work with for your website/email/dns.

Bad Dell Bad!

I think I am attracting bad quotes this month. About a year ago i purchased two new Dell servers for www.mlds-networks.com that cost me around $1200 new.  These systems came with 1 year on site next day warranty.  Now this is standard for servers and buissnes related products.  This is much better than any consumer warranty which are also only 1 year unless you buy extra.

Now everyone is the computer industry knows that computers loser value faster then just about anything on the market.  A system you buy today you could be lucky to find 1 year from now because the cost of parts has dropped so much and performance would be double for the same price or less.

Now Dell has called and emailed and snail mailed me more things on ‘BUY EXTENDED WARRANTY NOW!!’  Now I almost never buy these things but if they are a good enough deal Ill bite.  I request a quote.

$1,655.04 for 4 years.

Well I only planned for the servers to last 3 years before I replace them but hey why not 5 years! Please people this is more than I paid for the hardware that in 2 more years is worth about $200 if new (its not now). Also I purchased two because I run these machines in a active passive form so that if one fails the other takes over.  Not a single machine is critical and both systems are built from parts I can buy at Best Buy etc.

Well you can guess by now that the machines are out of warranty and will stay so until I pull office space of them. 

plants