Posting Audio on YouTube with background Image

I was going to post my podcast on youTube, maybe someone random would run across it why not.

This process had some needs, I needed to make a video, out of audio. To make it less boring I took my RCE logo as a static background image. To do this I went to my usual tools mencoder and ffmpeg. Turns out mencoder did what I needed though not easy.

Mencoder has an easy way to make a video out of a sequence of images, if you use just one image, you get a 1 second video with 1 frame (fps set to 1). To get around this, you could just set the frames per second to 1/runtime of your mp3. But while it would encode it, things like QuickTime crash (includes finder which I am proud of breaking).

The solution (given to me by roo on the IRC channel) was to make that 1 second video, copy it in 5 times to make a 5 second video, use that 5 times to make a 25 second etc. Retarded I know, but it worked. I made a small (dumb) script that automates this. It uses madtime to find the time needed, some math, mktemp and your on your way.

Download the script form the usual location buildyoutube.sh. And see the results on my ….., well I would after I went though all this work, went to upload to youtube, remembered, they don’t allow public videos more than 10 minutes long, damn.

Anyone know how to get more than 10 minutes allowed on youTube?

Amavis-new Quarantine Release

Mostly notes for myself on how to release mail from the Amavis Mail Quarantine. To do this you need to know the layout of your quarantine, have AM.PDP enabled by Unix Socket in the Amavis-new deamon and have the mail id.

Enable AM.PDP, is quite simple, use the following code in amavisd.conf:

$policy_bank{'AM.PDP-SOCK'} = {
  protocol => 'AM.PDP',  # Amavis policy delegation protocol
  auth_required_release => 0,  # don't require secret_id for amavisd-release
};

Note auth_required_release is 0 (False) for me, because my mail server is not accessible by normal users, not only that buy my amavis socket is walled of by regular unix file permissions for any user but the mail admin user. Once you have added this code run

amavisd reload

To restart amavis-new.

Using amavisd-release requires knowledge of the amavis quarantine directories. These are customizable, so check first. If you don’t have the format right, amavis may return a cryptic error:

450 4.5.0 Failure: SQL quarantine code not enabled at (eval 63) line 340,  line 4.

Example:
If you break up quarantine types into buckets as I have:

$QUARANTINEDIR = "$MYHOME/quarantine";
$spam_quarantine_method           = 'local:spam/%m.gz';
$banned_files_quarantine_method   = 'local:banned/%m';

You have to pass the bucket (directory) name to amavisd-release:

amavisd-release spam/kAiuhY2-fB7x.gz
amavisd-release banned/UctrJo0mH2Wf

If other formats are used like ‘local:spam-%m’ use the name of your format. Look at your $*quarantine_method variables in amavisd.conf. Also don’t forget that cron job for removing quarantined mail after it is over a given age, find -ctime will do nicely.

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