Showing posts with label gentoo. Show all posts
Showing posts with label gentoo. Show all posts

15 Oct 2011

Gentoo on Thinkpad T410: authen using fingerprint (gdm)

Step 1:
Download 2 ebuild files named: fingerprint-gui and upekbsapi-bin from this website http://gpo.zugaina.org.
Step 2: Create digest manifest file for them
cd /usr/portage/sys-auth
mkdir {fingerprint-gui, upekbsapi-bin} 
Copy fingerprint-gui-1.00.ebuild and fingerprint-gui-1.00.ebuild to these directories.
ebuild fingerprint-gui-1.00.ebuild digest 
ebuild  upekbsapi-bin-4.0.0218.ebuild digest 

Step 3: unmark  using package.keywords and install
emerge sys-auth/fingerprint-gui 
it shoud install both fingerprint-gui and upekbsapi-bin

Step 4: unmark libfprint and install it
Step 5: load fingerprint-gui and follow the installation steps to scan and verify your finger.
Step 6: Adding fingerprint-gui into pam and gdm

cat /etc/pam.d/system-auth
auth        required    pam_env.so
auth        sufficient  pam_fingerprint-gui.so try_first_identified
auth        required    pam_unix.so try_first_pass likeauth nullok
auth        optional    pam_permit.so
account        required    pam_unix.so
account        optional    pam_permit.so



cat /etc/pam.d/gdm
#%PAM-1.0
auth optional pam_fingerprint-gui.so -d
auth       optional        pam_env.so
auth       include        system-login
auth       required        pam_nologin.so

account    include        system-login


Logout and login to test new authentication method ;-)


6 Mar 2010

Stupid

Just updated my gentoo box and some features get problem. All should be solved by running "revdep-rebuild" to re-install some missing library. But there's an interesting bug (?) of wicd after update :). You cannot start wicd daemon with error
g3n2 ~ # /etc/init.d/wicd restart
/etc/init.d/wicd: line 12: syntax error: unexpected end of file
 * ERROR:  /etc/init.d/wicd has syntax errors in it; aborting ...
Take a look at wicd init script, someone who made update for wicd did make a mistake:
#!/sbin/runscript
 2 # Copyright 1999-2006 Gentoo Foundation
 3 # Distributed under the terms of the GNU General Public License v2
 4 
 5 opts="start stop restart"
 6 
 7 WICD_DAEMON=/usr/sbin/wicd
 8 WICD_PIDFILE=/var/run/wicd/wicd.pid
 9 
10 depend() {

11                   need dbus
Function depend() has no close parenthesis, and where is start() and stop() function? I don't know.I solved it by adding some line like bellow:
1 #!/sbin/runscript
 2 # Copyright 1999-2006 Gentoo Foundation
 3 # Distributed under the terms of the GNU General Public License v2
 4 
 5 opts="start stop restart"
 6 
 7 WICD_DAEMON=/usr/sbin/wicd
 8 WICD_PIDFILE=/var/run/wicd/wicd.pid
 9 
10 depend() {
11     need dbus
12     }
13 start() {
14             ebegin "Starting wicd daemon"
15                     "${WICD_DAEMON}" >/dev/null 2>&1
16                             eend $?
17 }
18 
19 stop() {
20             ebegin "Stopping wicd daemon"
21                     start-stop-daemon --stop --pidfile "${WICD_PIDFILE}"
22                             eend $?
23 }
Who works for the maintenance of wicd on gentoo? wtf

4 Mar 2010

portage-2.1.8 has new --rebuilt-binaries option

In portage-2.1.8 there's a new emerge --rebuilt-binaries
option that is very useful for people who build binary packages and
install them on multiple computers (using PORTAGE_BINHOST or shared
PKGDIR). The option causes packages to be automatically reinstalled in
cases when rebuilt binary packages are available (due to revdep-rebuild
or similar cases).
Rebuilds are detected by comparison of BUILD_TIME package metadata.
This option is enabled automatically when using binary packages
(--usepkgonly or --getbinpkgonly) together with --update and --deep.


http://blogs.gentoo.org/zmedico/2010/03/03/rebuilt_binaries_portage_2_1-8

29 Nov 2009

[New toy] Download HD wallpaper

Last night I went around the Internet to find some good wallpapers for my 1650*1050 laptop screen, then I found a good place with many wps divided into many types, and ready to be downloaded. One problem everyone will get is they just provide link to download 1 wallpaper at a time, so this script came out :).
I'm actually not a programmer, I write script just to make thing work, then it works, that's all. If someone can make it better, please let me know.
At the end, enjoy!
update 1: python script
#/usr/bin/env python
# hungnv coded
# Usage: hdwp.py then choose type
import os
types = ['abstract', 'computer', 'nature', 'travel', 'cars', 'celerbrities', 'animal']
def _getlink(bi, num, prefix):
        address = 'http://www.hdwallpapers.net/gallery/wallpapers/'
        final = (address + '%s' + '/%s%s%s.zip') %(bi, bi, prefix, num)
        return final
