10Nov No sound on T60 in Ubuntu Karmic

Just got a used laptop from work today (a lenovo t60p) and decided to install Ubuntu 9.10 on it. Most things were working pretty smoothly, I got the fingerprint reader working by following some of the stuff on http://www.thinkwiki.org/wiki/How_to_enable_the_fingerprint_reader_with_ThinkFinger. I also got the hard drive protection stuff working which is pretty nifty, never had that on a laptop, and I played tux racer by moving my laptop side-to-side, haha.

I had some problems with audio though. I tried several solutions I found on a forum here: http://ubuntuforums.org/showthread.php?t=346676 and http://ubuntuforums.org/showthread.php?t=1043568 but I think the thing that really made it work was that for some reason I was not in a group that would allow access to sound devices. The page here https://wiki.ubuntu.com/DebuggingSoundProblems said to make sure you have permissions for it…I figured this would be the last thing that would work since I was the user that installed the system, well, I guess I was wrong, the little checkbox wasn’t checked, I checked it and restarted and it work, who would have thought?

Now I just need to get bluetooth working…wasn’t seeing my phone…

28Aug Set up SLES/SuSE for imaging or as a virtual machine

I test software on SLES/SLED machines and it is always a pain trying to prepare images for re-use in other locations. SuSE uses hardware specific IDs for booting and configuring network interfaces by default so if you try to make an image and use it on another machine you are out of luck. Also, making VMWare images and cloning them creates all new hardware IDs as well so no cloning of the VMs either. Today I finally found a good way to fix all these problems so that network interfaces are set up automatically upon boot for DHCP and GRUB won’t boot using the /dev/disks/by-id/ location but just the /dev/sdaX location.

I found these tips on the Novell Cool Solutions page. One from http://www.novell.com/communities/node/1516/imaging-sled-10-sp1-workstation and another from http://www.novell.com/communities/node/5789/automatic-network-configuration-and-edirectory-configuration-bootable-vmware-images.

There are just two general steps that need to take place. First, make it so GRUB boots using the device name and not the device ID. To do this:

  1. Open Yast
  2. Navigate to System -> Partitioner
  3. For each partition that will be mounted click Edit, Fstab Options, and select Device name rather than Device ID
  4. Apply those settings
  5. Now open Yast -> System -> Bootloader
  6. For each entry click edit and for the root device select the proper device name
  7. Apply those settings and you are done

The second issue has to do with the device ID of the network card changing and so it is not configured for DHCP on boot. To make all your network interfaces configure automatically with DHCP on boot you need to be able to generate ifcfg-eth-id network configuration files for the interfaces on boot. To do this

  1. Download this buildeth0 script from (This was taken from a set of scripts on the second Novell link above)
    1. If you are running SLES/SLED 11 then download this script and rename it to buildeth0
  2. Copy the script buildeth0 to /etc/init.d/. Be sure to chmod 755 the script so it will execute.
  3. Now, add the script to the default run-levels rc3 and rc5 by running “chkconfig -a buildeth0″

This script requires that the persistent names are enforced and generated when your machine boots. This is already on by default in SLES/SLED. When the machine boots it will check all the devices connected and create persistent names for any ethernet device in /etc/udev/rules.d/30-net_persistent_names.rules. The script will check that file for any entries. It will then check to see if each of those entries have configuration information setup in /etc/sysconfig/network/ifcfg-eth-id-… if not it will generate that file automatically and configure the interface with DHCP. When the network is setup it will see the configuration there and configure the interface with DHCP.

To prepare for taking an image you should remove all the configuration information already setup for your machine so that when the new device boots it doesn’t wait for non-existing interfaces to be set up.

  1. rm /etc/sysconfig/network/ifcfg-eth-id*
  2. Edit /etc/udev/rules.d/30-net_persistent_names.rules and remove any SUBSYSTEM==”net” lines. (Don’t just comment them out)

That’s it, just shutdown and take a snapshot/image of the machine.

Tags: , , ,

11Aug Quick SVN Branch

Took me a while to figure out how to make a branch. There is an easy way to do it without even checking out a new local copy. Just:

svn copy https://your.svn.server/svn/location/trunk https://your.svn.server/svn/location/branches/branch_name -m "commit message"

All the work is done on the server. No mess locally and super quick…now I just need to figure out how to merge changes between branches easily

Tags: ,

04Aug Quick SSH Remote Key Setup For Passwordless Login

Lots of different ways of creating keys and sending them to remote machines so you can login. This is just a quick reference for me and how I do it.

If you haven’t already done so, you need to create keys for your local machine:

ssh-keygen -t dsa

Next, store that key in the remote machine’s authorized_keys file:

cat ~/.ssh/id_dsa.pub | ssh remote-machine 'sh -c "cat - >>~/.ssh/authorized_keys2"'

Now you can just use passwordless login to those machine that you ssh into the most (if it is setup, it is by default for me).

04Aug Uninstalling a Python setup.py style project

If you are like me and like to install the newest versions of software and not just settle for the ones available from a package manager, you may have some trouble if you get to a point where you want to uninstall it if that project uses python’s setuptools or disttools for installation.

Using setup.py is wonderful for installing but there is no uninstall option available…pretty sad. I saw that there were options for creating an RPM or Windows installer package from the source but no way to create a .deb for Debian/Ubuntu. So, if you are using an RPM based distro then all you will need is the bdist_rpm command and then install the resulting RPM file.

