Todays entertainment

So this morning some shirty douchebag sends us the following in a help request ticket:

"This is 2011, please don't make life more difficult than it has to be by using ftp the logs users out before they even get started. Just make a web page. How hard is it to find someone who understands HTML? Really? You might try your local junior high. I'm sure they have reached that level by now."

Note that we tested this ftp server with 3 different browsers and 2 different file managers across all three common desktop OSes. It works fine. He could have politely explained he was having trouble with the ftp and we would have looked in to it but no, he had to be a dick about it.

So I marked the ticket resolved with the comment: "User is an idiot.", the moral of the story being that if you want someone to help you it helps to not be an arsehole to them.

Out-sciencing a Christian, not difficult

out-sciencing a christian

MEncoder rocks

Lately I've had a spate of making simple music videos for upload to youtube, painfully simple really. Just a jpeg + an mp3 but I found that creating these files in the GUI video editing suites I tried was painfully slow and not particularly good. So here's a little perl script that makes life a little easier:

 #!/usr/bin/perl
 use strict;
 
 my $outputdir = $ENV{HOME};
 
 my ($conf, $prev);
 for(@ARGV) {   
   if( $_ =~ /^-(i|a|l|o)$/ ) {
     $prev = $1;
     next;
   } 
   if( $prev ) {
     $conf->{$prev} = $_;
     if( $prev =~ /^(i|a)$/ && ! -f $conf->{$prev} ) {
       die "File: $conf->{$prev} does not exist. You have failed me for the last time.\n";
     }
     $prev = 0;
   }
 }
 
 if( ! $conf->{l} ) {
   my ($min, $sec);
   my $mtime = `exiftool '$conf->{a}' | grep Duration`;
   $mtime =~ s/^Duration\s+:\s?[0]?(\d?[:]?\d+).*$/$1/i;
   if( $mtime =~ ':' ) { 
     ($min, $sec) = split ':', $mtime;
   } else {
     $min = 0;
     $sec = $mtime;
   }
   $sec = 0 if $sec =~ /00/;
   $conf->{l} = ($min * 60) + $sec;
 }
 
 my $mcmd = "mencoder mf://$conf->{i} -ovc lavc -oac copy -audiofile '$conf->{a}'  -fps 1/$conf->{l} -ofps 30 -o $outputdir/$conf->{o}.avi";
 
 print "Executing: $mcmd\n";
 
 system $mcmd;
 

Note this depends on having exiftool and mencoder installed. The syntax is very simple: ./script -i '/path/to/image_file.jpg' -a '/path/to/audio_file.mp3' -o output_file_name

It defaults to outputting to an avi in your home directory but the file size is nice and small and works fine with youtube.