<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>danielmorlock.de</title>
	<atom:link href="http://www.danielmorlock.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.danielmorlock.de</link>
	<description>It would be nice to ...</description>
	<lastBuildDate>Wed, 08 Feb 2012 09:53:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Firefox Addon for Clipperz Password Manager</title>
		<link>http://www.danielmorlock.de/2011/clipperz-widget/</link>
		<comments>http://www.danielmorlock.de/2011/clipperz-widget/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 12:16:20 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Clipperz Firefox Addon]]></category>
		<category><![CDATA[Addon]]></category>
		<category><![CDATA[Clipperz]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Password Manager]]></category>

		<guid isPermaLink="false">http://www.danielmorlock.de/?p=282</guid>
		<description><![CDATA[Keep your data to yourself! Clipperz Community Edition is a community driven, free and anonymous online password manager based on on the Open Source Javascript Crypto Library. Clipperz is an online service so you can access your passwords from everywhere. Your data is stored decrypted on a server and will be encrypted locally within your [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.clipperz.com"><img class="wp-image-286 alignright" title="Clipperz Community Edition" src="http://www.danielmorlock.de/wp-content/uploads/2011/11/Icon-150x150.png" alt="" width="105" height="105" /></a></p>
<h3>Keep your data to yourself!</h3>
<p><a title="Clipperz Community Edition" href="http://www.clipperz.com/open_source/clipperz_community_edition">Clipperz Community Edition</a> is a community driven, free and anonymous online password manager based on on the Open Source <a title="Javascript Crypto Library" href="http://www.clipperz.com/open_source/javascript_crypto_library">Javascript Crypto Library</a>. Clipperz is an online service so you can access your passwords from everywhere. Your data is stored decrypted on a server and will be encrypted locally within your browser using your personal passphrase. This ensures that only you can access your data! The Clipperz Community Edition is Open Source, so you can <a title="Browse the code at GitHub!" href="https://github.com/clipperz/password-manager">browse the code</a> and see what is going on or you can event host your own Clipperz Community Edition. This is a huge profit since there is no third party involved! If you are interested in hosting your own Clipperz Community Edition backend, refer to the <a title="Host your own Clipperz Community Edition!" href="https://github.com/clipperz/password-manager">building and installing steps</a> at GitHub.</p>
<h3>Clipperz Integration</h3>
<p>Because of Clipperz is a javascript application running as a webpage within your browser, it does not integrate well into your daily process. Before you can proceed an authentication process, you have to login to Clipperz, look for the corresponding password entry and copy &amp; paste your username and password. Clipperz introduces some tools where you can easily create so called direct logins using a javascript bookmarklet. Since this is very inconvenient and time consuming I decided to write a Firefox Addon with some beneficial features:</p>
<ul>
<li>Integrates Clipperz into the Mozilla Firefox browser, no need to open the Clipperz Community Edition webpage.</li>
<li>Automatically fills in your username and password for any registered direct login.</li>
<li>Provides easy access to add, modify or delete a direct login of the currently active webpage.</li>
<li>Integrates a password generator into the Firefox browser.</li>
<li>Enables auto-login for Clipperz webpage and widget if activated.</li>
<li>Connects either to the public Clipperz portal or to a third party hosted Clipperz Community Edition.</li>
<li>Hopefully opens the way to even more features &#8230;</li>
</ul>
<p><span id="more-282"></span></p>
<h3>Be Careful!</h3>
<p>Next to those benefits, you should notice the possible drawbacks. More features and the browser integration might degrade protection and security of your data stored by Clipperz:</p>
<ul>
<li>The auto-login is really comfortable but it is  an open door to your Clipperz account! Enabling your auto-login means that everybody who can access your browser can also access your data stored within Clipperz! You can disable the auto-login in the widget&#8217;s preferences. In this case, you will be prompted for your username and password the first time you start your browser.</li>
<li>Both, the widget and the Clipperz webpage are designed to encrypt your data on-demand. That means, only if you request a password, the decrypted data will be downloaded and encrypted locally using  your passphrase. The Clipperz addon initially downloads and encrypts the URLs of  each of your registered direct logins in oder to match a webpage, your stored a direct login for. If an appropriate webpage was found, the data of this direct login will also be downloaded, encrypted and automatically pasted into the according username and password fields. It is unlikely that the addon matches a wrong webpage, but I will not guarantee, that this could be harmfully used for an exploit or anything else.</li>
<li>In any case, you should notice that you degraded the level of data security Clipperz provides, if using this service in a traditional way. I assume no responsibility and liability for any damage, data loss or data thievery. Please use the Clipperz Firefox addon at your own risk!</li>
</ul>
<h3>Screenshots</h3>
<table class="no_border">
<tbody>
<tr>
<td><a title="Clipperz Widget Preferences" href="http://www.danielmorlock.de/wp-content/uploads/2011/12/11.png" rel="lightbox[clipperz]"><img class="alignnone size-thumbnail wp-image-430" title="Clipperz Addon Preferences" src="http://www.danielmorlock.de/wp-content/uploads/2011/12/11-150x150.png" alt="" width="150" height="150" /></a></td>
<td><a href="http://www.danielmorlock.de/wp-content/uploads/2011/12/21.png" rel="lightbox[clipperz]" title="Use a Clipperz server location of your choice!"><img class="alignnone size-thumbnail wp-image-431" title="Use a Clipperz server location of your choice!" src="http://www.danielmorlock.de/wp-content/uploads/2011/12/21-150x150.png" alt="" width="150" height="150" /></a></td>
<td><a href="http://www.danielmorlock.de/wp-content/uploads/2011/12/41.png" rel="lightbox[clipperz]" title="Use the integrated password generator to generate safe passwords!"><img class="alignnone size-thumbnail wp-image-432" title="Use the integrated password generator to generate safe passwords!" src="http://www.danielmorlock.de/wp-content/uploads/2011/12/41-150x150.png" alt="" width="150" height="150" /></a></td>
</tr>
<tr>
<td><a href="http://www.danielmorlock.de/wp-content/uploads/2011/12/51.png" rel="lightbox[clipperz]" title="Add your logins to Clipperz with just a single click!"><img class="alignnone size-thumbnail wp-image-433" title="Add your logins to Clipperz with just a single click!" src="http://www.danielmorlock.de/wp-content/uploads/2011/12/51-150x150.png" alt="" width="150" height="150" /></a></td>
<td colspan="2"><a href="http://www.danielmorlock.de/wp-content/uploads/2011/12/61.png" rel="lightbox[clipperz]" title="Let clipperz automatically paste your stored passwords!"><img class="alignnone size-thumbnail wp-image-434" title="Let clipperz automatically paste your stored passwords!" src="http://www.danielmorlock.de/wp-content/uploads/2011/12/61-150x150.png" alt="" width="150" height="150" /></a></td>
</tr>
</tbody>
</table>
<h3>Get Involved!</h3>
<p><a href="http://clipperz.com">The Clipperz project</a> is an awesome and pretty useful Open Source project from which everyone can profit! Most parts of this Firefox addon are based on the sources of the Clipperz community edition. So don&#8217;t forget to support those guys doing such a great work! I would also highly appreciate each kind of support to further improve the Clipperz addon. Like the Clipperz Community Edition, the addon is released under the <a href="http://www.gnu.org/licenses/agpl.html">AGPL</a>. Feel free to give your feedback, add issues or access the code at <a title="Github - Social Coding" href="https://github.com/danielmorlock/clipperzwidget">github</a>.<br />
<a href="http://www.danielmorlock.de/wp-content/uploads/2011/12/clipperzwidget-0.2.xpi"><img class="size-full wp-image-411 alignleft" style="margin-top: 60px;" title="Add Clipperz to Firefox!" src="http://www.danielmorlock.de/wp-content/uploads/2011/12/download-logo.png" alt="" width="100" height="105" /></a></p>
<h3>Download the Firefox Addon</h3>
<p>The latest release of the Mozilla Firefox Addon can be downloaded <a href="http://www.danielmorlock.de/wp-content/uploads/2011/12/clipperzwidget-0.2.xpi">here</a>. Note that this project is under ongoing development. If you want to checkout the latest features, you might want to refer to <a href="https://github.com/danielmorlock/clipperz-widget">github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2011/clipperz-widget/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Gentoo on Strato vServer</title>
		<link>http://www.danielmorlock.de/2011/gentoo-on-strato-vserver/</link>
		<comments>http://www.danielmorlock.de/2011/gentoo-on-strato-vserver/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 17:12:39 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[Container]]></category>
		<category><![CDATA[Network Configuration]]></category>
		<category><![CDATA[OpenVZ]]></category>
		<category><![CDATA[Strato]]></category>
		<category><![CDATA[vServer]]></category>

		<guid isPermaLink="false">http://www.danielmorlock.de/?p=253</guid>
		<description><![CDATA[This post is based on a post I found in the Gentoo wiki and should give some tips for setting up a Gentoo container for Virtuozzo/OpenVZ. Before I start, let me say a few words about the background and about my experience with current service providers, which really drive me nuts! A few days ago, [...]]]></description>
			<content:encoded><![CDATA[<p>This post is based on a <a href="http://de.gentoo-wiki.com/wiki/Installation_in_Virtuozzo_Container">post</a> I found in the Gentoo wiki and should give some tips for setting up a Gentoo container for <a href="http://de.wikipedia.org/wiki/Virtuozzo">Virtuozzo/OpenVZ</a>.</p>
<p>Before I start, let me say a few words about the background and about my experience with current service providers, which really drive me nuts! A few days ago, I wanted to install the latest WordPress updates and was confused when the WordPress 3.2.1 update failed because of not supporting MySQL 4 anymore. I checked the version of the MySQL server and figured out that my current hosting provider <strong>Server4You</strong> still has MySQL 4 installed on my web hosting server. So I asked them to update the MySQL server software to a current stable release. Unfortunately they told me that they can&#8217;t update the server since this would bring another huge amount of updates. I don&#8217;t think that any distribution still offers long term support for MySQL 4 &#8211; correct me if I&#8217;m wrong. This is why I decided to rent a vServer from <strong>Strato</strong>.<br /><span id="more-253"></span></p>
<p>As I said, I followed the guide from the Gentoo wiki in order to replace the pre-installed Ubuntu with my favorite Gentoo distribution. Since <a href="http://www.gentoo.de/doc/de/openrc-migration.xml">Baselayout 2 and OpenRC</a>, Gentoo supports the boot process in an OpenVZ container out of the box. Thus creating a Gentoo container is as easy as getting the latest stage3 and changing some configuration files. I also found a <a href="http://azabani.com/gentoovz/">script</a> which expects a stage3 archive and creates another archive which is ready to be started as an OpenVZ container. I found that script after I did all by hand, so I&#8217;ve not tested the script.</p>
<p>Nevertheless, the guide and I guess also the gentoovz script cannot manage the whole configuration and some parts are missing which have to be be done manually. I experienced some trouble with the device naming support <em>udev</em>. Fortunately, I enabled the OpenRC logger in <em>/etc/rc.conf</em>:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.conf <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> logger<br />
<span style="color: #666666; font-style: italic;"># rc_logger launches a logging daemon to log the entire rc process to</span><br />
<span style="color: #007800;">rc_logger</span>=<span style="color: #ff0000;">&quot;YES&quot;</span></div></div>
<p>This will make OpenRC to log the boot process into <em>/var/log/rc.log</em>. After switching back into recovery mode, I found the following in the OpenRC log:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>rc.log<br />
rc boot logging started<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>...<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Mounting <span style="color: #000000; font-weight: bold;">/</span>dev ...<br />
mount: Operation not supported<br />
&nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!!</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
&nbsp;<span style="color: #000000; font-weight: bold;">*</span> ERROR: udev-mount failed to start<br />
&nbsp;<span style="color: #000000; font-weight: bold;">*</span> ERROR: cannot start udev <span style="color: #c20cb9; font-weight: bold;">as</span> udev-mount would not start<span style="color: #000000; font-weight: bold;">&lt;/</span>dev<span style="color: #000000; font-weight: bold;">&gt;</span><br />
rc boot logging stopped</div></div>
<p>It seems that <em>udev-mount</em> did not start because the mount operation is not supported within the OpenVZ container and thus, the boot process stopped. Since we don&#8217;t need udev anyways, uninstalling this service was the fastest solution:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span>emerge <span style="color: #660033;">-C</span> sys-fs<span style="color: #000000; font-weight: bold;">/</span>udev</div></div>
<p></p>
<p>The most time consuming part was in fact the network configuration. I found several other guides mainly based on <a href="http://log.pardus.de/2008/04/gentoo-on-1-vserver.html">this blog</a> where the system configuration is described briefly. Further they figure out their static IP address which is obviously the external IP address of the vServer and a gateway IP address for the default route. Seems to be easy, but it seems that Strato has changed their OpenVZ networking and do not offer any gateway IP address anymore:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ route<br />
Kernel IP routing table<br />
Destination &nbsp; &nbsp; Gateway &nbsp; &nbsp; &nbsp; &nbsp; Genmask &nbsp; &nbsp; &nbsp; &nbsp; Flags Metric Ref &nbsp; &nbsp;Use Iface<br />
loopback &nbsp; &nbsp; &nbsp; &nbsp;localhost &nbsp; &nbsp; &nbsp; 255.0.0.0 &nbsp; &nbsp; &nbsp; UG &nbsp; &nbsp;<span style="color: #000000;">0</span> &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0</span> lo<br />
default &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">*</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.0.0.0 &nbsp; &nbsp; &nbsp; &nbsp; U &nbsp; &nbsp; <span style="color: #000000;">2</span> &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0</span> venet0</div></div>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">ip route</span><br />
127.0.0.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">8</span> via 127.0.0.1 dev lo <br />
default dev venet0 &nbsp;metric <span style="color: #000000;">2</span></div></div>
<p>Further more confusing was the network setup of the rescue system and the pre-configured Ubuntu on the vServer. The virtual interface <em>venet0</em> which is created by OpenVZ as a point-to-point connection between the host and the guest system has had the address of the loop back device <em>127.0.0.1/32</em> &#8211; you noticed the netmask? Further there was an alias <em>venet0.0</em> of the virtual interface which was configured with my static IP address. Obviously this was kind of OpenVZ magic which makes troubleshooting really difficult. It turned out that one do not need the <em>venet0.0</em> alias and it is fine to configure <em>venet0</em> with the external IP address where the vServer should be reachable:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span>net <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> config_venet0<br />
<span style="color: #007800;">config_venet0</span>=<span style="color: #ff0000;">&quot;85.XX.XX.XX netmask 255.255.255.255 broadcast 0.0.0.0&quot;</span></div></div>
<p>Since I don&#8217;t find any configured default gateways on the previously installed system and also not on the rescue system, I gave it a try and exit the rescue system and started the booting of my Gentoo container via the Strato web interface. Of course, I could not reach the server neither with <em>ping</em> nor with <em>ssh</em>. So I&#8217;m not the best in networking but that has shown that I have to set any routing information. I remember that once I used <em>pppoe</em>, I also had to define a default route without a gateway IP address:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">route add default ppp0</div></div>
<p>The question is how to configure that default route in <em>/etc/rc.conf</em>. It seems that this is really difficult to find if you have only networking basics. Google always brought me to Gentoo&#8217;s handbook where they describe how to set the default route with a default gateway IP! I also asked in Gentoo&#8217;s IRC where they did not even believe that this is my network configuration which is in fact working in the rescue system. One of these guys called me a &#8220;Troll&#8221; and I also felt like one &#8211; but that guy did not know the answer either. So trial and error gave me that:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">routes_venet0</span>=<span style="color: #ff0000;">&quot;85.XX.XX.XX/0 dev venet0 scope link <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;default via 0.0.0.0 dev venet0&quot;</span></div></div>
<p>Note the line break after &#8220;scope link&#8221; which turned out to be essential. Adding the remaining parts from the howtos I finally got my networking configuration working:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>conf.d<span style="color: #000000; font-weight: bold;">/</span>net<br />
<span style="color: #007800;">modules</span>=<span style="color: #ff0000;">&quot;!ifconfig iproute2&quot;</span><br />
<span style="color: #007800;">config_venet0</span>=<span style="color: #ff0000;">&quot;85.XX.XX.XX netmask 255.255.255.255 broadcast 0.0.0.0&quot;</span><br />
<span style="color: #007800;">routes_venet0</span>=<span style="color: #ff0000;">&quot;85.XX.XX.XX/0 dev venet0 scope link <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;default via 0.0.0.0 dev venet0&quot;</span><br />
<span style="color: #007800;">dns_servers_venet0</span>=<span style="color: #ff0000;">&quot;81.169.163.106 85.214.7.22&quot;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2011/gentoo-on-strato-vserver/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>USB Tethering on Gentoo using Cyanogenmod7</title>
		<link>http://www.danielmorlock.de/2011/usb-tethering-on-gentoo-using-cyanogenmod7/</link>
		<comments>http://www.danielmorlock.de/2011/usb-tethering-on-gentoo-using-cyanogenmod7/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 12:01:45 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Cyanogenmod]]></category>
		<category><![CDATA[Google Nexus One]]></category>
		<category><![CDATA[USB Tethering]]></category>

		<guid isPermaLink="false">http://www.danielmorlock.de/?p=247</guid>
		<description><![CDATA[I had some trouble when setting up USB tethering on a Gentoo Linux 2.6.38-gentoo-r6. I setup genkernel following a post at forums.gentoo.org. Device Drivers ---&#62; &#160; &#91;*&#93; Network device support ---&#62; &#160; &#160; USB Network Adapters ---&#62; &#160; &#160; &#160; &#91;M&#93; Multi-purpose USB Networking Framework &#160; &#160; &#160; &#160; &#60;M&#62; CDC Ethernet support &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>I had some trouble when setting up USB tethering on a Gentoo Linux 2.6.38-gentoo-r6. I setup genkernel following a <a href="http://forums.gentoo.org/viewtopic-t-843255-start-0-postdays-0-postorder-asc-highlight-.html?sid=966f794b87eb45c8f883e9455f75d358">post</a> at forums.gentoo.org. <span id="more-247"></span></p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Device Drivers ---<span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Network device support ---<span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; USB Network Adapters ---<span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span> Multi-purpose USB Networking Framework<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;</span>M<span style="color: #000000; font-weight: bold;">&gt;</span> CDC Ethernet support<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;</span>M<span style="color: #000000; font-weight: bold;">&gt;</span> CDC EEM support<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;</span>M<span style="color: #000000; font-weight: bold;">&gt;</span> Simple USB Network Links <span style="color: #7a0874; font-weight: bold;">&#40;</span>CDC Ethernet subset<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Embedded ARM Linux links<br />
&nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> USB Support ---<span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;*&gt;</span> USB Modem <span style="color: #7a0874; font-weight: bold;">&#40;</span>CDC ACM<span style="color: #7a0874; font-weight: bold;">&#41;</span> support<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;*&gt;</span> USB Wireless Device Management support</div></div>
<p>After re-building the kernel, we wondered why the module <em>rndis_host</em> was missing, which is required to recognize the USB ethernet device. After searching the kernel configuration we find out, that another option must enabled to compile this module:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Device Drivers ---<span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Network device support ---<span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; USB Network Adapters ---<span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span> Multi-purpose USB Networking Framework<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;</span>M<span style="color: #000000; font-weight: bold;">&gt;</span> Host <span style="color: #000000; font-weight: bold;">for</span> RNDIS and ActiveSync devices <span style="color: #7a0874; font-weight: bold;">&#40;</span>EXPERIMENTAL<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></div>
<p>We now can modprobe the rndis host module which also loads the dependent modules:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ modprobe <span style="color: #660033;">-v</span> rndis_host<br />
insmod <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>2.6.38-gentoo-r6<span style="color: #000000; font-weight: bold;">/</span>kernel<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>mii.ko <br />
insmod <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>2.6.38-gentoo-r6<span style="color: #000000; font-weight: bold;">/</span>kernel<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>usb<span style="color: #000000; font-weight: bold;">/</span>usbnet.ko <br />
insmod <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>2.6.38-gentoo-r6<span style="color: #000000; font-weight: bold;">/</span>kernel<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>usb<span style="color: #000000; font-weight: bold;">/</span>cdc_ether.ko <br />
insmod <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>2.6.38-gentoo-r6<span style="color: #000000; font-weight: bold;">/</span>kernel<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>usb<span style="color: #000000; font-weight: bold;">/</span>rndis_host.ko</div></div>
<p>We were using the Google Nexus One with <a href="http://wiki.cyanogenmod.com/index.php?title=Nexus_One:_Full_Update_Guide">CyanogenMod-7.1.0-RC1-N1</a> and Android version 2.3.4. After attaching the device and enabling USB tethering, we got the following dmesg:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">usb <span style="color: #000000;">2</span>-<span style="color: #000000;">1.8</span>: new high speed USB device using ehci_hcd and address <span style="color: #000000;">8</span><br />
usb <span style="color: #000000;">2</span>-<span style="color: #000000;">1.8</span>: New USB device found, <span style="color: #007800;">idVendor</span>=18d1, <span style="color: #007800;">idProduct</span>=4e11<br />
usb <span style="color: #000000;">2</span>-<span style="color: #000000;">1.8</span>: New USB device strings: <span style="color: #007800;">Mfr</span>=<span style="color: #000000;">1</span>, <span style="color: #007800;">Product</span>=<span style="color: #000000;">2</span>, <span style="color: #007800;">SerialNumber</span>=<span style="color: #000000;">3</span><br />
usb <span style="color: #000000;">2</span>-<span style="color: #000000;">1.8</span>: Product: Nexus One<br />
usb <span style="color: #000000;">2</span>-<span style="color: #000000;">1.8</span>: Manufacturer: Google, Inc.<br />
usb <span style="color: #000000;">2</span>-<span style="color: #000000;">1.8</span>: SerialNumber: HT063P801456<br />
usb <span style="color: #000000;">2</span>-<span style="color: #000000;">1.8</span>: bad cdc descriptor</div></div>
<p>We expected a new USB ethernet device <em>usb0</em> but got a <em>bad cdc descriptor</em> error instead. Googling the issue leads us to a wrong way: We found lots of posts and bug entries which indicates kernel bugs e.g. with non-unique USB id&#8217;s or even a not-working Cyanogenmod. Fortunately that does not apply to our issue since we have to enable another kernel setting to fix it:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Device Drivers ---<span style="color: #000000; font-weight: bold;">&gt;</span> <br />
&nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> USB support &nbsp;---<span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;*&gt;</span> &nbsp; USB Gadget Support &nbsp;---<span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;</span>M<span style="color: #000000; font-weight: bold;">&gt;</span> &nbsp; USB Gadget Drivers<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;</span>M<span style="color: #000000; font-weight: bold;">&gt;</span> &nbsp; &nbsp; Ethernet Gadget <span style="color: #7a0874; font-weight: bold;">&#40;</span>with CDC Ethernet support<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp; &nbsp; &nbsp; RNDIS support</div></div>
<p>After re-bulding the kernel, we got the following when attaching the N1 and enabling USB tethering:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">usb <span style="color: #000000;">1</span>-<span style="color: #000000;">3</span>: new high speed USB device using ehci_hcd and address <span style="color: #000000;">5</span><br />
usb <span style="color: #000000;">1</span>-<span style="color: #000000;">3</span>: New USB device found, <span style="color: #007800;">idVendor</span>=18d1, <span style="color: #007800;">idProduct</span>=4e13<br />
usb <span style="color: #000000;">1</span>-<span style="color: #000000;">3</span>: New USB device strings: <span style="color: #007800;">Mfr</span>=<span style="color: #000000;">1</span>, <span style="color: #007800;">Product</span>=<span style="color: #000000;">2</span>, <span style="color: #007800;">SerialNumber</span>=<span style="color: #000000;">3</span><br />
usb <span style="color: #000000;">1</span>-<span style="color: #000000;">3</span>: Product: Nexus One<br />
usb <span style="color: #000000;">1</span>-<span style="color: #000000;">3</span>: Manufacturer: Google, Inc.<br />
usb <span style="color: #000000;">1</span>-<span style="color: #000000;">3</span>: SerialNumber: HT063P801456<br />
rndis_host <span style="color: #000000;">1</span>-<span style="color: #000000;">3</span>:<span style="color: #000000;">1.0</span>: usb0: register <span style="color: #ff0000;">'rndis_host'</span> at usb-0000:00:1a.7-<span style="color: #000000;">3</span>, RNDIS device, ae:b8:2a:f6:5f:b0</div></div>
<p>We now can run <em>ifconfig</em> or <em>dhcpcd</em> in order to configure the new ethernet device to establish a network connection:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ dhcpcd usb0<br />
dhcpcd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">18640</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: version 5.2.12 starting<br />
dhcpcd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">18640</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: usb0: broadcasting <span style="color: #000000; font-weight: bold;">for</span> a lease<br />
dhcpcd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">18640</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: usb0: offered 192.168.42.32 from 192.168.42.129<br />
dhcpcd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">18640</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: usb0: acknowledged 192.168.42.32 from 192.168.42.129<br />
dhcpcd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">18640</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: usb0: checking <span style="color: #000000; font-weight: bold;">for</span> 192.168.42.32<br />
dhcpcd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">18640</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: usb0: leased 192.168.42.32 <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #000000;">3600</span> seconds<br />
dhcpcd<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">18640</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: forked to background, child pid <span style="color: #000000;">18676</span></div></div>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">ping</span> heise.de<br />
PING heise.de <span style="color: #7a0874; font-weight: bold;">&#40;</span>193.99.144.80<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">56</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">84</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> bytes of data.<br />
<span style="color: #000000;">64</span> bytes from redirector.heise.de <span style="color: #7a0874; font-weight: bold;">&#40;</span>193.99.144.80<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #007800;">icmp_req</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">248</span> <span style="color: #007800;">time</span>=<span style="color: #000000;">21.9</span> ms<br />
^C<br />
<span style="color: #660033;">---</span> heise.de <span style="color: #c20cb9; font-weight: bold;">ping</span> statistics <span style="color: #660033;">---</span><br />
<span style="color: #000000;">1</span> packets transmitted, <span style="color: #000000;">1</span> received, <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> packet loss, <span style="color: #000000; font-weight: bold;">time</span> 0ms<br />
rtt min<span style="color: #000000; font-weight: bold;">/</span>avg<span style="color: #000000; font-weight: bold;">/</span>max<span style="color: #000000; font-weight: bold;">/</span>mdev = <span style="color: #000000;">21.999</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">21.999</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">21.999</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.000</span> ms</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2011/usb-tethering-on-gentoo-using-cyanogenmod7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lenovo W510 Integrated Webcam &amp; Face Authentication</title>
		<link>http://www.danielmorlock.de/2011/lenovo-w510-integrated-webcam-face-authentication/</link>
		<comments>http://www.danielmorlock.de/2011/lenovo-w510-integrated-webcam-face-authentication/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 18:44:44 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[Face Authentication]]></category>
		<category><![CDATA[Face Recognition]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[Lenovo]]></category>
		<category><![CDATA[OpenCV]]></category>
		<category><![CDATA[PAM]]></category>
		<category><![CDATA[w510]]></category>

		<guid isPermaLink="false">http://www.danielmorlock.de/?p=207</guid>
		<description><![CDATA[Getting tired of typing my root&#8217;s password each sudo, I was looking for a more efficient method to authenticate myself. Since I don&#8217;t need high security on my notebook, I was wondering whether one can use the integrated webcam of my notebook to do some basic face authentication. There exists a pluggable authentication module (pam) [...]]]></description>
			<content:encoded><![CDATA[<p>Getting tired of typing my root&#8217;s password each sudo, I was looking for a more efficient method to authenticate myself. Since I don&#8217;t need high security on my notebook, I was wondering whether one can use the integrated webcam of my notebook to do some basic face authentication. <a href="http://www.pam-face-authentication.org/">There exists</a> a pluggable authentication module (pam) which is doing face identification based on the <a href="http://opencv.willowgarage.com/wiki/">Open Source Computer Vision</a> library.<span id="more-207"></span><br />
This post assumes a Gentoo Linux on a Lenovo Thinkpad W510 and shows how to setup the face recognition pam modules to be integrated in the Gnome desktop environment. To setup the integrated webcam, please refer to <a href="2010/setup-gentoo-on-lenovo-thinkpad-w510/">this earlier post</a>. After that, the webcam should be recognized as an USB device:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">19</span>:<span style="color: #000000;">30</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000;">0</span> daniel<span style="color: #000000; font-weight: bold;">@</span>ws1 <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>daniel $ lsusb<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-i</span> webcam<br />
Bus 001 Device 006: ID 17ef:480f Lenovo Integrated Webcam <span style="color: #7a0874; font-weight: bold;">&#91;</span>R5U877<span style="color: #7a0874; font-weight: bold;">&#93;</span></div></div>
<p>Because the face authentication it is based on <a href="http://opencv.willowgarage.com/wiki/">OpenCV</a>, we need to install this library first. Fortunately, it&#8217;s located in portage:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span>emerge <span style="color: #660033;">-v</span> opencv</div></div>
<p>Next, we need to download and extract the sources for the face authentication pam:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>pam-face-authentication.googlecode.com<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>pam-face-authentication-<span style="color: #000000;">0.3</span>.tar.gz<br />
$ <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzf</span> pam-face-authentication-<span style="color: #000000;">0.3</span>.tar.gz</div></div>
<p>We can use <a href="http://www.cmake.org">cmake</a> to build the source and install the binaries:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #7a0874; font-weight: bold;">cd</span> pam-face-authentication-<span style="color: #000000;">0.3</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> build <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> build<br />
$ cmake .. &nbsp;<br />
<span style="color: #660033;">--</span> Checking GNUCXX version <span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">4</span> to determine &nbsp;OpenCV <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span> path<br />
<span style="color: #660033;">--</span> Performing Test PAM_MESSAGE_CONST<br />
<span style="color: #660033;">--</span> Performing Test PAM_MESSAGE_CONST - Success<br />
<span style="color: #660033;">--</span> Found PAM: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libpam.so;<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>libdl.so<br />
<span style="color: #660033;">--</span> Configuring <span style="color: #000000; font-weight: bold;">done</span><br />
<span style="color: #660033;">--</span> Generating <span style="color: #000000; font-weight: bold;">done</span><br />
<span style="color: #660033;">--</span> Build files have been written to: <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>daniel<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>today<span style="color: #000000; font-weight: bold;">/</span>pam-face-authentication-<span style="color: #000000;">0.3</span><span style="color: #000000; font-weight: bold;">/</span>build<br />
$ <span style="color: #c20cb9; font-weight: bold;">make</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp;<span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Built target DESKTOP_ENTRY_FILE<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">31</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Built target pam_face_authentication<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">96</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Built target qt-facetrainer<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Built target xwindowFaceAuth<br />
Install the project...<br />
<span style="color: #660033;">--</span> Install configuration: <span style="color: #ff0000;">&quot;&quot;</span><br />
<span style="color: #660033;">--</span> Installing: <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>security<span style="color: #000000; font-weight: bold;">/</span>pam_face_authentication.so<br />
<span style="color: #660033;">--</span> Installing: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>qt-facetrainer<br />
<span style="color: #660033;">--</span> Removed runtime path from <span style="color: #ff0000;">&quot;/usr/local/bin/qt-facetrainer&quot;</span><br />
<span style="color: #660033;">--</span> Installing: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>kde<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">4</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>xwindowFaceAuth<br />
<span style="color: #660033;">--</span> Installing: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>haarcascade_eye.xml<br />
<span style="color: #660033;">--</span> Installing: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>haarcascade_eye_tree_eyeglasses.xml<br />
<span style="color: #660033;">--</span> Installing: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>haarcascade_nose.xml<br />
<span style="color: #660033;">--</span> Installing: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>haarcascade.xml<br />
<span style="color: #660033;">--</span> Installing: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>icons<span style="color: #000000; font-weight: bold;">/</span>pfa-logo.png<br />
<span style="color: #660033;">--</span> Installing: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>applications<span style="color: #000000; font-weight: bold;">/</span>qt-facetrainer.desktop</div></div>
<p>Next, the pam module must be configured to be use for system authentication:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>pam.d<span style="color: #000000; font-weight: bold;">/</span>system-auth<br />
auth&nbsp; &nbsp; &nbsp; &nbsp; required&nbsp; &nbsp; pam_env.so <br />
auth&nbsp; &nbsp; &nbsp; &nbsp; sufficient&nbsp; pam_unix.so try_first_pass likeauth nullok <br />
auth&nbsp; &nbsp; &nbsp; &nbsp; sufficient&nbsp; pam_face_authentication.so<br />
auth&nbsp; &nbsp; &nbsp; &nbsp; required&nbsp; &nbsp; pam_fprintd.so<br />
account required&nbsp; &nbsp; pam_unix.so <br />
&nbsp;<br />
password&nbsp; &nbsp; required&nbsp; &nbsp; pam_cracklib.so <span style="color: #007800;">difok</span>=<span style="color: #000000;">2</span> <span style="color: #007800;">minlen</span>=<span style="color: #000000;">8</span> <span style="color: #007800;">dcredit</span>=<span style="color: #000000;">2</span> <span style="color: #007800;">ocredit</span>=<span style="color: #000000;">2</span> <span style="color: #007800;">retry</span>=<span style="color: #000000;">3</span> <br />
password&nbsp; &nbsp; required&nbsp; &nbsp; pam_unix.so try_first_pass use_authtok nullok sha512 shadow <br />
session &nbsp; &nbsp; required&nbsp; &nbsp; pam_limits.so <br />
session &nbsp; &nbsp; required&nbsp; &nbsp; pam_env.so <br />
session &nbsp; &nbsp; required&nbsp; &nbsp; pam_unix.so <br />
session &nbsp; &nbsp; optional&nbsp; &nbsp; pam_permit.so</div></div>
<p>As you see, I configured <em>pam_face_authentication.so </em> right after the traditional login using password. By doing so, first the user is asked to type a password. If this authentication has failed (or the user just hit enter), it is tried to recognize the face. If this has failed, the user is asked for finger print, which is described in an <a href="2010/lenovo-w510-fingerprint-reader-gnome-integration/">earlier post</a>.</p>
<p>After this steps, we can train the faces for each user:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span>qt-facetrainer</div></div>
<p>In order to enable face recognition authentication for the root user i.e. su and sudo, we have to run <em>qt-facetrainer</em> as root:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span><span style="color: #c20cb9; font-weight: bold;">sudo</span> qt-facetrainer</div></div>
<p>That&#8217;s it. The face recognition is now enabled as fallback method for authentication in any pam based service i.e. gdm/xdm and gnome-screensaver. Please note that this authentication method can be easily circumvented. The <em>qt-facetrainer</em> offers some advanced settings to configure the tradeoff between security and recognition performance in order to avoid false-positives. But one could simply use a photo of the corresponding user in order to grant access to the system. I did not try that, but please keep that in mind. </p>
<p>In any case, this method should neither be used in security critical systems nor it should be used as a required pam method, because different illumination seems also to be a problem so that under bad circumstances, the face cannot be recognized correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2011/lenovo-w510-integrated-webcam-face-authentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Suspend2 on Thinkpad W510</title>
		<link>http://www.danielmorlock.de/2010/suspend2-on-thinkpad-w510/</link>
		<comments>http://www.danielmorlock.de/2010/suspend2-on-thinkpad-w510/#comments</comments>
		<pubDate>Sun, 21 Nov 2010 14:55:44 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[nvidia driver]]></category>
		<category><![CDATA[suspend2]]></category>
		<category><![CDATA[USB 3.0]]></category>
		<category><![CDATA[xhci]]></category>
		<category><![CDATA[xhci_hcd]]></category>

		<guid isPermaLink="false">http://www.danielmorlock.de/?p=197</guid>
		<description><![CDATA[Following my previous posts and using xhci &#38; xhci_hcd for USB 3.0 support leads to problems when suspend to disk/ram: Some USB 3.0 devices just don&#8217;t suspend and the hibernate process will be canceled. On thing we can do is to unbind all devices using the USB kernel modules. A list of active devices can [...]]]></description>
			<content:encoded><![CDATA[<p>Following my previous posts and using <strong>xhci</strong> &amp;<strong> xhci_hcd</strong> for USB 3.0 support leads to problems when suspend to disk/ram: Some USB 3.0 devices just don&#8217;t suspend and the hibernate process will be canceled.<span id="more-197"></span><br />
On thing we can do is to unbind all devices using the USB kernel modules. A list of active devices can be found as follows:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>pci<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>ehci_hcd <span style="color: #660033;">-type</span> l <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> module<br />
<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>pci<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>ehci_hcd<span style="color: #000000; font-weight: bold;">/</span>0000:00:1a.0<br />
<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>pci<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>ehci_hcd<span style="color: #000000; font-weight: bold;">/</span>0000:00:1d.0</div></div>
<p>So we just have to unbind those devices:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> 0000:00:1a.0 <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>pci<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>ehci_hcd<span style="color: #000000; font-weight: bold;">/</span>unbind<br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> 0000:00:1d.0 <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>pci<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>ehci_hcd<span style="color: #000000; font-weight: bold;">/</span>unbind</div></div>
<p>Note that your USB attached devices will stop working until you re-bind them:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> 0000:00:1a.0 <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>pci<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>ehci_hcd<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">bind</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> 0000:00:1d.0 <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>pci<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>ehci_hcd<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">bind</span></div></div>
<p>You can put the stuff together in a scriptlet to do an unbind before suspend and a re-bind on resume:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># -*- sh -*-</span><br />
<br />
AddConfigHandler xhci_parse_option<br />
AddConfigHelp <span style="color: #ff0000;">&quot;xhci_devices &quot;</span> <span style="color: #ff0000;">&quot;Device list to unbind/bind USB devices using xhci on suspend/resume&quot;</span><br />
<br />
xhci_unbind<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">for</span> device <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$devices</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #007800;">$device</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>pci<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>ehci_hcd<span style="color: #000000; font-weight: bold;">/</span>unbind<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">done</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">0</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
xhci_bind<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">for</span> device <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$devices</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #007800;">$device</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>bus<span style="color: #000000; font-weight: bold;">/</span>pci<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>ehci_hcd<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">bind</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">done</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">0</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
xhci_parse_option<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">in</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; xhci_devices<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007800;">devices</span>=<span style="color: #ff0000;">&quot;$*&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">;;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">1</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">esac</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$XHCI_HOOKED</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; AddSuspendHook <span style="color: #000000;">35</span> xhci_unbind<br />
&nbsp; &nbsp; &nbsp; &nbsp; AddResumeHook <span style="color: #000000;">35</span> xhci_bind<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007800;">XHCI_HOOKED</span>=<span style="color: #000000;">1</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">fi</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">0</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span></div></div>
<p>To install the scriptlet just create a file in /etc/hibernate/scriptlets.d and define a device list e.g. in /etc/hibernate/common.conf:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>hibernate<span style="color: #000000; font-weight: bold;">/</span>common.conf<br />
<span style="color: #666666; font-style: italic;"># ...</span><br />
xhci_devices 0000:00:1a.0 0000:00:1d.0<br />
<span style="color: #666666; font-style: italic;"># ...</span></div></div>
<p>Unforunately the aproach above did not work. Some USB devices seems to be still active and refused to suspend. Since I do not really have any USB 3.0 device, I decided to disable USB 3.0 until I get the above approach working:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Device Drivers<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> USB support<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp;xHCI HCD <span style="color: #7a0874; font-weight: bold;">&#40;</span>USB <span style="color: #000000;">3.0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></div></div>
<p>With this kernel configuration, we get suspend to disk working. But resuming the systems brings another problem with NVidia drivers 260.19.21 (64bit): The resumed system was either extremely slow or we just got a white screen. In both cases, restarting X fixed the problem but this is obviously not a solution. I found some <a href="https://help.ubuntu.com/community/NvidiaLaptopBinaryDriverSuspend">information</a> about a bug using NVidia&#8217;s TwinView together with hibernation. Following the proposed workaround, I enabled the NvAGP driver option:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>X11<span style="color: #000000; font-weight: bold;">/</span>xorg.conf.d<span style="color: #000000; font-weight: bold;">/</span>nvidia.conf<br />
Section <span style="color: #ff0000;">&quot;Device&quot;</span><br />
&nbsp; &nbsp; Identifier&nbsp; <span style="color: #ff0000;">&quot;Device0&quot;</span><br />
&nbsp; &nbsp; Driver&nbsp; <span style="color: #ff0000;">&quot;nvidia&quot;</span><br />
&nbsp; &nbsp; VendorName&nbsp; <span style="color: #ff0000;">&quot;NVIDIA Corporation&quot;</span><br />
&nbsp; &nbsp; BoardName &nbsp; <span style="color: #ff0000;">&quot;Nvidia Quadro FX880M&quot;</span><br />
&nbsp; &nbsp; Option&nbsp; <span style="color: #ff0000;">&quot;AddARGBGLXVisuals&quot;</span> <span style="color: #ff0000;">&quot;true&quot;</span><br />
&nbsp; &nbsp; Option&nbsp; <span style="color: #ff0000;">&quot;NoLogo&quot;</span> <span style="color: #ff0000;">&quot;true&quot;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># Enable brightness control</span><br />
&nbsp; &nbsp; Option &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">&quot;RegistryDwords&quot;</span> <span style="color: #ff0000;">&quot;EnableBrightnessControl=1&quot;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># Workaround: Enabling twinview breaks suspend</span><br />
&nbsp; &nbsp; Option &nbsp;<span style="color: #ff0000;">&quot;NvAGP&quot;</span> <span style="color: #ff0000;">&quot;1&quot;</span><br />
<br />
EndSection</div></div>
<p>And prevent the kernel from loading intel_agp module. Either by adding the following line to the modprobe blacklist:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>modprobe.d<span style="color: #000000; font-weight: bold;">/</span>blacklist.conf <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> intel_agp<br />
blacklist intel_agp</div></div>
<p>Or you just make sure that the modules is neither build-in nor compiled as module in the current kernel configuration.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2010/suspend2-on-thinkpad-w510/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lenovo W510 Fingerprint Reader &amp; Gnome Integration</title>
		<link>http://www.danielmorlock.de/2010/lenovo-w510-fingerprint-reader-gnome-integration/</link>
		<comments>http://www.danielmorlock.de/2010/lenovo-w510-fingerprint-reader-gnome-integration/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 00:15:47 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[fingerprint]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[Lenovo]]></category>
		<category><![CDATA[Thinkpad]]></category>
		<category><![CDATA[w510]]></category>

		<guid isPermaLink="false">http://www.danielmorlock.de/?p=161</guid>
		<description><![CDATA[This post is based upon setting up Gentoo on a Lenovo Thinkpad W510 and shows how to setup the fingerprint reader and integrate into Gnome desktop environment. Following Debian GNU/Linux on the Thinkpad W510, the fingerprint work is still in progress. We spent some time to figure out, that the fprintd project is state of [...]]]></description>
			<content:encoded><![CDATA[<p>This post is based upon setting up <a href="http://www.danielmorlock.de/2010/setup-gentoo-on-lenovo-thinkpad-w510/">Gentoo on a Lenovo Thinkpad W510</a> and shows how to setup the fingerprint reader and integrate into Gnome desktop environment.<span id="more-161"></span><br />
Following <a href="http://math.umons.ac.be/an/W510/">Debian GNU/Linux on the Thinkpad W510</a>, the fingerprint work is still in progress. We spent some time to figure out, that the <a href="http://cgit.freedesktop.org/libfprint/fprintd/">fprintd project</a> is state of the art at least for desktop environments using DBus. The fprintd is using <a href="http://cgit.freedesktop.org/libfprint/fprintd/">lfprint</a> which is also available by portage.</p>
<p>Before we start, we have to make sure that the fingerprint read is recognized correctly. On the W510, the fingerprint reader is recognized as USB input device:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ lsusb <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> Finger<br />
Bus 001 Device 004: ID 147e:<span style="color: #000000;">2016</span> Upek Biometric Touchchip<span style="color: #000000; font-weight: bold;">/</span>Touchstrip Fingerprint Sensor</div></div>
<p>If there is no appropriate device id, there might be something wrong with the kernel USB configuration. Refer to <a href="http://www.danielmorlock.de/2010/setup-gentoo-on-lenovo-thinkpad-w510/">Gentoo on a Lenovo Thinkpad W510</a> and make sure, the USB configuration works fine.</p>
<p>Further we installed the corresponding Gentoo packages from portage.</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ emerge <span style="color: #660033;">-av</span> fprintd libfprint<br />
...</div></div>
<p>Note that libfprint is required by fprintd, hence you must not explicit install that package. But it might be that the packages are masked as unstable and you have to unmask them:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-n3</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>portage<span style="color: #000000; font-weight: bold;">/</span>package.keywords<br />
<span style="color: #666666; font-style: italic;"># Fingerprint reader setup, 2010-10-28</span><br />
sys-auth<span style="color: #000000; font-weight: bold;">/</span>fprintd ~amd64<br />
sys-auth<span style="color: #000000; font-weight: bold;">/</span>libfprint ~amd64</div></div>
<p>Finally we start recording fingerprints using fprintd-enroll:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ fprintd-enroll<br />
Using device <span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>reactivated<span style="color: #000000; font-weight: bold;">/</span>Fprint<span style="color: #000000; font-weight: bold;">/</span>Device<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span><br />
Enrolling right index finger.<br />
Enroll result: enroll-stage-passed<br />
Enroll result: enroll-stage-passed<br />
Enroll result: enroll-stage-passed<br />
Enroll result: enroll-stage-passed<br />
Enroll result: enroll-stage-passed<br />
Enroll result: enroll-completed</div></div>
<p>Note that we got some problems when we tried to envroll the fingerprint as non-root user:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ fprintd-enroll<br />
Using device <span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>reactivated<span style="color: #000000; font-weight: bold;">/</span>Fprint<span style="color: #000000; font-weight: bold;">/</span>Device<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span><br />
failed to claim device: Not Authorized: net.reactivated.fprint.device.enroll</div></div>
<p>We fixed that by editing <em>/usr/share/polkit-1/actions/net.reactivated.fprint.device.policy</em> where we allow action id <em>net.reactivated.fprint.device.verify</em> and <em>net.reactivated.fprint.device.enroll</em> for any user and not only for the active one. There might be a bug in sys-auth/consolekit but we did not yet have time to work on that and hence are using that workaround.</p>
<p>Finally, we modified <em>/etc/pam.d/system-auth </em>configuration in order to use the fingerprint mechanism:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>pam.d<span style="color: #000000; font-weight: bold;">/</span>system-auth<br />
auth&nbsp; &nbsp; &nbsp; &nbsp; required&nbsp; &nbsp; pam_env.so<br />
auth&nbsp; &nbsp; &nbsp; &nbsp; sufficient&nbsp; pam_fprintd.so<br />
auth&nbsp; &nbsp; &nbsp; &nbsp; sufficient&nbsp; pam_unix.so try_first_pass likeauth nullok<br />
<span style="color: #666666; font-style: italic;">#auth &nbsp; &nbsp; &nbsp; required&nbsp; &nbsp; pam_unix.so try_first_pass likeauth nullok</span><br />
account &nbsp; &nbsp; required&nbsp; &nbsp; pam_unix.so <br />
<br />
password&nbsp; &nbsp; required&nbsp; &nbsp; pam_cracklib.so <span style="color: #007800;">difok</span>=<span style="color: #000000;">2</span> <span style="color: #007800;">minlen</span>=<span style="color: #000000;">8</span> <span style="color: #007800;">dcredit</span>=<span style="color: #000000;">2</span> <span style="color: #007800;">ocredit</span>=<span style="color: #000000;">2</span> <span style="color: #007800;">retry</span>=<span style="color: #000000;">3</span><br />
password&nbsp; &nbsp; required&nbsp; &nbsp; pam_unix.so try_first_pass use_authtok nullok sha512 shadow<br />
session &nbsp; &nbsp; required&nbsp; &nbsp; pam_limits.so<br />
session &nbsp; &nbsp; required&nbsp; &nbsp; pam_env.so<br />
session &nbsp; &nbsp; required&nbsp; &nbsp; pam_unix.so<br />
session &nbsp; &nbsp; optional&nbsp; &nbsp; pam_permit.so</div></div>
<p>Thank to the Dbus integration, there are no further needs to enable the fingerprint reader in e.g. the gnome screensaver (gnome-screensaver) or the gnome display manager (gdm) &#8211; that stuff works just out of the box:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">su</span> -<br />
Swipe your right index finger on UPEK Eikon <span style="color: #000000;">2</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2010/lenovo-w510-fingerprint-reader-gnome-integration/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setup Gentoo on Lenovo Thinkpad W510</title>
		<link>http://www.danielmorlock.de/2010/setup-gentoo-on-lenovo-thinkpad-w510/</link>
		<comments>http://www.danielmorlock.de/2010/setup-gentoo-on-lenovo-thinkpad-w510/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 19:28:03 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[Lenovo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Thinkpad]]></category>

		<guid isPermaLink="false">http://www.danielmorlock.de/?p=94</guid>
		<description><![CDATA[Setting up Gentoo Linux on a Lenovo device is straight forwarded since Lenovo already supports several linux distributions and lots of manuals and further readings. Related Posts Lenovo W510 Integrated Webcam &#38; Face Authentication Lenovo W510 Fingerprint Reader &#38; Gnome Integration Suspend2 on Thinkpad W510 Debian GNU/Linux on the Thinkpad W510 Find more manuals for [...]]]></description>
			<content:encoded><![CDATA[<p>Setting up Gentoo Linux on a Lenovo device is straight forwarded since Lenovo already supports several linux distributions and lots of manuals and further readings.<span id="more-94"></span></p>
<h2>Related Posts</h2>
<p><a href="2011/lenovo-w510-integrated-webcam-face-authentication">Lenovo W510 Integrated Webcam &amp; Face Authentication</a><br />
<a href="2010/lenovo-w510-fingerprint-reader-gnome-integration/">Lenovo W510 Fingerprint Reader &amp; Gnome Integration</a><br />
<a href="2010/suspend2-on-thinkpad-w510/">Suspend2 on Thinkpad W510</a><br />
<a href="http://math.umons.ac.be/an/W510/">Debian GNU/Linux on the Thinkpad W510</a><br />
Find more manuals for Linux on IBM/Lenovo Laptops on <a href="http://tuxmobil.org/ibm.html">tuxmobile.org</a></p>
<h2>Hardware</h2>
<ul>
<li>Intel(R) Core(TM) i7 CPU Q 720  @ 1.60GHz</li>
</ul>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ws1 linux <span style="color: #666666; font-style: italic;"># lscpu</span><br />
Architecture: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;x86_64<br />
CPU op-mode<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>: &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">32</span>-bit, <span style="color: #000000;">64</span>-bit<br />
CPU<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">8</span><br />
Thread<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> per core: &nbsp; &nbsp;<span style="color: #000000;">2</span><br />
Core<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> per socket: &nbsp; &nbsp;<span style="color: #000000;">4</span><br />
CPU socket<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>: &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">1</span><br />
NUMA node<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">1</span><br />
Vendor ID: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GenuineIntel<br />
CPU family: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">6</span><br />
Model: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">30</span><br />
Stepping: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">5</span><br />
CPU MHz: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">1600.000</span><br />
Virtualization: &nbsp; &nbsp; &nbsp; &nbsp;VT-x<br />
L1d cache: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 32K<br />
L1i cache: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 32K<br />
L2 cache: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;256K<br />
L3 cache: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6144K</div></div>
<ul>
</li>
<li>1x 4 GB DDR3 RAM</li>
<li>128 GB SATA Solid State Disk (Linux System, Linux Swap ~5 GB, Windows NTFS)</li>
<li>500 GB SATA Hard Disk</li>
<li>Nvidia Quadro FX880M</li>
<li>Intel Corporation 82577LM Gigabit Network Connection</li>
<li>Intel Corporation WiFi Link 6000 Series</li>
</ul>
<h3>Details</h3>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ws1 ~ <span style="color: #666666; font-style: italic;"># lspci</span><br />
00:<span style="color: #000000;">00.0</span> Host bridge: Intel Corporation Clarksfield<span style="color: #000000; font-weight: bold;">/</span>Lynnfield DMI <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> <span style="color: #000000;">11</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:<span style="color: #000000;">03.0</span> PCI bridge: Intel Corporation Clarksfield<span style="color: #000000; font-weight: bold;">/</span>Lynnfield PCI Express Root Port <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> <span style="color: #000000;">11</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:<span style="color: #000000;">08.0</span> System peripheral: Intel Corporation Clarksfield<span style="color: #000000; font-weight: bold;">/</span>Lynnfield System Management Registers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> <span style="color: #000000;">11</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:<span style="color: #000000;">08.1</span> System peripheral: Intel Corporation Clarksfield<span style="color: #000000; font-weight: bold;">/</span>Lynnfield Semaphore and Scratchpad Registers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> <span style="color: #000000;">11</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:<span style="color: #000000;">08.2</span> System peripheral: Intel Corporation Clarksfield<span style="color: #000000; font-weight: bold;">/</span>Lynnfield System Control and Status Registers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> <span style="color: #000000;">11</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:<span style="color: #000000;">08.3</span> System peripheral: Intel Corporation Clarksfield<span style="color: #000000; font-weight: bold;">/</span>Lynnfield Miscellaneous Registers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> <span style="color: #000000;">11</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:<span style="color: #000000;">10.0</span> System peripheral: Intel Corporation QPI Link <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> <span style="color: #000000;">11</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:<span style="color: #000000;">10.1</span> System peripheral: Intel Corporation QPI Routing and Protocol Registers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> <span style="color: #000000;">11</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:<span style="color: #000000;">16.0</span> Communication controller: Intel Corporation Ibex Peak HECI Controller <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 06<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:<span style="color: #000000;">16.3</span> Serial controller: Intel Corporation Ibex Peak KT Controller <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 06<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:<span style="color: #000000;">19.0</span> Ethernet controller: Intel Corporation 82577LM Gigabit Network Connection <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 06<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:1a.0 USB Controller: Intel Corporation Ibex Peak USB2 Enhanced Host Controller <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 06<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:1b.0 Audio device: Intel Corporation Ibex Peak High Definition Audio <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 06<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:1c.0 PCI bridge: Intel Corporation Ibex Peak PCI Express Root Port <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 06<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:1c.1 PCI bridge: Intel Corporation Ibex Peak PCI Express Root Port <span style="color: #000000;">2</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 06<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:1c.3 PCI bridge: Intel Corporation Ibex Peak PCI Express Root Port <span style="color: #000000;">4</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 06<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:1c.4 PCI bridge: Intel Corporation Ibex Peak PCI Express Root Port <span style="color: #000000;">5</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 06<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:1c.6 PCI bridge: Intel Corporation Ibex Peak PCI Express Root Port <span style="color: #000000;">7</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 06<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:1c.7 PCI bridge: Intel Corporation Ibex Peak PCI Express Root Port <span style="color: #000000;">8</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 06<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:1d.0 USB Controller: Intel Corporation Ibex Peak USB2 Enhanced Host Controller <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 06<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:1e.0 PCI bridge: Intel Corporation <span style="color: #000000;">82801</span> Mobile PCI Bridge <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> a6<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:1f.0 ISA bridge: Intel Corporation Ibex Peak LPC Interface Controller <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 06<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:1f.2 SATA controller: Intel Corporation Ibex Peak <span style="color: #000000;">6</span> port SATA AHCI Controller <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 06<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
00:1f.3 SMBus: Intel Corporation Ibex Peak SMBus Controller <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 06<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
01:<span style="color: #000000;">00.0</span> VGA compatible controller: nVidia Corporation Device 0a3c <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> a2<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
01:<span style="color: #000000;">00.1</span> Audio device: nVidia Corporation Device 0be2 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> a1<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
03:<span style="color: #000000;">00.0</span> Network controller: Intel Corporation WiFi Link <span style="color: #000000;">6000</span> Series <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> <span style="color: #000000;">35</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
0d:<span style="color: #000000;">00.0</span> SD Host controller: Ricoh Co Ltd Device e822 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 01<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
0d:<span style="color: #000000;">00.1</span> System peripheral: Ricoh Co Ltd Device e230 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 01<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
0f:<span style="color: #000000;">00.0</span> USB Controller: NEC Corporation Device 0194 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 03<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #000000;">17</span>:<span style="color: #000000;">00.0</span> SD Host controller: Ricoh Co Ltd Device e822 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 01<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #000000;">17</span>:<span style="color: #000000;">00.3</span> FireWire <span style="color: #7a0874; font-weight: bold;">&#40;</span>IEEE <span style="color: #000000;">1394</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>: Ricoh Co Ltd Device e832 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 01<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ff:<span style="color: #000000;">00.0</span> Host bridge: Intel Corporation QuickPath Architecture Generic Non-Core Registers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 04<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ff:<span style="color: #000000;">00.1</span> Host bridge: Intel Corporation QuickPath Architecture System Address Decoder <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 04<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ff:<span style="color: #000000;">02.0</span> Host bridge: Intel Corporation QPI Link <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 04<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ff:<span style="color: #000000;">02.1</span> Host bridge: Intel Corporation QPI Physical <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 04<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ff:<span style="color: #000000;">03.0</span> Host bridge: Intel Corporation Lynnfield Integrated Memory Controller <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 04<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ff:<span style="color: #000000;">03.1</span> Host bridge: Intel Corporation Lynnfield Integrated Memory Controller Target Address Decoder <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 04<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ff:<span style="color: #000000;">03.4</span> Host bridge: Intel Corporation Lynnfield Integrated Memory Controller Test Registers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 04<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ff:<span style="color: #000000;">04.0</span> Host bridge: Intel Corporation Lynnfield Integrated Memory Controller Channel <span style="color: #000000;">0</span> Control Registers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 04<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ff:<span style="color: #000000;">04.1</span> Host bridge: Intel Corporation Lynnfield Integrated Memory Controller Channel <span style="color: #000000;">0</span> Address Registers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 04<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ff:<span style="color: #000000;">04.2</span> Host bridge: Intel Corporation Lynnfield Integrated Memory Controller Channel <span style="color: #000000;">0</span> Rank Registers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 04<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ff:<span style="color: #000000;">04.3</span> Host bridge: Intel Corporation Lynnfield Integrated Memory Controller Channel <span style="color: #000000;">0</span> Thermal Control Registers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 04<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ff:<span style="color: #000000;">05.0</span> Host bridge: Intel Corporation Lynnfield Integrated Memory Controller Channel <span style="color: #000000;">1</span> Control Registers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 04<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ff:<span style="color: #000000;">05.1</span> Host bridge: Intel Corporation Lynnfield Integrated Memory Controller Channel <span style="color: #000000;">1</span> Address Registers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 04<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ff:<span style="color: #000000;">05.2</span> Host bridge: Intel Corporation Lynnfield Integrated Memory Controller Channel <span style="color: #000000;">1</span> Rank Registers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 04<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ff:<span style="color: #000000;">05.3</span> Host bridge: Intel Corporation Lynnfield Integrated Memory Controller Channel <span style="color: #000000;">1</span> Thermal Control Registers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 04<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></div>
<h3>64 Bit Architecture</h3>
<p>The laptop comes with the Intel i7 720 QM processor which is a real quad core processor providing 8 cores (4 * 2 due to hyperthreading). Since we have &#8220;only&#8221; 4 GB of DDR3 memory, there would be no further needs for a 64 bit arch! But we have the option to add another 4 GB of RAM where a 64 bit arch would make sense.</p>
<p>The correct arch is <strong>not</strong> <a href="http://en.wikipedia.org/wiki/Ia64">IA-64</a> which is for Itanium processors, a series of 64-bit Intel microprocessors. What we have to use is Intel&#8217;s <a href="http://en.wikipedia.org/wiki/X86-64">x86-64</a> arch which first specs came from AMD and hence is known as <a href="http://de-mirror.org/distro/gentoo/releases/amd64/">AMD64</a>.</p>
<h2>Installing Gentoo Base</h2>
<p>For system setup, we followed the steps in the <a href="http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml">Gentoo Quickinstall Guide</a>. For any issues, read below!</p>
<h3>Booting &amp; Ext4 Filesystem</h3>
<p>We decide to use ext4 filesystem but we ran into trouble (got stupid beginner &#8211; you forgot to compile for boot fs driver into the kernel &#8211; panic) when we tried to boot from that ext4 partition using Grub 0.97. Following the <a href="https://ext4.wiki.kernel.org/index.php/Ext4_Howto#Booting_from_an_ext4_filesystem">ext4.wiki.kernel.org</a>, at least Grub2 1.97 is required for doing so. That&#8217;s the reason we gave Grub2 a chance and set it up following <a href="http://en.gentoo-wiki.com/wiki/Grub2">Gentoo&#8217;s Grub2 Wiki</a>.</p>
<p>If you are chrooted from the Gentoo live CD you probably will get the warning &#8220;Cannot find list of partitions&#8221; when invoking &#8220;grub-mkconfig -o /boot/grub/grub.cfg&#8221;. Any Windows installation won&#8217;t be found in that case. That&#8217;s fine as long you linux was found correctly. Just re-run &#8220;grub-mkconfig -o /boot/grub/grub.cfg&#8221; when you get your system up. Without chrooting, os-prober will work properly.</p>
<p>If you cannot load the kernel, because the root (/dev/sd*) was not found, check whether you have enabled Intel PATA/SATA support at:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Device Drivers<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Serial ATA and Parallel ATA drivers<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> ATA SFF support<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Intel ESB, ICH, PIIX3, PIIX4 PATA<span style="color: #000000; font-weight: bold;">/</span>SATA support</div></div>
<p>Don&#8217;t enable PATA/SATA support as module since like the filesystem driver, this is required before any module is loaded.</p>
<p><a href="http://ubuntuforums.org/showthread.php?t=1195275">Human Beeings Grub2 Howto</a></p>
<h3>USE Flags</h3>
<p>We found the following at the <a href="http://devmanual.gentoo.org/archs/amd64/index.html">Gentoo development guide</a>:</p>
<blockquote><p>Modern x86 processors support special instruction sets like mmx, sse, SSE2 and 3DNow! AMD64 also provides support for them, but in most cases, x86 assembler code is incompatible with AMD64 assembler. There are lots of packages that provide support through USE flags for these instruction sets. Originally, the USE flags were introduced to keep support for older processors such as the Pentium I that can&#8217;t handle such code. Currently, all AMD64s support the same combination of extended instruction sets, so there is no reason to make  use of the mentioned USE flags. That&#8217;s why these USE flags are hard-masked in  all AMD64-profiles. This doesn&#8217;t mean we don&#8217;t support the extensions  themselves, instead, we hard-enable them.</p></blockquote>
<p>So we just ignored the following use flags:</p>
<ul>
<li> mmx</li>
<li> mmx2</li>
<li> sse</li>
<li> sse2</li>
<li> 3dnow</li>
<li> 3dnowext</li>
</ul>
<p>Further we defined the following use flags in make.conf:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Snippet from <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>make.conf<br />
USE = <span style="color: #ff0000;">&quot;a52 aac acpi alsa apache2&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> bash-completion bcmath bluetooth -branding&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> cdda cddb cdparanoia cdr cgi cracklib crypt cscope css cups&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> dbus dri dv dvd dvdr&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> encode&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> fbcon ffmpeg firefox flac&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> gd gif gnome gnome-keyring gnuplot gstreamer gtk gzip&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> imagemagick&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> jpeg&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> -kde&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> lame lapack latex libgda libnotify&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> mad mozilla mp3 mp4 mpeg mplayer mysql&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> -networkmanager nsplugin&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> ogg opengl&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> pdf php png ppds python&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> -qt4 quicktime&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> rdesktop readline recode rss ruby&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> samba simplexml smartcard smp soap spell subversion svg symlink syslog&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> tcl threads tidy tiff tk tokenizer truetype&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> unicode usb&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> v4l v4l2 vcd vhosts vim-syntax vnc&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> wifi win32codecs&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> X xcomposite xml xv xvid&quot;</span><br />
USE = <span style="color: #ff0000;">&quot;<span style="color: #007800;">${USE}</span> zsh-completion&quot;</span></div></div>
<h3>C Flags</h3>
<p>Fortunately, the Gentoo people made their thoughts about <a href="http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel#Core_i7_and_Core_i5.2C_Xeon_55xx">Safe CFlags</a>.</p>
<p>Following their advice, I use the following cflags for my 64 bit profile (amd64) and &gt;= GCC 4.3:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Snippet from <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>make.conf<br />
<span style="color: #007800;">CHOST</span>=<span style="color: #ff0000;">&quot;x86_64-pc-linux-gnu&quot;</span><br />
<span style="color: #007800;">CFLAGS</span>=<span style="color: #ff0000;">&quot;-march=core2 -mtune=generic -O2 -pipe&quot;</span><br />
<span style="color: #007800;">CXXFLAGS</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${CFLAGS}</span>&quot;</span></div></div>
<h3>Kernel Configuration</h3>
<p>We are using latest sys-kernel/tuxonice-sources which is the latest kernel <strong>2.6.34</strong> patched with <a href="http://www.suspend2.net/">tuxonice</a> stuff to enable enhaced suspend. We started from scratch and we&#8217;ve chosen kernel options from which we thought that they were required. Further we partly follow the <a href="http://math.umons.ac.be/an/W510/kernel.conf">configuration</a> which was linked by <a href="http://math.umons.ac.be/an/">numerical analysis team</a> on their <a href="http://math.umons.ac.be/an/W510/">website.</a></p>
<p>Specific things which might be useful:</p>
<ul>
<li>For USB 3.0 support:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Device Drivers<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> USB support<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp;xHCI HCD</div></div>
</li>
<li>For smart card reader to work properly:
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Device Drivers<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span> MMC<span style="color: #000000; font-weight: bold;">/</span>SD<span style="color: #000000; font-weight: bold;">/</span>SDIO card support<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp; Secure Digital Host Controller Interface support</div></div>
</li>
<li>For integrated webcam, enable options for <a href="http://de.gentoo-wiki.com/wiki/Uvcvideo">uvcvideo</a>.</li>
<li>The correct kernel module for Intel Corporatio 82577LM Gigabit Network Connection (e1000e) and for Intel Corporation WiFi Link 6000 Series (iwlagn):
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Device Drivers<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Network device support<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Ethernet <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1000</span> Mbit<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span> Intel<span style="color: #7a0874; font-weight: bold;">&#40;</span>R<span style="color: #7a0874; font-weight: bold;">&#41;</span> PRO<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1000</span> PCI-Express Gigabit Ethernet support<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp;Wireless LAN<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span> Intel Wireless Wifi<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span> Intel Wireless WiFi Next Gen AGN <span style="color: #7a0874; font-weight: bold;">&#40;</span>iwlagn<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></div>
</li>
<li>According processor type and features:
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Processor <span style="color: #7a0874; font-weight: bold;">type</span> and features<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> ScaleMP vSMP<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">8</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> Maximum number of CPUs<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> SMT <span style="color: #7a0874; font-weight: bold;">&#40;</span>Hyperthreading<span style="color: #7a0874; font-weight: bold;">&#41;</span> scheduler support<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Multi-core scheduler support<br />
&nbsp; &nbsp; Processor family <span style="color: #7a0874; font-weight: bold;">&#40;</span>Core <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">/</span>newer Xeon<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></div>
</li>
<li>Thinkpad specific drivers:
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Device Drivers<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> X86 Platform Specific Device Drivers<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> ThinkPad ACPI Laptop Extras<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Allow control of important LEDs <span style="color: #7a0874; font-weight: bold;">&#40;</span>unsafe<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Video output control support<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Support NVRAM polling <span style="color: #000000; font-weight: bold;">for</span> hot keys</div></div>
</li>
</ul>
<p>Our latest running kernel configuration can be found <a href='http://www.danielmorlock.de/wp-content/uploads/2010/10/2.6.36-tuxonice-r3-config.tar.gz'>here</a>.</p>
<h3>X Server</h3>
<p>Further followed <a href="http://www.gentoo.org/doc/en/xorg-config.xml">Gentoo X Server Configuration Howto</a> to setup the X server, framebuffer and the nouveau driver. This guide is using <a href="http://en.wikipedia.org/wiki/Hardware_abstraction_layer">hal</a> which &#8220;makes&#8221; the x server working out-of-the-box without any configuration file.</p>
<p>First try results in:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ws1 ~ <span style="color: #666666; font-style: italic;"># startx</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>EE<span style="color: #7a0874; font-weight: bold;">&#41;</span> AIGLX error: dlopen of <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>dri<span style="color: #000000; font-weight: bold;">/</span>nouveau_dri.so failed <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>dri<span style="color: #000000; font-weight: bold;">/</span>nouveau_dri.so: cannot open shared object file: No such <span style="color: #c20cb9; font-weight: bold;">file</span> or directory<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>EE<span style="color: #7a0874; font-weight: bold;">&#41;</span> AIGLX: reverting to software rendering</div></div>
<p>Following <a href="http://nouveau.freedesktop.org/wiki/TroubleShooting#Xorg.3Anouveaudri.soismissing.28AIGLXerror.29">this</a>, nouveau_dri.so is in development and not supported. In order to get rid of that warning, we have to disable AIGLX in the xorg configuration.</p>
<p>Second try started my login manager but without mouse and keyboard. I double checked whether synaptics and evdev is configured properly:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ws1 ~ <span style="color: #666666; font-style: italic;"># cat /etc/make.conf | grep INPUT</span><br />
<span style="color: #007800;">INPUT_DEVICES</span>=<span style="color: #ff0000;">&quot;evdev synaptics&quot;</span></div></div>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ws1 ~ <span style="color: #666666; font-style: italic;"># eix evdev -o synaptics</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span>I<span style="color: #7a0874; font-weight: bold;">&#93;</span> x11-drivers<span style="color: #000000; font-weight: bold;">/</span>xf86-input-evdev<br />
&nbsp; &nbsp; &nbsp;Available versions: &nbsp;2.3.2 2.4.0 ~2.5.0 <span style="color: #7a0874; font-weight: bold;">&#123;</span>debug<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
&nbsp; &nbsp; &nbsp;Installed versions: &nbsp;2.4.0<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">22</span>:<span style="color: #000000;">44</span>:07 <span style="color: #000000;">10</span><span style="color: #000000; font-weight: bold;">/</span>05<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">10</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>-debug<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp;Homepage: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;http:<span style="color: #000000; font-weight: bold;">//</span>xorg.freedesktop.org<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; &nbsp; &nbsp;Description: &nbsp; &nbsp; &nbsp; &nbsp; Generic Linux input driver<br />
<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span>I<span style="color: #7a0874; font-weight: bold;">&#93;</span> x11-drivers<span style="color: #000000; font-weight: bold;">/</span>xf86-input-synaptics<br />
&nbsp; &nbsp; &nbsp;Available versions: &nbsp;1.2.1 ~1.2.2-r2 ~1.3.0 <span style="color: #7a0874; font-weight: bold;">&#123;</span>debug hal<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
&nbsp; &nbsp; &nbsp;Installed versions: &nbsp;1.2.1<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">22</span>:<span style="color: #000000;">44</span>:<span style="color: #000000;">20</span> <span style="color: #000000;">10</span><span style="color: #000000; font-weight: bold;">/</span>05<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">10</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>-debug -hal<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp;Homepage: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;http:<span style="color: #000000; font-weight: bold;">//</span>cgit.freedesktop.org<span style="color: #000000; font-weight: bold;">/</span>xorg<span style="color: #000000; font-weight: bold;">/</span>driver<span style="color: #000000; font-weight: bold;">/</span>xf86-input-synaptics<span style="color: #000000; font-weight: bold;">/</span><br />
&nbsp; &nbsp; &nbsp;Description: &nbsp; &nbsp; &nbsp; &nbsp; Driver <span style="color: #000000; font-weight: bold;">for</span> Synaptics touchpads<br />
<br />
Found <span style="color: #000000;">2</span> matches.</div></div>
<p>While looking for some troubleshooting docs, we found the Gentoo <a href="http://www.gentoo.org/proj/en/desktop/x/x11/xorg-server-1.8-upgrade-guide.xml">Xorg 1.8 Upgrade Guide</a> which stated that since Xorg 1.8 hal is deprecated and replaced by udev. So to not troubleshooting the deprecated hal, we decided to upgrade to current unstable xorg server. We emerged =x11-base/xorg-server-1.9.0-r2 with the newly introduced udev USE flag and all peripherals worked!</p>
<h3>Nvidia &amp; Compiz</h3>
<p>We want to use <a href="http://en.gentoo-wiki.com/wiki/Compiz-Fusion">compiz-fusion</a> and we tried the unstable nouveau 3D acceleration following the <a href="http://en.gentoo-wiki.com/wiki/Nouveau">Gentoo Wiki</a>. Starting x server worked properly, but when we started compiz-manager to initialize the compiz stuff, things went wrong and we did not get compiz running. This is why we use the proprietary x11-drivers/nvidia-drivers which results in additional problems:</p>
<ul>
<li><span style="text-decoration: line-through;">Dots per inch (dpi) value could not be determined correctly which ends up in huge font-sizes</span><br />
It seems that the nvidia-driver calculates the dpi in a different way than the nouveau driver does. Anyways, we adjusted the font sizes in gnome to fix that.</li>
<li><span style="text-decoration: line-through;">Following <a href="http://www.gentoo.org/doc/en/nvidia-guide.xml#doc_chap3_sect2">Gentoo Nvidia Guide</a>, the in kernel drivers conflicts with the proprietary driver &#8211; in fact when we installed x11-drivers/nvidia-drivers, the framebuffer support was gone.</span><br />
Fortunately, uvesafb is a generic driver and does not program the nvidia card at all (in contrast to the nouveau driver which supports acceleration and stuff). Because uvesafb doesn&#8217;t do that we can use both, nvidia proprietary driver for X and uvesafb driver for frambuffer. We followed the <a href="http://dev.gentoo.org/~spock/projects/uvesafb/">uvesafb guide</a> in order to setup uvesafb. Further we used /sys/bus/platform/drivers/uvesafb/uvesafb.0/vbe_modes in order to get supported modes and modified the grub kernel parameter accordingly:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2</span>:<span style="color: #000000;">24</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000;">0</span> root <span style="color: #000000; font-weight: bold;">/</span>root $ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>grub <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-C2</span> uvesafb<br />
<span style="color: #666666; font-style: italic;"># This line imports any entries to the end of the 'linux' line.</span><br />
<span style="color: #666666; font-style: italic;"># The entries are appended to the end of the normal mode only.</span><br />
<span style="color: #007800;">GRUB_CMDLINE_LINUX_DEFAULT</span>=<span style="color: #ff0000;">&quot;video=uvesafb:1280x800-32,mtrr:3,ywrap&quot;</span></div></div>
</li>
<li><span style="text-decoration: line-through;">After starting compiz fusion using compiz-manager we see a white screen.</span><br />
In order to fix that, we set the nvidia option AddARGBGLXVisuals to true:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2</span>:<span style="color: #000000;">25</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000;">0</span> root <span style="color: #000000; font-weight: bold;">/</span> $ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>X11<span style="color: #000000; font-weight: bold;">/</span>xorg.conf.d<span style="color: #000000; font-weight: bold;">/</span>04-nvidia.conf<br />
Section <span style="color: #ff0000;">&quot;Device&quot;</span><br />
&nbsp; &nbsp; Identifier&nbsp; <span style="color: #ff0000;">&quot;Device0&quot;</span><br />
&nbsp; &nbsp; Driver&nbsp; <span style="color: #ff0000;">&quot;nvidia&quot;</span><br />
&nbsp; &nbsp; VendorName&nbsp; <span style="color: #ff0000;">&quot;NVIDIA Corporation&quot;</span><br />
&nbsp; &nbsp; BoardName &nbsp; <span style="color: #ff0000;">&quot;Nvidia Quadro FX880M&quot;</span><br />
&nbsp; &nbsp; Option&nbsp; <span style="color: #ff0000;">&quot;AddARGBGLXVisuals&quot;</span> <span style="color: #ff0000;">&quot;true&quot;</span><br />
EndSection<br />
<br />
Section <span style="color: #ff0000;">&quot;Extensions&quot;</span><br />
&nbsp; &nbsp; Option&nbsp; <span style="color: #ff0000;">&quot;Composite&quot;</span> <span style="color: #ff0000;">&quot;enable&quot;</span><br />
EndSection</div></div>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2010/setup-gentoo-on-lenovo-thinkpad-w510/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>XML Mass Importer for Google Calendar</title>
		<link>http://www.danielmorlock.de/2010/import-events-into-google-calendar/</link>
		<comments>http://www.danielmorlock.de/2010/import-events-into-google-calendar/#comments</comments>
		<pubDate>Sat, 25 Sep 2010 23:00:05 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Calendar]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Import]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.danielmorlock.de/?p=57</guid>
		<description><![CDATA[This ia a easy-to-use PHP class to import Google events from custom XML files. Requirements My wrapper uses parts of the Zend framework. If you use Gentoo just let portage do that task: emerge -av dev-php5/ZendFramework. I&#8217;m sure that other distributions also maintain packages for that framework. If not, you&#8217;ve to install the Zend Framework [...]]]></description>
			<content:encoded><![CDATA[<p>This ia a easy-to-use PHP class to import Google events from custom XML files.<span id="more-57"></span><br />
<strong>Requirements</strong></p>
<p>My wrapper uses parts of the Zend framework. If you use <a href="www.gentoo.org">Gentoo</a> just let portage do that task: <em><strong>emerge -av dev-php5/ZendFramework</strong></em>.<br />
I&#8217;m sure that other distributions also maintain packages for that framework. If not, you&#8217;ve to install the Zend Framework by hand like desribed <a href="http://framework.zend.com/">here</a>.</p>
<p>You need at least a running PHP interpreter (here: <em><strong>dev-lang/php-5.2.13</strong></em>).</p>
<p><strong>Import XML</strong></p>
<p>In order to start, connect and login to the Google calendar service:</p>
<div class="codecolorer-container php default" style="border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">include</span> <span style="color: #0000ff;">&quot;lib/Import.class.php&quot;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$CalendarID</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;id@group.calendar.google.com&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$Username</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;username&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$Password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// Login to Google service</span><br />
<span style="color: #000088;">$Import</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Import<span style="color: #009900;">&#40;</span><span style="color: #000088;">$Username</span><span style="color: #339933;">,</span> <span style="color: #000088;">$Password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Before we create an event, we&#8217;ve to organize data. This is done by creating xpath mapping between your custom XML and the expected attributes:</p>
<div class="codecolorer-container php default" style="border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">// Define some templates (map event attributes to Google event attributes)</span><br />
<span style="color: #000088;">$Import</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Title</span> <span style="color: #339933;">=</span> “<span style="color: #339933;">&lt;/</span>staffel<span style="color: #339933;">/</span>spiel<span style="color: #339933;">/</span>teamheim<span style="color: #339933;">&gt;</span> – <span style="color: #339933;">&lt;/</span>staffel<span style="color: #339933;">/</span>spiel<span style="color: #339933;">/</span>teamgast<span style="color: #339933;">&gt;</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">&lt;/</span>staffel<span style="color: #339933;">/</span>liganame<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#41;</span>”<span style="color: #339933;">;</span><br />
<span style="color: #000088;">$Import</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Location</span> <span style="color: #339933;">=</span> “<span style="color: #339933;">&lt;/</span>staffel<span style="color: #339933;">/</span>spiel<span style="color: #339933;">/</span>teamheim<span style="color: #339933;">&gt;,</span> <span style="color: #339933;">&lt;/</span>staffel<span style="color: #339933;">/</span>spiel<span style="color: #339933;">/</span>halle<span style="color: #339933;">&gt;</span>”<span style="color: #339933;">;</span><br />
<span style="color: #000088;">$Import</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Start</span> <span style="color: #339933;">=</span> “<span style="color: #339933;">&lt;/</span>staffel<span style="color: #339933;">/</span>spiel<span style="color: #339933;">/</span>datum<span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;/</span>staffel<span style="color: #339933;">/</span>spiel<span style="color: #339933;">/</span>uhrzeit<span style="color: #339933;">&gt;</span>”<span style="color: #339933;">;</span><br />
<span style="color: #000088;">$Import</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Duration</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">120</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// 2 hours</span><br />
<span style="color: #000088;">$Import</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">UniqueKey</span> <span style="color: #339933;">=</span> “<span style="color: #339933;">&lt;/</span>staffel<span style="color: #339933;">/</span>spiel<span style="color: #339933;">/</span>datum<span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;/</span>staffel<span style="color: #339933;">/</span>spiel<span style="color: #339933;">/</span>uhrzeit<span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;/</span>staffel<span style="color: #339933;">/</span>spiel<span style="color: #339933;">/</span>halle<span style="color: #339933;">&gt;</span>”<span style="color: #339933;">;</span></div></div>
<p>As you see, I try to import dates for a national volleyball league. Fortunately they <a href="http://www.volleyball-nordbaden.de/index.php?option=com_content&amp;view=article&amp;id=322&amp;Itemid=418">provide some XML exports</a> like the following:</p>
<div class="codecolorer-container xml default" style="border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;staffel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;liganame<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Bezirksklasse 1 Herren, Süd<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/liganame<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;spiel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;datum<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>09.10.2010<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/datum<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uhrzeit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>15:00<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/uhrzeit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;halle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Otto-Hahn-Gymnasium (OHG)<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/halle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;teamheim<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SSC Karlsruhe III<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/teamheim<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;teamgast<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>TSG Blankenloch II<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/teamgast<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ergebnis<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0:0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ergebnis<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ballpunkte<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0:0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ballpunkte<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/spiel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/staffel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>If you are oblivious, just add some reminders:</p>
<div class="codecolorer-container php default" style="border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$Import</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">AddReminder</span><span style="color: #009900;">&#40;</span>Import<span style="color: #339933;">::</span><span style="color: #004000;">REMINDER_POPUP</span><span style="color: #339933;">,</span> Import<span style="color: #339933;">::</span><span style="color: #004000;">REMINDER_ONE_DAY</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Finally we can start adding our stuff. This can take several time, so please make sure that you set PHP&#8217;s executable environment accordingly:</p>
<div class="codecolorer-container php default" style="border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">// Read XML file containing data for events</span><br />
<span style="color: #000088;">$Import</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Read</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.volleyball-nordbaden.de/xml_export/spiele_1665.xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// Add events to Google calendar</span><br />
<span style="color: #000088;">$Number</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$Import</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.google.com/calendar/feeds/<span style="color: #006699; font-weight: bold;">$CalendarID</span>/private/full&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;//spiel&quot;</span><span style="color: #339933;">,</span> Import<span style="color: #339933;">::</span><span style="color: #004000;">CONFLICT_SHIFT</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Imported <span style="color: #006699; font-weight: bold;">$Number</span> events!&quot;</span><span style="color: #339933;">;</span></div></div>
<p><strong>Sources</strong></p>
<p>You can checkout the latest version from Google code:<br />
<strong><em>svn checkout http://matchimport.googlecode.com/svn/trunk/ matchimport-read-only</em></strong>.<br />
There&#8217;s an example script <a href="http://code.google.com/p/matchimport/source/browse/trunk/run.php">run.php</a> which contains the basic steps to initialize a mass-import.</p>
<p>The source is under Free BDS license, so feel free to modify the code.<br />
Visit the <a href="http://code.google.com/p/matchimport">Google code project</a> for more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2010/import-events-into-google-calendar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Segmentation fault</title>
		<link>http://www.danielmorlock.de/2009/segmentation-fault/</link>
		<comments>http://www.danielmorlock.de/2009/segmentation-fault/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 10:48:54 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Apache2]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Segmentation Fault]]></category>

		<guid isPermaLink="false">http://www.danielmorlock.de/?p=71</guid>
		<description><![CDATA[I experienced that sometimes, web applications partly break with the following apache error log: $ cat /var/log/apache/error.log &#91;Thu Oct 22 11:54:39 2009&#93; &#91;notice&#93; child pid 17157 exit signal Segmentation fault &#40;11&#41; &#91;Thu Oct 22 12:00:06 2009&#93; &#91;notice&#93; child pid 17158 exit signal Segmentation fault &#40;11&#41; &#91;Thu Oct 22 12:02:47 2009&#93; &#91;notice&#93; child pid 17191 exit [...]]]></description>
			<content:encoded><![CDATA[<p>I experienced that sometimes, web applications partly break with the following apache error log:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>apache<span style="color: #000000; font-weight: bold;">/</span>error.log<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Thu Oct <span style="color: #000000;">22</span> <span style="color: #000000;">11</span>:<span style="color: #000000;">54</span>:<span style="color: #000000;">39</span> <span style="color: #000000;">2009</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>notice<span style="color: #7a0874; font-weight: bold;">&#93;</span> child pid <span style="color: #000000;">17157</span> <span style="color: #7a0874; font-weight: bold;">exit</span> signal Segmentation fault <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">11</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Thu Oct <span style="color: #000000;">22</span> <span style="color: #000000;">12</span>:00:06 <span style="color: #000000;">2009</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>notice<span style="color: #7a0874; font-weight: bold;">&#93;</span> child pid <span style="color: #000000;">17158</span> <span style="color: #7a0874; font-weight: bold;">exit</span> signal Segmentation fault <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">11</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Thu Oct <span style="color: #000000;">22</span> <span style="color: #000000;">12</span>:02:<span style="color: #000000;">47</span> <span style="color: #000000;">2009</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>notice<span style="color: #7a0874; font-weight: bold;">&#93;</span> child pid <span style="color: #000000;">17191</span> <span style="color: #7a0874; font-weight: bold;">exit</span> signal Segmentation fault <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">11</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Thu Oct <span style="color: #000000;">22</span> <span style="color: #000000;">12</span>:02:<span style="color: #000000;">47</span> <span style="color: #000000;">2009</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>notice<span style="color: #7a0874; font-weight: bold;">&#93;</span> child pid <span style="color: #000000;">17343</span> <span style="color: #7a0874; font-weight: bold;">exit</span> signal Segmentation fault <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">11</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></div></div>
<p>Whenever that error occurred, the server response is empty. In my case, that issue mostly happens in ajax requests where the server response should be some XML snippets. But if the segfault occurs, the XML snippet is empty &#8211; the onliest hint I get is the log entry in /var/log/apache/error.log.<br />
<span id="more-71"></span><br />
First thing I tried is to debug applications using Zend Debugger, but if the debugger was enabled and I step through the application, the error did not happen and the request finishes correctly. Because Google did not lead to an answer, I sat down and tried until I was able to reproduce the error with a simple PHP script:</p>
<div class="codecolorer-container php default" style="border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.php.net/session_start"><span style="color: #990000;">session_start</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">class</span> A<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;A::__construct()&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __destruct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;MyObject&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;A::__destruct()&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __toString<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;CLASS_A&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">new</span> A<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>First time I called this script via web browser all things are good. But the second time, I get an segmentation fault error in the apache log and the browser just displays nothing. Reason for that is that I try to store the current object in the session variable. When I do this the very first time, it work&#8217;s because <em>$_SESSION["MyObject"]</em> is not defined. But for any further call, <em>$_SESSION["MyObject"]</em> is defined with the current object and it will be undefined in order to assign the new value. Thus <em>A::__destruct()</em> is called a second time, where <em>$_SESSION["MyObject"]</em> will be re-defined again. This results in a endless loop and ends up in a segmentation fault of the currently used worker thread of the apache webserver.<br />
Note that in PHP 5.2 (and earlier?), there&#8217;s a <a href="http://bugs.php.net/bug.php?id=15522">Bug</a> which causes a segmentation fault whenever a PHP function is called recursively more than a definit times. I tried to reproduced and got a segmentation fault after about 900000 recursions.<br />
To do things right, we should check <em>$_SESSION["MyObject"]</em> whether it contains the current object. Only if <em>$_SESSION["MyObject"]</em> contains another object than the current, we can safely define another value!</p>
<div class="codecolorer-container php default" style="border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.php.net/session_start"><span style="color: #990000;">session_start</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">class</span> A<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;A::__construct()&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __destruct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span> <span style="color: #339933;">!==</span> <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;MyObject&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;MyObject&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;A::__destruct()&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __toString<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;CLASS_A&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">new</span> A<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Storing objects in session variables brings another issue: The destructor of each object stored in the session is called each time, the current script ends. But the constructor is never called, because the initialized object already exists in the session. In order to avoid the destructor call, I recommend to serialize the object by using <a href="http://php.net/manual/de/function.serialize.php">serialize()</a> before storing it in the session:</p>
<div class="codecolorer-container php default" style="border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.php.net/session_start"><span style="color: #990000;">session_start</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">class</span> A<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;A::__construct()&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __destruct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;MyObject&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/serialize"><span style="color: #990000;">serialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;A::__destruct()&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __toString<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;CLASS_A&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">new</span> A<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>In order to access the serialized object, you should unserialize the object first by using <a href="http://php.net/manual/de/function.unserialize.php">unserialize()</a>. Please note, that no every object property can be serialized and should be handled separately. You can use PHP&#8217;s magic methods like <a href="http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.sleep">__sleep()</a> or <a href="http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.sleep">__wakeup()</a> to handle those properties.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2009/segmentation-fault/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Both ondblclick &amp; onclick Handlers</title>
		<link>http://www.danielmorlock.de/2009/using-both-ondblclick-onclick-handlers/</link>
		<comments>http://www.danielmorlock.de/2009/using-both-ondblclick-onclick-handlers/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 12:14:23 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Handler]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[onclick]]></category>
		<category><![CDATA[ondblclick]]></category>

		<guid isPermaLink="false">http://comserver.bigfatservers.com/wordpress/?p=29</guid>
		<description><![CDATA[Back from hell after long I post a workaround for the ondblclick and onclick javascript issue: It&#8217;s not possible to define both handlers so that the onclick handler won&#8217;t get active on a doubleclick. &#60;input type=&#34;button&#34; &#160; &#160; &#160; &#160; &#160; &#160;value=&#34;Example&#34; &#160; &#160; &#160; &#160; &#160; &#160;onclick=&#34;MethodA();&#34; &#160; &#160; &#160; &#160; &#160; &#160;ondblclick=&#34;MethodB();&#34; /&#62; [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript">var dblclick = false;function MethodA(){setTimeout(function(){if(dblclick == true){return;}alert('MethodA');},250);}function MethodB(){dblclick = true;alert('MethodB');setTimeout(function(){dblclick = false;},250);}</script></p>
<p>Back from hell after long I post a workaround for the ondblclick and onclick javascript issue: It&#8217;s not possible to define both handlers so that the onclick handler won&#8217;t get active on a doubleclick.</p>
<p><span id="more-29"></span></p>
<div class="codecolorer-container html4strict default" style="border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Example&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;MethodA();&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">ondblclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;MethodB();&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></div></div>
<div style="width:100%;text-align:right">
<input type="button" value="Example" onclick="alert('MethodA');" ondblclick="alert('MethodB');" />
</div>
<p>A possible workaround is to use a semaphore-like global variable (here: dblclick). This is set to true whenever the doubleclick handler is performed.<br />
Further we delay the single click handler for some miliseconds (here: 250) and check against the dblclick semaphore until continue.</p>
<div class="codecolorer-container javascript default" style="border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> dblclick <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">function</span> MethodA<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;setTimeout<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>dblclick <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'MethodA'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">250</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #003366; font-weight: bold;">function</span> MethodB<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;dblclick <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'MethodB'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp;setTimeout<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dblclick <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">250</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<div style="width:100%;text-align:right;">
<input type="button" value="Example" onclick="MethodA();" ondblclick="MethodB();" />
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2009/using-both-ondblclick-onclick-handlers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fvwm Configuration</title>
		<link>http://www.danielmorlock.de/2007/fvwm-configuration/</link>
		<comments>http://www.danielmorlock.de/2007/fvwm-configuration/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 00:26:55 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[Composite]]></category>
		<category><![CDATA[Fvwm]]></category>
		<category><![CDATA[Window Manager]]></category>

		<guid isPermaLink="false">http://comserver.bigfatservers.com/wordpress/?p=12</guid>
		<description><![CDATA[This is my custom fvwm configuration for F Virtual Window Manager. This configuration works well in combination with Gnome desktop environment. The configuration is thought to combine the advantages of an highly configurable window manager and a plain desktop environment. I stopped using fvwm and started using awesome. Fell free to use my configuration as [...]]]></description>
			<content:encoded><![CDATA[<p>This is my custom fvwm configuration for F Virtual Window Manager. This configuration works well in combination with Gnome desktop environment. The configuration is thought to combine the advantages of an highly configurable window manager and a plain desktop environment.<br />
I stopped using <a href="http://www.fvwm.org">fvwm</a> and started using <a href="http://awesome.naquadah.org/">awesome</a>. Fell free to use my configuration as starting point for yours. It is really clean and well documented. Have fun!</p>
<p><a href="http://code.google.com/p/fvwm-config/">Find sources at code.google.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2007/fvwm-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Booting Gentoo from USB Hard Disk</title>
		<link>http://www.danielmorlock.de/2007/booting-gentoo-from-usb-hard-disk/</link>
		<comments>http://www.danielmorlock.de/2007/booting-gentoo-from-usb-hard-disk/#comments</comments>
		<pubDate>Sun, 19 Aug 2007 22:23:52 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[Boot]]></category>
		<category><![CDATA[External Storage]]></category>
		<category><![CDATA[Grub]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://comserver.bigfatservers.com/wordpress/?p=15</guid>
		<description><![CDATA[I installed my Gentoo on my internal hard disk. Due to mobility I think about moving my system to a portable USB hard disk. The first idea was to use an initial ram disk image to load the USB drivers and load the main system. I read some things about creating an inital ram disk [...]]]></description>
			<content:encoded><![CDATA[<p>I installed my <b>Gentoo</b> on my internal hard disk. Due to mobility I think about moving my system to a portable USB hard disk. The first idea was to use an initial ram disk image to load the USB drivers and load the main system. I read some things about  creating an inital ram disk image (<b>initrd</b>) by using <b>mkinitrd</b> and come to the end, that there has to be a solution which is more easier than using an initrd.<br /><span id="more-15"></span></p>
<blockquote><p>The main problem when booting from USB is the following: First of all, the BIOS is setting up its USB drivers to load the kernel into the RAM. After this step, the BIOS makes the kernel booting. When the kernel is booting, it unloads the BIOS USB drivers to load the kernel specific USB drivers. There is some time between unload the BIOS drivers and loading the kernel drivers where no USB driver is active &#8211; without an USB driver, the kernel cannot access the root filesystem and panics.</p></blockquote>
<p>The solution is to delay the kernel boot process until the kernel USB drivers are loaded and the kernel can access the root filesystem. I found the <strong>rootdelay</strong> boot parameter in my current kernel documentation:</p>
<div class="codecolorer-container text default" style="border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;rootdelay = [KNL] Delay (in seconds) to pause before attempting<br />
&nbsp;to mount the root filesystem</div></div>
<p>So booting your linux distribution from an USB disk is quiet easy:</p>
<ul>
<li>Just append the rootdelay parameter to your boot loader configuration (in my case, this is <b>grub</b>):
<p><div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>grub.cfg<br />
<span style="color: #666666; font-style: italic;"># 2.6.22-suspend2-r1</span><br />
title 2.6.22-suspend2-r1<br />
root <span style="color: #7a0874; font-weight: bold;">&#40;</span>hd0,<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
kernel <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-2.6.22-suspend2-r1 <span style="color: #007800;">root</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb2 <span style="color: #007800;">video</span>=vesafb-tng:mtrr,ywrap <span style="color: #007800;">resume2</span>=swap:<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb5 <span style="color: #007800;">rootdelay</span>=<span style="color: #000000;">5</span></div></div>
</p>
</li>
<li>When you boot your system from USB, you have to think about changing device names. If your device was at /dev/hda, the USB device will be at /dev/sda. So you have to figure out your USB device name, adjust the fstab configuration and the root kernel parameter in your grub configuration.</li>
<li>Finally you have to make sure, that you build-in the needed USB drivers into your kernel. So I set the following options in my kernel configuration:
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Device Drivers &nbsp;---<span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp;USB support &nbsp;---<span style="color: #000000; font-weight: bold;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">*&gt;</span> Support <span style="color: #000000; font-weight: bold;">for</span> Host-side USB<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp; USB device filesystem<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">*&gt;</span> &nbsp; EHCI HCD <span style="color: #7a0874; font-weight: bold;">&#40;</span>USB <span style="color: #000000;">2.0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> support<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp; &nbsp; Full speed ISO transactions <span style="color: #7a0874; font-weight: bold;">&#40;</span>EXPERIMENTAL<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp; &nbsp; Root Hub Transaction Translators <span style="color: #7a0874; font-weight: bold;">&#40;</span>EXPERIMENTAL<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp; &nbsp; Improved Transaction Translator scheduling <span style="color: #7a0874; font-weight: bold;">&#40;</span>EXPERIMENTAL<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">*&gt;</span> &nbsp; UHCI HCD <span style="color: #7a0874; font-weight: bold;">&#40;</span>most Intel and VIA<span style="color: #7a0874; font-weight: bold;">&#41;</span> support<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">*&gt;</span> USB Mass Storage support</div></div>
</li>
<li>
It depends on your architecture whether you have to build-in EHCI, OHCI or UHCI. Just use <b>lspci</b> to detect you requirements. In my case I got the following output:
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">lspci</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-i</span> UHCI<br />
00:1d.0 USB Controller: Intel Corporation 82801G <span style="color: #7a0874; font-weight: bold;">&#40;</span>ICH7 Family<span style="color: #7a0874; font-weight: bold;">&#41;</span> USB UHCI <span style="color: #666666; font-style: italic;">#1 (rev 01)</span><br />
00:1d.1 USB Controller: Intel Corporation 82801G <span style="color: #7a0874; font-weight: bold;">&#40;</span>ICH7 Family<span style="color: #7a0874; font-weight: bold;">&#41;</span> USB UHCI <span style="color: #666666; font-style: italic;">#2 (rev 01)</span><br />
00:1d.2 USB Controller: Intel Corporation 82801G <span style="color: #7a0874; font-weight: bold;">&#40;</span>ICH7 Family<span style="color: #7a0874; font-weight: bold;">&#41;</span> USB UHCI <span style="color: #666666; font-style: italic;">#3 (rev 01)</span><br />
00:1d.3 USB Controller: Intel Corporation 82801G <span style="color: #7a0874; font-weight: bold;">&#40;</span>ICH7 Family<span style="color: #7a0874; font-weight: bold;">&#41;</span> USB UHCI <span style="color: #666666; font-style: italic;">#4 (rev 01)</span><br />
ws1 linux <span style="color: #666666; font-style: italic;"># lspci | grep -i OHCI</span><br />
ws1 linux <span style="color: #666666; font-style: italic;"># lspci | grep -i EHCI</span><br />
00:1d.7 USB Controller: Intel Corporation 82801G <span style="color: #7a0874; font-weight: bold;">&#40;</span>ICH7 Family<span style="color: #7a0874; font-weight: bold;">&#41;</span> USB2 EHCI Controller <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 01<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
ws1 linux <span style="color: #666666; font-style: italic;">#</span></div></div>
</p>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2007/booting-gentoo-from-usb-hard-disk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Burning CD/DVD using the Shell</title>
		<link>http://www.danielmorlock.de/2007/writing-cddvd-from-shell/</link>
		<comments>http://www.danielmorlock.de/2007/writing-cddvd-from-shell/#comments</comments>
		<pubDate>Sat, 19 May 2007 10:09:27 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[cdrecord]]></category>
		<category><![CDATA[iso]]></category>
		<category><![CDATA[mkisofs]]></category>

		<guid isPermaLink="false">http://comserver.bigfatservers.com/wordpress/?p=11</guid>
		<description><![CDATA[It&#8217;s not very difficult to write CD/DVD&#8217;s from the linux shell. Here&#8217;s is a short summary how to burn CD/DVD&#8217;s using mkisofs and cdrecord. First of all, you have to create an ISO image, which you can write onto CD/DVD. I&#8217;m using mkisofs for this job: $ mkisofs -J -v -r -o /tmp/myimage.iso /folder/to/burn -v [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not very difficult to write CD/DVD&#8217;s from the linux shell. Here&#8217;s is a short summary how to burn CD/DVD&#8217;s using <em>mkisofs</em> and <em>cdrecord.</em><span id="more-11"></span><br />
First of all, you have to create an ISO image, which you can write onto CD/DVD. I&#8217;m using <em>mkisofs</em> for this job:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span>mkisofs <span style="color: #660033;">-J</span> <span style="color: #660033;">-v</span> <span style="color: #660033;">-r</span> <span style="color: #660033;">-o</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>myimage.iso <span style="color: #000000; font-weight: bold;">/</span>folder<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>burn</div></div>
<ul>
<li>-v Verbose execution</li>
<li>-J Generate Joliet directory records in addition to regular iso9660 file names. (Windows compatibility)</li>
<li>-r Adapt file mode bits</li>
<li>-i Defines ouput image</li>
</ul>
<p>After you created an ISO image, you can burn the image onto CD/DVD using <em>cdrecord</em></p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span><span style="color: #c20cb9; font-weight: bold;">cdrecord</span> <span style="color: #660033;">-v</span> <span style="color: #660033;">-eject</span> <span style="color: #660033;">-driveropts</span>=burnfree <span style="color: #660033;">-dao</span> <span style="color: #007800;">dev</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>hdc <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>myimage.iso</div></div>
<ul>
<li>-v Increment the verbose level</li>
<li>-eject Eject the CD/DVD after process has finished</li>
<li>-driveropts=burnfree Turn on support for buffer underrun free writing</li>
<li>-dao Write your CD/DVD in Disk At Once Mode</li>
<li>-dev Define the device</li>
</ul>
<p>That&#8217;s it &#8211; with increased verbose level, you can watch the process of your burn job.<br />
Alternatively, you can create the image and burn the CD/DVD on the fly using linux pipes:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span>mkisofs <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>folder<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>burn <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cdrecord</span> <span style="color: #660033;">-v</span> <span style="color: #660033;">-eject</span> <span style="color: #660033;">-driveropts</span>=burnfree &nbsp;<span style="color: #007800;">dev</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>hdc -</div></div>
<p>In this case, <em>mkisofs</em> prints the image data to stdout. We catch this and redirect the image data directly to cdrecord. Note, that if <em>mkisofs</em> fails creating the image completely, <em>cdrecord</em> might rubish your CD/DVD.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2007/writing-cddvd-from-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DigitalProductID Decode Algorithm</title>
		<link>http://www.danielmorlock.de/2007/digitalproductid-decode-algorithm/</link>
		<comments>http://www.danielmorlock.de/2007/digitalproductid-decode-algorithm/#comments</comments>
		<pubDate>Thu, 19 Apr 2007 21:35:21 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Digital Product ID]]></category>
		<category><![CDATA[Microsoft Windows XP]]></category>

		<guid isPermaLink="false">http://comserver.bigfatservers.com/wordpress/?p=10</guid>
		<description><![CDATA[Some licence keys for a Microsoft software creates a DigitalProductID in the Windows registry. For example, you might find the digital product id for your Microsoft Windows in your registry at: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion The following algorithm shows you howto decode the digital product id to fetch your raw product key. If you loose your product [...]]]></description>
			<content:encoded><![CDATA[<p>Some licence keys for a Microsoft software creates a DigitalProductID in the Windows registry. For example, you might find the digital product id for your Microsoft Windows in your registry at: <strong>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion</strong></p>
<p>The following algorithm shows you howto decode the digital product id to fetch your raw product key. If you loose your product key, this should help you to get it back without spending money. <span id="more-10"></span><em>Please use this knowledge only for legal use! </em>This is the onliest limitation to the following algorithm:</p>
<div class="codecolorer-container csharp default" style="border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-style: italic;">/* Digit Array */</span><br />
<span style="color: #6666cc; font-weight: bold;">Char</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> Digits <span style="color: #008000;">=</span> <span style="color: #008000;">&#123;</span><span style="color: #666666;">'B'</span>, <span style="color: #666666;">'C'</span>, <span style="color: #666666;">'D'</span>, <span style="color: #666666;">'F'</span>, <span style="color: #666666;">'G'</span>, <span style="color: #666666;">'H'</span>, <span style="color: #666666;">'J'</span>,<span style="color: #666666;">'K'</span>, <span style="color: #666666;">'M'</span>, <span style="color: #666666;">'P'</span>, <span style="color: #666666;">'Q'</span>, <span style="color: #666666;">'R'</span>, <span style="color: #666666;">'T'</span>, <span style="color: #666666;">'V'</span>, <span style="color: #666666;">'W'</span>, <span style="color: #666666;">'X'</span>, <span style="color: #666666;">'Y'</span>, <span style="color: #666666;">'2'</span>, <span style="color: #666666;">'3'</span>, <span style="color: #666666;">'4'</span>, <span style="color: #666666;">'6'</span>, <span style="color: #666666;">'7'</span>, <span style="color: #666666;">'8'</span>, <span style="color: #666666;">'9'</span><span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span><br />
<span style="color: #6666cc; font-weight: bold;">Char</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> DecodedKey <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> <span style="color: #6666cc; font-weight: bold;">Char</span><span style="color: #008000;">&#91;</span><span style="color: #FF0000;">25</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">;</span><br />
<span style="color: #000000;">System</span><span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">Byte</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> BinaryKey <span style="color: #008000;">=</span> <span style="color: #008000;">&#123;</span>0x7f, 0x6a, 0x51, 0x4c, 0x8e, 0x5a, 0x91, 0x56, 0xea, 0x34, 0x77, 0x1a, 0xb7, 0xf2, 0x02<span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">// Not really a working key :-)</span><br />
<span style="color: #6666cc; font-weight: bold;">int</span> StartOffset <span style="color: #008000;">=</span> 0x34<span style="color: #008000;">;</span><br />
<span style="color: #6666cc; font-weight: bold;">int</span> i, j, k<span style="color: #008000;">;</span><br />
<span style="color: #6666cc; font-weight: bold;">String</span> Result <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span><br />
<span style="color: #0600FF; font-weight: bold;">for</span> <span style="color: #008000;">&#40;</span>i <span style="color: #008000;">=</span> DecodedKey<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span><span style="color: #008000;">-</span><span style="color: #FF0000;">1</span><span style="color: #008000;">;</span> i <span style="color: #008000;">&gt;=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> i <span style="color: #008000;">--</span><span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;k <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #0600FF; font-weight: bold;">for</span> <span style="color: #008000;">&#40;</span>j <span style="color: #008000;">=</span> BinaryKey<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span><span style="color: #008000;">-</span><span style="color: #FF0000;">1</span><span style="color: #008000;">;</span> j <span style="color: #008000;">&gt;=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> j<span style="color: #008000;">--</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; k <span style="color: #008000;">=</span> <span style="color: #008000;">&#40;</span>k <span style="color: #008000;">&lt;&lt;</span> <span style="color: #FF0000;">8</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">+</span> BinaryKey<span style="color: #008000;">&#91;</span>j<span style="color: #008000;">&#93;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BinaryKey<span style="color: #008000;">&#91;</span>j<span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> <span style="color: #008000;">&#40;</span><span style="color: #000000;">System</span><span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">Byte</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span>k <span style="color: #008000;">/</span> <span style="color: #FF0000;">24</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; k <span style="color: #008000;">=</span> k <span style="color: #008000;">%</span> <span style="color: #FF0000;">24</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp;DecodedKey<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> Digits<span style="color: #008000;">&#91;</span>k<span style="color: #008000;">&#93;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>You got the raw decoded key in the <strong>Result</strong> variable. After decoding, you have to format the product key e.g. adding &#8220;-&#8221; after every 5th char and so on. I used <em>Microsoft .NET Framework </em>and <em>C#</em> to access the registry and decode the byte progression.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2007/digitalproductid-decode-algorithm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gentoo, Gnome &amp; Vmware Trouble</title>
		<link>http://www.danielmorlock.de/2007/dbuild-trouble/</link>
		<comments>http://www.danielmorlock.de/2007/dbuild-trouble/#comments</comments>
		<pubDate>Wed, 28 Mar 2007 08:02:04 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[Dbus]]></category>
		<category><![CDATA[VMWare]]></category>

		<guid isPermaLink="false">http://comserver.bigfatservers.com/wordpress/?p=9</guid>
		<description><![CDATA[After another world-update (Vmware Workstation 5.5.3 build-34685, D-Bus Message Bus Daemon 1.0.2) I got the following errors when I try to start vmware: $ /opt/vmware/workstation/bin/vmware /opt/vmware/workstation/lib/bin/vmware: /opt/vmware/workstation/lib/lib/libpng12.so.0/libpng12.so.0: no version information available &#40;required by /usr/lib/libcairo.so.2&#41; process 1777: Attempt to remove filter function 0xb6c80c20 user data 0x8805038, but no such filter has been added D-Bus not built [...]]]></description>
			<content:encoded><![CDATA[<p>After another world-update (Vmware Workstation 5.5.3 build-34685, D-Bus Message Bus Daemon 1.0.2) I got the following errors when I try to start vmware:</p>
<p align="left">
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>vmware<span style="color: #000000; font-weight: bold;">/</span>workstation<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>vmware<br />
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>vmware<span style="color: #000000; font-weight: bold;">/</span>workstation<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>vmware: <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>vmware<span style="color: #000000; font-weight: bold;">/</span>workstation<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libpng12.so.0<span style="color: #000000; font-weight: bold;">/</span>libpng12.so.0: no version information available <span style="color: #7a0874; font-weight: bold;">&#40;</span>required by <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libcairo.so.2<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
process <span style="color: #000000;">1777</span>: Attempt to remove filter <span style="color: #000000; font-weight: bold;">function</span> 0xb6c80c20 user data 0x8805038, but no such filter has been added<br />
D-Bus not built with <span style="color: #660033;">-rdynamic</span> so unable to print a backtrace<br />
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>vmware<span style="color: #000000; font-weight: bold;">/</span>workstation<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>vmware: <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>vmware<span style="color: #000000; font-weight: bold;">/</span>workstation<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libpng12.so.0<span style="color: #000000; font-weight: bold;">/</span>libpng12.so.0: no version information available <span style="color: #7a0874; font-weight: bold;">&#40;</span>required by <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libcairo.so.2<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>vmware<span style="color: #000000; font-weight: bold;">/</span>workstation<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>vmware: <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>vmware<span style="color: #000000; font-weight: bold;">/</span>workstation<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libpng12.so.0<span style="color: #000000; font-weight: bold;">/</span>libpng12.so.0: no version information available <span style="color: #7a0874; font-weight: bold;">&#40;</span>required by <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libcairo.so.2<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
process <span style="color: #000000;">1788</span>: Attempt to remove filter <span style="color: #000000; font-weight: bold;">function</span> 0xb7006c20 user data 0x8806c80, but no such filter has been added<br />
D-Bus not built with <span style="color: #660033;">-rdynamic</span> so unable to print a backtrace</div></div>
<p><span id="more-9"></span><br />
It seems that there is a problem with the gnome dbus daemon running in background. There are several workarounds at web on vmware and gentoo pages which propose either to change soft-links linking corresponding libraries or start vmware with changed library dependings.<br />
My workaround is quiet easy: Just stop the dbus daemon before starting vmware:</p>
<div class="codecolorer-container bash default" style="border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>vmware<br />
<span style="color: #666666; font-style: italic;">#!/bin/bash</span><br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>dbus stop<br />
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>vmware<span style="color: #000000; font-weight: bold;">/</span>workstation<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>vmware<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>dbus start</div></div>
<p>This will prevent you from changing any software preferences and is likely to be removed easily when this dbus vmware bug is hopefully fixed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2007/dbuild-trouble/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Upload Script with Progress Bar</title>
		<link>http://www.danielmorlock.de/2007/upload-script/</link>
		<comments>http://www.danielmorlock.de/2007/upload-script/#comments</comments>
		<pubDate>Tue, 27 Feb 2007 23:55:38 +0000</pubDate>
		<dc:creator>Daniel Morlock</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Progress Bar]]></category>
		<category><![CDATA[Upload]]></category>
		<category><![CDATA[Without Javascript]]></category>

		<guid isPermaLink="false">http://comserver.bigfatservers.com/wordpress/?p=7</guid>
		<description><![CDATA[If you want to upload some files through a web interface using PHP, you might use a classic POST method to push the data to the action script. If you choose your file and submit the HTML form, the file is transfered to the server and moved into a temporary file. Further your action script [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to upload some files through a web interface using PHP, you might use a classic POST method to push the data to the action script. If you choose your file and submit the HTML form, the file is transfered to the server and moved into a temporary file. Further your action script can examine the file and copy it to a specific location.<br />
This method works fine, but I has one essential disadvantage: The file has to be transfered completely before you can examine the filetype, filesize and other file information. Further when transfering the file, you have no information about the transfer status. Assume, you want to upload a huge file. After you submit the upload form, you&#8217;ll wait several minutes without any information.I found a solution which is working quiet well. I will post some examples and will desribe basic ideas about upload files using CGI PHP. Maybe you want to use this information to build your own upload script.<span id="more-7"></span></p>
<h3>Using CGI PHP</h3>
<p>There are different possibilities, you can run PHP. In general, PHP runs as module, e.g. in a <a href="http://www.apache.org">apache web server</a>. But there is another interesting method to run PHP. If you run a PHP script as CGI program, a new process is forked and the PHP interpreter is loaded into this process. This method allows us to run several PHP scripts concurrently.<br />
Imagine, that we have a PHP script to transfer the file and periodically write out the size of transfered data into a temporary state file. Further another script exists to read out the state file information, calculate the percentage of transfered data and displays a cute progress bar. Now we can use the concurrency described above to let the two scripts run concurrently. So you see, the main idea is to separate the upload and the statistic script. While the upload script transfers data, the statistic script will show the progress bar.</p>
<h3>Filetransfer Management</h3>
<p>The idea of transfering is quit easy: We read a data package of a couple of bytes (e.g. 1024 bytes), examine it and save it in a temporary file. After we reach the end of file (eof), we move the temporary file to the destination file. You can get an idea of this transfer from the following code example:</p>
<pre lang="php">#!/usr/bin/php
<?PHP // If the file size is too huge for uploading ... if($_ENV['CONTENT_LENGTH'] &gt; (1024^2) * 10)
{
     echo "Location: http://meinedomain.de/error.html\n\n";
     die(0);
}
$bytesTransfered = 0;
while(!feof(STDIN))
{
     $buffer = fread(STDIN,1024);
     $bytesTransfered += strlen($buffer);
     file_put_contents("/tmp/upload",$buffer,FILE_APPEND);
}
die(0);
?></pre>
<p>Note, that this script run as CGI program, like I desribed above.</p>
<p>As you see, I periodically read 1024 bytes from STDIN. This wrapps the input stream e.g. coming from a HTML input form. Let&#8217;s have a look at the input stream layout.</p>
<p>Further you are able, to validate the content length by using <em>$_ENV['CONTENT_LENGTH']</em> at the beginning of the upload script, like I did on line 4.</p>
<h3>Data Streaming</h3>
<p>If you look at the uploaded file, you will see something like the following snippet I got after uploading a jpeg file:</p>
<pre lang="bash">-----------------------------1951833994121914805585029106
Content-Disposition: form-data; name="datei"; filename="sysarc.jpg"
Content-Type: image/jpeg
some binary or ASCII code
-----------------------------1951833994121914805585029106--</pre>
<p>As you see, we got the basic information <em>Content-Disposition</em> and <em>Content-Type</em> at the beginning of the file stream. So the idea is to parse the first lines of an incoming transfer until the header is completely transfered. Further one can examine the header information and perhaps, you can stop the file transfer, e.g. if someone wants to upload a forbidden content type.</p>
<p>To sum up, we have an upload control script, which can hand over essential information (filetype, filename, filesize, transfered bytes) to another statistic script. It&#8217;s your turn to create a statistic script which analysis this information.</p>
<h3>Avoiding Javascript</h3>
<p>Now, you know the basic ideas about uploading files with pure PHP. You don&#8217;t need further client-side scripting languages like <em>Javascript</em> to use the upload script. Think about multiple frames (I know, that&#8217;s very old-school, but I found no other possibility). If your are using two frames, one frame can show the upload form and can call the upload script while the other frame can show the statistic page all the time. The statistic page refreshes itself every few seconds using the following html meta tag:</p>
<pre lang="php">
<meta http-equiv="refresh" content="5; URL=http://meinedomain.de/statistic.php">
</pre>
<p>If an upload begins, the upload script hands over upload information to the statistic script which creates an upload progress bar.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danielmorlock.de/2007/upload-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

