Archive for the ‘North Star Labs’ Category

Quick Ruby Upcase Filter

This is a real quick one. I noticed uuidgen under linux produces lower case strings, while it’s Mac OS X counterpart produces uppercase strings. I generate UUID’s for the certificate CN field in Puppet, so I wanted them to match.

This one-liner did the trick nicely.

uuidgen | ruby -pe '$_.upcase!'
 

Adobe Flash Player Handles MPEG-4/AVC H.264 Video

Adobe Flash 9 IconI noticed in my RSS feeds recently that the new version of the Adobe Flash Player browser plug-in supports H.264/MPEG-4 AVC and AAC audio, but I didn’t think much of it at the time. As it turns out, I’m really happy that Adobe supports standard MP4 files accessible through plain HTTP, as it cuts out the proprietary Flash Video (FLV) format.

Macs are wonderful when creating rich media since they now ship with iMovie, and relatively inexpensive tools such as ProfCast are out there. This rich media derives a lot of value from being represented in standard formats such as MPEG-4 AVC (H.264) video, and AAC audio, all rolled up into the standard MP4 container. However, it turns out to be incredibly difficult to publish this standards-compliant media to a web page player that “just works” like Youtube.com.

Until now, the only viable way to embed this content in a web site was to use the quicktime plug-in, which is a bit heavy for the task. With the most recent versions of Flash Player 9, we now can directly play high quality videos, in a standard format, produced with free tools.

Here’s an example using Jeroen Wijering’s excellent, and free (Creative Common’s Licensed) Flash Video Player. Check out how nice “The Machine is Us/ing Us” looks, compared to the Youtube version at: http://www.youtube.com/watch?v=6gmP4nk0EOE

The code for this is relatively simple, though a bit of a pain to get formatted correctly. And by “bit” I mean, it took me hours. If I start to do more video content, I’ll definitely look into a plug-in so the blog handles these details.

<embed src="/blog/flvplayer.swf">
  allowfullscreen="true"
  allowscriptaccess="always"
  flashvars="&displayheight=350&file=/blog/media/WeschWeb2v3.mp4&width=420&height=315"
  align="middle" height="315" width="420" />

The video is a conversion from a high quality Quicktime file to standard H.264/AAC video.

Hopefully we’ll start to see higher quality videos up on Youtube now. In the meantime, you’re able to do it yourself if you need to publish higher quality video in an easily accessible manner.

 

Trac: IntegrityError

TracRecently, I’ve been getting Trac: IntegrityError exceptions on my Trac 0.10.3 installation, which I use to publish scripts and code in the knowledge base. It didn’t take me long to figure out what the problem was, based on the information in Trac Ticket 4586 and 4043.

It did take me a bit longer to work around the actual problem, however. I’ve upgraded track to 0.10.4, and issued the following two commands:

trac-admin ~/nsl/var/svntracs/northstarlabs upgrade
trac-admin ~/nsl/var/svntracs/northstarlabs resync

Substitute in the full path to your trac project directory, and you should get back up and running quickly.

Thanks to chxo.com for publishing this quick fix.

 

Restarting Apache on Bluehost

I have a dedicated IP address on a shared hosting server from bluehost.com. This setup is working well for me; my goal is to run a subversion server with public http and https access, authenticated users for commit access, Trac project management, and a blog. The only issue I’ve really run into is bluehost binds to port 80 and 443 with their virtualhost apache server, so even though I have a dedicated IP, these ports are already bound. As a result, I simply run the subversion server on an alternate port.

Sometimes, however, my custom build of Apache would die off and the subversion server would be down. I wrote a small bash script and configured my bluehost account to execute this script fairly frequently to make sure apache is always running. A bit dirty, but it works. If you running a similar setup, you may be interested in the apache restart script.

The script is: check_httpd.sh.