Hauppauge WinTV-PVR 150 MCE remote

I recently purchased a Hauppauge WinTV-PVR 150 MCE (media center edition) kit for my mythtv box. Everything was pretty smooth using Knoppmyth R5A30 except the damned remote which refused to work. The remote that comes with this kit is described online as an MCE 2005 remote. It has RC6 printed on the back (I think its made by phillips) and the IR receiver is labeled SMK on the bottom.

I saw that the receiver was picked up by the kernel (dmesg) but the remote wasn’t passing any characters to mythtv. I started lircd and ran ‘irw’ to see what (if any) data was comming in from the remote. Nothing. So then I did a ps aux|grep lirc and realized that lirc wasn’t running. After another restart and the lirc process going away I took a look at the lirc rc script under /etc/init.d/lirc .

To get my lircd working properly I changed the following line in /etc/init.d/lirc :

start-stop-daemon –start –quiet –exec /usr/sbin/lircd — $LIRCD_ARGS \

to:

start-stop-daemon –start –quiet –exec /usr/sbin/lircd \

A simple /etc/init.d/lirc restart did the trick. Now running irw confirmed that the remote was sending data to the system properly. Woopie! More MythTV updates as I continue to get this system working. A proper MAME setup is next.

EDIT: For those of you that have been asking for my lircd.conf file, here it is.

Windows usernames with spaces and Samba

Recently I had an issue where a windows user needed access to a samba share on a unix machine. The problem was that the windows user had a username with a space in it (tisk tisk) and unix/samba couldn’t directly support that. A quick workaround is to define a usermap in your smb.conf like so:

[global]
username map = /usr/local/private/usermap.txt

In the usermap.txt you define the username as follows:

username = “User Name”

Where username is the local unix username and “User Name” is the broken windows username with the space. It’s important to quote the username, otherwise samba will treat it as two different usernames. This isn’t the only use for samba usermaps but I was unable to find a well documented example of supporting windows usernames with spaces in them so hopefully this will save someone else time in the future.

The coolest application I’ve seen in a while

Do you have two systems on your desktop and two sets of keyboards and two (or three in my case) monitors? Want to use one keyboard and mouse on both systems without hardware? I’ve stumbled across a cool multi-platform app called Synergy that lets me use one keyboard and mouse on my Windows and Linux system at the same time!

The server app runs on my windows laptop (dual head) and the client side runs on my linux desktop. Now I can use the nice $120 Logitech wireless keyboard I have on both systems without any extra hardware. I simply move my mouse pointer over to the left hand side of my windows machine and it switches my keyboard over to the linux machine, without delay (although you can configure one). Very cool. It’s made my day for sure!

Using apache mod_rewrite to support multiple subdomains in the same virtual host

Here’s a trick for redirecting multiple subdomains like sub.domain.tld to www.domain.tld/sub.

ServerAdmin webmaster@servername.tld
DocumentRoot /home/www/domain.tld/html
DirectoryIndex index.php index.htm index.html
ServerName domain.tld
ServerAlias www.domain.tld
ServerAlias subdomain1.domain.tld
ServerAlias subdomain2.domain.tld
RewriteEngine On
RewriteCond %{HTTP_HOST} ^subdomain1\.domain\.tld$ [NC]
RewriteRule ^(.*)$ http://www.domain.tld/subdomain1$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^subdomain2\.domain\.tld$ [NC]
RewriteRule ^(.*)$ http://www.domain.tld/subdomain2$1 [R=301,L]

This comes in handy if you want to support multiple subdomains in the same apache virtual host. All the subdomain pages can then be stored under DocumentRoot without creating different virtual hosts.

Quick and dirty remote unix backups

So you need to backup a remote unix system but don’t have enough free disk space to tar locally and then tranfer? Try this!

ssh username@hostname.tld “tar -zcvf – / –exclude /proc –exclude /dev ” | cat > my-system-backup.tgz

This is a breakdown of what this does:

– Starts an ssh session with your remote system (hostname.tld)
– Executes tar -zcvf – / –exclude /proc –exclude /dev ( the exclude statements ensure we don’t grab bits we don’t want, /proc for sure)
– Since tar has – as the filename it pipes the output to the shell, which in turn is piped into cat
– The > redirects the output into a filename of your choice, the .tgz indicated Gzip’d tar file, you can name it whatever you like but .tgz is a standard.

The above command will backup the entire system but you can specify any path, a simple . will backup all your home dir contents on the remote system. I have found this handy on several occasions when I needed a quick and dirty backup of some files on a remote host. Backups to the remote hosts local disk aren’t much good if the system goes down!