Updated Posts to Fix Links (LIRC and xorg.conf files)

My apologies as I have not been posting to the blog for a while.  I recently noticed some comments from people looking for LIRC and xorg.conf files for the Sony KDL-46S4100.  I moved this blog several years ago, without realizing that I broke the links.  Everything should work now.

Posted in Uncategorized | Leave a comment

mdadm RAID array doesn’t start after reboot

I recently added a new mdadm RAID array to my Ubuntu 10.04 system.  But it wouldn’t start after reboot, and mdstat showed a strange error – a RAID device with only a single drive, with a similar name to the array that I had created.  This article gives a great explanation and a fix.

 

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

Auto-Select Printer by Network Connection

Windows 7 includes a great feature for people that travel a lot: the ability to auto-select the default printer based on what network you’re connected to.  In my case, I travel a lot between my house and my in-laws’ house.  Both homes have Wi-Fi and are setup for wireless printing.  This feature automatically changes the default printer to my laser when I’m at home and their inkjet when I’m there.

To use it, go to “Devices and Printers” in the Start Menu.  Select any one of your printers; this will enable the “Manage Default Printers” option.  Select this, and the following screen will appear.

From there, simply select what printer you want to set as default with each of your networks.  In the example above, the default printer will change to “Fax” every time I connect to “Network 2.”

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

Execute Commands in Linux Before/After Suspend

In my never ending pursuit to make my HTPC into an “appliance,” I ran into issues with autofs (the automounter) after resuming from standby.  To correct this, I created a script that kills it prior to suspend and launches a new instance when the HTPC resumes from suspend.

#!/bin/bash
#Script kills autofs when going into standby to eliminate issues with it
case $1 in
suspend)
#suspending to RAM
/etc/init.d/./autofs stop
;;
resume)
#resume from suspend
sleep 3
/etc/init.d/./autofs start
;;
esac

The script can be easily modified to execute different commands to suit your needs.  Simply place it in the following location:

etc/pm/sleep.d/

Posted in Software, Technology | Tagged , , , | 1 Comment

How to Make the Jetway AD3RTLAN-G Daughter Board Work

I recently upgraded my firewall hardware to a Jetway JNF91-600 motherboard.  Jetway boards are great for such projects because they are cheap and they offer some great daughter board options.  The AD3RTLAN-G offers three additional 10/100/1000 NIC ports for a very reasonable price ~ $50.  Unfortunately, it does not appear as if that particular daughter board and motherboard are plug and play.  I was unable to find any documentation on how to get them to work, but luckily, after a few hours of tinkering, was able to get it to work.

To do so, I modified the BIOS settings as such:

PnP/PCI Configurations -> IRQ Resources -> IRQ-7 assigned to (change this value from “Reserved” to “PCI Device”).

Posted in Hardware, Technology | Tagged , , , , , , | 1 Comment

Refresh conky when Network Becomes Available

For those of you using conky, you probably already realize that it allows you to pull a lot of useful information from other machines, or Internet sources, such as Google Calendar or Remember the Milk.  But, those pieces of information aren’t typically polled very often so lapses in network connectivity can cause those portions of your conky display to remain un-updated or showing blank, even after you regain network connectivity.  Fortunately, Debian based systems provide a script directory that is executed whenever a network interface is brought up, i.e., it regains network connectivity.  This directory is: /etc/network/if-up.d/.  Copy the following to a script in the directory and it will update all of your conky instances every time you regain network connectivity:

#! /bin/bash
killall -SIGUSR1 conky

Don’t forget to change the ownership to root:root and to set the permissions to 755.

Posted in Software | Tagged , , | Leave a comment

Fix it: anacron doesn't run after resuming from suspend

Anacron is a very useful tool for systems that aren’t left on constantly.  It works in conjunction with cron to make sure that your scheduled jobs get run, even if your computer is off when they are supposed to run.  Essentially, anacron will wait for a set period after your computer is turned back on, then it will run any jobs that were supposed to be run.  Tux Radar has a great, in-depth article about how they interact.

I personally use anacron on my HTPC (an Acer Aspire Revo), which is running XBMC 9.11, which is based on Ubuntu 9.10.  Anacron was not installed by default, so if you are running a similar setup, you can install it by running the following from the command line:

sudo apt-get install anacron

I am in the process of setting my HTPC to go into standby when I’m not using it, as opposed to leaving it on all of the time.  Obviously, having the HTPC in standby most of the time would interfere with my cron jobs.  One job in particular – updating my XBMC media library – is important, and needs to be run daily.  Luckily, anacron comes setup, out of the box, to run not just when you reboot the machine, but also when it resumes from standby.  Unfortunately, an issue exists that was preventing anacron from running – both at startup and when resuming from standby.