If you are running Debian or Ubuntu then just do this:

python setup.py bdist_rpm
cd dist
sudo alien -d -c {your_package}.rpm # Make sure you don't use the src RPM
sudo dpkg -i {your_package}.deb

That’s it, now you have installed the package. I haven’t tested this extensively so I don’t know if there are problems because the setup.py file isn’t run with the install parameter so some things may not be configured right, but it should work for the most part.

Also, I have not had much luck with it but you may also want to try out stdeb http://github.com/astraw/stdeb/tree/master

12May Nice MS Fonts (Tahoma, Calibri, etc.) for Ubuntu

I use several Windows based apps in Ubuntu under Wine and several times I have noticed that the text in some of the apps just don’t look right. Well, I found a good setup that makes all the fonts look like they are supposed to and also gives somewhat of a sharper look to Ubuntu as well. The guide can be found at http://www.stchman.com/ms_fonts.html

05May Removing applets from Gnome Panel / Resetting Gnome Panel

So, I was adding applets to my panel and there was one that was messed up. I looked in the gconf-editor and noticed a ton of the applets that I was adding but they were not showing on the panel so I couldn’t delete them. Well, if you want to delete panel applets that you can’t see then open up gconf-editor and navigate to apps/panel/applets and find the name of the key that is the applet you added. It will most likely be named applet_#, look at the bonobo_iid to find out what the applet is.

gconf-editor

gconf-editor

Once you have the name then run the command:

gconftool-2 --recursive-unset /apps/panel/applets/your_applet_name

If you want to destroy all your panel applets and start over then do:

gconftool-2 --recursive-unset /apps/panel
gnome-panel --replace

24Mar SSH Tunnel Quick Reference

This is really for my own benefit and quick reference. Here is the command to setup a local tunnel to a remote machine using ssh:

ssh -f -L [local-bind-address]:{local-port}:{endpoint-machine}:{endpoint-port} -N user@ssh-host

The options used:

-f – go into background before executing any commands
-L – For port forwarding [bind address:] local port : host : hostport
-N – Don’t run any commands on the remote SSH host, just set up the tunnel

The nice thing about this is that the endpoint machine can be different from the ssh host and the name used is in fact resolved by the remote ssh machine.

19Mar Fixing messed up permissions on a linux filesystem

Ever accidentally change permissions on a filesystem and don’t know what it was before or how to get it back? Me too…

I was messing around with openSuSE the other day. I installed it on another partition on my hard drive. I mounted my Ubuntu partition and was just trying to copying some stuff over. In one of my dumbest moves I did something to the effect of chmod a+rwx /media/ubuntu, effectively screwing up all my permissions…I honestly don’t know what I was thinking.

Just recently I booted into my Ubuntu installation and noticed something weird when I logged it. It said that it couldn’t read some .dmrc file because of wrong permissions. I just fixed the problem and carried on. Then as I was trying to run a command with sudo it gave me the same error, that the permissions on /etc/sudoers was wrong. Good luck fixing that without a root password.

So I went back to openSuSE and wrote a little script that would fix the permissions as much as possible. I had another Ubuntu system that I mounted using sshfs and then basically searched for every file that existed locally on the remote machine and took the permissions from the remote machine’s files and copied them locally to fix the issue. Obviously it would not catch every file because I have different things installed on each but since they were both Ubuntu machines it came out close enough.

So here is the script I used, hopefully it will be of help:


#/usr/bin/env python
import os, stat, sys

def get_perms(path):
	st = os.stat(path)
	mode = st[stat.ST_MODE]
	return mode & 07777

def set_perms(frompath, topath):
	os.chmod(topath, get_perms(frompath))

if __name__ == "__main__":
	print "copying perms to %s" % sys.argv[1]
	print "looking for similar files in %s" % sys.argv[2]
	if raw_input("do you wish to continue? ").lower() == "y":
		for root, dirs, files in os.walk(sys.argv[1]):
			for f in files+dirs:
				topath = os.path.join(root, f)
				frompath = topath.replace(sys.argv[1], sys.argv[2], 1)
				print "doing %s -> %s" % (frompath, topath)
				if os.path.islink(topath):
					print "file %s is a link, skipping" % topath
					continue
				if not os.path.exists(frompath):
					print "file %s does not exist to copy perms from" % frompath
					continue

				#print "frompath %s, perms %o" % (frompath, get_perms(frompath))
				#print "topath before to %s, perms %o" % (topath, get_perms(topath))

				set_perms(frompath, topath)
				#print "frompath %s, perms %o" % (frompath, get_perms(frompath))
				#print "topath after to %s, perms %o" % (topath, get_perms(topath))

16Mar Akregator starts with error message ‘Unable to load storage backend plugin “metakit”. No feeds are archived’

I was just playing around with different feed readers lately. I enjoy Akregator because it gives me all the options I need and probably the feature that I like the most is that it displays the number of unread items in the system tray and can be minimized to the tray as well.

I have installed Akregator on my machine at work and everything was working great. I installed it on my laptop and was having a problem that showed a message ‘Unable to load storage backend plugin “metakit”. No feeds are archived’ and all feeds were marked as unread even though it had previously been read.

Found a fix that was pretty simple. Just run kbuildsyscocoa from the command line and start it up again. Works like a charm.