Using Hauppauge MCE remote with Arch Linux

Recently I shut down my Windows Media Center PC and it felt like the end of an era. I was no longer using its TV recording capabilities but mostly using it in my son’s room as a media receiver. Needless to say it seemed a bit of a waste so I finally just pulled it down and we have been using a Sony SMPN-100 that can easily be moved around the house wherever it is needed.

Fast forward a few weeks my son decided he wanted his own computer. I had the old Media Center machine sitting in a closet providing a nice home for a bunch of dust and a few spiders so it made sense to pull it out of mothballs. I knew it would easily plug into his TV as that is how it spent a majority of its life so I went about getting it reconfigured. I have recently switched my personal system over to Arch Linux so I thought it would be a good time to reload his machine with Arch and install XBMC on the machine so he could also have a media center when he is not playing Minecraft.

I quickly had Arch and XBMC up and running. Next I had the IR receiver and my old Hauppauge MCE remote hooked up and then trouble began. It would seem that the newer Linux kernels have baked in support for IR remotes out of the box which is definitely a plus, but there is not much documentation out there about getting it working correctly. Even without installing the lirc daemon the remote somewhat worked with XBMC  but not as I would have expected. I spent the better part of two days attempting to get it working as my remote of old. I googled, I read forums and every blog post I could find about lirc and getting it setup with XBMC. There may have been a little grumbling and swearing thrown in for good measure. No matter what I tried, running irw it seemed to pick the remote up as a keyboard.

Since my remote apparently had an identity crisis I decided to try a different approach; if the remote wanted to be a keyboard that was fine with me. The trick is finding the key map for the remote and reprogram in such a way it did what I wanted it to do. First I needed to find out what driver it was using for the remote by running ir-keytable.

Found /sys/class/rc/rc0/ (/dev/input/event5) with:
Driver mceusb, table rc-rc6-mce
Supported protocols: NEC RC-5 RC-6 JVC SONY LIRC other
Enabled protocols: RC-6

The important part here is to find out what key table the remote is using, in this case I am using the rc6-mce key table. Next I copied the key table in /etc/rc_keymaps/rc6_mce into my home folder and basically the next part is trial and error. I ran ir-keytable -t (which operates much like irw) and pushed the button I wanted to map starting with the OK button to find the key code. I would then push the button that worked in XBMC to find out what that key code was and then Ctrl-C out of ir-keytable and fire up an editor to modify the rc6_mce key map file in my area. I changed the KEY_OK to KEY_ENTER in this case and saved the rc6_mce file. Next I ran sudo ir-keytable -c to clear the current table and then reprogram the buttons with sudo ir-keytable -w ~/rc6_mce which loads my new key map. I tested to make sure it worked as expected and I was happy to have my OK button back. OK indeed.

Basically  just rinse and repeat for any key you want to map on the remote. Once I was happy with my results, I copied the rc6_mce keymap from my home folder back to  /etc/rc_keymaps so it would be reloaded at boot. I made a backup of the original rc6_mce key map file just to be on the safe side.

Hopefully that will save someone a little bit of time and heart ache.


Railo installer issues on Arch Linux

The Railo installer does a great job across multiple operating systems but it is not completely infallible (although it does come awfully close). The installer will complete, but there are two extra steps you will need to take to get things up and running smoothly on Arch Linux.

First, fire up your favorite editor and open up /opt/railo/tomcat/conf/server.xml and scroll down until you find the HTTP connector block. You will see something along the lines of “@@tomcatport@@” listed where the port should be. Replace this value with whichever port you want Tomcat listening on.

Next we need to move the railo_ctl file from /opt/railo/ to /etc/rc.d/, this is the folder that Arch Linux uses for its daemon services instead of /etc/init.d/ like Debian and RHEL systems use. Once the file is in there, chmod 0755 /etc/rc.d/railo_ctl to set the permissions on the file.

Finally, if you want Railo to startup automatically on boot there is one final modification to make. With your favorite editor open up /etc/rc.conf and add railo_ctl to the DAEMONS line and it will now start when you boot your machine.  You should now be ready to start Railo up, just sudo /etc/rc.d/railo_ctl start and you should be in business.

Using PostFix to send emails using Amazon SES

Of all the Amazon Web Services I use,  the Simple Email Service would have to be the service I use the most. ColdFusion allows me to easily create a component that sends emails pragmatically but, however, it would be much nicer to use the CFMAIL tag and be done with it. As it turns out, Amazon SES allows you to send a raw email so you can run PostFix  to relay the message through Amazon SES using a perl script.

