Monday, February 4, 2013

Easy steps to enable Finger Print Reader on Linux Mint / Ubuntu


Here I am using Linux Mint 14 ( Mint is very similar OS to Ubuntu) on Lenovo ThinkPad machine.

Step 1 - is your Finger print reader detected by system...?

First check whether your figer print reader is recognized or not by the system. for this open terminal and run command.

$ lsusb
  
It shows information about USB buses in the system and the devices connected to them. Then look for your finger print reader device. (My finger print reader device, Upek is listed in device list.)

.. 
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 147e:2020 Upek 
Bus 001 Device 004: ID 04f2:b2eb Chicony Electronics Co., Ltd 
..

Step 2 -Installing fPrint

Use following commands to install fPrint.

$ sudo add-apt-repository ppa:fingerprint/fprint
$ sudo apt-get update
$ sudo apt-get install libpam-fprintd  

if Installation is success, the needed lines in common-auth should now be present. for that type following command in terminal

$ grep fprint /etc/pam.d/common-auth

you should observe similar output like this,

auth [success=2 default=ignore] pam_fprintd.so 

Final (Fun) Step - configure fPrint

Now run

$ fprintd-enroll

swipe your right index finger until process is completed.

Using device /net/reactivated/Fprint/Device/0
Enrolling right index finger.
Enroll result: enroll-stage-passed
Enroll result: enroll-stage-passed
Enroll result: enroll-stage-passed
Enroll result: enroll-stage-passed
Enroll result: enroll-stage-passed
Enroll result: enroll-stage-passed
Enroll result: enroll-completed

Now you should be able to authenticate (Login, Terminal,  Lock screen, and everywhere ) by swiping your right index finger.

see how it works on terminal authentication.


( Note: If finger print fails, then system automatically prompt you to enter password. )

Have fun...

Alternatives for fPrint:

I found another GUI client called Fingerprint GUI.( http://www.n-view.net/Appliance/fingerprint/ ) it has some advance features, compare to fPrint.


Reference: 

  1. http://www.thinkwiki.org/wiki/How_to_enable_integrated_fingerprint_reader_with_fprint

Sunday, February 3, 2013

Limit the scope of the SVN Checkout - Example


Assume We want to checkout WSO2 Carbon branch 4.0.0 source code from [1]. But our target branch source is located under following sub locations.  
  1. https://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.0.0/
  2. https://svn.wso2.org/repos/wso2/carbon/orbit/branches/4.0.0/
  3. https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.0.0/
To give you a better idea, above three svn locations are represented in tree view in the following diagram. 

carbon/
├── kernel
│   ├── branches
│   │   └── 4.0.0
│   ├── graduated
│   ├── tags
│   └── trunk
├── orbit
│   ├── branches
│   │   └── 4.0.0
│   ├── graduated
│   ├── tags
│   └── trunk
└── platform
    ├── branches
    │   └── 4.0.0
    ├── graduated
    ├── tags
    └── trunk


Possible Methods of SVN checkouts for our problem


We can either use following options.

  1. checkout entire Carbon platform ( including trunk, branches, etc.) (  $svn co https://svn.wso2.org/repos/wso2/carbon  )
  2. checkout each above svn code locations separately. ( $svn co https://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.0.0/  . Similarly other two locations.  )

But first method is too time consuming, because it checkout entire Carbon Platform. So second method seems to be a good choice, but is also have some (minor) negative points.
Since codes are not in same svn structure (as in the first method) in file system, maintaining can be a little bit hard. Also If you need to checkout another location ( for example let's say carbon/platform/trunk ), again you need to checkout it separately.
So it is better to have some mechanism to narrow down the svn scope when checkout the code. There are some reference articles in end of this post. Refer them to get more information about this technique. Let's see how we can do this.

Limit the Scope of the SVN checkout


( Here I am using the subversion client which come with Ubuntu )

Let's try to checkout only following structure. 

carbon/
├── kernel
│   └── branches
│       └── 4.0.0
├── orbit
│   └── branches
│       └── 4.0.0
└── platform
    └── branches
        └── 4.0.0



Step 1 - Making svn structure up to 1 level depth. 


type following commands in terminal ( instructions are in bold letters.)

~/wso2 $ svn co https://svn.wso2.org/repos/wso2/carbon --depth immediates
A    carbon/orbit
A    carbon/kernel
A    carbon/platform
Checked out revision 160720.
~/wso2 $ 

this will create following svn structure on the file system.

carbon/
├── kernel
├── orbit
└── platform



Step 2 - Making path kernel/branches/4.0.0


type following commands in terminal ( instructions are in bold letters.)


~/wso2 $ cd carbon/kernel/
~/wso2/carbon/kernel $ svn up --set-depth empty branches
Updating 'branches':
A    branches
Updated to revision 160722. 
~/wso2/carbon/kernel $ cd branches/
~/wso2/carbon/kernel/branches $ svn up --set-depth empty 4.0.0
Updating '4.0.0':
A    4.0.0
Updated to revision 160722.
~/wso2/carbon/kernel/branches $

now we have created following svn structure.
carbon/
├── kernel
│   └── branches
│       └── 4.0.0
├── orbit
└── platform
 But still kernel/branches/4.0.0 doesn't contain any file. So let's update kernel/branches/4.0.0.

move to 4.0.0 directory using 

~/wso2/carbon/kernel/branches $ cd 4.0.0
Then type
~/wso2/carbon/kernel/branches/4.0.0 $ svn up --set-depth infinity
this will update all files located under https://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.0.0/.

Step 3 - Repeat step 2 for other two locations ( for orbit and platform ).




Advantages:

  • All three locations are under some svn tree.
  • Quick.
  • Limits the scope and skips unnecessary locations. 
  • Taking svn up at svn root directory ( in this example carbon ) will update only above three locations which we made using this examples. other will not update.
  • Easy Maintenance.


Reference

  1. http://svnbook.red-bean.com/en/1.7/svn.ref.svn.html
  2. http://svnbook.red-bean.com/en/1.6/svn.advanced.sparsedirs.html