<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Demerson3</id>
	<title>ThinkWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Demerson3"/>
	<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/wiki/Special:Contributions/Demerson3"/>
	<updated>2026-05-08T01:46:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.12</generator>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Tpb&amp;diff=53317</id>
		<title>Tpb</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Tpb&amp;diff=53317"/>
		<updated>2012-01-15T07:22:27Z</updated>

		<summary type="html">&lt;p&gt;Demerson3: debian: tpb is now in stable. fixed link.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot; |&lt;br /&gt;
== tpb - Thinkpad Buttons ==&lt;br /&gt;
TPB is a little program that enables you to use the IBM ThinkPad(tm) special keys.&lt;br /&gt;
&lt;br /&gt;
With TPB it is possible to bind a program to the ThinkPad, Mail, Home and Search button. TPB can also run a callback program on each state change with the changed state and the new state as options. So it is possible to trigger several actions on different events. TPB has a on-screen display (OSD) to show volume, mute, brightness and some other informations. Furthermore TPB supports a software mixer, as the R series ThinkPads have no hardware mixer to change the volume.&lt;br /&gt;
&lt;br /&gt;
TPB has been ported to KDE, yielding the [[KMilo]] plugin.&lt;br /&gt;
||&lt;br /&gt;
&lt;br /&gt;
[[Image:Tpb.jpg]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Project Homepage / Availability ===&lt;br /&gt;
http://www.nongnu.org/tpb/&lt;br /&gt;
&lt;br /&gt;
=== Status ===&lt;br /&gt;
Version 0.6.4&lt;br /&gt;
&lt;br /&gt;
=== Packages ===&lt;br /&gt;
* {{Debian}} packages are available: http://packages.debian.org/stable/utils/tpb&lt;br /&gt;
* {{Gentoo}} ebuild: http://packages.gentoo.org/packages/?category=app-laptop;name=tpb&lt;br /&gt;
* {{Redhat}} packages: http://dag.wieers.com/packages/tpb/&lt;br /&gt;
* {{Ubuntu}} packages: http://packages.ubuntu.com/lucid/tpb&lt;br /&gt;
&lt;br /&gt;
=== Subversion ===&lt;br /&gt;
The sources can be checked out through anonymous SVN with the following instruction set:&lt;br /&gt;
 svn co svn://svn.savannah.nongnu.org/tpb/trunk tpb&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
* [http://www.nongnu.org/tpb/doc/tpb.1.html Man-Page]&lt;br /&gt;
&lt;br /&gt;
=== Sample configuration ===&lt;br /&gt;
* [http://www.nongnu.org/tpb/doc/tpbrc.html /etc/tpbrc]&lt;br /&gt;
* Note that on some systems the &amp;quot;nvram&amp;quot; module will need to be loaded before tpb will work, as tpb needs to write to this device.  If you run tpb in user-space, you will need write permissions (and, possibly, read); it is probably best to simply add users to a &amp;quot;nvram&amp;quot; group. Adding users to the nvram group &lt;br /&gt;
* Alternatively if adding groups/users is not to your taste, then you can add some udev.rules to allow user read/write access to nvram. Create a new script file called 10-local.rules in your udev rules definition directory on Gentoo it is /etc/udev/rules.d&lt;br /&gt;
 # Rule needed for tpb + xosd program&lt;br /&gt;
 &amp;quot;KERNEL==\&amp;quot;nvram\&amp;quot;, MODE=\&amp;quot;664\&amp;quot;&lt;br /&gt;
* Also note that using tpb and xmodmap altogether may cause some problems. For example, on a ThinkPad T60p running under Debian GNU/Linux (Etch, Testing), to map the two buttons next to the up arrow to some function, adding the right lines to ~/.Xmodmap may not be sufficient: you need to specify in your /etc/tpbrc (or ~/.tpbrc) the following line:&lt;br /&gt;
 XEVENTS     OFF&lt;br /&gt;
(You just need to uncomment this line in the sample configuration file.)&lt;br /&gt;
* To automatically start xmodmap. Create an executable script file called xmodmap.sh&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 exec xmodmap /home/MyScripts/.Xmodmap&lt;br /&gt;
where /home/MyScripts/.Xmodmap contains the new key definitions. For more information on defining the thinkpad special keys see [http://www.thinkwiki.org/wiki/Windows_Keys] or [http://www.thinkwiki.org/wiki/How_to_get_special_keys_to_work].&lt;br /&gt;
Create a sym link to the above script file from KDE's autostart directory &lt;br /&gt;
 ln -s /home/MyScripts/xmodmap.sh ~/.kde/Autostart/&lt;br /&gt;
* To automatically start tpb under KDE (note its needs X run successfully). Create an executable script file     &lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH&lt;br /&gt;
 tpb -d&lt;br /&gt;
(Note /usr/local/lib must point to where the library files for Xosd are installed [search for libxosd.*]).&lt;br /&gt;
Finally create a sym link to the above script file from KDE's autostart directory &lt;br /&gt;
 ln -s /home/MyScripts/tpb ~/.kde/Autostart/&lt;br /&gt;
&lt;br /&gt;
=== Contact ===&lt;br /&gt;
Contact the author at [mailto:markus.braun@krawel.de markus.braun@krawel.de].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Related links === &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Tools]]&lt;/div&gt;</summary>
		<author><name>Demerson3</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=ACPI_sleep_power_drain_test_script&amp;diff=53316</id>
		<title>ACPI sleep power drain test script</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=ACPI_sleep_power_drain_test_script&amp;diff=53316"/>
		<updated>2012-01-15T04:34:16Z</updated>

		<summary type="html">&lt;p&gt;Demerson3: note non-POSIX date +%s&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following script will suspend your notebook to ram, and output some statistics about the power drain to {{path|/var/log/battery-test.log}}. The output will look something like this:&lt;br /&gt;
&lt;br /&gt;
 Initial energy reading (18.69) is between 10 and 100 Wh, so power_divider is probably correct.&lt;br /&gt;
 Sat Jan 14 19:57:25 PST 2012&lt;br /&gt;
 Sat Jan 14 19:57:41 PST 2012&lt;br /&gt;
 &lt;br /&gt;
 start second: 1326599845&lt;br /&gt;
   end second: 1326599861&lt;br /&gt;
 time consumed: 16 seconds&lt;br /&gt;
 === WARNING === sleep time was less than 20 minutes: results may not be reliable&lt;br /&gt;
 &lt;br /&gt;
 start energy: 18.69 Wh&lt;br /&gt;
   end energy: 18.64 Wh&lt;br /&gt;
 energy consumed: .05 Wh&lt;br /&gt;
 &lt;br /&gt;
 watts used while asleep = 11.25000000000000001125&lt;br /&gt;
 (values above 1 are high)&lt;br /&gt;
 Your computer is using a lot of power while sleeping.&lt;br /&gt;
 You may wish to refer to http://www.thinkwiki.org/wiki/How_to_reduce_power_consumption&lt;br /&gt;
&lt;br /&gt;
{{NOTE|This Script can be customized in numerous ways:&lt;br /&gt;
*You may wish to pass some quirk mode parameters to pm-suspend, or use a different suspend method -- adjust the suspend_func function, and/or pm_params. You should really make sure pm-suspend works before using this script :)&lt;br /&gt;
*different versions of the linux kernel combined with different hardware may report power in different units. Newer kernels use micro- rather than milli- units; and some R32 models report values in centi- rather than milli- units. Adjust the power_divider variable to compensate for these discrepancies.&lt;br /&gt;
*The script assumes you have only one battery. If you have a second battery (for example, an UltraBay Slim battery), take it out for this test or change the BATTERY variable from &amp;quot;BAT0&amp;quot; to &amp;quot;BAT1&amp;quot;. If you do the latter, you will get bogus results if the second battery is run down while sleeping.&lt;br /&gt;
*The usage threshold of 0.8 Watt may be too low or high for displaying a warning. You can adjust it if you like&lt;br /&gt;
*If you are using a really old kernel that does not support /sys/class/power_supply then you can uncomment the older get_energy and get_status lines}}&lt;br /&gt;
&lt;br /&gt;
Please save this script to a file, e.g. {{path|test-sleep-power-drain.sh}}, make it executable ({{cmdroot|chmod +x test-sleep-power-drain.sh}}) and execute it as root while your notebook is running on battery power. To get representative values you should leave the notebook suspended for at least 20 minutes.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # test-sleep-battery-usage.sh&lt;br /&gt;
 # test script for measuring power drain during suspend-to-ram with ACPI&lt;br /&gt;
 # you should carefully read through this script and make adjustments as necessary before running it!&lt;br /&gt;
 # http://www.thinkwiki.org/wiki/ACPI_sleep_power_drain_test_script&lt;br /&gt;
 &lt;br /&gt;
 # written for linux kernel 2.6.38, with older kernel options that you can uncomment if needed&lt;br /&gt;
 # as far as I know, this script contains only one non-POSIX command: date +%s&lt;br /&gt;
 &lt;br /&gt;
 # uncomment and/or change the following parameters if you need to pass them to pm-suspend&lt;br /&gt;
 # pm_params=&amp;quot;--quirk-s3-bios --quirk-s3-mode&amp;quot;&lt;br /&gt;
 # Refer to http://www.thinkwiki.org/wiki/Problem_with_display_remaining_black_after_resume&lt;br /&gt;
 &lt;br /&gt;
 # if you have two batteries, you should take one out (and adjust the battery variable) in order to get an accurate reading&lt;br /&gt;
 battery=BAT0&lt;br /&gt;
 &lt;br /&gt;
 # paths and energy/status functions - these work for linux kernels 2.6.25 through 3.2 and beyond&lt;br /&gt;
 battery_dir=/sys/class/power_supply/$battery&lt;br /&gt;
 get_energy () { cat $battery_dir/energy_now; }&lt;br /&gt;
 get_status () { cat $battery_dir/status; }&lt;br /&gt;
 discharging_string=&amp;quot;Discharging&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # /proc/acpi/battery was deprecated somewhere in the era of linux kernel 2.6.24&lt;br /&gt;
 # if you are using such an old kernel that does not have /sys/class/power_supply, you can uncomment these lines:&lt;br /&gt;
 # battery_dir=/proc/acpi/battery/$battery&lt;br /&gt;
 # get_energy () { grep 'remaining capacity' $battery_dir/state | awk '{print $3}'; }&lt;br /&gt;
 # get_status () { grep '^charging state:' $battery_dir/state | awk '{print $3}'; }&lt;br /&gt;
 # discharging_string=&amp;quot;discharging&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # suspend command&lt;br /&gt;
 suspend_func () { pm-suspend $pm_params; }&lt;br /&gt;
 &lt;br /&gt;
 # here is an older version of the suspend command; you can uncomment it if you want to use it&lt;br /&gt;
 # suspend_func () {&lt;br /&gt;
 # if [ -e /proc/acpi/sleep ]; then&lt;br /&gt;
 #   echo 3 &amp;gt; /proc/acpi/sleep&lt;br /&gt;
 # else&lt;br /&gt;
 #   echo -n mem &amp;gt; /sys/power/state&lt;br /&gt;
 # fi&lt;br /&gt;
 # }&lt;br /&gt;
 &lt;br /&gt;
 # different kernels and different hardware report energy values using different units&lt;br /&gt;
 # energy values should typically be in the range of 15 - 75 Wh (Watt-hours, or Ah, Amp-hours. Whatever :-)&lt;br /&gt;
 # get an energy value from $energy_file, divide by the power_divider, and see what you get...&lt;br /&gt;
 # if yours is 2.5 or 250 rather than 25, adjust the divider&lt;br /&gt;
 power_divider=1000000 # micro watt hours / μWh&lt;br /&gt;
 # power_divider=1000 # milli watt hours / mWh&lt;br /&gt;
 # power_divider=100 # centi watt hours / cWh&lt;br /&gt;
 &lt;br /&gt;
 warning_threshold=0.8 # watts above which we give a warning&lt;br /&gt;
 &lt;br /&gt;
 logfile=/var/log/battery-test.log&lt;br /&gt;
 &lt;br /&gt;
 # it is easier to do copy/paste script tests if failures don't exit the shell :-)&lt;br /&gt;
 do_exit () { exit $1; }&lt;br /&gt;
 &lt;br /&gt;
 # the sed function strips trailing zeros off of the bc result, e.g. 14.50000000000 -&amp;gt; 14.5  (but 0 -&amp;gt; 0)&lt;br /&gt;
 calcfunc () { echo &amp;quot;$@&amp;quot; | bc -l | sed '/^0$/!s,0*$,,'; }&lt;br /&gt;
 # a creative way to compare floating point numbers...&lt;br /&gt;
 a_less_than_b () { case $(echo &amp;quot;$1-$2&amp;quot; | bc) in -*) return 0;; *) return 1;; esac; }&lt;br /&gt;
 &lt;br /&gt;
 which bc &amp;gt;/dev/null || { echo &amp;quot;I need 'bc' to do floating point operations. install it, or change the functions 'calcfunc' and 'a_less_than_b'&amp;quot;; do_exit 1; }&lt;br /&gt;
 &lt;br /&gt;
 test_energy=$(calcfunc $(get_energy)/$power_divider)&lt;br /&gt;
 if a_less_than_b $test_energy 10; then&lt;br /&gt;
   warn_pwr=&amp;quot;less than 10 watt-hours&amp;quot;&lt;br /&gt;
 elif a_less_than_b 100 $test_energy; then&lt;br /&gt;
   warn_pwr=&amp;quot;more than 100 watt-hours&amp;quot;&lt;br /&gt;
 else&lt;br /&gt;
   warn_pwr=&amp;quot;ok&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 if [ $warn_pwr = &amp;quot;ok&amp;quot; ]; then&lt;br /&gt;
   echo &amp;quot;Initial energy reading ($test_energy) is between 10 and 100 Wh, so power_divider is probably correct.&amp;quot; | tee -a $logfile&lt;br /&gt;
 else&lt;br /&gt;
   echo &amp;quot;WARNING: Energy reading ($test_energy) is $warn_pwr. Perhaps you need to adjust the power_divider?&amp;quot; | tee -a $logfile&lt;br /&gt;
   echo -n &amp;quot;Continue with the test anyway? [y/N] &amp;quot;&lt;br /&gt;
   read abort&lt;br /&gt;
   case $abort in [Yy]*) ;; *) do_exit 1;; esac;&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 status=$(get_status)&lt;br /&gt;
 [ $status = $discharging_string ] || { echo &amp;quot;battery status is '$status' -- not '$discharging_string'. We need to run on the battery.&amp;quot;; do_exit 1; }&lt;br /&gt;
 [ $USER = root ] || { echo &amp;quot;must run as root.&amp;quot;; do_exit 1; }&lt;br /&gt;
 &lt;br /&gt;
 # remove USB for external mouse before sleeping&lt;br /&gt;
 modprobe -r usbhid uhci_hcd ehci_hcd&lt;br /&gt;
 &lt;br /&gt;
 # save system time -- is this really necessary?&lt;br /&gt;
 # hwclock --systohc&lt;br /&gt;
 &lt;br /&gt;
 # get start values&lt;br /&gt;
 date | tee -a $logfile&lt;br /&gt;
 start_second=$(date +%s)&lt;br /&gt;
 start_energy_reading=$(get_energy)&lt;br /&gt;
 start_watt_hours=$(calcfunc $start_energy_reading / $power_divider)&lt;br /&gt;
 &lt;br /&gt;
 # go to sleep&lt;br /&gt;
 suspend_func&lt;br /&gt;
 &lt;br /&gt;
 # get end values&lt;br /&gt;
 end_second=$(date +%s)&lt;br /&gt;
 end_energy_reading=$(get_energy)&lt;br /&gt;
 end_watt_hours=$(calcfunc $end_energy_reading / $power_divider)&lt;br /&gt;
 date | tee -a $logfile&lt;br /&gt;
 &lt;br /&gt;
 # restore system time -- see above&lt;br /&gt;
 # hwclock --hctosys&lt;br /&gt;
 &lt;br /&gt;
 #restore usb&lt;br /&gt;
 modprobe uhci_hcd ehci_hcd usbhid&lt;br /&gt;
 &lt;br /&gt;
 secs_consumed=$(calcfunc $end_second-$start_second)&lt;br /&gt;
 hours_consumed=$(calcfunc $secs_consumed/3600)&lt;br /&gt;
 watt_hours_consumed=$(calcfunc $start_watt_hours-$end_watt_hours)&lt;br /&gt;
 sleep_watts=$(calcfunc $watt_hours_consumed/$hours_consumed)&lt;br /&gt;
 &lt;br /&gt;
 echo | tee -a $logfile&lt;br /&gt;
 echo &amp;quot;start second: $start_second&amp;quot; | tee -a $logfile&lt;br /&gt;
 echo &amp;quot;  end second: $end_second&amp;quot; | tee -a $logfile&lt;br /&gt;
 echo &amp;quot;time consumed: $secs_consumed seconds&amp;quot; | tee -a $logfile&lt;br /&gt;
 [ $secs_consumed -lt 1200 ] &amp;amp;&amp;amp; echo &amp;quot;=== WARNING === sleep time was less than 20 minutes: results may not be reliable&amp;quot; | tee -a $logfile&lt;br /&gt;
 echo | tee -a $logfile&lt;br /&gt;
 echo &amp;quot;start energy: $start_watt_hours Wh&amp;quot; | tee -a $logfile&lt;br /&gt;
 echo &amp;quot;  end energy: $end_watt_hours Wh&amp;quot; | tee -a $logfile&lt;br /&gt;
 echo &amp;quot;energy consumed: $watt_hours_consumed Wh&amp;quot; | tee -a $logfile&lt;br /&gt;
 echo | tee -a $logfile&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;watts used while asleep = $sleep_watts&amp;quot; | tee -a $logfile&lt;br /&gt;
 echo &amp;quot;(values above 1 are high)&amp;quot; | tee -a $logfile&lt;br /&gt;
 &lt;br /&gt;
 if a_less_than_b $sleep_watts $warning_threshold; then&lt;br /&gt;
   echo &amp;quot;Results are good-- looks like your computer is sleeping soundly&amp;quot; | tee -a $logfile&lt;br /&gt;
 else&lt;br /&gt;
   echo &amp;quot;Your computer is using a lot of power while sleeping.&amp;quot; | tee -a $logfile&lt;br /&gt;
   echo &amp;quot;You may wish to refer to http://www.thinkwiki.org/wiki/How_to_reduce_power_consumption&amp;quot; | tee -a $logfile&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 echo | tee -a $logfile&lt;br /&gt;