I found a good tutorial on getting this configured here. I did have an issue getting perl to find the file, but this post details how to work around that issue. The great thing about handling it this way is other applications on the server can send messages through the gateway, not just ColdFusion applications.

Installing yasm on Amazon Linux

I am currently working on a project that requires me to build ffmpeg locally on an Amazon Linux instance.  I did a repo search and could find nasm, but ffmpeg didn’t like it at compile time.  Here is how to get yasm installed.  I am documenting this because I will probably need it again.  It is assumed you have already installed git-core.

git clone git://
cd yasm
./configure --prefix=/usr 
sudo make install

Git is a handy little tool.

Installing s3fs on RHEL/Centos

Lately I have been doing a lot of work with AWS t1.micro instances running Amazon Linux which seem to be based on RHEL/Centos.  Both Railo and ACF do a good job of interacting with Amazon S3 storage which definitely makes our jobs as developers easier, but what if you wanted to mount your S3 storage locally to have access to your files at the system level so you could actually work with them?  Luckily there is an open-sourced s3fs project that will allow you to do just that.

At the time of this writing, the current file release is s3fs-1.59.tar.gz.  The unfortunate thing is, s3fs requires Fuse 2.8.4 and the newest version available in the package repos is Fuse 2.8.3.  The first step is to get the newest version of Fuse and get it on the server.

wget ""

Once the download is completed, extract it:

tar -xzvf fuse-2.8.4.tar.gz
cd fuse-2.8.4

If you are still on a stock install of Amazon Linux, at this point we will need some tools to get everything configured and compiled.

sudo yum groupinstall "Development Tools"

This will install the tools we need for a moment.  However, we will need to install some more packages to get s3fs to compile.  We might as well get them now:

sudo yum install curl-devel libxml2-devel openssl-devel mailcap

Now we should still be in the the fuse-2.8.4 directory, so now it is time to configure and compile Fuse.

./configure --prefix=/usr
sudo make install
sudo ldconfig
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
pkg-config --modversion fuse

If everything went as planned, pkg-config should return 2.8.4.

Next we need to download and install s3fs.  First we need to get and extract the archive:

tar -xzvf s3fs-1.59.tar.gz
cd s3fs-1.59
./configure --prefix=/usr
sudo make install

The installation should now be in working order.  The next step will be to decide how you would like to create your password file for s3fs.  You can either create a site wide password file /etc/passwd-s3fs or you can create one just for your user account ~/.passwd-s3fs.  The files are required to be secure, so if you go with the system wide password file be sure to chmod 640 /etc/passwd-s3fs or if you want to use your user account, chmod 600 ~/.passwd-s3fs.  The format for the files is the standard [AccessKey]:[SecretKey].

Finally, lets map the drive to a local directory.  In my home directory I created a folder name s3storage that will be my mount point.  We create the mount with

s3fs [bucketname] ~/s3storage -o default_acl=public-read

I have only set this up on one machine so I still do not have the install down completely, but I was able to get this up and running successfully.  All the steps above are more or less from memory so I apologize for any hazy steps.  I will correct as needed.

Speeding up Aptana Studio 3

My IDE of choice when developing is Aptana Studio.  I was setting up a new install last night on a Windows development machine and it seemed like it was a little “sluggish” (yes, that is a technical term).

After some quick Googling I found Mike Henke’s post on Turbo Charging Eclipse.  Since Aptana is built on top of Eclipse this is just what I was looking for.  Mike’s guide is pretty dang comprehensive and I will not reiterate it but if you are looking for some performance gains I would consider it recommended reading.

Admittedly, I did not go through all the steps he outlined.  I made some “best guesses” based on my system configuration and went with it.  Here is my current AptanaStudio3.ini file for Windows, although the same optimizations should work equally well on Linux.

Aptana Studio 3

The end result, Aptana definitely feels like it has a little more pep in its step.  I do not have any benchmarks or hard quantitative data to back that up, only my personal experience.

FireSSH plugin for Firefox

While scanning through my news feeds this morning I found a cool plugin for Firefox called FireSSH that, as the name alludes too, allows you to SSH to a host from your web browser.  Once the plugin is installed you can paste an SSH address in the url bar and go.

Now I just need to find something like this for Chrome.