Wednesday, June 2, 2010

Ubuntu Lucid: Enable fingerprint authentication on Lenovo T60

I configured fingerprint authentication on my Lenovo T60, here's the procedure.

NOTE: This is supposed to work with any compatible fingerprint hardware not just T60.

NOTE2:under some circumstances fprint stops responding, so this is not stable enough for production purposes.

Here's how:
  1. Install fprint-demo (sudo apt-get install fprint-demo)
  2. Run the fprint-demo application and configure the fingers you want to use to log in.
    TIP: make sure to verify the fingerprint before leaving this application, otherwise, you may not be able to use it for authentication
  3. sudo gedit /etc/pam.d/common-auth 
  4.  Add this line to the file: auth sufficient pam_fprint.so. 
NOTE: The changes on this file apply inmediately, this means, if you screw things up, and even lock your computer, you may not be able lo log in back again. Just in case, have a live cd available. Log in using the live cd, mount the ext partition and edit this file manually, this will get you back in. At least this worked for me ;-)


Here's how my file looks like: 

#
# /etc/pam.d/common-auth - authentication settings common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authentication modules that define
# the central authentication scheme for use on the system
# (e.g., /etc/shadow, LDAP, Kerberos, etc.).  The default is to use the
# traditional Unix authentication mechanisms.
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
# local modules either before or after the default block, and use
# pam-auth-update to manage selection of other modules.  See
# pam-auth-update(8) for details.
auth sufficient pam_fprint.so
# here are the per-package modules (the "Primary" block)pam.d
auth    [success=2 default=ignore]    pam_unix.so nullok_secure
auth    [success=1 default=ignore]    pam_winbind.so krb5_auth krb5_ccache_type=FILE cached_login try_first_pass
# here's the fallback if no module succeeds
auth    requisite            pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
auth    required            pam_permit.so
# and here are more per-package modules (the "Additional" block)
# end of pam-auth-update config
#auth required pam_unix.so nullok_secure

After these steps, try locking your session, when unlocking you will be prompted for a fingerprint, if you fail to provide the correct fingerprint, the system will failover to ask a password.

Tuesday, June 1, 2010

CMU Sphinx error: ./wave2feat: error while loading shared libraries: libsphinxbase.so.1: cannot open shared object file: No such file or directory

I'm doing some research on voice recognition. Really doing my first steps on this field. I've been struggling to get started using CMU sphinx for the last two days. The tutorial published on the CMU sphinx site has some flaws. For instance, it says you need to build the trainer first, but if you don't build the sphinxbase code first, it wont let you build it, saying it's missing sphinxbase. Then, it doesn't say you need to install sphinxbase either. So after building sphinxbase, make sure to run

# cd sphinxbase
# make install

Now, when you think you have everything in place, and you get to the point where you perform a preliminary training run

# perl scripts_pl/make_feats.pl -ctl etc/an4_train.fileids
The, I started getting this error:

./wave2feat: error while loading shared libraries: libsphinxbase.so.1: cannot open shared object file: No such file or directory

This drove me nuts, until I stumbled into this post, and this gave me the idea to run this command:

# sudo ldconfig -v | grep sphinx

you should get an output like this:
libsphinxbase.so.1 -> libsphinxbase.so.1.1.1
libsphinxad.so.0 -> libsphinxad.so.0.0.1

If there's no output, try editing the /etc/ld.so.conf file and add a /usr/local/lib line at the end of the file. I tried this at first bout found it's not neccesary if you run the ldconfig command it will refresh the references automatically.

Ubuntu Lucid - dual monitor flickers on Lenovo T60 ATI card

I had some issues with Ubuntu 10 Lucid and my Lenovo T60 (ATI rage card). When I plugged in my secondary monitor (DELL 19'' LCD) the display started flickering. Turns out there seems to be an specific issue with the ATI video card. I found a forum post that solves the problem by editing /boot/grub/menu.lst and adding radeon.modeset=0 to the startup parameters.
The first problem I encountered was that the article said you should edit menu.lst but the Ubuntu Lucid setup installs grub 2 which has no menu.lst file.

