Starting Conky with Gnome

Conky is an awesome way to add some nerd bling to your Linux desktop.  Conky can be started by adding it to System->Preferences->Startup Applications.  But in some cases, mine included, Conky won’t draw properly.  In my case, Conky was appearing as a window over the desktop, blocking part of the panel.  To correct this, you simply need to create a script that delays Conky startup until after the other Gnome components are loaded.  The script below will delay starting Conky for 20 seconds:

#!/bin/sh
#Delay conky start for windows to be drawn
sleep 20s
conky &

Posted in Software | Tagged , , , , | Leave a comment

Get the Windows 7 Aero Snap Feature in Ubuntu

http://www.omgubuntu.co.uk/2009/11/aero-snap-ubuntu-linux.html

Posted in Software | Tagged , , | Leave a comment

Getting Visual Notification of SMART Hard Drive Failures

Linux has a fairly robust tool for detecting SMART hard drive failures – the smartmontools suite.  I have used this suite on my server for a number of years, having caught 3-4 failures before they were able to cause an issue.  On the server, I have a mail server running that emails me about any imminent failures.  But, for whatever reason, I have never set up SMART monitoring on my laptop.  One reason may have been that I didn’t want to go through the hassle of setting up a mail server.

The combination of smartmontools and smart-notifier provide an alternative, with smartmontools doing the heavy lifting and smart-notifier providing an on-screen cue should anything go awry.  First, install packages:

sudo apt-get install smartmontools smart-notifier

Second, setup smartmontools.  First, you must edit /etc/default/smartmontools by uncommenting the line: start_smartd=yes, as well as editing the line: enable_smart=”/dev/sda”, to include your drive(s).  Third, you must edit /etc/smartd.conf.  Make sure that all of the lines in the file are commented, then add the following line at the bottom of the file:

DEVICESCAN -m root -M test -M exec /usr/share/smartmontools/smartd-runner

This line tells smartd to post a test alert when it is started and to execute the smartd-runner program.  That program is what notifies smart-notifier to display a message.

Fourth, restart your computer.  When you are back in Gnome, open a terminal window and enter the following command:

sudo /./etc/init.d/smartmontools restart

You should see the following:

If this worked, you have one last step, modifying your smartd.conf file to remove the test.  Change the last line to the following:

DEVICESCAN -m root -M exec /usr/share/smartmontools/smartd-runner

If the notification does not show up, make sure that smart-notifier is running.

Posted in Software | Tagged , , , | Leave a comment

Adding Internal Bluetooth to a HP dv6626 Laptop

You can generally add internal Bluetooth capability to Hewlett Packard DV6000 series laptops.  Just for those interested, I successfully added internal Bluetooth to the dv6626, despite it being one of the lower end models.  I recommend the following link:

http://cegeekbook.blogspot.com/2009/11/how-to-add-bluetooth-to-dv6000.html

As indicated on that page, you can buy the necessary parts (a small card and a cable) on eBay for less than $20.  I recommend buying all of the parts together, as I attempted it once before with a separate card and cable, which ended up in failure.  I later determined that the cable was faulty.  If all works well, the Bluetooth card will show up as a USB device:

Bus 007 Device 002: ID 03f0:171d Hewlett-Packard Wireless (Bluetooth + WLAN) Interface [Integrated Module]
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 064e:a110 Suyin Corp. HP Webcam
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 1b1c:0b11
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Posted in Hardware | Tagged , , , | Leave a comment

Upgrade from Ubuntu 8.04 LTS to 10.04 LTS – How to fix RAID at Boot

I just upgraded my file server from Ubuntu 8.04 LTS to 10.04 LTS.  Anyone that is familiar with Ubuntu’s numbering scheme (and rollout schedule for LTS releases) will realize that the versions are separated by two years.  A lot things can happen in 2 years!

After a (what I thought) successful network upgrade, I rebooted my server, waited a few minutes, and then was unable to ssh in.  Fearing the worst, I plugged a monitor in to see what was wrong.  The system was unable to mount one of my partitions and was waiting for user input.  That partition is actually a linux software RAID partition.

After some research, I discovered that Ubuntu had switched from grub to grub2 (I believe the change was made in Ubuntu 9.10).  After some more digging, I found out that grub2 does not automatically locate and activate linux software RAID partitions.  Grub was able to do this, without relying on any configuration files (i.e., /etc/mdadm/mdadm.conf).  Upon reviewing my mdadm.conf file, I found that it was out of date; I didn’t realize that it was because grub didn’t need it to activate my RAID partitions.  The following command will activate all of your software RAID partitions:

mdadm –auto-detect

The following command will provide all of the information on your software RAID partitions:

mdadm –detail –scan

Take the output of the second command and update your /etc/mdadm/mdadm.conf file.  Your software RAID partitions should now be activated upon boot!

Posted in Software | Tagged , , , , , , , | 2 Comments

libvirtd: Gracefully Shutting Down VMs

libvirtd – part of libvirt – is a daemon that manages virtual machines in Linux – including those running under KVM.  I recently made the move from controlling my virtual machines with scripts in /etc/init.d to libvirtd.  libvirt has a number of advantages over using KVM directly, including:

  • Definition of VMs via an XML file (easier to read than the lengthy kvm command line commands)
  • Supporting scripts that ease creating VMs (although for this task, I still prefer kvm command line)
  • Ability to control VMs remotely via Virtual Machine Manager
  • Cleaner network configuration
  • Ability to gracefully shutdown VMs

Issuing a shutdown command to a VM under libvirt is essentially like pushing the power button on a regular PC.  ACPI capability within your guest OS can then process the button press accordingly, for instance, shutting down or suspending the VM.  I’ve used this successfully on several OSs, including:

  • Ubuntu 9.10 Server – you must install ACPI support – apt-get install acpid
  • Ubuntu 9.10 Desktop – ACPI support is already installed, but you must set the behavior, i.e., shutdown on button press.  The default is to ask the user what they want to do.
  • Windows 7 – Everything works out of the box.  I suspect that this is standard for the more recent Windows releases

To ensure that your VM can process ACPI, make sure that you include the following lines in the configuration XML file:

<features>
<acpi/>
</features>

Posted in Software | Tagged , , , , | Leave a comment

Resolution: Slow Printing of PDFs on Brother HL-2170w

I have been using a Brother HL-2170w as my printer for approximately a year now.  I have it setup as a shared printer, on my Linux server, through CUPS.  I print to it from an Ubuntu laptop.  I initially had it installed using the OpenPrinting driver on both my server and my laptop.  This setup worked well for everything but PDFs.  PDFs would take an abnormally long amount of time to print, in some instances 15 minutes per page.  During this time gs would not be consuming any CPU resources, so I was perplexed as to why it would take so long.

However, I recently changed by setup and now PDF printing takes a few seconds of processing per page.  On the server side, I changed the driver to the raw driver.  On my laptop, I switched to using Brother’s LPR driver with CUPS Wrapper.  It now behaves as one would expect, gs cranks at near 100% CPU utilization for a few seconds and then the job starts printing.  I have not gone back to determine what was causing the issue: not using the RAW driver on the server, or Brother’s driver.  Either way, leaving the queue raw is probably good in mixed environments, where you have both Linux and Windows clients using the printer.

Posted in Software | Tagged , , , , , | Leave a comment

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!

Posted in Software | Tagged , , , , , | Leave a comment

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

Posted in Software | Tagged , , | Leave a comment

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.

Posted in Software | Tagged , , | 5 Comments