It turns out that anacron will not run if your computer is operating on battery power.  I’m assuming that the idea was that you don’t want to burn precious laptop battery power on background tasks.  But my HTPC was reporting that it wasn’t on AC power, even though it is incapable of operating any other way!  This was preventing anacron from running my jobs.  I was able to see the behavior by parsing my /var/log/syslog:

Jul  9 11:39:29 ***** anacron[2577]: Anacron 2.3 started on 2010-07-09
Jul  9 11:39:29 ***** anacron[2577]: Will run job `cron.daily’ in 5 min.
Jul  9 11:39:29 ***** anacron[2577]: Jobs will be executed sequentially
Jul  9 11:39:29 ***** init: anacron main process (2577) killed by TERM signal

As you can see, the anacron process was being started, and then immediately killed, because the HTPC thought that it was running on battery.  After a little more digging, I determined that the culprit was a script named on_ac_power.  On my system, this script was located in two locations: /sbin/ and /usr/bin/.  To fix the issue, I simply replaced both instances with my own on_ac_power script which contains the following 2 lines:

#!/bin/sh
return 0

This simply returns the value 0, which corresponds to the computer being on AC power.  Make sure to set the ownership for the file to root:root and the permissions to 755.  After making the replacement, anacron worked like a champ!

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

Gmail on Postfix: Updating your Certificates

There are many guides on the web for setting up a postfix mail server to work with gmail, for example:

http://www.marksanborn.net/linux/send-mail-postfix-through-gmails-smtp-on-a-ubuntu-lts-server/

I have a separate gmail account for sending server notifications, such as mdadm failures, SMART warnings, etc.  Step 4 of the guide given above involves copying the Thawte Premium Server Certificate Authority to the end of your server certificate.  Recently, my setup stopped working and I noticed the following errors in /var/log/mail.info:

Jun 11 03:47:38 ******* postfix/smtp[2496]: certificate verification failed for smtp.gmail.com[74.125.113.109]:587: untrusted issuer /C=US/O=Equifax/OU=Equifax Secure Certificate Authority
Jun 11 03:47:38 ******* postfix/smtp[2452]: Untrusted TLS connection established to smtp.gmail.com[74.125.113.109]:587: TLSv1 with cipher RC4-MD5 (128/128 bits)
Jun 11 03:47:38 ******* postfix/smtp[2452]: C702D32C1A7: to=<*******>, relay=smtp.gmail.com[74.125.113.109]:587, delay=420914, delays=420912/0.08/2.5/0, dsn=4.7.5, status=deferred (Server certificate not trusted)
Jun 11 03:47:38 ******* postfix/smtp[2506]: certificate verification failed for smtp.gmail.com[74.125.113.109]:587: untrusted issuer /C=US/O=Equifax/OU=Equifax Secure Certificate Authority
Jun 11 03:47:38 ******* postfix/smtp[2514]: certificate verification failed for smtp.gmail.com[74.125.113.109]:587: untrusted issuer /C=US/O=Equifax/OU=Equifax Secure Certificate Authority
Jun 11 03:47:38 ******* postfix/smtp[2483]: Untrusted TLS connection established to smtp.gmail.com[74.125.113.109]:587: TLSv1 with cipher RC4-MD5 (128/128 bits)
Jun 11 03:47:38 ******* postfix/smtp[2496]: Untrusted TLS connection established to smtp.gmail.com[74.125.113.109]:587: TLSv1 with cipher RC4-MD5 (128/128 bits)

It turns out that gmail now uses a different Certificate Authority: Equifax Secure Certificate Authority.  So, to get things working again, simply use the Equifax certificate in step 4.  The Equifax Secure Certificate Authority can be found here:

https://www.geotrust.com/resources/root-certificates/index.html

Posted in Software | Tagged , , , | 2 Comments

Ubuntu 10.04: Why is ksmd eating CPU cycles?

If you use KVM virtualization, under Ubuntu 10.04 Server LTS, with more than one virtual host running at a time, you may have noticed ksmd eating a lot of CPU cycles.  This behavior was not present under 8.04 Server LTS.  Apparently, the kmsd functionality was enabled by default in 10.04.  KSM – Kernel Samepage Merging – merges memory pages between virtual hosts to save space.  Unfortunately, for some, it also utilizes a lot of CPU resources to perform this function.  For my use case, I don’t care about the amount of RAM occupied by my virtual hosts, indeed, I installed far more RAM than I need in my server so that I don’t have to worry about a lack of RAM.  If you would like to disable ksmd, edit your /etc/default/qemu-kvm file as follows:

# To disable qemu-kvm’s page merging feature, set KSM_ENABLED=0 and
# sudo restart qemu-kvm

KSM_ENABLED=0
#SLEEP_MILLISECS=2000

Then, as the comments in the file state, restart qemu-kvm.

Posted in Software | Tagged , , , | 2 Comments