Wednesday, November 22, 2006

Why MythTV?

I've been doing some more reading, and it seems that MythTV is a logical choice for the Home Theatre PC I want to put together. Here are some of the features offered by MythTV:

  • Basic 'live-tv' functionality. Pause/Fast Forward/Rewind "live" TV.
  • Support for multiple tuner cards and multiple simultaneous recordings.
  • Distributed architecture allowing multiple recording machines and multiple playback machines on the same network, completely transparent to the user.
  • Compresses video in software using rtjpeg (from Nuppelvideo) or mpeg4 (from libavcodec). Full support for Hardware MPEG-2 encoder cards (Hauppauge PVR-250 / PVR-350). Preliminary support for DVB cards and the new pcHDTV tuner card.
  • Support for the (very nice looking) hardware MPEG-2 decoder and TV out present on the Hauppauge PVR-350.
  • Completely automatic commercial detection/skipping
  • Grabs program information using xmltv.
  • A fully themeable menu to tie it all together.

Here's what it looks like (the above info and the below screenshot are taken from the MythTV website):


All in all, this looks like a pretty good system. Of course, my wife will insist that it's aesthetically pleasing as well, and that could be more of a challenge...

DIY Home Theater

Last night I realized that I am using a VCR that is older than my oldest child, and she hits the double digits next year.

I'm getting old.

Rather than wallow in self pity, though, I decided to focus my energy into something productive. It's time to do away with the elderly analog VCR and try building a Home Theater PC. I've been thinking about this for quite some time, and believe it's time to give it a go.

Although I don't have the specifics worked out, I am certain that MythTV will be a component of the final mix. This is a free, Tivo-like package that does not require a subscription.

Besides, I think that getting my Asterisk system working is going to take awhile. I need to have a success of some sort in the meantime.

Tuesday, November 21, 2006

Interesting Add On for Asterisk

While planning for my Asterisk install, it occurred to me that someone has almost certainly already built and released an open source project for web based administration of the server. While I have by no means completed my research into this topic, I did stumble across a very nice package called VoiceOne. This seems to be almost exactly what I will need.

Here is a sample screenshot of the application. It looks very promising.

Asterisk update

I've been doing some more reading about the hardware requirements and options for setting up an Asterisk PBX, and came across this information:

"If you build an Asterisk system without the need for PCI cards, you have a much greater set of choices for what kind of computer to run Asterisk on. If things are configured correctly, the ATAs are handling all of the load for coding/decoding digitized streams of voice to/from analog. You have a better chance of being able to successfully share a computer for asterisk and some other tasks. There are some great choices in small form factor computers. It's even possible to run Asterisk on a Linksys WRT54GS, but that box is a bit too underpowered for a full featured Asterisk configuration. Linksys also sells ATAs with firmware from Sipura. Now it's been announced that Linksys is buying Sipura. I haven't seen any reports on hacking the version of the WRT54G with the embedded ATA yet, but I'm hoping we might see some pretty cool things soon."

Please note that I fixed some spelling errors in this prior to putting it here. I can't help it; the English prof in me takes precedence over the nerd from time to time. Anyway, it sounds a lot like the external box (i.e. the Linksys - Sipura SPA-3000) might be a better solution given that I'm using older hardware for my home installation of Asterisk. After a bit of browsing, I found an excellent price on one here, in Canada. I'm tempted to try this using my Linksys WRT54GS router, but since that's currently connecting my antenna to the Internet, I might be asking it to do more than it can.

Monday, November 20, 2006

Automatic Backups with rdiff-backup

I finally got around to finishing my backup scripts. My goal was to have off site backup of machines on my internal network to a remote location, through a secure tunnel established with OpenVPN. I elected to go with rdiff-backup, as it permits nifty features like point-in-time recovery (i.e. restore this file/directory/whatever as it was on a certain date at a certain time). I set up a machine in the same physical location as the servers I wanted to back up as a primary backup server (so as to permit speedy recovery without having to go through the tunnel), and then backed up once a day off site to the remote machine.

It turned out to be pretty easy.

The first step was to allow automatic backups without human intervention. The way that rdiff-backup works is actually pretty cool. You establish a connection to the remote server using some login facility such as telnet, rlogin, or ssh (I went with ssh for obvious reasons -- it's the most secure), and then execute the rdiff-backup program on the remote machine, telling it to send the files across the network to wherever you want them backed up. This means that rdiff-backup has to be installed on both the "server" and the "clients". Installation is a snap.

The next step is to create a "backupuser" account on all machines, and use Public Key Infrastructure (PKI) to permit secure unattended logins.

This is relatively simple. First, create the account on all machines (i.e. adduser command). Next, generate a public/private keypair for the account as follows:

trolius> ssh-keygen2
Generating 2048-bit dsa key pair
1 oOo.oOo.o
Key generated.
2048-bit dsa, user@Local, Wed Mar 22 2002 00:13:43 +0200
Passphrase :
Again :
Private key saved to /home/backupuser/.ssh/id_dsa_2048_a
Public key saved to /home/backupuser/.ssh/id_dsa_2048_a.pub


Note that you might get slightly different feedback depending on your version of OpenSSH. Next, rename the generate private and public keys to whatever your OpenSSH requires them to be (hint: read /etc/ssh/sshd_config for a clue). Copy the keys to the remote machines, and log into each once so that you can say "yes" when prompted as to whether or not you want to accept the keys.

Finally, back everything up! These commands will do it for you:

/usr/local/bin/rdiff-backup \
backupuser@192.168.0.16::/home/httpd \
/backup/luther/httpd
Note that the slashes (\) are there to keep the command from going out of the text area on the blog; you can use them or not, as you wish, when you type the actual commands. This command backs up /home/httpd on "luther" to /backup/luther/httpd on the machine which originated the command (i.e. the one that is receiving the backup).
rdiff-backup -r 3D /backup/luther/httpd/somedir/ \
/home/backupuser/tmp/
This will restore the entire "somedir" directory to the local directory /home/backupuser/tmp/ as it was three days ago. The "r" stands for "restore as of". You can use a variety of formats to specify date, time, etc. Other acceptable time strings include 5m4s (5 minutes and 4 seconds) and 2002-03-05 (March 5th, 2002).

I ran the backups once, to ensure that everything is backed up, and then added each command as a crontab in /etc/crontab to run it hourly on the "primary" backup server. I then added similar entries on the crontab of the remote backup server, to run once a day at 4:00 AM.

Couldn't be simpler, and I can sleep better at night knowing my data is stored redundantly.