glennji.com

Because life's too short to save your work

ubuntu

Nov 16

Rescuing a dead hard-drive

Recently my Aunty's computer died, and yesterday I got a chance to try to recover it. The hard-drive wasn't booting, missing a system file for Windows, but the rest of the machine seemed fine when booted to Ubuntu off a USB drive. So how do I go about recovering the crashed HDD?

A little reading on the intertubes suggested I needed to create an image, first and foremost (oh the irony, "foremost", geddit? No? Oh, you will) and a little more scrabbling got me to GNU ddrescue (sudo apt-get install gddrescue). Slightly different from dd in that it will skip over blocks it can't read, rather than crashing out, but otherwise the same -- able to read a "raw" disk into an image file.

As it turns out, I didn't have gddrescue on the USB boot, and the machine wasn't on the Internet so I couldn't install it without messing about, so I tried dd instead:

  1. dd -i /dev/sda -o /media/Big-USB-Drive/disk-image.img

Yeah, okay, that was before I started reading about computer forensics and hard-drive recovery, okay. It took a long time, but didn't crash out -- I ended up with an 80GB file image containing everything that was on the original drive. Lucky, I guess. But what do I do with an 80GB disk image?

The first thing I tried turned out to be the last thing I needed -- the foremost utility, which can scan a drive and recover files (even if they've been deleted). I ran that a couple of times and ended up with a directory full of sorted filetypes ... but not the original filesystem. This gave me the idea: I could just mount this image and then copy stuff off, right?

Yep, sure can, thanks to SleuthKit. I installed this, then was able to scan the image for partitions:

  1. $ mmls file -b
  2. DOS Partition Table
  3. Offset Sector: 0
  4. Units are in 512-byte sectors
  5.  
  6.      Slot    Start        End          Length       Size    Description
  7. 00:  -----   0000000000   0000000000   0000000001   0512B   Primary Table (#0)
  8. 01:  -----   0000000001   0000000031   0000000031   0015K   Unallocated
  9. 02:  00:01   0000000032   0001646591   0001646560   0803M   DOS FAT16 (0x06)
  10. 03:  00:00   0001646592   0002013183   0000366592   0179M   DOS FAT16 (0x06)

(Okay, that's not exactly the output I got -- it was an NTFS partition, starting a "63". So 63 * 512 (the "units are in..." line above) gives 32256 ... and then I found the "typical" NTFS drive image can be mounted with:

  1. sudo mkdir /media/recovery
  2. sudo mount -t ntfs -o r,force,loop,offset=32256 drive-image.img /media/recovery

Once that was done I just copied everything from the /media/recovery "drive" to the BigUSB drive ... done!

And a happy Aunty Denise can sort out her files from there.

More information on the Ubuntu wiki.

Nov 16

Updated2: Webcam snapshot on login and unlock (Ubuntu 10.10)

Yep, a few more small changes:

  1. #!/bin/sh
  2. # Take a snapshot with the webcam
  3. OLDDIR=`pwd`
  4. MYDIR="$( cd "$( dirname "$0" )" && pwd )"
  5.  
  6. cd $MYDIR
  7.  
  8. BASEFILENAME="$MYDIR/`date +%Y-%m-%d-%I-%M-%S`"
  9. JPEGFILE="$BASEFILENAME.jpeg"
  10. JPGFILE="$BASEFILENAME.jpg"
  11. PPMFILE="$BASEFILENAME.ppm"
  12. POSFILE="$BASEFILENAME.pos"
  13. FACEFILE="$BASEFILENAME-face.jpg"
  14. WIDTH=250
  15. HEIGHT=180
  16. FPS=25
  17. DEST_VIDEO=$MYDIR/lifelog.mpg
  18.  
  19. # Say cheese!
  20. streamer -o $JPEGFILE -s 640x480
  21. mv $JPEGFILE $JPGFILE
  22.  
  23. # Do some face detection
  24. convert "$JPGFILE" "$PPMFILE"
  25. $MYDIR/mlpcascadescan $PPMFILE -savepos -draw -model $MYDIR/models/mlp-cascade19x19-20-2-110
  26. if [ -f $POSFILE ]
  27. then
  28.    FACE_POS=`head -n 2 $POSFILE | tail -n 1`
  29.    X=`echo $FACE_POS | awk '{print $1}'`
  30.    Y=`echo $FACE_POS | awk '{print $2}'`
  31.    W=`echo $FACE_POS | awk '{print $3}'`
  32.    H=`echo $FACE_POS | awk '{print $4}'`
  33.    FACE_X=`echo $X - 40 | bc`
  34.    FACE_Y=`echo $Y - 20 | bc`
  35.    FACE_W=`echo $W + 80 | bc`
  36.    FACE_H=`echo $H + 40 | bc`
  37.    convert -crop "$FACE_W"x"$FACE_H"+"$FACE_X"+"$FACE_Y" -resize "$WIDTH"x"$HEIGHT" "$JPGFILE" "$FACEFILE"
  38.  
  39.    # a .face file used by GDM
  40.    rm ~/.face
  41.    convert $FACEFILE ~/face.png
  42.    mv ~/face.png ~/.face
  43.  
  44.    # Now make a lifelog video - (not working particularly well as yet!!)
  45.    rm $DEST_VIDEO
  46.    mencoder mf://$MYDIR/\*-face.jpg -mf w=$WIDTH:h=$HEIGHT:fps=$FPS:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o $DEST_VIDEO
  47.  
  48.    # A couple of useful links
  49.    rm $MYDIR/latest-face.jpg
  50.    ln -s $FACEFILE $MYDIR/latest-face.jpg
  51.  
  52. fi
  53.  
  54. rm $MYDIR/latest.jpg
  55. ln -s $JPGFILE $MYDIR/latest.jpg
  56.  
  57. # cleanup
  58. rm $MYDIR/*.ppm
  59. rm $MYDIR/*.pos
  60.  
  61. cd $OLDDIR

Nov 12

Updated: Webcam snapshot on login and unlock (Ubuntu 10.10)

Last night I made a small alteration to the webcam snapshot script to include the face-recognition library "TorchVision3".

The script now looks like:

  1. #!/bin/sh
  2. # Take a snapshot with the webcam
  3. MYDIR="$( cd "$( dirname "$0" )" && pwd )"
  4.  
  5. BASEFILENAME="$MYDIR/`date +%Y-%m-%d-%k-%M-%S`"
  6. JPEGFILE="$BASEFILENAME.jpeg"
  7. JPGFILE="$BASEFILENAME.jpg"
  8. PPMFILE="$BASEFILENAME.ppm"
  9. POSFILE="$BASEFILENAME.pos"
  10. FACEFILE="$BASEFILENAME-face.jpg"
  11. WIDTH=250
  12. HEIGHT=180
  13. FPS=25
  14. DEST_VIDEO=$MYDIR/lifelog.mpg
  15.  
  16. # Say cheese!
  17. streamer -o $JPEGFILE -s 640x480
  18. mv $JPEGFILE $JPGFILE
  19.  
  20. # Do some face detection
  21. convert "$JPGFILE" "$PPMFILE"
  22. $MYDIR/mlpcascadescan $PPMFILE -savepos -draw -model $MYDIR/models/mlp-cascade19x19-20-2-110
  23. if [ -f $POSFILE ]
  24. then
  25.    FACE_POS=`head -n 2 $POSFILE | tail -n 1`
  26.    X=`echo $FACE_POS | awk '{print $1}'`
  27.    Y=`echo $FACE_POS | awk '{print $2}'`
  28.    W=`echo $FACE_POS | awk '{print $3}'`
  29.    H=`echo $FACE_POS | awk '{print $4}'`
  30.    FACE_X=`echo $X - 40 | bc`
  31.    FACE_Y=`echo $Y - 20 | bc`
  32.    FACE_W=`echo $W + 80 | bc`
  33.    FACE_H=`echo $H + 40 | bc`
  34.    convert -crop "$FACE_W"x"$FACE_H"+"$FACE_X"+"$FACE_Y" -resize "$WIDTH"x"$HEIGHT" "$JPGFILE" "$FACEFILE"
  35.  
  36.    # a .face file used by GDM
  37.    rm ~/.face
  38.    convert $FACEFILE ~/.face
  39.  
  40.    # Now make a lifelog video - (not working particularly well as yet!!)
  41.    rm $DEST_VIDEO
  42.    mencoder mf://$MYDIR/\*-face.jpg -mf w=$WIDTH:h=$HEIGHT:fps=$FPS:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o $DEST_VIDEO
  43.  
  44.    # A couple of useful links
  45.    rm $MYDIR/latest.jpg
  46.    ln -s $JPGFILE $MYDIR/latest.jpg
  47.    rm $MYDIR/latest-face.jpg
  48.    ln -s $FACEFILE $MYDIR/latest-face.jpg
  49.  
  50. fi
  51.  
  52. # cleanup
  53. rm $MYDIR/*.ppm
  54. rm $MYDIR/*.pos

Nov 08

Webcam snapshot on login and unlock (Ubuntu 10.10)

And this is why I love GNU/Linux: with a few minutes and the Internet, I've just hacked up a way to take a webcam snapshot every time I login and unlock the PC. The best way to keep track of Movember, if nothing else!

First I created a script to take the snapshot and put it in ~/.local/bin/faces/take-snapshot.sh

  1. #!/bin/sh
  2. # Take a snapshot with the webcam
  3. MYDIR="$( cd "$( dirname "$0" )" && pwd )"
  4.  
  5. BASEFILENAME="$MYDIR/`date +%Y-%m-%d-%T`"
  6. JPEGFILE="$BASEFILENAME.jpeg"
  7. JPGFILE="$BASEFILENAME.jpg"
  8. PNGFILE="$BASEFILENAME.png"
  9.  
  10. # Say cheese!
  11. streamer -o $JPEGFILE
  12. mv $JPEGFILE $JPGFILE
  13. rm $MYDIR/latest.jpg
  14. ln -s $JPGFILE $MYDIR/latest.jpg
  15.  
  16. # Create a dot face file
  17. rm $MYDIR/*.png 2> /dev/null
  18. convert -crop 200x200+0+0 -gravity Center -resize 128x128 $JPGFILE $PNGFILE
  19. rm ~/.face
  20. cp $PNGFILE ~/.face

Test that a few times -- yep, I'm getting a jpeg in the faces directory, converting (and cropping) to a PNG for the dot-face file used by GDM. This uses the program "streamer" (in the Ubuntu repositories), but you could probably find some other webcam snapshot app if streamer doesn't work for your webcam (it is V4L2 only, I think).

Next, I script the GDM login. GDM already has some scripts that it runs at particular points in the login, so I just extend that. Edit /etc/gdm/PreSession/Default (as root) and add:

  1. if [ -x $HOME/.gdm/PreSession/Default ];
  2. then
  3.     sudo -u $USER $HOME/.gdm/PreSession/Default >> /var/log/boo.log
  4. fi

This extends the GDM scripts to also execute user-specific scripts in my home directory. In my case, I add a script called ~/.gdm/PreSession/Default containing:

  1. $HOME/.local/bin/faces/take-snapshot.sh

Yep, calling the take-snapshot.sh script. chmod u+x ~/.gdm/PreSession/Default and login and a couple of times to make sure it is working -- each time a new picture should be taken, so check the ~/.local/bin/faces directory to make sure.

All that's left is to capture the gnome-screensaver deactivation, and a little Perl script comes to the rescue. Create a file screensaver-watch.pl in the ~/.local/bin/faces directory:

  1. #!/usr/bin/perl
  2. #gnome
  3. my $cmd = "dbus-monitor --session \"type='signal',interface='org.gnome.ScreenSaver',member='ActiveChanged'\"";
  4.  
  5. open (IN, "$cmd |");
  6.  
  7. while (<IN>) {
  8.    if (m/^\s+boolean false/) {
  9.       system("bash /home/glennji/.local/bin/faces/take-snapshot.sh");
  10.    }
  11. }

Yep, this watches DBUS for the gnome-screensaver signal, and runs take-snapshot.sh again. (You'll need to edit -- it's got my home dir hardcoded.)

Final step is to make sure screensaver-watch.pl is started on every login. The easiest way I could think of was to create a file called Screensaver Snapshot.desktop in ~/.config/autostart with the following contents:

  1. [Desktop Entry]
  2. Version=1.0
  3. Type=Application
  4. Terminal=false
  5. Icon[en_US]=eog
  6. Exec=/home/glennji/.local/bin/faces/screensaver-watch.pl
  7. Name[en_US]=Screensaver Snapshot
  8. Name=Screensaver Snapshot
  9. Icon=eog

(Again, hardcoded paths. Some things are too important to do the right way after all.)

Logout, login, check the dir, lock screen, unlock and check again. Woooo!

Jan 18

Alphacool LCD support in serdisplib, lcd4linux - the hard way

The Alphacool LCD is nice: 320x200 pixels, graphical, brushed aluminium with a blue back-light. I've got one in my main PC, and it's been sitting there - inactive - since I upgraded from Ubuntu Feisty. Yesterday I (finally) got it going again, with only a little mucking about.

The display is now officially in serdisplib, provided you've got libusb (and specify it in the configure), and there is a serdisplib-based driver in lcd4linux ... although it's not compiled in the standard lcd4linux package that comes with Ubuntu Intrepid.

So, first thing was to download serdisplib and compile it. To do this in a slightly-more sensible way I use checkinstall to create a .deb package. It's a good idea, because it means the software is controlled by the packaging system (and can therefore be removed or reinstalled as necessary). Install checkinstall if you don't have it

sudo apt-get install checkinstall

So, I gunzipped the serdisplib package then opened a terminal and navigated to the appropriate directory:

cd ~/serdisplib-1.97.8

This is the source-code of serdisplib, so I need to configure and make it to compile it for my system. Make sure you scroll back up and check the output of the configure, because the first time I tried it didn't compile libusb because I didn't have the libusb-dev package. This was resolved by installing it in the usual way:

sudo apt-get install libusb libusb-dev

So then, configure and make:

./configure --enable-libusb
make

Alright, at this point I had compiled the binaries, but they're still sitting in this directory (rather than the /usr/bin and other system directories). It's a good time to test out the display:

testserdisp -n alphacool -p 'USB:060C/04EB'

It's a bit weird, but the display shows up as an "EEH Datalink GmbH". Try:

lsusb

... and you can see an entry like

Bus 004 Device 002: ID 060c:04eb EEH Datalink GmbH

Anyway, my test worked - the LCD was activated and displayed a test pattern. You can run a few tests with this one, but I was just happy to see it running again. Time to install serdisplib to the system!

Normally, this is done by running something like "sudo make install", which copies the compiled files and libraries to the appropriate locations, but as I said earlier this would mean serdisplib was entirely outside the packaging system. Instead, run:

checkinstall

This will ask a couple of questions (a description) and then create a .deb package which can be installed (and removed) like any other package. Find the .deb in the same directory and either double-click it in the file manager or install it from the terminal with

sudo dpkg -i serdisplib_1.97.8-1_i386.deb

What I didn't realise, but probably should have, is that this installs to /usr/local (e.g. /usr/local/bin, /usr/local/lib) rather than /usr. This isn't really a problem, but lcd4linux had trouble a little further on finding the libraries in /usr/local/lib rather than /usr/lib. At the time, I just copied the serdisplib stuff from /usr/local/lib to /usr/lib, but it would probably be better to either configure serdisplib to use /usr, or configure lcd4linux to look in /usr/local/lib. Oh well.

So, onto lcd4linux. I already had lcd4linux installed from the Ubuntu repositories, but it didn't include the serdisplib driver. You can check what drivers are included with

lcd4linux -l

So it was time to download the source code for lcd4linux too. Gunzip this in the same way as serdisplib. After attempting to compile this a couple of times I found I needed to patch the source code. Download the patch to your home directory and apply it

cd ~
patch -p0 < lcd4linux-0.10.1_rc2-nordtsc.patch

then we can compile and install it

cd lcd4linux-0.10.1-RC2
./configure
make
checkinstall
sudo dpkg -i lcd4linux-0.10.1_RC2-1_i386.deb

Cool! So now I had the new lcd4linux AND it had serdisplib support. Because I had the Ubuntu repository one too, I could test the two:

/usr/sbin/lcd4linux -l

That's the Ubuntu repo one

/usr/local/bin/lcd4linux -l

and that's the new one. Importantly, this has the line

serdisplib          : any

showing that it has the serdisplib support compiled in.

Because I had installed the repo one first, I already had an init.d script for starting lcd4linux at boot time. However, you want to edit /etc/init.d/lcd4linux and specify the absolute path to the new lcd4linux executable. i.e. change the DAEMON line to:

DAEMON=/usr/local/bin/lcd4linux

Also, you need an lcd4linux config file in /etc/lcd4linux.conf. The easiest way to get this is copy the sample one

sudo cp /usr/share/doc/lcd4linux/lcd4linux.conf.sample.gz /etc/
cd /etc
sudo gunzip lcd4linux.conf.sample.gz
sudo mv lcd4linux.conf.sample lcd4linux.conf

Now edit /etc/lcd4linux.conf with your favourite text editor. Find the SerDispLib display section and replace it with this:

Display SerDispLib {
   Driver 'serdisplib'
   Port 'USB:060C/04EB'
   Model 'ALPHACOOL'
}

Then go to the end of the file and comment/uncomment the appropriate line to specify the SerDispLib display

Display 'SerDispLib'
#Display 'LCD-Linux'
#Display 'LCD2041'
#Display 'LK202'
#Display 'LK204'
#Display 'MI240'
#Display 'CW12232'
#Display 'HD44780-generic'
#Display 'HD44780-WinAmp'

... and a layout

Layout 'Default'
#Layout 'TestLayer'
#Layout 'TestImage'
#Layout 'L8x2'

All being well, you should be able to start up lcd4linux and have the display activate with

sudo /etc/init.d/lcd4linux start

Cool!

There's a lot of tweaking and playing that you can do with lcd4linux layouts, so go nuts.

Jul 11

Gaming for self-improvement

Some people are naturally strategic thinkers. We all subconsciously process a multitude of data-points -- other peoples' emotional states, for example; the tiny signals that say "danger!"; even driving a vehicle. But some people take that processing to a higher abstraction and think in terms of situations, outcomes, agents -- even if they don't realise that's how they think.

Someone who is good at chess is obviously a strategic thinker. But so is the social or corporate climber, or the rally-organiser, or the RTS-gamer. Hell, business-people and entrepreneurs are strategic thinkers of a high-order. This might be obvious to a lot of people, but I've realised that I don't think this way. Strategy lets me down. I play instant-action games (FPS) and live for the moment, with only a cursory nod towards the future ... since the future I plan for may not eventuate!

So I decided that I should take steps to improve my strategic thinking abilities, and after talking to a friend I decided upon a computer game called "Dawn Of War". Set in the distant-future Warhammer 40,000 universe, you control squads of the post-human "Space Marines" and battle various alien and other-dimensional beings. What I like about Dawn Of War is the rich mythology and storyline -- I read some Warhammer 40,000 books growing up, and have seen the table-top game in stores (although not tried it). So it fulfils my basic need for imagination-fuel better than the old favourites Starcraft, Total Annihilation or Command & Conquer.

Better, the game was £10 from Amazon, and ran first-time in Wine on Ubuntu Linux.

Like I say, I'm not naturally a strategic-thinker, but I have noticed a certain change in my abilities as I play through the levels (sometimes multiple times, to try out different tactics). I was also thinking this morning about the general rules for RTS games I've determined so far, and how they might apply to things in Real Life® (RL):-

Nail the build-order
Or: Determine the optimal process
In-game, this means figuring out what the best order of build commands should be: do I need a main base, then a plasma generator, then a barracks, another generator then a squad? There is definitely an optimal process to building up big in as short a time as possible, and games like Dawn Of War capitalise on that by introducing new units, vehicles and structures with each tutorial mission.

In-RL, process optimisation is the best way to either lighten your workload (if applied to a 9-to-5 job) or get more done (if applied to your own entrepreneurial endeavours). To optimise a process you have to both observe the process and consider it -- that is, apply conscious analysis and effort to an accurate mental model of the process, rather than just following a process because it is familiar or for its own sake. Most humans will just follow the process without deep-thinking it -- why else do we exchange most of our time for money? Even if we are the boss?

Keep your troops close
Or: proximity begets communication/cooperation
In-game: any army can be defeated if spread too thin, and having more than a few clusters of troops means you cannot effectively monitor them -- a war on too many fronts is a losing proposition. (This has been used by military leaders historically, and is the reason we use the singular phrase "The Front" or "The Front Line" rather than something like "The Fronts".) So cluster together, build a secondary base near the front if possible and replenish your troops from there.

RL: Apart from the obvious military tactics, it makes sense to keep your resources close-at-hand. For personnel, co-locating business (sales, marketing) and technology (operations, manufacturing) means real communications and faster reactivity to the changing market (the "front" for commercial enterprise). For personal, having a "dashboard view" (e.g. of finances) allows for situational analysis and problem avoidance that is both fast and intelligent. Continuing the finance example, it makes sense to have a portfolio (hell, a spreadsheet will do) of all investments, assets, savings, debts, debtors and budgeted projected requirements in one place.

Automatic-fire gun turrets are your friend
Or: automate everything -- including notification
In-game example: For the last mission I played, I had multiple attack points -- enemy troops (those damn Eldar) would hit me from a number of sides, and it was all I could do to move my retalitory troops from one side of the base to the other. Not good. So I built up the necessary capabilities and started placing automatic-fire gun turrets at the usual incursion locations.

Suddenly my troops weren't even needed -- a couple of turrets could take out all but the most concerted attack, and my builder (technician, drone) was nearby to repair or replace the turrets as needed. I could build up my army and begin my own strikes, expanding the "safe" territory ... and then building more automatic-fire turrets, expanding, rinse and repeat ad infinitum (or at least until the end of the mission).

In RL as in the game, automation is a necessary tactic for getting beyond the level of survival (putting out fires, keeping the show on the road, keeping our heads above water -- we have so many colloquialisms for this because it's deep in our psyche) towards actually doing something useful. Utilising humans as brainless robots is stupid; doing it to ourselves is even more ridiculous.

When I refer to automation in RL, I mean getting a more efficient system to do repetitive tasks for us, leaving us to do the things we are good at. It includes the field of "intelligence augmentation" (using systems to provide us with appropriate information in a ready-format which augments our decision-making) and even, say, World Wide Web search engines. If I pay my bills by direct-debit or standing order, it's automated. If my PC backs up my personal files for me, it's automated. If my Oyster travel card adds £20 every time the balance gets too low ... you guessed it.

In Timothy Ferris' Four Hour Work Week, automation is the key to a low-maintenance "muse" business -- every possible part of the order-fulfillment backend is integrated, so an order on the web is sent directly to the factory, which sends the completed goods to a drop-shipper (who was also automatically advised of the delivery destination). This leaves Tim to either deal with customer queries, or go swimming in Greece. Whichever he prefers.

But of course you have to trust your automated systems, and the only way to do that is to be notified of exceptional situations. Automation's noisy twin is thus notification -- you want to know if you're double-charged, or your manufacturing chain breaks down, or your solar collector array is on fire. Unless it's AI, an automated system will eventually be out-of-date and out-of-sync with it's environment i.e. the model upon which the system was based no longer matches reality. So timely, appropriate notification of exceptional "edge-conditions" can allow you to tweak the automated system back in-line.

Anyway, that's all I've got so far. I'm sure there's much more that can be learned from strategy games.

May 12

Installing MediaTomb UPnP Media Server

Mediatomb is an free open source UPnP server for Linux and Mac OS X. It allows you to stream media (videos and music) to networked devices for playback, and has an (admittedly grim) web-based GUI.

Installing in Ubuntu or Debian is easy (for other distros please check the website). First, add the gpg key so the package can be verified:

   wget http://apt.mediatomb.cc/key.asc -O- -q | sudo apt-key add -

Add the following line to /etc/apt/sources.list:

   deb http://apt.mediatomb.cc/ feisty main 

(Note that although the package specifies "feisty" it will work in the new "gutsy" i.e. Ubuntu 7.10.)

Now install like normal:

   sudo aptitude install mediatomb

Unfortunately the version here doesn't seem to support MySQL as a backend.

Of course, you will want to add your music too. If my music collection is at /opt/share/Music:

   sudo mediatomb --add /opt/share/Music

Now you can tune in with a music player such as Rhythmbox or iTunes

May 12

Password-less logins with PAM

Sometimes you want certain to be able to log in to certain user accounts without a password -- for a guest account, for example. It's not terribly secure, sure, but sometimes you don't need that security. Read on for how to do this on any GNU/Linux OS that uses PAM and GDM.

To enable password-less logins for any operating system that uses PAM and GDM, edit /etc/pam.d/gdm to add the following line:

   auth    sufficient      pam_listfile.so sense=allow file=/etc/passwordless item=user
   
   @include common-auth
   ... 

Then create the /etc/passwordless file (readable only by root). List each user you want to login without a password, one per line.

If you are using the GDM autologin feature, add the line "@include common-pamkeyring" to /etc/pam.d/gdm-autologin. I haven't tried it, but this is reported to allow the no-password user wireless access without entering the keyring password.

If not, you need a script like the following to your session startup:

   #!/bin/sh
   exec echo -n "MyKeyringPassword" | /usr/lib/libpam-keyring/pam-keyring-tool -u -s

However, pam-keyring-tool is not included in Ubuntu 7.10, so you need to compile it.