&lt;br /&gt;
The script was originally written by Jan-Hendrik Benter in 2005.&lt;br /&gt;
It was completely rewritten by David Emerson in 2012.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripts]]&lt;/div&gt;</summary>
		<author><name>Demerson3</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=ACPI_sleep_power_drain_test_script&amp;diff=53315</id>
		<title>ACPI sleep power drain test script</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=ACPI_sleep_power_drain_test_script&amp;diff=53315"/>
		<updated>2012-01-15T04:26:30Z</updated>

		<summary type="html">&lt;p&gt;Demerson3: completely rewrote the script. Now supports newer kernels and is more flexible and easier to customize.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following script will suspend your notebook to ram, and output some statistics about the power drain to {{path|/var/log/battery-test.log}}. The output will look something like this:&lt;br /&gt;
&lt;br /&gt;
 Initial energy reading (18.69) is between 10 and 100 Wh, so power_divider is probably correct.&lt;br /&gt;
 Sat Jan 14 19:57:25 PST 2012&lt;br /&gt;
 Sat Jan 14 19:57:41 PST 2012&lt;br /&gt;
 &lt;br /&gt;
 start second: 1326599845&lt;br /&gt;
   end second: 1326599861&lt;br /&gt;
 time consumed: 16 seconds&lt;br /&gt;
 === WARNING === sleep time was less than 20 minutes: results may not be reliable&lt;br /&gt;
 &lt;br /&gt;
 start energy: 18.69 Wh&lt;br /&gt;
   end energy: 18.64 Wh&lt;br /&gt;
 energy consumed: .05 Wh&lt;br /&gt;
 &lt;br /&gt;
 watts used while asleep = 11.25000000000000001125&lt;br /&gt;
 (values above 1 are high)&lt;br /&gt;
 Your computer is using a lot of power while sleeping.&lt;br /&gt;
 You may wish to refer to http://www.thinkwiki.org/wiki/How_to_reduce_power_consumption&lt;br /&gt;
