swisspig.net - To hell with the pig... I'm going to Switzerland.

Technical Notes (Wednesday, September 14, 2005)

I haven't had much interesting to say recently. But I figured out some fun stuff...

  • I figured out how to make my gaim windows flash on the task bar using these instructions (note to self: libwnck16 is now being held back). I also used wmctrl to take the buddy list off the task bar where it is basically useless: $ wmctrl -b add,skip_taskbar -r "Buddy List" -F. I put that in a loop with a five second delay, running in the background, so if for whatever reason I click on the list and it comes back, it is forced off again.
  • I figured out that sudo has to match the whole command line and not just the program name — so if you want to use NOPASSWD on mount for your user, you have to specify /bin/mount * in order for it to work.
  • I also re-discovered that you can't set environment variables from a shell script in bash. That is, if you say export FOO=bar in a script, and run the script from the command line, FOO will still be unset after the script runs. You'd have to source the script (e.g. $ . script.sh or $ source script.sh). What's funny, is I'd always had a script, called setjava, that set up my environment. It worked just fine. Well after checking, it turns out that I had created an alias called setjava to ". setjava", so it would behave the way you expect it to.
  • I finally figured out why when I ssh to fire, it logs in automagically, but when I ssh to lexicon, it prompts for a password. Turns out there's this ssh-agent thingie that keeps track of your passwords and uses public key authentication. It assumes if you've logged in as you, locally (and have access to the private key), that you really are you, and should be allowed to log in to the other systems. Once you've got your keys generated locally, all you have to do is call $ ssh-copy-id -i ~/.ssh/id_rsa.pub you@host. You can search for more detailed instructions on your own — or read the man pages. (Edit: a good explanation can be found at SSH ohne Passwort — kurze Anleitung... yes, it's in German, but it's pretty easy to figure out.)
  • I also discovered an interesting fact about Debian and Ubuntu... when you move the boot partition, bad things happen. And by bad things, I mean no matter what you do, the kernel panics. I'd been used to the old fashioned way of doing things, where you point LILO at your kernel, and that's all there is to it. But now, apparently, there is this nifty initrd stuff, and within the initrd file (which turns out to be a cramfs type file system) there is an rc file with a reference to the device it was originally installed on. After learning way more about this process than necessary, I mounted the existing initrd file (using cramfs), copied the whole file structure into a new directory, changed all the references to the old device to the new device, then called mkcramfs (see man page) on the directory to create a new initrd file. This worked like a charm — too bad I tried a hundred and fifty other things before I figured that out. And it was all silly and pointless anyway, because all I really should have done was call # apt-get --reinstall install linux-image-2.6.10-5-686 . Then you have to fix your /boot/grub/menu.lst so that you don't have two of everything — and don't forget to reinstall grub if you changed devices. Also, there's a really neat tool called gparted that helped me resize and move around my partitions (which caused the kernel mess), though since it has to run in X, and under Ubuntu you can only log into X as a user, it makes it very difficult to do things like move the home partition. But regular parted works okay for that.

Wow that's a lot of things to figure out. I should probably keep track of them as I find them, and not have to post them all at once!

—Brian (9/14/2005 2:44 PM)
(0 comments)

Comments

No comments.

Name
URL
Comment
(no html)
 

Disclaimer: Opinions on this site are those of Brian Ziman and do not necessarily
reflect the views of any other organizations or businesses mentioned.