I found this other article that explains how to edit the startup settings. I recommend booting up and editing the startup settings on the grub menu before changing the config files. This way if the parameters fail, you don't end up crashing your boot.

So in a nutshell, menu.lst has been replaced by /boot/grub/grub.cfg, so my file (first section, looks something like this:

some other sections code here

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,1)'
search --no-floppy --fs-uuid --set f5046c00-0fb3-4b57-9968-cac7b8fc3fa9
linux /boot/vmlinuz-2.6.32-22-generic root=UUID=f5046c00-0fb3-4b57-9968-cac7b8fc3fa9 ro radeon.modeset=0 quiet splash
initrd /boot/initrd.img-2.6.32-22-generic



Editing this file and rebooting does the trick, although I'm not sure what this parameter does, I'll look it up later to see if there are other interesting settings.

Sunday, May 30, 2010

Getting JDownloader to work on Ubuntu

JDownloader is open source, platform independent and written completely in Java. It simplifies downloading files from One-Click-Hosters like Rapidshare.com or Megaupload.com - not only for users with a premium account but also for users who don't pay. It offers downloading in multiple paralell streams, captcha recognition, automatical file extraction and much more. Of course, JDownloader is absolutely free of charge. Additionally, many "link encryption" sites are supported - so you just paste the "encrypted" links and JD does the rest. JDownloader can import CCF, RSDF and the new DLC files.
 Getting it to work on Ubuntu is quite straightforward. Instructions are provided here
Basically, you need to add an untrusted repository to your aptitude repository list. Open a terminal and run:

sudo add-apt-repository ppa:jd-team/jdownloader
sudo apt-get update
sudo apt-get install jdownloader

this will install JDownloader. The first time you run the application (From internet/JDownloader program group in Gnome) it will launch a downloader/updater which will download the latest version for the application.








 This screen closes automatically when finished and shows the regular application after that.

Saturday, May 29, 2010

Control the calories you eat with Cron-o-meter

After playing around with some on-line calorie counter sites, specially this one, I decided a local software would fit my needs best, rather than going on-line every time I needed to check-in my meals.
After some searching I stumbled upon cron-o-meter. It's an open source JAVA program so I can run it both in my Ubuntu Lucid Lynx and Windows XP installs.
I have two disk partitions in my computer, so I needed to do some tweaking to make it work.

Here's how:
  1. download the windows installer and install as usual
  2. set up the a user profile following the software instruction. This creates a "cronometer" folder on the local applications settings folder. We'll use this folder from the linux install to share the profile data.
  3. download the zip file from sourceforge and unzip, this is the generic version, works on linux or mac-os
  4. create a cronometer.sh script with this contents:

    #!/bin/sh

    # INSTRUCTIONS
    # 1) Install Java 1.5 or later for Linux (http://java.com/download/)
    # 2) Download Mac OS X Version and Unzip in desired location
    # 3) Place this launcher script next to the application bundle
    # 4) Execute script to launch CRON-o-Meter

    cd "CRONoMeter.app/Contents/Resources/Java/"
    java -cp cronometer.jar:jcommon-1.0.10.jar:jfreechart-1.0.6.jar:swingx-0.9.3.jar:cronometer.jar:usda_sr22.jar:crdb_004.jar:docs.jar ca.spaz.cron.CRONOMETER


  5. before running the program create a simbolic link to the windows folder

    ln -s /media/HDC-SYSTEM/Documents\ and\ Settings/austin-user/Application\ Data/cronometer .cronometer

    If you already ran cron-o-meter once, delete the ~/.cronometer directory before running the ln command above.

  6. Run the application using the cronometer.sh script. It will launch the application and any custom foods or entries you create on both sides will get synchronized automatically.