&lt;br /&gt;
{{NOTE|This Script can be customized in numerous ways:&lt;br /&gt;
*You may wish to pass some quirk mode parameters to pm-suspend, or use a different suspend method -- adjust the suspend_func function, and/or pm_params. You should really make sure pm-suspend works before using this script :)&lt;br /&gt;
*different versions of the linux kernel combined with different hardware may report power in different units. Newer kernels use micro- rather than milli- units; and some R32 models report values in centi- rather than milli- units. Adjust the power_divider variable to compensate for these discrepancies.&lt;br /&gt;
*The script assumes you have only one battery. If you have a second battery (for example, an UltraBay Slim battery), take it out for this test or change the BATTERY variable from &amp;quot;BAT0&amp;quot; to &amp;quot;BAT1&amp;quot;. If you do the latter, you will get bogus results if the second battery is run down while sleeping.&lt;br /&gt;
*The usage threshold of 0.8 Watt may be too low or high for displaying a warning. You can adjust it if you like&lt;br /&gt;
*If you are using a really old kernel that does not support /sys/class/power_supply then you can uncomment the older get_energy and get_status lines}}&lt;br /&gt;
&lt;br /&gt;
Please save this script to a file, e.g. {{path|test-sleep-power-drain.sh}}, make it executable ({{cmdroot|chmod +x test-sleep-power-drain.sh}}) and execute it as root while your notebook is running on battery power. To get representative values you should leave the notebook suspended for at least 20 minutes.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # test-sleep-battery-usage.sh&lt;br /&gt;
 # test script for measuring power drain during suspend-to-ram with ACPI&lt;br /&gt;
 # you should carefully read through this script and make adjustments as necessary before running it!&lt;br /&gt;
 # http://www.thinkwiki.org/wiki/ACPI_sleep_power_drain_test_script&lt;br /&gt;
 &lt;br /&gt;
 # written for linux kernel 2.6.38, with older kernel options that you can uncomment if needed&lt;br /&gt;
 &lt;br /&gt;
 # uncomment and/or change the following parameters if you need to pass them to pm-suspend&lt;br /&gt;
 # pm_params=&amp;quot;--quirk-s3-bios --quirk-s3-mode&amp;quot;&lt;br /&gt;
 # Refer to http://www.thinkwiki.org/wiki/Problem_with_display_remaining_black_after_resume&lt;br /&gt;
 &lt;br /&gt;
 # if you have two batteries, you should take one out (and adjust the battery variable) in order to get an accurate reading&lt;br /&gt;
 battery=BAT0&lt;br /&gt;
 &lt;br /&gt;
 # paths and energy/status functions - these work for linux kernels 2.6.25 through 3.2 and beyond&lt;br /&gt;
 battery_dir=/sys/class/power_supply/$battery&lt;br /&gt;
 get_energy () { cat $battery_dir/energy_now; }&lt;br /&gt;
 get_status () { cat $battery_dir/status; }&lt;br /&gt;
 discharging_string=&amp;quot;Discharging&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # /proc/acpi/battery was deprecated somewhere in the era of linux kernel 2.6.24&lt;br /&gt;
 # if you are using such an old kernel that does not have /sys/class/power_supply, you can uncomment these lines:&lt;br /&gt;
 # battery_dir=/proc/acpi/battery/$battery&lt;br /&gt;
 # get_energy () { grep 'remaining capacity' $battery_dir/state | awk '{print $3}'; }&lt;br /&gt;
 # get_status () { grep '^charging state:' $battery_dir/state | awk '{print $3}'; }&lt;br /&gt;
 # discharging_string=&amp;quot;discharging&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # suspend command&lt;br /&gt;
 suspend_func () { pm-suspend $pm_params; }&lt;br /&gt;
 &lt;br /&gt;
 # here is an older version of the suspend command; you can uncomment it if you want to use it&lt;br /&gt;
 # suspend_func () {&lt;br /&gt;
 # if [ -e /proc/acpi/sleep ]; then&lt;br /&gt;
 #   echo 3 &amp;gt; /proc/acpi/sleep&lt;br /&gt;
 # else&lt;br /&gt;
 #   echo -n mem &amp;gt; /sys/power/state&lt;br /&gt;
 # fi&lt;br /&gt;
 # }&lt;br /&gt;
 &lt;br /&gt;
 # different kernels and different hardware report energy values using different units&lt;br /&gt;
 # energy values should typically be in the range of 15 - 75 Wh (Watt-hours, or Ah, Amp-hours. Whatever :-)&lt;br /&gt;
 # get an energy value from $energy_file, divide by the power_divider, and see what you get...&lt;br /&gt;
 # if yours is 2.5 or 250 rather than 25, adjust the divider&lt;br /&gt;
 power_divider=1000000 # micro watt hours / μWh&lt;br /&gt;
 # power_divider=1000 # milli watt hours / mWh&lt;br /&gt;
 # power_divider=100 # centi watt hours / cWh&lt;br /&gt;
 &lt;br /&gt;
 warning_threshold=0.8 # watts above which we give a warning&lt;br /&gt;
 &lt;br /&gt;
 logfile=/var/log/battery-test.log&lt;br /&gt;
 &lt;br /&gt;
 # it is easier to do copy/paste script tests if failures don't exit the shell :-)&lt;br /&gt;
 do_exit () { exit $1; }&lt;br /&gt;
 &lt;br /&gt;
 # the sed function strips trailing zeros off of the bc result, e.g. 14.50000000000 -&amp;gt; 14.5  (but 0 -&amp;gt; 0)&lt;br /&gt;
 calcfunc () { echo &amp;quot;$@&amp;quot; | bc -l | sed '/^0$/!s,0*$,,'; }&lt;br /&gt;
 # a creative way to compare floating point numbers...&lt;br /&gt;
 a_less_than_b () { case $(echo &amp;quot;$1-$2&amp;quot; | bc) in -*) return 0;; *) return 1;; esac; }&lt;br /&gt;
 &lt;br /&gt;
 which bc &amp;gt;/dev/null || { echo &amp;quot;I need 'bc' to do floating point operations. install it, or change the functions 'calcfunc' and 'a_less_than_b'&amp;quot;; do_exit 1; }&lt;br /&gt;
 &lt;br /&gt;
 test_energy=$(calcfunc $(get_energy)/$power_divider)&lt;br /&gt;
 if a_less_than_b $test_energy 10; then&lt;br /&gt;
   warn_pwr=&amp;quot;less than 10 watt-hours&amp;quot;&lt;br /&gt;
 elif a_less_than_b 100 $test_energy; then&lt;br /&gt;
   warn_pwr=&amp;quot;more than 100 watt-hours&amp;quot;&lt;br /&gt;
 else&lt;br /&gt;
   warn_pwr=&amp;quot;ok&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 if [ $warn_pwr = &amp;quot;ok&amp;quot; ]; then&lt;br /&gt;
   echo &amp;quot;Initial energy reading ($test_energy) is between 10 and 100 Wh, so power_divider is probably correct.&amp;quot; | tee -a $logfile&lt;br /&gt;
 else&lt;br /&gt;
   echo &amp;quot;WARNING: Energy reading ($test_energy) is $warn_pwr. Perhaps you need to adjust the power_divider?&amp;quot; | tee -a $logfile&lt;br /&gt;
   echo -n &amp;quot;Continue with the test anyway? [y/N] &amp;quot;&lt;br /&gt;
   read abort&lt;br /&gt;
   case $abort in [Yy]*) ;; *) do_exit 1;; esac;&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 status=$(get_status)&lt;br /&gt;
 [ $status = $discharging_string ] || { echo &amp;quot;battery status is '$status' -- not '$discharging_string'. We need to run on the battery.&amp;quot;; do_exit 1; }&lt;br /&gt;
 [ $USER = root ] || { echo &amp;quot;must run as root.&amp;quot;; do_exit 1; }&lt;br /&gt;
 &lt;br /&gt;
 # remove USB for external mouse before sleeping&lt;br /&gt;
 modprobe -r usbhid uhci_hcd ehci_hcd&lt;br /&gt;
 &lt;br /&gt;
 # save system time -- is this really necessary?&lt;br /&gt;
 # hwclock --systohc&lt;br /&gt;
 &lt;br /&gt;
 # get start values&lt;br /&gt;
 date | tee -a $logfile&lt;br /&gt;
 start_second=$(date +%s)&lt;br /&gt;
 start_energy_reading=$(get_energy)&lt;br /&gt;
 start_watt_hours=$(calcfunc $start_energy_reading / $power_divider)&lt;br /&gt;
 &lt;br /&gt;
 # go to sleep&lt;br /&gt;
 suspend_func&lt;br /&gt;
 &lt;br /&gt;
 # get end values&lt;br /&gt;
 end_second=$(date +%s)&lt;br /&gt;
 end_energy_reading=$(get_energy)&lt;br /&gt;
 end_watt_hours=$(calcfunc $end_energy_reading / $power_divider)&lt;br /&gt;
 date | tee -a $logfile&lt;br /&gt;
 &lt;br /&gt;
 # restore system time -- see above&lt;br /&gt;
 # hwclock --hctosys&lt;br /&gt;
 &lt;br /&gt;
 #restore usb&lt;br /&gt;
 modprobe uhci_hcd ehci_hcd usbhid&lt;br /&gt;
 &lt;br /&gt;
 secs_consumed=$(calcfunc $end_second-$start_second)&lt;br /&gt;
 hours_consumed=$(calcfunc $secs_consumed/3600)&lt;br /&gt;
 watt_hours_consumed=$(calcfunc $start_watt_hours-$end_watt_hours)&lt;br /&gt;
 sleep_watts=$(calcfunc $watt_hours_consumed/$hours_consumed)&lt;br /&gt;
 &lt;br /&gt;
 echo | tee -a $logfile&lt;br /&gt;
 echo &amp;quot;start second: $start_second&amp;quot; | tee -a $logfile&lt;br /&gt;
 echo &amp;quot;  end second: $end_second&amp;quot; | tee -a $logfile&lt;br /&gt;
 echo &amp;quot;time consumed: $secs_consumed seconds&amp;quot; | tee -a $logfile&lt;br /&gt;
 [ $secs_consumed -lt 1200 ] &amp;amp;&amp;amp; echo &amp;quot;=== WARNING === sleep time was less than 20 minutes: results may not be reliable&amp;quot; | tee -a $logfile&lt;br /&gt;
 echo | tee -a $logfile&lt;br /&gt;
 echo &amp;quot;start energy: $start_watt_hours Wh&amp;quot; | tee -a $logfile&lt;br /&gt;
 echo &amp;quot;  end energy: $end_watt_hours Wh&amp;quot; | tee -a $logfile&lt;br /&gt;
 echo &amp;quot;energy consumed: $watt_hours_consumed Wh&amp;quot; | tee -a $logfile&lt;br /&gt;
 echo | tee -a $logfile&lt;br /&gt;
 &lt;br /&gt;
 echo &amp;quot;watts used while asleep = $sleep_watts&amp;quot; | tee -a $logfile&lt;br /&gt;
 echo &amp;quot;(values above 1 are high)&amp;quot; | tee -a $logfile&lt;br /&gt;
 &lt;br /&gt;
 if a_less_than_b $sleep_watts $warning_threshold; then&lt;br /&gt;
   echo &amp;quot;Results are good-- looks like your computer is sleeping soundly&amp;quot; | tee -a $logfile&lt;br /&gt;
 else&lt;br /&gt;
   echo &amp;quot;Your computer is using a lot of power while sleeping.&amp;quot; | tee -a $logfile&lt;br /&gt;
   echo &amp;quot;You may wish to refer to http://www.thinkwiki.org/wiki/How_to_reduce_power_consumption&amp;quot; | tee -a $logfile&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 echo | tee -a $logfile&lt;br /&gt;