def downloader(_xx_):
        link = _getlink(x, i, _xx_)
        print 'Link is: %s' %link
        osvn = 'wget '+_getlink(x, i, _xx_)+' '
        os.system(osvn)
if __name__=='__main__':
        for i in range(len(types)):
                print i+1,'.',types[i]
        x = raw_input('Choose which type of wp you want to download: ')            
        if x in types:
                for i in range(1,108):
                        if i < 10:
                                _pref = '_000'
                                downloader(_pref)
                        elif i > 9 and i < 100:
                                _pref = '_00'
                                downloader(_pref)
                        else:
                                _pref = '_0'
                                downloader(_pref)
        else:
                print 'plz choose type again'
exit()
 Usage: copy and save it whatever name you want, chmod +x then run, enter your choice, wait until it finished. Update 0: I modified to make it sorter.

#/bin/bash

#Script to Download HD wallpaper from http://www.hdwallpapers.net

#hungnv@opensource.com.vn

url="http://www.hdwallpapers.net/gallery/wallpapers/"

pref="_00"

pref1="_000"

pref2="_0"

x[1]="abstract"

x[2]="cars"

x[3]="celeb"

x[4]="computer"

x[5]="animal"

x[6]="nature"

x[7]="travel"

echo -e "\t\t\n           1. Abstract

   2. Cars

   3. Celerbities

   4. Computer

   5. Animal

   6. Nature

   7. Travel

   " 

read -p 'Enter type of wallpaper you want to download: ' type

#for j in $(seq 1 7)

for ((j=0; j&lt;8; j++))
 do
 if [ $type -eq $j ]
 then
  echo Your photo is being downloaded...
  for ((i=1; i&lt;109; i++))
   do
    if [ $i -lt 10 ] 
    then
     wget -O ${x[`echo $j`]}_$i.zip $url${x[`echo $j`]}/${x[`echo $j`]}$pref1$i.zip
      if test ! -s  "${x[`echo $j`]}_$i.zip" 
       then rm -f "${x[`echo $j`]}_$i.zip"
      fi
    elif [ $i -lt 100 ] 
    then
     wget -O ${x[`echo $j`]}_$i.zip $url${x[`echo $j`]}/${x[`echo $j`]}$pref$i.zip
      if test ! -s  "${x[`echo $j`]}_$i.zip" 
       then rm -f "${x[`echo $j`]}_$i.zip"
      fi
    else
     wget -O ${x[`echo $j`]}_$i.zip $url${x[`echo $j`]}/${x[`echo $j`]}$pref2$i.zip
      if test ! -s  "${x[`echo $j`]}_$i.zip" 
       then rm -f "${x[`echo $j`]}_$i.zip"
      fi
    fi
   done
 fi
done
exit 0

Disqus