Interphero Miscellany

Hopefully something good will come of this…

Interphero Miscellany RSS Feed
 
 
 
 

How to Set XBMC to Auto Update the Library

It should come as no surprise that XBMC has great library functionality.  And its skinning ability has allowed third-party developers to display the myriad of information contained within the library with great effect.  Library management is fairly easy with one HTPC running XBMC, but it can become more time-consuming as that number increases.  XBMC used to have an option to essentially constantly update the library.  Even with enabling this functionality in the settings file, I was unable to get it to work (I keep my media on Samba share, so this may have to do with it).

But, you can also schedule updates to occur using cron.  This method offers an additional benefit if you are running XBMC on a limited-resource machine, such as an Acer Aspire Revo, in that you can schedule the library update to occur when you are not using the machine.  I accomplished this by dumping a script into the /etc/cron.daily/ folder, however, you can make an actual cron tab entry if you prefer to customize when the library update runs, or if you would like it to run more or less than once per day.  But, to get this working, you will need to install the xbmc-eventclients-xbmc-send package:

sudo apt-get install xbmc-eventclients-xbmc-send

After installing, the following command will cause XBMC to update the video library:

/usr/bin/xbmc-send -a “UpdateLibrary(video)” >> /dev/null 2>&1

Note, that you can also update the audio library by replacing “video” with “audio.”  As noted, this command can either be added to your crontab, or as a script in one of the /etc/cron. directories.  Enjoy!

Google Now Offers DNS Service

Google has just added DNS to its public (free) services.  I was previously using OpenDNS, but I’ve decided to give Google’s service a try:

http://code.google.com/speed/public-dns/docs/using.html

Fixing “Lock Screen” in Ubuntu 9.10 (Karmic)

So far my experience with Ubuntu 9.10 (Karmic) has been great.  I find it noticeably quicker as well as more attractive visually.  That’s not to say that it is without issues.  For example, after the upgrade the “lock screen” function was broken.  After digging around a bit and trying to lock the screen from the command line I found the following:

user@interphero:~$ gnome-screensaver-command –lock
** Message: Screensaver is not running!
user@interphero:~$

The “lock screen” functionality is part of gnome-screensaver, and for some reason, gnome-screensaver was no longer being started with Gnome.  I fixed this by adding gnome-screensaver as a startup application by going to Main Menu->System->Preferences->Startup Applications.

Linux KVM and VNC: Keep Your Pointer Straight

KVM allows you to run virtual machines on a Linux machine.  One of the great features is provided by the ‘-vnc’ flag, which allows you to run a virtual machine headless, i.e., without a graphics adapter, while still being able to connect to it through VNC.  One issue that I have encountered, especially on Windows virtual machines, is that the mouse pointer in the VM does not always line up with your actual mouse pointer.  Luckily, this is easily correctable.  To fix it, add the following flag to your kvm command when starting the virtual machine: ‘-usbdevice tablet’.

Seagate Barracuda Hard Drives: Upgrading to the SD1A Firmware

I am a bit behind on this issue, but essentially, Seagate Barracuda 7200.11 hard drives had some issues with certain firmwares bricking the drive.  When the error appeared, the drive would no longer be recognized by the BIOS, making subsequent firmware upgrades impossible.  Although I have been running a RAID-5 array of five of these drives for over a year, I was finally caught by the bug after a reboot, when my RAID-5 array came up in degraded mode.  Seagate’s warranty process was relatively straight forward; I paid the $20 fee to have a new drive sent via 2-Day UPS, in a hard drive shipping container with a return-postage label.  I was a bit ticked about paying the fee, but it saved me a lot of headaches regarding finding a suitable shipping container.  I also avoided having to wait for them to receive the defective drive, after which they would mail out the new drive.  My goal was to have the array in degraded mode for as short of a period as possible, to avoid having a second drive fail before it was repaired.

As I noted above, this issue occurs when the computer is rebooted, the drives won’t just drop off of your SATA controller.  As such I wanted to repair the array without rebooting the machine.  First, I had to determine which drive was actually down/damaged.  To do so, I used the following command on each of the drives in the RAID array:

dd if=/dev/sdX of=/dev/null

I ran this command for each drive, while watching the hard drive activity lights on my RAID enclosure.  Alternatively, I could have run a similar command for the RAID array itself:

dd if=/dev/mdX of=/dev/null

The drive that doesn’t show activity is the one that needs to be replaced.  After pulling the drive and replacing it with the replacement from Seagate I hot-added it to the system, once again, to avoid rebooting the machine and potentially having another drive fail.  To do so, I used the scsiadd command, for which you can find an article here.  I stepped through each channel, trying to add the drive; note that selecting an empty channel won’t break anything.  To verify that the drive has been added back in, you can run:

ls /dev/sd*