&lt;br /&gt;
The script was originally written by Jan-Hendrik Benter in 2005.&lt;br /&gt;
It was completely rewritten by David Emerson in 2012.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripts]]&lt;/div&gt;</summary>
		<author><name>Demerson3</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=How_to_enable_the_integrated_fingerprint_reader_with_ThinkFinger&amp;diff=43695</id>
		<title>How to enable the integrated fingerprint reader with ThinkFinger</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=How_to_enable_the_integrated_fingerprint_reader_with_ThinkFinger&amp;diff=43695"/>
		<updated>2009-07-20T18:31:20Z</updated>

		<summary type="html">&lt;p&gt;Demerson3: /* Fix for the fingerprint reader getting too hot */ clean up the fancy init script, add faster alternative&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[How to enable the fingerprint reader]] has a good explanation for using the fingerprint reader with the closed-source binary driver. But there is also an opensource project called [http://thinkfinger.sourceforge.net ThinkFinger] which does the same, but open.&lt;br /&gt;
&lt;br /&gt;
However: The fingerprint reader is an INSECURE device and gives a false sense of security! There has been quite a bit of research by a hacker named Starbug, a member of the Chaos Computer Club, Berlin, Germany. He outlined in two very good talks how to forge each and every available fingerprint sensor available at the cost of a few euros, using materials from your local hardware store, a digicam and a laser printer! Here's some links:&lt;br /&gt;
* [http://www.ccc.de/updates/2007/umsonst-im-supermarkt?language=en  Fingerprint recognition in supermarkets]&lt;br /&gt;
* [ftp://ftp.ccc.de/pub/documentation/Fingerabdruck_Hack/fingerabdruck.mpg Video tutorial for forging fingerprints]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
=== From source ===&lt;br /&gt;
&lt;br /&gt;
Download thinkfinger-0.3.tar.gz from the [http://thinkfinger.sourceforge.net/ homepage] and unpack it somewhere, make sure you have the gcc compiler, libtool, pkg-config, libusb-dev and libpam0g-dev installed, then:&lt;br /&gt;
&lt;br /&gt;
{{cmduser|cd thinkfinger-0.3}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code style=&amp;quot;white-space:nowrap;color:#495988;background-color:white;&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;$&amp;lt;/nowiki&amp;gt; ./configure --prefix=/usr --sysconfdir=/etc --with-securedir=/lib/security --with-birdir=/etc/pam_thinkfinger&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cmduser|make}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|make install}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|/lib/security is the directory, where PAM assumes its modules on Debian and openSUSE, it may vary for your distro!}}&lt;br /&gt;
&lt;br /&gt;
&amp;quot;make install&amp;quot; doesn't create the birdir we specified (where thinkfinger will store users' biometric info), so create it:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|mkdir /etc/pam_thinkfinger}}&lt;br /&gt;
&lt;br /&gt;
If everything went OK assert that you find pam_thinkfinger.so in /lib/security typing:&lt;br /&gt;
&lt;br /&gt;
{{cmduser|ls /lib/security}}&lt;br /&gt;
&lt;br /&gt;
=== From package ===&lt;br /&gt;
&lt;br /&gt;
==== Debian ====&lt;br /&gt;
[http://packages.debian.org/source/experimental/thinkfinger Packages] arrived in Debian experimental on Aug 2nd, 2007 (cf. [http://bugs.debian.org/409563 bug #409563]). To access the experimental packages via apt, add the following lines to your sources.list:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# experimental&lt;br /&gt;
deb ftp://mirrors.kernel.org/debian/ experimental main contrib non-free&lt;br /&gt;
deb-src ftp://mirrors.kernel.org/debian/ experimental main contrib non-free&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where of course you may replace mirrors.kernel.org with your mirror of choice. Just make sure that it hosts the experimental repositories.&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|aptitude update}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|aptitude install libthinkfinger0 libpam-thinkfinger thinkfinger-tools}}&lt;br /&gt;
&lt;br /&gt;
should then get you up and running.&lt;br /&gt;
&lt;br /&gt;
To make everything work you'll have to have permission to work the device ({{cmduser|sudo adduser myself plugdev}} worked for me), and you'll also have to follow instructions below about adding the device to your PAM methods.&lt;br /&gt;
&lt;br /&gt;
==== Ubuntu ====&lt;br /&gt;
&lt;br /&gt;
===== Gutsy =====&lt;br /&gt;
&lt;br /&gt;
From https://wiki.ubuntu.com/ThinkFinger&lt;br /&gt;
&lt;br /&gt;
Add PPA repositories to your sources.list:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
deb     http://ppa.launchpad.net/jldugger/ubuntu gutsy main restricted universe multiverse&lt;br /&gt;
deb-src http://ppa.launchpad.net/jldugger/ubuntu gutsy main restricted universe multiverse&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install necessary packages:&lt;br /&gt;
&lt;br /&gt;
{{cmduser|sudo apt-get install thinkfinger-tools  libpam-thinkfinger}}&lt;br /&gt;
&lt;br /&gt;
===== Hardy =====&lt;br /&gt;
&lt;br /&gt;
Hardy includes the latest thinkfinger and it is up to date with subversion.  Install packages:&lt;br /&gt;
&lt;br /&gt;
{{cmduser|sudo apt-get install thinkfinger-tools libpam-thinkfinger}}&lt;br /&gt;
&lt;br /&gt;
Update the pam configuration files:&lt;br /&gt;
&lt;br /&gt;
{{cmduser|sudo /usr/lib/pam-thinkfinger/pam-thinkfinger-enable}}&lt;br /&gt;
&lt;br /&gt;
Enroll your fingerprint (creates $HOME/.thinkfinger.bir).  If this gives an error about claiming the USB device then a reboot was claimed to work, but in fact it may just be a permissions problem.  {{NOTE|Do not try to enroll using 'sudo' - it will cause hidden permission problems}}&lt;br /&gt;
&lt;br /&gt;
{{cmduser|tf-tool --acquire}}&lt;br /&gt;
&lt;br /&gt;
Check fingerprint enrollment&lt;br /&gt;
&lt;br /&gt;
{{cmduser|tf-tool --verify}}&lt;br /&gt;
&lt;br /&gt;
You can expect everything to work correctly.  Note that you still have to enter your username if prompted but will be able&lt;br /&gt;
to swipe your finger instead of the password.  The prompt will usually be &amp;quot;Password or swipe finger&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Graphical login&lt;br /&gt;
* Text console login&lt;br /&gt;
* sudo&lt;br /&gt;
* screen lock/screen saver&lt;br /&gt;
* Administrative password prompt (eg for update or package managers).  (Note no &amp;quot;or swipe finger&amp;quot; in prompt).&lt;br /&gt;
&lt;br /&gt;
===== Intrepid =====&lt;br /&gt;
After installing from the normal repositories coming with Ubuntu 8.10, you would have to press enter after sweeping finger. (This bug: [https://bugs.launchpad.net/ubuntu/+source/thinkfinger/+bug/256429 https://bugs.launchpad.net/ubuntu/+source/thinkfinger/+bug/256429])&lt;br /&gt;
Therefore Jon Oberheide made an update that can be found here: &lt;br /&gt;
[https://launchpad.net/~jon-oberheide/+archive https://launchpad.net/~jon-oberheide/+archive]&lt;br /&gt;
(As of 2/3/09, this no longer seems to be the case. Just proceed to the install step.)&lt;br /&gt;
&lt;br /&gt;
Add the PPA repositories to your source.list (/etc/apt/source.list):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
deb http://ppa.launchpad.net/jon-oberheide/ubuntu intrepid main&lt;br /&gt;
deb-src http://ppa.launchpad.net/jon-oberheide/ubuntu intrepid main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update installer:&lt;br /&gt;
&lt;br /&gt;
{{cmduser|sudo apt-get update}}&lt;br /&gt;
&lt;br /&gt;
And install:&lt;br /&gt;
&lt;br /&gt;
{{cmduser|sudo apt-get install thinkfinger-tools}}&lt;br /&gt;
&lt;br /&gt;
===== Jaunty =====&lt;br /&gt;
&lt;br /&gt;
The same package by Jon Oberheide is necessary, as with Intrepid, though the package thinkfinger-tools is installed by default.&lt;br /&gt;
&lt;br /&gt;
Add key:&lt;br /&gt;
&lt;br /&gt;
{{cmduser|sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com F2A12FABE936A7BBDC4EA33351DB180D1323E149}}&lt;br /&gt;
&lt;br /&gt;
Add the PPA repositories to your source.list (/etc/apt/source.list):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
deb http://ppa.launchpad.net/jon-oberheide/ppa/ubuntu jaunty main&lt;br /&gt;
deb-src http://ppa.launchpad.net/jon-oberheide/ppa/ubuntu jaunty main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update installer:&lt;br /&gt;
&lt;br /&gt;
{{cmduser|sudo apt-get update}}&lt;br /&gt;
&lt;br /&gt;
And install:&lt;br /&gt;
&lt;br /&gt;
{{cmduser|sudo apt-get install thinkfinger-tools libpam-thinkfinger}}&lt;br /&gt;
&lt;br /&gt;
==== Fedora/Fedora Core ====&lt;br /&gt;
{{cmdroot|yum install thinkfinger}}&lt;br /&gt;
&lt;br /&gt;
==== Gentoo ====&lt;br /&gt;
{{cmdroot|emerge sys-auth/thinkfinger}}&lt;br /&gt;
&lt;br /&gt;
==== OpenSUSE ====&lt;br /&gt;
openSUSE 10.2 includes the package &amp;quot;libthinkfinger&amp;quot; (version 0.1-7) - you will find newer packages [http://beta1.suse.com/private/thoenig/10.2/thinkfinger/ here].&lt;br /&gt;
&lt;br /&gt;
== Testing the driver ==&lt;br /&gt;
&lt;br /&gt;
Now the driver is installed and should be working. You can try it (as root) with&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|tf-tool --acquire}}&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|tf-tool --verify}}&lt;br /&gt;
&lt;br /&gt;
This will ask you to swipe your finger three times, save the fingerprint to /tmp/test.bir and then verify your fingerprint with the bir-file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuring PAM to use ThinkFinger ==&lt;br /&gt;
Now you can configure PAM to use ThinkFinger:&lt;br /&gt;
&lt;br /&gt;
Open {{path|/etc/pam.d/common-auth}} (In FC6, F7, and Gentoo, this file is {{path|/etc/pam.d/system-auth}}):&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|nano -w /etc/pam.d/common-auth}}&lt;br /&gt;
&lt;br /&gt;
Add this line before any pam_unix or pam_unix2 directives:&lt;br /&gt;
 auth     sufficient     pam_thinkfinger.so&lt;br /&gt;
&lt;br /&gt;
If your PAM uses the pam_unix and not the pam_unix2 module, you need to pass a specific argument in&lt;br /&gt;
the /etc/pam.d/common-auth directive to make it consider the password entered at the pam_thinkfinger prompt.&lt;br /&gt;
 auth     required     pam_unix.so try_first_pass&lt;br /&gt;
&lt;br /&gt;
For instance, {{path|/etc/pam.d/common-auth}} looks like this:&lt;br /&gt;
 auth    sufficient      pam_thinkfinger.so&lt;br /&gt;
 auth    required        pam_unix.so nullok_secure try_first_pass&lt;br /&gt;
&lt;br /&gt;
On openSUSE 10.2, it looks like this now:&lt;br /&gt;
 auth    required        pam_env.so&lt;br /&gt;
 auth    sufficient      pam_thinkfinger.so&lt;br /&gt;
 auth    required        pam_unix2.so&lt;br /&gt;
&lt;br /&gt;
On Ubuntu 8.10 - Intrepid Ibex you should just add the following line the the /etc/pam.d/common-auth file so it looks like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
# here are the per-package modules (the &amp;quot;Primary&amp;quot; block)&lt;br /&gt;
auth	sufficient	pam_thinkfinger.so&lt;br /&gt;
auth	[success=1 default=ignore]	pam_unix.so try_first_pass nullok_secure&lt;br /&gt;
# here's the fallback if no module succeeds&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Ubuntu 9.04, you don't need to edit manually, just type:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|sudo /usr/lib/pam-thinkfinger/pam-thinkfinger-enable}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we are ready to add users to thinkfinger. You can add a fingerprint for a user with:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|tf-tool --acquire $USERNAME}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|This may not work for you. Please read the Intrepid Ibex point in the discussion to this page.}}&lt;br /&gt;
&lt;br /&gt;
Now the user should be able to login with his finger instead of the password.&lt;br /&gt;
&lt;br /&gt;
If you would like to use thinkfinger for su, you have to enroll the fingerprint for root user with:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|tf-tool --acquire root}}&lt;br /&gt;
&lt;br /&gt;
{{NOTE|You should see the &amp;quot;Password or swipe finger:&amp;quot; prompt when trying to sudo or su. If you don't, you probably do not have the &amp;quot;User level driver support&amp;quot; compiled into your kernel or the &amp;quot;uinput&amp;quot; module loaded!}}&lt;br /&gt;
&lt;br /&gt;
== xscreensaver/gnome-screensaver ==&lt;br /&gt;
{{NOTE|In Fedora 7, the package has been modified in such a way as to make doing this unnecessary.}}&lt;br /&gt;
&lt;br /&gt;
If you'd like to be able to unlock your screen using the fingerprint reader, you must have current versions of xscreesaver (&amp;gt;~5.03) or gnome-screensaver (&amp;gt;~2.18.2). Then you must give yourself access to the fingerprint reader and your bir-file, because unlike login/gdm/su/sudo, both gnome-screensaver and xscreensaver do not run as root. The following procedure will make the fingerprint reader accessible to members of the &amp;quot;fingerprint&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
Make the group: {{cmdroot|groupadd fingerprint}}&lt;br /&gt;
&lt;br /&gt;
Save the following as {{path|/etc/udev/rules.d/60-thinkfinger.rules}} and run {{cmdroot|sudo /sbin/udevtrigger}}. If you are using a Debian-based distribution, it is likely you are affected by the following [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=489831 bug] where you need to replace {{path|udevtrigger}} with {{path|udevadm trigger}} (with the space!) in order for the following to work. You may need to reboot for this to take effect.&lt;br /&gt;
 #&lt;br /&gt;
 # udev rules file for the thinkfinger fingerprint scanner&lt;br /&gt;
 # &lt;br /&gt;
 # gives access to the fingerprint reader to those in the &amp;quot;fingerprint&amp;quot; group&lt;br /&gt;
 #&lt;br /&gt;
 # Taken from:&lt;br /&gt;
 #  http://www.thinkwiki.org/wiki/How_to_enable_the_fingerprint_reader_with_ThinkFinger&lt;br /&gt;
 # which was taken and modified from:&lt;br /&gt;
 #  http://article.gmane.org/gmane.linux.drivers.thinkfinger/329&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
 # SGS Thomson Microelectronics Fingerprint Reader&lt;br /&gt;
 SYSFS{idVendor}==&amp;quot;0483&amp;quot;, SYSFS{idProduct}==&amp;quot;2016&amp;quot;, SYMLINK+=&amp;quot;input/thinkfinger-%k&amp;quot;, MODE=&amp;quot;0660&amp;quot;, GROUP=&amp;quot;fingerprint&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # the also-needed uinput device&lt;br /&gt;
 KERNEL==&amp;quot;uinput&amp;quot;, MODE=&amp;quot;0660&amp;quot;, GROUP=&amp;quot;fingerprint&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, edit {{path|/etc/pam.d/gnome-screensaver}} so that it looks like this:&lt;br /&gt;
 auth    sufficient      pam_thinkfinger.so&lt;br /&gt;
 auth    required        pam_unix.so try_first_pass nullok_secure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Per user:&lt;br /&gt;
&lt;br /&gt;
# Add him to the group: {{cmdroot|gpasswd -a $USERNAME fingerprint}}&lt;br /&gt;
{{NOTE|The following steps do not need to be done in Ubuntu Intrepid as the bir files are handled differently.}}&lt;br /&gt;
# Make him owner of his bir-file: {{cmdroot|chown $USERNAME:root /etc/pam_thinkfinger/$USERNAME.bir}}&lt;br /&gt;
# Give him read-only access to his bir-file: {{cmdroot|chmod 400 /etc/pam_thinkfinger/$USERNAME.bir}}&lt;br /&gt;
# Give &amp;quot;execute only&amp;quot; access to everyone for the /etc/pam_thinkfinger/ directory: {{cmdroot|chmod o+x /etc/pam_thinkfinger}} (WARNING: this opens up security a little).&lt;br /&gt;
&lt;br /&gt;
== GNOME ==&lt;br /&gt;
&lt;br /&gt;
{{NOTE|1=This problem should be solved if you're using sudo &amp;gt;= 1.6.9p9. Links: [http://savannah.nongnu.org/bugs/?19132], [http://www.sudo.ws/bugs/show_bug.cgi?id=180], [https://bugs.launchpad.net/ubuntu/+source/gksu/+bug/86843]}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
gksu/gksudo doesn't work correctly. It just stays invisible. When starting a su privileged application such as synaptics you will not get prompted for the password. Nevertheless you can swipe your finger and it should authenticate you. Starting synaptics twice makes gksudo visible.&lt;br /&gt;
&lt;br /&gt;
There are two possibilities to solve it:&lt;br /&gt;
* Changing the string &amp;quot;Password or swipe finger:&amp;quot; to a plain &amp;quot;Password:&amp;quot; (like sudo normally would do) in the file pam/pam_thinkfinger.c of the thinkfinger source directory. Of course, in the console you will then only see a &amp;quot;Password:&amp;quot; instead of &amp;quot;Password or swipe finger:&amp;quot; but this is still more usefull than having gksu/gksudo crashing everytime.&lt;br /&gt;
* Patching libgksu with the following patch. This is also a nasty hack until a better solution is implemented.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--- libgksu-2.0.3/libgksu/libgksu.c.orig	2007-06-17 16:00:24.000000000 +0200&lt;br /&gt;
+++ libgksu-2.0.3/libgksu/libgksu.c		2007-06-17 16:00:47.000000000 +0200&lt;br /&gt;
@@ -2663,7 +2663,7 @@&lt;br /&gt;
        */&lt;br /&gt;
       for (counter = 0; counter &amp;lt; 50; counter++)&lt;br /&gt;
 	{&lt;br /&gt;
-	  if (strncmp (buffer, &amp;quot;GNOME_SUDO_PASS&amp;quot;, 15) == 0)&lt;br /&gt;
+	  if (strncmp (buffer, &amp;quot;GNOME_SUDO_PASS&amp;quot;, 15) == 0 || strncmp (buffer, &amp;quot;Password or swi&amp;quot;, 15) == 0)&lt;br /&gt;
 	    break;&lt;br /&gt;
 &lt;br /&gt;
 	  read_line (parent_pipe[0], buffer, 256);&lt;br /&gt;
@@ -2675,7 +2675,7 @@&lt;br /&gt;
       if (context-&amp;gt;debug)&lt;br /&gt;
 	fprintf (stderr, &amp;quot;brute force GNOME_SUDO_PASS ended...\n&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
-      if (strncmp(buffer, &amp;quot;GNOME_SUDO_PASS&amp;quot;, 15) == 0)&lt;br /&gt;
+      if (strncmp(buffer, &amp;quot;GNOME_SUDO_PASS&amp;quot;, 15) == 0 || strncmp(buffer, &amp;quot;Password or swi&amp;quot;, 15) == 0)&lt;br /&gt;
 	{&lt;br /&gt;
 	  gchar *password = NULL;&lt;br /&gt;
 	  gboolean prompt_grab;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KDE ==&lt;br /&gt;
&lt;br /&gt;
Integration in KDE and kdm seems not to be easily possible now. There is a filed [https://bugs.kde.org/show_bug.cgi?id=116682 bug] at kde.org where you can vote for this.&lt;br /&gt;
&lt;br /&gt;
Moreover, kdm in openSUSE 10.3 and in Kubuntu 8.10 crashes when pam_thinkfinger is enabled. A possible &amp;quot;workaround&amp;quot; is downgrading to thinkfinger 0.2.2. &lt;br /&gt;
&lt;br /&gt;
Another workaround is to use Fprint from [http://www.reactivated.net/fprint/wiki/Main_Page] which works quite nicely on my X61s and Kubuntu Hardy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This Howto was copied from [[Installing Ubuntu 6.06 on a ThinkPad T43#Fingerprint_Reader]] and then slightly modified.&lt;br /&gt;
&lt;br /&gt;
== Fix for the fingerprint reader getting too hot ==&lt;br /&gt;
&lt;br /&gt;
If you notice that your fingerprint reader occasionally gets very hot then you might be interested in this section. Thanks to Tino Keitel, he actually gave me this solution through the linux-thinkpad mailing list.&lt;br /&gt;
&lt;br /&gt;
First we need to determine if the reader is not on autosuspend mode.&lt;br /&gt;
Open a terminal and run:&lt;br /&gt;
&lt;br /&gt;
 for i in `find /sys/devices/*/*/usb* -name level` ; do echo -n &amp;quot;$i: &amp;quot; ; cat $i ; done&lt;br /&gt;
&lt;br /&gt;
We care about the devices that are with &amp;quot;on&amp;quot; state and we need to determine if one of those is the reader. So for each of those run something like:&lt;br /&gt;
&lt;br /&gt;
 cat /sys/devices/pci0000\:00/0000\:00\:1a.0/usb1/1-2/idVendor &lt;br /&gt;
 0483&lt;br /&gt;
 &lt;br /&gt;
 cat /sys/devices/pci0000\:00/0000\:00\:1a.0/usb1/1-2/idProduct &lt;br /&gt;
 2016&lt;br /&gt;
&lt;br /&gt;
Use the corresponding path of the devices that you got with &amp;quot;on&amp;quot; state and then compare the output with the output of the lsusb command. An example:&lt;br /&gt;
&lt;br /&gt;
 lsusb output: Bus 001 Device 004: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader&lt;br /&gt;
&lt;br /&gt;
Which matches the output above (0483:2016). Once you have determined the path of your reader then become root with su - and:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;auto&amp;quot; &amp;gt; /sys/&amp;lt;path-to-device&amp;gt;/power/level&lt;br /&gt;
&lt;br /&gt;
After this, the fingerprint reader should be in &amp;quot;autosuspend&amp;quot; and will not get hot anymore. And it will still work as normal.&lt;br /&gt;
&lt;br /&gt;
This will only work for the current session. If you want to make this change persistent and have [http://linux-diag.sourceforge.net/Sysfsutils.html sysfsutils] installed, edit the file {{path|/etc/sysfs.conf}} and add the line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;path-to-device&amp;gt;/power/level = auto&lt;br /&gt;
&lt;br /&gt;
Following the above example, that would be &lt;br /&gt;
&lt;br /&gt;
 devices/pci0000\:00/0000\:00\:1a.0/usb1/1-2/power/level = auto&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can install an init script:&lt;br /&gt;
&lt;br /&gt;
 sudo gedit /etc/init.d/ReaderNoMoreHot&lt;br /&gt;
&lt;br /&gt;
Paste the following into it:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #&lt;br /&gt;
 echo &amp;quot;auto&amp;quot; &amp;gt; /sys/&amp;lt;path-to-device&amp;gt;/power/level&lt;br /&gt;
&lt;br /&gt;
Save and close. Then:&lt;br /&gt;
&lt;br /&gt;
 sudo chmod 755 /etc/init.d/ReaderNoMoreHot&lt;br /&gt;
 sudo update-rc.d ReaderNoMoreHot defaults 90&lt;br /&gt;
&lt;br /&gt;
--[[User:Lunatico|Lunatico]] 19:19, 1 August 2008 (CEST), extended by --[[User:Michaelthomas h|Michaelthomas h]] 23:36, 9 August 2008 (CEST)&lt;br /&gt;
&lt;br /&gt;
For the init script above, you can use the following more elaborate script, which does all the work for you of identifying the &amp;lt;path-to-device&amp;gt;. This can be useful since the USB device id can change under various circumstances (kernel upgrade etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# find the fingerprint reader and change its power level to autosuspend&lt;br /&gt;
&lt;br /&gt;
usbname=&amp;quot;SGS Thomson Microelectronics Fingerprint Reader&amp;quot;&lt;br /&gt;
usbid=$(lsusb |grep &amp;quot;$usbname&amp;quot; |cut -d' ' -f6);&lt;br /&gt;
[[ -z $usbid ]] &amp;amp;&amp;amp; echo &amp;quot;USB Device \&amp;quot;$usbname\&amp;quot; not found&amp;quot; &amp;amp;&amp;amp; exit 1&lt;br /&gt;
&lt;br /&gt;
unset failed_bool&lt;br /&gt;
find /sys/devices/*/*/usb* -name idVendor -print | (&lt;br /&gt;
  while read vfile; do&lt;br /&gt;
    dir=$(dirname $vfile);&lt;br /&gt;
    vendor=$(&amp;lt;$vfile);&lt;br /&gt;
    product=$(&amp;lt;$dir/idProduct);&lt;br /&gt;
    if [[ $vendor:$product = $usbid ]]; then&lt;br /&gt;
      plevel_file=$dir/power/level&lt;br /&gt;
      old_level=$(&amp;lt;$plevel_file);&lt;br /&gt;
      [[ $old_level = auto ]] || echo auto &amp;gt;$plevel_file || failed_bool=1&lt;br /&gt;
      break;&lt;br /&gt;
    fi;&lt;br /&gt;
  done&lt;br /&gt;
  if [[ $failed_bool ]]; then&lt;br /&gt;
    echo &amp;quot;Failed to set the fingerprint reader's power level to 'auto'.&amp;quot;&lt;br /&gt;
    exit 1&lt;br /&gt;
  fi&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is an alternate script. The code is cleaner and it's about 20x faster:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# find the fingerprint reader and change its power level to autosuspend&lt;br /&gt;
&lt;br /&gt;
find_manuf=STMicroelectronics&lt;br /&gt;
find_prod=&amp;quot;Biometric Coprocessor&amp;quot;&lt;br /&gt;
&lt;br /&gt;
for devdir in /sys/class/usb_device/*/device; do&lt;br /&gt;
  manuf=$(&amp;lt;$devdir/manufacturer)&lt;br /&gt;
  [[ $manuf = $find_manuf ]] || continue;&lt;br /&gt;
  prod=$(&amp;lt;$devdir/product)&lt;br /&gt;
  [[ $prod = $find_prod ]] || continue;&lt;br /&gt;
  # if we get here then we have the right device!&lt;br /&gt;
  plevel_file=$devdir/power/level&lt;br /&gt;
  old_level=$(&amp;lt;$plevel_file);&lt;br /&gt;
  # if it is already set properly then exit silently:&lt;br /&gt;
  [[ $old_level = auto ]] &amp;amp;&amp;amp; exit 0&lt;br /&gt;
  # if we successfully change it then exit silently:&lt;br /&gt;
  echo auto &amp;gt;$plevel_file &amp;amp;&amp;amp; exit 0&lt;br /&gt;
  echo &amp;quot;Failed to set the fingerprint reader's power level to 'auto'.&amp;quot;&lt;br /&gt;
  exit 1&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
# if we make it through the for loop without exiting, the search failed&lt;br /&gt;
echo &amp;quot;Could not find the $find_manuf $find_prod (fingerprint reader)&amp;quot;&lt;br /&gt;
exit 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Demerson3</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Talk:Code/tp-fancontrol&amp;diff=35058</id>
		<title>Talk:Code/tp-fancontrol</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Talk:Code/tp-fancontrol&amp;diff=35058"/>
		<updated>2007-12-09T01:03:47Z</updated>

		<summary type="html">&lt;p&gt;Demerson3: began discussion section, report of use with t42&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{CodeHeader|&lt;br /&gt;
|filename=tp-fancontrol&lt;br /&gt;
|context=[[ACPI fan control script#Comprehensive_bash_script_with_fine_control_over_fan_speed]]&lt;br /&gt;
|author=[[User:Thinker|Thinker]] and [[User:Spiney|Spiney]]&lt;br /&gt;
|license=GPL v2 or later, or GFDL v1.2 or later&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Discussion ===&lt;br /&gt;
&lt;br /&gt;
Great work, guys!&lt;br /&gt;
&lt;br /&gt;
I have a hitachi HTS548080M9AT00 in my T42 (2373-M1U).&amp;lt;br /&amp;gt;&lt;br /&gt;
It DOES provide the SENSE CONDITION command&amp;lt;br /&amp;gt;&lt;br /&gt;
(works with hdparm -H /dev/hda, or your perl script read_hitachi_temp /dev/hda)&amp;lt;br /&amp;gt;&lt;br /&gt;
however, my system does not provide /sys/block/$DEV/device/model&amp;lt;br /&amp;gt;&lt;br /&gt;
...so the script gives an error about not finding that file, and does the energy-taxing read.&lt;br /&gt;
&lt;br /&gt;
I'm not sure where else to look for that model number ... it's in dmesg, of course. Perhaps it would be appropriate to change the script to just read that information once, from an alternate source (in the case 'model' is not provided in /sys/block/hda/device) rather than every time it polls?&lt;br /&gt;
&lt;br /&gt;
My fan seems to be running pretty consistently at level 2, about 3000 rpm, whether I use the script or leave it to auto-control.&lt;br /&gt;
&lt;br /&gt;
~David Emerson&lt;/div&gt;</summary>
		<author><name>Demerson3</name></author>
		
	</entry>
</feed>