If the drive was added by scsiadd, you should have a new entry.  After this I was able to format the drive and add it back into the array.  As for the other drives, I needed to upgrade the firmware from SD15 to SD1A, with the exception of the replacement drive, which already had SD1A installed.  I used the following guide, which explains everything much better than I could.  Once again, I used the tricks above to figure out which drive was which prior to using scsiadd to remove it from the system.  At this point, all of my drive have been updated to SD1A and I am **hopefully** safe.

I was late to update the BIOS on these drives and in many ways, I was lucky.  I didn’t do it sooner because I had been running them for more than a year without issue.  I believe that I got by for so long because I use the drives in my server, which is not rebooted often, at least relative to your standard desktop.  Moral of the story: if you haven’t done so yet, update your firmware to SD1A.

If you are uncertain about which firmware you are running, various tools will display it:

scsiadd -p

smartctl –all /dev/sdX

New to the blog: Commentary

I have decided to broaden the scope of my blog to include my commentary/humor related to current events, as well as long-standing issues.  In addition, I will be revamping the site to separate out “commentary” from the core “technology” content.

DVD Playback Issues with XBMC

I typically archive my DVDs to MPEG files prior to playing them back in XBMC, so that they are displayed in my library.  And for some reason, I would use the DVD player on my surround receiver to playback DVD rentals, as opposed to using XBMC.  Last night I finally decided to use XBMC to play a rental, when to my surprise, it wouldn’t play the disc!

For background, I installed XBMC over a minimal Ubuntu install, done with the server edition.  As such, I don’t think that some of the multimedia related files were installed.  A quick review of the XBMC log file (~/.xbmc/temp/xbmc.log) showed errors relating to a UDF library.  UDF is the disc format used for DVDs.  To resolve the issue, I installed two packages:

sudo apt-get install udftools libudf0

Note, I believe that udftools would have been sufficient to resolve the problem.  From then on, XBMC automatically starts playing a DVD upon insertion.

Check your Server’s Pulse with Twitter

I had a problem – a remote server that I couldn’t check the status of.  It is located a friend’s house and I would occasionally lose contact with it.  Sometimes it would be down (he apparently doesn’t have reliable electricity) and I wouldn’t notice it for a week or two.  This server acts as my remote backup server, so I didn’t want to potentially miss an important backup run.

While others view Twitter as a great social networking, Web 2.0, whatever, I see it as a free update/status server.  Several folks have talked about updating Twitter from the command line:

http://lightlinux.blogspot.com/2009/06/twitter-updates-from-linux-cli.html

http://www.junauza.com/2009/03/follow-me-twitting-from-linux-command.html

I decided to use curl (as described in the blogs above) to setup a heartbeat from my remote server.  Essentially, every half hour, the remote server sends out a tweet with its full hostname and the local time to Twitter.  If I am ever curious about whether the remote server is up, I can check Twitter, and also figure out approximately when it went down, based upon the time of the last update.  I have been using the following bash script:

#!/bin/bash
curl –basic -u  “username:password” -d “status=$(hostname -f) is alive at $(date) local time.” http://www.twitter.com/statuses/update.xml >/dev/null

I have cron setup to run the script every half hour, although you can change the update interval to suit your own needs.  I also created a separate Twitter account strictly for this purpose and made it private.

In the future, I may utilize Twitter’s RSS feature to send me an email if a server misses an update.

Convert PDFs to Grayscale from the Command Line

Ghostscript can be used to convert color PDFs to grayscale, from the command line.  Check it out:

http://vince-debian.blogspot.com/2008/05/pdf-conversion-to-grayscale.html

Nvidia Closed Source Driver Setup

While there is nothing wrong with the open source Nvidia video drivers, they simply don’t have some of the functions that HTPC users need, namely VDPAU.  Although I’ve heard that early installation of the Nvidia proprietary drivers was difficult, it is now fairly straight forward.  The following site contains every available version of the Nvidia proprietary drivers:

ftp://download.nvidia.com/XFree86/Linux-x86/

After downloading the appropriate version, make it executable with chmod, then run it with sudo.  One error that frequently occurs is: “ERROR: Unable to find the kernel source tree for currently running kernel.”  First, make sure that you have your kernel source installed.  But, if you do have your kernel source installed, it may just be an issue of pointing the Nvidia driver in the right direciton.

The Nvidia driver looks for your kernel source in /usr/src/linux.  However, many distributions, store the kernel source in a directory named after the specific version of the kernel, e.g.,/usr/src/linux-headers-2.6.28-13.  As such, you can fix the error by simply creating a softlink to the specific version of the kernel that you are running by executing the following command within the /usr/src directory: ln -s /usr/src/linux-&(uname -r)/ linux

 

February 2010
M T W T F S S
« Jan    
1234567
891011121314
15161718192021
22232425262728