<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
   <channel>
      <title>anti</title>
      <link>http://anti.teamidiot.de/</link>
      <description>privat bei reichen Eltern — anti@conference.jabber.teamidiot.de</description>
      <language>en</language>
      <copyright>Copyright 2010</copyright>
      <lastBuildDate>Thu, 08 Jul 2010 23:33:04 +0100</lastBuildDate>
      <generator>http://www.sixapart.com/movabletype/</generator>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs> 

            <item>
         <title>Multiseat hacks (gnome gdm)</title>
         <description><![CDATA[<p>I have two screens connected to a powerful box. Mostly, I&#8217;m using these for coding and it&#8217;s running Xinerama with radeon (sssh don&#8217;t say anything).</p>

<p>Only sometimes however, I would like to share the machine with a second user.</p>

<p>There are several recommended ways for multiseat setup:</p>


<ul>
<li>Configure the Xserver with seperate screens (not Xinerama). Start Xephyr/Xnest on each screen</li>
<li>Start two seperate Xserver (this requires seperate graphic cards or <strong>maybe</strong> <a href="http://airlied.livejournal.com/72187.html">this patch</a> which I couldn&#8217;t get to work)</li>
</ul>



<p>Furthermore, you need to fiddle with the login manager to do everything &#8220;right&#8221;.</p>

<p>As my setup is more temporary, I opted for a middle way. It remains not without rough edged though&#8230; The main login remains running on two screens, and in the case of wanting to share, I will set up a Xephyr instance on one monitor. </p>

<p>Because of Xinerama, Xephyr doesn&#8217;t work out of the box like that. So I chose a small hack: I open an empty xterm (which has the netwm ability to go to fullscreen) and embed the Xephyr in it:</p>

<pre><code>uxterm -title Xephyr +sb -hold -e ''</code></pre>

<p>move the xterm window to the second monitor and switch it to fullscreen&#8230; I am using Gnome and have assigned a keybinding for that. That way, Xephyr will be running &#8220;full screen&#8221; on just one monitor, something that it isn&#8217;t able to do on its own (Xephyrs fullscreen would expand over both monitors due to Xinerama)</p>

<p>Now we need to start the Xephyr and allow the login for the other account. Again, we have two possibilities. One is to use the xdmcp mode of gdm, and another to use gdmflexiserver &#8212; the Gnome user switcher.</p>

<p><b>Update:</b> I can&#8217;t get the <span class="caps">SCIM </span>input method editor to work with xdmcp&#8230; anyone knows why? So I&#8217;ve resorted to the gdmflexiserver one for now.</p>

<p>For the xdmcp, we need to enable it. For example, in SuSE, set <code>DISPLAYMANAGER_REMOTE_ACCESS=&quot;yes&quot;</code> in <code>/etc/sysconfig/displaymanager</code>. Then it is enough to use a wrapper script. For access to the input devices, root permission is required though.</p>

<p>For the gdmflexiserver approach on the other hand, it is necessary to replace <code>/usr/bin/Xorg</code> &#8212; since <code>gdmflexiserver --xnest</code> is &#8220;not implemented&#8221;&#8230;</p>

<p>The wrapper script or <code>Xorg</code> replacement thus works like this:</p>

<p>First, we define the devices which we want to give the Xephyr use:</p>

<pre><code>#!/bin/zsh
mouse=Razer_Razer_1600dpi_3_button_optical_mouse
keybd=046a_0011</code></pre>

<p>These are examples from my box, the Razer is a mouse and the strange keyboard is a cheap Cherry one &#8212; who knows why they can&#8217;t afford to brand its <span class="caps">ID.</span> Look in <code>/dev/input/by-id</code> after connecting your devices to find out their IDs. This approach is more flexible than using the &#8220;event#&#8221; devices, whose numbering might change if connected differently.</p>

<p>Now construct the real paths and add some checks to see if the devices are connected:</p>

<pre><code>mouse=/dev/input/by-id/usb-${mouse}-event-mouse
keybd=/dev/input/by-id/usb-${keybd}-event-kbd
if [[ -h $keybd &amp;&amp; -h $mouse ]] {</code></pre>

<p><b>only in the Xorg case</b>, we now loop over all available displays and find the first one which has a empty xterm window created as outlined above, to plant the Xephyr into:</p>

<pre><code>	for ((disp=0;disp&lt;$((${DISPLAY#*:}+0));++disp)) {</code></pre>

<p><b>in the wrapper case</b>, we set the dummy disp variable instead</p>

<pre><code>	disp=$((${DISPLAY#*:}+0))</code></pre>

<p>finally, we locate the empty window using xwininfo and the <code>-title</code> as specified on top:</p>

<pre><code>	OIFS=$IFS; IFS=$'\n'
	winin=($(DISPLAY=:$disp xwininfo -name Xephyr -children)); IFS=$OIFS
	if [[ $winin[1]  'xwininfo: Window id: '*' "Xephyr"' && \
		$winin[4]  '     1 child:' &amp;&amp; \
		$winin[5]  *' (has no name): ()'* ]] {
		winid=($=winin[1])
		if [[ $winid[4]  0x* ]] {
			fontsdir=(/usr/share/fonts/*(/))</code></pre>

<p>Xephyr doesn&#8217;t seem to know about the default fonts, so we construct a fontsdir here, might need to adjust this to your local site font dirs. Now for the start command. <b>In case of the Xorg replacement for use with gdmflexiserver</b>, it is important to get rid of the <code>-verbose</code> flag which Xephyr does not understand. The <code>-parent</code> switch designs Xephyr to embed itself into another window:</p>

<pre><code>exec env DISPLAY=:$disp Xephyr -retro \
	-mouse evdev,,,device=$mouse \
	-keybd evdev,,device=$keybd,xkbmodel=evdev \
	-fp ${(j:,:)fontsdir} -parent $winid[4] \
	${@:#-verbose}</code></pre>

<p><b>for the wrapper script</b>, we use the <code>-query</code> parameter for xdmcp query:</p>

<pre><code>exec gnomesu -- Xephyr -retro \
	-mouse evdev,,,device=$mouse \
	-keybd evdev,,device=$keybd,xkbmodel=evdev \
	-fp ${(j:,:)fontsdir} -parent $winid[4] \
	-once -query $@</code></pre>

<p>just finish all the open blocks now&#8230;</p>

<pre><code>		}
	}
}</code></pre>

<p>however, in the <b>Xorg replacement script</b>, we will want to fall back to the <b>real</b> Xorg when we haven&#8217;t prepared any special window for Xephyr:</p>

<pre><code>}
exec Xorg.old $@</code></pre>

<p>As you can see, we moved <code>/usr/bin/Xorg</code> to <code>/usr/bin/Xorg.old</code> and put the replacement script up as <code>/usr/bin/Xorg</code> instead. That way, you can now prepare an xterm window as per above and execute <code>gdmflexiserver</code> without need for root.</p>

<p>With the wrapper script, just save it somewhere. You can then call it like this:</p>

<pre><code>./xephyr-xdmcp 127.0.0.1 :3</code></pre>

<p>Where 127.0.0.1 means your local host which you are going to query using xdmcp and :3 is a free display number for Xephyr to listen on.</p>

<p>An outstanding trouble I&#8217;m having in both cases is with the Gnome keyboard-properties tool which will set the keyboard layout upon login. Since it needs a different layout &#8212; evdev layout in the case of Xephyr, and local connected keyboard layout in the case of plain X, it will break the keyboard layout directly after login.</p>

<p>So far the only workaround is to rightclick on the desktop, &#8220;Open Terminal&#8221; and type in the command</p>

<pre><code>setxkbmap -model evdev</code></pre>

<p>before you can start working proper in the Xephyr instance. Maybe someone can come up with a better fix?</p>]]></description>
         <link>http://anti.teamidiot.de/nei/2010/07/multiseat_hacks_gnome_gdm/</link>
         <guid>http://anti.teamidiot.de/nei/2010/07/multiseat_hacks_gnome_gdm/</guid>
        <dc:creator>Nei</dc:creator>
                  <category domain="http://www.sixapart.com/ns/types#category">Linux</category>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">evdev</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">gdm</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">gdmflexiserver</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">gnome</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">keyboard</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">multi-user-x</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">multiseat</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">opensuse</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">xdmcp</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">Xephyr</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">xkb</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">Xnest</category>
        
         <pubDate>Thu, 08 Jul 2010 23:33:04 +0100</pubDate>
      </item>
            <item>
         <title>int log2 in gcc / c++</title>
         <description><![CDATA[<p>I wonder why this result isn&#8217;t on google&#8217;s #1 for int log2 gcc.</p>

<p>To get the integer logarithm to the base of 2, try</p>

<pre><code>      sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(   n );
     sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(  n );
sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll( n ); </code></pre>]]></description>
         <link>http://anti.teamidiot.de/nei/2010/06/int_log2_in_gcc_c/</link>
         <guid>http://anti.teamidiot.de/nei/2010/06/int_log2_in_gcc_c/</guid>
        <dc:creator>Nei</dc:creator>
                  <category domain="http://www.sixapart.com/ns/types#category">Programmierung</category>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">c</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">c++</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">int</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">log</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">log2</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">logarithm</category>
        
         <pubDate>Fri, 18 Jun 2010 18:06:53 +0100</pubDate>
      </item>
            <item>
         <title>SUN UNIX Keyboard &amp; Linux Gnome</title>
         <description><![CDATA[<p>I shot a <span class="caps">UNIX </span>keyboard on ebay.</p>

<p class="right" style="float:right;padding-left:1em"><a href="/u/nei/sun_unix_keyb.jpg"><img alt="sun_unix_keyb.jpg" src="/u/nei/sun_unix_keyb-thumb.jpg" width="306" height="230" /></a></p>

<p>Of course, it &#8220;just works&#8221; when you plug it in. However, I want it to work properly, that is, the special keys on the left should show their labels when assigning them e.g. in gnome-keybinding-properties. To do that, it is apparently necessary to edit the xkb rules &amp; xml files which are found in <code>/usr/share/X11/xkb/rules</code> on my distribution.</p>

<p>There is a &#8220;Sun Type 5/6&#8221; Layout available in gnome-keyboard-properties, but it mysteriously renders the BackSpace key unusuable &#8212; this might be a particular bug of my installation, any hints appreciated. (has apparently been fixed in <a href="http://cgit.freedesktop.org/xkeyboard-config/commit/?id=c954ef1dac2e1614572e3db02de07ebf0e974a95">this commit</a>, which probably means fixed in xkeyboard-config 1.8)</p>

<p><b>Update; the old solution provided problematic (it has been hidden below.)</b> Here is the new approach:</p>

<p>Fix the BackSpace key with this patch:</p>

<pre><code>--- a/usr/share/X11/xkb/symbols/sun_vndr/us	2010-06-16 20:39:59.937546375 +0200
+++ b/usr/share/X11/xkb/symbols/sun_vndr/us	2010-06-15 00:56:22.547604150 +0200
@@ -62,6 +62,8 @@ xkb_symbols &quot;sunbasic&quot; {
     include &quot;inet(evdev)&quot;
 
     include &quot;us(basic)&quot;
+    // these keys are common to all layouts
+    key &lt;BKSP&gt; {	[ BackSpace	]	};
     include &quot;pc(function)&quot;
     include &quot;pc(editing)&quot;
     include &quot;keypad(x11)&quot;</code></pre>

<p>Fix the &#8220;too old&#8221; AltGr mapping (XOrg changed it from Mode_switch to <span class="caps">ISO</span>_Level3_Shift, which is defined in the level3 symbols:)</p>

<pre><code>--- a/usr/share/X11/xkb/symbols/sun_vndr/us	2010-06-16 20:39:59.937546375 +0200
+++ b/usr/share/X11/xkb/symbols/sun_vndr/us	2010-06-15 00:56:22.547604150 +0200
@@ -74,7 +76,8 @@ xkb_symbols &quot;sunbasic&quot; {
     key &lt;LFSH&gt; { [ Shift_L		]			};
     key &lt;RTSH&gt; { [ Shift_R		]			};
     key &lt;LALT&gt; { [ Alt_L		]			};
-    key &lt;ALGR&gt; { [ Mode_switch		]			};
+//  key &lt;ALGR&gt; { [ Mode_switch		]			};
+    include &quot;level3(ralt_switch)&quot;
     key &lt;LMTA&gt; { [ Meta_L		]			};
     key &lt;RMTA&gt; { [ Meta_R		]			};
     key &lt;LCTL&gt; { [ Control_L		]			};</code></pre>

<p>Shuffle the modifier maps:</p>

<pre><code>--- a/usr/share/X11/xkb/symbols/sun_vndr/us	2010-06-16 20:39:59.937546375 +0200
+++ b/usr/share/X11/xkb/symbols/sun_vndr/us	2010-06-15 00:56:22.547604150 +0200
@@ -116,9 +119,9 @@ xkb_symbols &quot;sunbasic&quot; {
     modifier_map Control { Control_L, Control_R };
     modifier_map Shift   { Shift_R, Shift_L };
     modifier_map Mod1    { Meta_L, Meta_R };
-    modifier_map Mod2    { Mode_switch };
-    modifier_map Mod3    { Num_Lock };
-    modifier_map Mod4    { Alt_L };
+//  modifier_map Mod2    { Mode_switch };
+    modifier_map Mod2    { Num_Lock };
+    modifier_map Mod3    { Alt_L };
 };
 
 hidden</code></pre>

<p>Gnome wants its so-called &#8220;&lt;Alt&gt;&#8221;-binding on Mod1. I put the ♦Meta-keys there, because they&#8217;re in the right place. It further <strong>requires</strong> Mod2 to be Num_Lock, otherwise it is not happy and a lot of modifier keys stop working when Num_Lock is enabled. (Only the Mod2 is ignored when calculating the overlaps.) The former Mode_switch is mapped to Mod5 by the include above.</p>

<p>With this configuration, the following is now an useful addition to your <code>.Xresources</code>:</p>

<pre><code>xterm*metaSendsEscape: true
xterm*altIsNotMeta: true
xterm*altSendsEscape: false</code></pre>

<p>That way, Alt can be used to generate &#8220;Alternate keys&#8221; and ♦Meta works for key movement.</p>

<p>(X)Emacs on the other hand wants all kinds of &#8220;Meta&#8221; to be on one modifier, and (optionally) all kinds of &#8220;Alt&#8221; on the same, or another. My previous setup was causing <strong>one</strong> Meta key and the Alt key mapped to Mod1, and another one to Mod4. With the modifier mappings above, Meta correctly generates M- and Alt &#8212; generates A- (Super, aka Win-key, would get interpreted as S- in XEmacs.)</p>

<p>I suspect since I have not bound any &lt;Super&gt; keys, <strong>Gnome-Do</strong> is now confused and launches on a simple press of the Space-bar! Makes you unable to types spaces. I don&#8217;t know how to fix this. Trying to assign Alt+space as the Summon Key fails &#8212; it only displays &#8220;space&#8221;&#8230; since I don&#8217;t use Gnome-Do anyway, I removed it for now using <code>gnome-session-properties</code>.</p>

<p>I wanted to add the <span class="caps">UNIX </span>layout to the keyboard image display in the Gnome keyboard properties, so I made a new layout in the rules directory:</p>

<p>1. Added a new model to <code>base.xml</code>:</p>

<pre><code>    &lt;model&gt;
      &lt;configItem&gt;
        &lt;name&gt;sun_unix&lt;/name&gt;
        &lt;description&gt;Sun Type USB UNIX Layout&lt;/description&gt;
        &lt;vendor&gt;Sun Microsystems&lt;/vendor&gt;
      &lt;/configItem&gt;
    &lt;/model&gt;</code></pre>

<p>2. Do the same for <code>base.lst</code></p>

<pre><code>! model
  sun_unix        Sun Type USB UNIX Layout</code></pre>

<p>3. Add rules to <code>base</code> that set the desired options, on the way also fixing the missing geometry for the type6 and euro keyboard:</p>

<pre><code>! model		=	keycodes
  sun_unix 	=	sun(type6_usb)

! model		=	geometry
  sun6	 	=	sun(type6)
  sun_unix 	=	sun(type6unix)
  sun6euro 	=	sun(type6tuv)

! model		layout			=	symbols
  sun_unix	us			=	sun_vndr/us(type6)
  sun_unix	*			=	sun_vndr/us(type6)+%l%(v)</code></pre>

<p>Fix a bug in the <code>rules</code> that manifests when you use more than keyboard layout &#8212; because of the missing rules, the &#8220;pc&#8221; symbols are added, causing havok in the modifier mappings</p>

<pre><code>! model		layout[1]		=	symbols
  sun6		*			=	sun_vndr/us(type6)+%l[1]%(v[1])
  sun_unix	*			=	sun_vndr/us(type6)+%l[1]%(v[1])
  sun6euro	*			=	sun_vndr/us(type6)+%l[1]%(v[1])</code></pre>

<p>Modify the ctrl:nocaps rule to make CapsLock an additional right Control (the default key for example in VirtualBox) with this patch: (optional)</p>

<pre><code>--- a/usr/share/X11/xkb/symbols/ctrl	2010-06-16 20:39:59.922548680 +0200
+++ b/usr/share/X11/xkb/symbols/ctrl	2010-06-14 22:21:41.482666941 +0200
@@ -5,7 +5,8 @@
 // eliminate the caps lock key completely (replace with control)
 partial modifier_keys 
 xkb_symbols &quot;nocaps&quot; {
-    replace key &lt;CAPS&gt;	{  [ Control_L, Control_L ] };
+//  replace key &lt;CAPS&gt;	{  [ Control_L, Control_L ] };
+    replace key &lt;CAPS&gt;	{  [ Control_R ] };
     modifier_map  Control { &lt;CAPS&gt;, &lt;LCTL&gt; };
 };
 </code></pre>

<p>Fix the geometry (caps and control are swapped):</p>

<pre><code>--- a/usr/share/X11/xkb/geometry/sun	2010-06-16 20:39:59.910515296 +0200
+++ b/usr/share/X11/xkb/geometry/sun	2010-06-14 22:29:08.208691859 +0200
@@ -2885,7 +2885,7 @@ xkb_geometry &quot;t6unix&quot; {
 	};
 	row {
 	    top= 39;
-	    keys { &lt;FRNT&gt;, &lt;COPY&gt;, { &lt;CAPS&gt;, 9, shape=&quot;CAPS&quot; },
+	    keys { &lt;FRNT&gt;, &lt;COPY&gt;, { &lt;LCTL&gt;, 9, shape=&quot;LCTL&quot; },
 		   &lt;AC01&gt;, &lt;AC02&gt;, &lt;AC03&gt;, &lt;AC04&gt;, &lt;AC05&gt;, 
 		   &lt;AC06&gt;, &lt;AC07&gt;, &lt;AC08&gt;, &lt;AC09&gt;, &lt;AC10&gt;, 
 		   &lt;AC11&gt;,
@@ -2902,7 +2902,7 @@ xkb_geometry &quot;t6unix&quot; {
 	};
 	row {
 	    top= 77;
-	    keys { &lt;FIND&gt;, &lt;CUT&gt;, { &lt;LCTL&gt;, 9, shape=&quot;LCTL&quot; },
+	    keys { &lt;FIND&gt;, &lt;CUT&gt;, { &lt;CAPS&gt;, 9, shape=&quot;CAPS&quot; },
 		   &lt;LALT&gt;, {&lt;LMTA&gt;, &quot;LMTA&quot;},
 		 { &lt;SPCE&gt;, &quot;SPCE&quot; },
 		   {&lt;RMTA&gt;, &quot;RMTA&quot;}, &lt;COMP&gt;, &lt;ALGR&gt;</code></pre>

<p><em>Other problems</em></p>

<p>Unfortunately, I cannot get the Compose <span class="caps">LED </span>to light up.</p>

<p><b>Gnome doesn&#8217;t accept the SunFront keybinding to bring windows to the front &#8212; what&#8217;s up with that?? It works when I just assign it, but stops working on next login.</b> As a workaround, I could get it to work by setting <code>/apps/metacity/window_keybindings/raise_or_lower</code> to the magical value <code>0x8c</code> in <code>gconf-editor</code></p>

<p>It is not neccessary to choose any options in the gnome-keyboard-properties.</p>]]></description>
         <link>http://anti.teamidiot.de/nei/2010/06/sun_unix_keyboard_linux_gnome/</link>
         <guid>http://anti.teamidiot.de/nei/2010/06/sun_unix_keyboard_linux_gnome/</guid>
        <dc:creator>Nei</dc:creator>
                  <category domain="http://www.sixapart.com/ns/types#category">Linux</category>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">alt</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">compose</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">gnome</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">keyboard</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">linux</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">meta</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">sun</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">tastatur</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">type 7</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">unix</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">xkb</category>
        
         <pubDate>Wed, 02 Jun 2010 22:30:59 +0100</pubDate>
      </item>
            <item>
         <title>cpan for local user configuration</title>
         <description><![CDATA[<p>To install perl modules without root permission, this seems to work for me within <code>cpan</code>:</p>

<pre><code>o conf mbuildpl_arg &quot;\
--lib=~/myperl/lib \
--installman1dir=~/myperl/man/man1 \
--installman3dir=~/myperl/man/man3 \
--installscript=~/myperl/bin \
--installbin=~/myperl/bin \
--install_base=~/myperl&quot;

o conf makepl_arg &quot;\
LIB=~/myperl/lib \
INSTALLMAN1DIR=~/myperl/man/man1 \
INSTALLMAN3DIR=~/myperl/man/man3 \
INSTALLSCRIPT=~/myperl/bin \
INSTALLBIN=~/myperl/bin \
INSTALL_BASE=~/myperl&quot;

o conf commit</code></pre>

<p>Then add something like</p>

<p><code>export PERL5LIB=~/myperl/lib:~/myperl/lib/perl5/site_perl/5.10.0${PERL5LIB:+:}$PERL5LIB</code></p>

<p>to your <code>.zshenv</code> or environment profile. I had to add the site_perl dir because Sub::Uplevel installed there, yes, I&#8217;m too lazy to investigate. So beware of strange makefiles.</p>

<p>Now you can restart cpan with the <span class="caps">PERL5LIB </span>environment set and should be able to install modules.</p>

<p>I had to switch <span class="caps">INSTALL</span>_BASE for <span class="caps">PREFIX </span>in the past, ymmv.</p>]]></description>
         <link>http://anti.teamidiot.de/nei/2010/05/cpan_for_local_user_configurat/</link>
         <guid>http://anti.teamidiot.de/nei/2010/05/cpan_for_local_user_configurat/</guid>
        <dc:creator>Nei</dc:creator>
                  <category domain="http://www.sixapart.com/ns/types#category">Programmierung</category>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">cpan</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">perl</category>
        
         <pubDate>Wed, 26 May 2010 09:25:45 +0100</pubDate>
      </item>
            <item>
         <title>rc.status on the left??</title>
         <description><![CDATA[<p>Result:<br />
<a href="/u/nei/status_left.html" onclick="window.open('/u/nei/status_left.html','popup','width=700,height=440,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="/u/nei/status_left-thumb.png" width="300" height="188" alt="" /></a></p>

<p>Useful if you have a huge resolution and having trouble making out which line the &#8220;failed&#8221; belongs to :-)</p>

<pre><code>--- /etc/rc.status      2010-05-19 16:05:42.561038358 +0200
+++ /etc/rc.status      2010-05-19 10:09:18.287053928 +0200
@@ -70,14 +70,15 @@
         attn=&quot;${esc}[1;33m&quot;
         norm=`echo -en &quot;${esc}[m\017&quot;`
         stat=`echo -en &quot;\015${esc}[${COLUMNS}C${esc}[10D&quot;`
+        stat=`echo -en &quot;\015${esc}[G${esc}[14@${esc}[10C...${esc}[11D&quot;`
 
-     rc_done=&quot;${stat}${done}done${norm}&quot;
+     rc_done=&quot;${stat}   ${done}done${norm}&quot;
   rc_running=&quot;${stat}${done}running${norm}&quot;
-   rc_failed=&quot;${stat}${warn}failed${norm}&quot;
+   rc_failed=&quot;${stat} ${warn}failed${norm}&quot;
    rc_missed=&quot;${stat}${warn}missing${norm}&quot;
   rc_skipped=&quot;${stat}${attn}skipped${norm}&quot;
-     rc_dead=&quot;${stat}${warn}dead${norm}&quot;
-   rc_unused=&quot;${stat}${extd}unused${norm}&quot;
+     rc_dead=&quot;${stat}   ${warn}dead${norm}&quot;
+   rc_unused=&quot;${stat} ${extd}unused${norm}&quot;
   rc_unknown=&quot;${stat}${attn}unknown${norm}&quot;
   rc_done_up=&quot;${esc}[1A${rc_done}&quot;
 rc_failed_up=&quot;${esc}[1A${rc_failed}&quot;</code></pre>

<p>More refinement with <code>xtty=$(stty -g); stty -echo; echo -en &quot;\033[6n&quot;; read -d R curpos; stty $xtty</code>, then see if cursor is at beginning of line and go up one line.</p>]]></description>
         <link>http://anti.teamidiot.de/nei/2010/05/rcstatus_on_the_left/</link>
         <guid>http://anti.teamidiot.de/nei/2010/05/rcstatus_on_the_left/</guid>
        <dc:creator>Nei</dc:creator>
                  <category domain="http://www.sixapart.com/ns/types#category">Linux</category>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">left</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">opensuse</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">rc.status</category>
        
         <pubDate>Wed, 19 May 2010 15:53:38 +0100</pubDate>
      </item>
            <item>
         <title>ASRock X58 Extreme3</title>
         <description><![CDATA[<p>Installed an <span class="caps">ASR</span>ock <span class="caps">X58</span> Extreme3 motherboard, so far the following results:</p>

<p class="right" style="float:right;padding-left:1em"><a href="/u/nei/x58_extreme3.jpg"><img src="/u/nei/x58_extreme3-thumb.jpg" width="306" height="230" alt="" /></a></p>

<p>Linux Kernel 2.6.34</p>


<ul>
<li>basic function works out of the box (as expected!)</li>
<li>hibernate (suspend to disk) breaks
<ul>
<li>should work if you unload xhci_hcd (USB3)</li>
</ul>
</li>
<li>suspend to ram (mem) suspends, but does not resume
<ul>
<li>caps lock &amp; scroll lock <span class="caps">LED</span>s flash on resume</li>
<li>diagnostic <span class="caps">LED </span>shows 24</li>
<li>pm_tests pass</li>
<li>pm_trace hash matches drivers/base/power/main.c:564</li>
</ul>
</li>
<li><code>sensors</code> shows some coretemp temperatures
<ul>
<li><span class="caps">W83677HG</span>-I has no driver (would be needed to read fan speed, vcore, etc.)</li>
</ul>
</li>
<li>couldn&#8217;t find <strong>any</strong> controllable fan (BIOS can control 2 pwm fans and 2 voltage fans, but only manually except <span class="caps">CPU </span>fan)</li>
<li>system <strong>clock</strong> is way too slow! It lags 10 minutes just after 2 hours of operating. hardware clock seems to be fine though(?)</li>
</ul>



<p>maybe not related to the board</p>


<ul>
<li>Sony photo camera is not recognized as mass storage unless <code>rmmod -f usb_storage &amp;&amp; modprobe usb-storage</code> <strong>after</strong> connecting; somewhat annoying.</li>
</ul>



<p>not used yet:</p>


<ul>
<li><span class="caps">USB3</span></li>
<li><span class="caps">SATA3 </span>(6Gb/s)</li>
</ul>



<p>overclocking experiments</p>


<ul>
<li>can easily adjust <span class="caps">QPI </span>/ core speed in <span class="caps">BIOS. </span></li>
</ul>



<p>random thoughts</p>


<ul>
<li>I feared most the northbridge cooler fan; but it is perfectly silent (to my ears).</li>
<li><span class="caps">ECC </span>ram works as advertised</li>
<li>remember to turn on virtualization features and turbo boost stuff in <span class="caps">BIOS </span>(everyone would check that, I guess)</li>
<li>direct <span class="caps">BIOS </span>flash from <span class="caps">USB </span>is very convenient</li>
<li>use amidmi or amidedos to edit dmi data</li>
</ul>

]]></description>
         <link>http://anti.teamidiot.de/nei/2010/05/asrock_x58_extreme3_1/</link>
         <guid>http://anti.teamidiot.de/nei/2010/05/asrock_x58_extreme3_1/</guid>
        <dc:creator>Nei</dc:creator>
                  <category domain="http://www.sixapart.com/ns/types#category">Linux</category>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">asrock</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">clock skew</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">extreme3</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">fan</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">linux</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">mainboard</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">motherboard</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">resume</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">sensors</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">suspend</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">usb3</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">x58</category>
        
         <pubDate>Mon, 17 May 2010 14:17:35 +0100</pubDate>
      </item>
            <item>
         <title>xmessage utf-8</title>
         <description><![CDATA[<p>People are <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=505893">claiming</a> that <code>xmessage</code> does not support unicode utf-8, or that you should switch to some <a href="https://bugzilla.redhat.com/show_bug.cgi?id=496701">gnome</a> <a href="http://murga-linux.com/puppy/viewtopic.php?t=25319">crap</a> instead. Try specifying the resource <code>*international: true</code> and it will work as advertised. (You might still have to set up your fonts properly.)</p>

<p>By the way, a proper Gnome-alternative is <a href="http://live.gnome.org/Zenity">Zenity</a>.</p>]]></description>
         <link>http://anti.teamidiot.de/nei/2010/02/xmessage_utf8/</link>
         <guid>http://anti.teamidiot.de/nei/2010/02/xmessage_utf8/</guid>
        <dc:creator>Nei</dc:creator>
                  <category domain="http://www.sixapart.com/ns/types#category">Linux</category>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">utf-8</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">xmessage</category>
        
         <pubDate>Wed, 24 Feb 2010 12:22:11 +0100</pubDate>
      </item>
            <item>
         <title>Get back the Gnome logout keybinding </title>
         <description><![CDATA[<p>Since I upgraded Gnome from 2.24 to something more recent, what was then Ctrl+Alt+Del (or <code>&lt;Control&gt;&lt;Alt&gt;Delete</code> speaking of gconf settings) didn&#8217;t show the logout dialog anymore, but rather the shutdown/reboot one! I like to be able to log out or switch user with a keyboard shortcut, however, there is no predefined action which would lead to that dialog anymore.</p>

<p>As a workaround, create the following entries in the gnome registry, for example using <code>gconf-editor</code>:<br />
in <code>/apps/metacity/global_keybindings/run_command_10</code>, enter the keybinding (e.g. <code>&lt;Control&gt;&lt;Alt&gt;Delete</code>)<br />
in <code>/apps/metacity/keybinding_commands/command_10</code>, use the command <code>gnome-session-save --logout-dialog --gui</code> &#8212; this will do the magic trick of opening the log out dialog.</p>

<p>Disable the old binding to shutdown using <code>gnome-keybinding-properties</code> by clicking on the entry and hitting backspace, if desired.</p>]]></description>
         <link>http://anti.teamidiot.de/nei/2010/02/get_back_the_gnome_logout_keyb/</link>
         <guid>http://anti.teamidiot.de/nei/2010/02/get_back_the_gnome_logout_keyb/</guid>
        <dc:creator>Nei</dc:creator>
                  <category domain="http://www.sixapart.com/ns/types#category">Linux</category>
        
        
         <pubDate>Wed, 10 Feb 2010 13:54:21 +0100</pubDate>
      </item>
            <item>
         <title>ZTE K3565-Z Vodafone Websessions (on OS X)</title>
         <description><![CDATA[<p>The K3565-Z is sold with Vodafone Websessions currently for 30 EUR (in Germany). There is no hardware-based Simlock, only the connector-software by Vodafone won't work with other networks, but this software sucks anyway. The problem seems to be to find the drivers.</p>

<p>Following is tested on OS X 10.6.2.</p>

<ul>
<li>Download the <a href="http://www.zte.com.au/downloads/software/MF626_MAC_UI_M02.zip">connection manager</a> (from this <a href="http://www.zte.com.au/main/Product_Downloads/MF626_downloads.htm">website</a>). It is for some device called MF626, which seems to be the same.<br>
Do not install this package but instead only ./Contents/Packages/drv.pkg (can be reached by e.g. right-click - show package contents).
</li>
<li>
Now plug in the UMTS-stick and wait for the ZeroCD-crap to be mounted. Eject the device in the Finder. Ignore any "found new devices"-messages for now. 
</li>
<li>
Open Terminal.app and run <tt>sudo screen /dev/tty.ZTEUSBATPort</tt>.<br>
Type: <tt>at+zcdrun=8</tt>, press enter. You should receive "Close autorun state result(0:FAIL 1:SUCCESS):1". The annoying flash-drive is now disabled.
</li>
<li>
Now open System Preferences and choose "ZTEUSBModem". Go through Advanced - Modem and choose "Generic" as vendor and "GPRS (GSM/3G)" as device. Don't forget to enter the APN if your provider requires you to do so.
</li>
<li>
Use <tt>*99#</tt> as phone number.
</li>
</ul>

<p>Sources:<br />
<ul><br />
<li><a href="http://technomat-helga.blogspot.com/">http://technomat-helga.blogspot.com/</a></li><br />
<li><a href="http://www.zte.com.au/downloads/USB_Modem_Config_Procedure.pdf">http://www.zte.com.au/downloads/USB_Modem_Config_Procedure.pdf</a></li><br />
</ul></p>]]></description>
         <link>http://anti.teamidiot.de/nusse/2010/01/zte_k3565z_vodafone_websession/</link>
         <guid>http://anti.teamidiot.de/nusse/2010/01/zte_k3565z_vodafone_websession/</guid>
        <dc:creator>nusse</dc:creator>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">K3565</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">osx</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">simlock</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">umts</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">vodafone</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">websessions</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">zerocd</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">zte</category>
        
         <pubDate>Sat, 30 Jan 2010 20:27:10 +0100</pubDate>
      </item>
            <item>
         <title>wine PPTVIEW (PowerPoint Viewer)</title>
         <description><![CDATA[<pre><code>wine c:/Program\ Files/Microsoft\ Office/Office12/PPTVIEW.EXE
fixme:heap:HeapSetInformation 0x110000 1 (nil) 0</code></pre>

<p>I&#8217;m not sure maybe it is something particular to my wine install, but the PowerPoint Viewer refuses to start. I finally found out that this is caused by the environment variable <code>LANG</code> being set to something other than <code>en_US.UTF-8</code>, so the fix&#8230;</p>

<pre><code>LANG=en_US.UTF-8 wine c:/Program\ Files/Microsoft\ Office/Office12/PPTVIEW.EXE </code></pre>

<p>Unfortunately, even with the powerpoint viewer I haven&#8217;t been able to view this presentation, which made me try this approach at all. It crashes at roughly the same position that OpenOffice.org goes into 100% <span class="caps">CPU </span>during import, oh well&#8230;</p>]]></description>
         <link>http://anti.teamidiot.de/nei/2009/12/wine_pptview_powerpoint_viewer/</link>
         <guid>http://anti.teamidiot.de/nei/2009/12/wine_pptview_powerpoint_viewer/</guid>
        <dc:creator>Nei</dc:creator>
                  <category domain="http://www.sixapart.com/ns/types#category">Linux</category>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">powerpoint</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">pptview</category>
        
         <pubDate>Wed, 02 Dec 2009 19:35:17 +0100</pubDate>
      </item>
            <item>
         <title>Linux中文手写输入法使用Chrasis的SCIM写字板和汉统／北京文通的辨识软件</title>
         <description><![CDATA[<p><em>Linux中文手写输入法使用<a href="http://chrasis.blogspot.com/">Chrasis</a>的<a href="http://www.scim-im.org/"><span class="caps">SCIM</span></a>写字板和<a href="http://wiki.openrays.org/index.php?title=%E6%B1%89%E7%BB%9F%E4%B8%AD%E6%96%87%E8%BE%93%E5%85%A5%E5%B9%B3%E5%8F%B0">汉统</a>／北京文通的辨识软件。<br />
<embed 
  src="/static/player.swf" 
  width="500"
  height="300"
  allowscriptaccess="always"
  allowfullscreen="true"
  flashvars="file=/u/nei/hanzi.flv&amp;image=/u/nei/hanzi.png"
/></em><br />
<a href="/u/nei/hanzi.png">Screenshot</a> <a href="/u/nei/hanzi.flv"><span class="caps">FLV</span></a></p>]]></description>
         <link>http://anti.teamidiot.de/nei/2009/10/linuxchrasisscim/</link>
         <guid>http://anti.teamidiot.de/nei/2009/10/linuxchrasisscim/</guid>
        <dc:creator>Nei</dc:creator>
                  <category domain="http://www.sixapart.com/ns/types#category">Linux</category>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">acpi</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">chinese</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">handwriting</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">input method</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">scim</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">unihan</category>
        
         <pubDate>Fri, 30 Oct 2009 18:29:40 +0100</pubDate>
      </item>
            <item>
         <title>Unihan-Wtpen SCIM chinese character handwriting recognition under Linux</title>
         <description><![CDATA[<p>Chinese character handwriting recognition under Linux using the <a href="http://chrasis.blogspot.com/">Chrasis</a> Input Pad for <a href="http://www.scim-im.org/"><span class="caps">SCIM</span></a> and the <a href="http://www.sw-linux.com/en/scripts/main/viewitem.php?itemid=2158511108981584&amp;showid=products&amp;catid=platforms">Unihan-Wtpen</a> recognition engine by Wintone (Beijing).</p>]]></description>
         <link>http://anti.teamidiot.de/nei/2009/10/unihanwtpen_scim_chinese_chara_1/</link>
         <guid>http://anti.teamidiot.de/nei/2009/10/unihanwtpen_scim_chinese_chara_1/</guid>
        <dc:creator>Nei</dc:creator>
                  <category domain="http://www.sixapart.com/ns/types#category">Linux</category>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">chinese</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">handwriting</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">input method</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">scim</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">unihan</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">wtpen</category>
        
         <pubDate>Fri, 30 Oct 2009 18:29:39 +0100</pubDate>
      </item>
            <item>
         <title>screencast with ffmpeg</title>
         <description><![CDATA[<p><a href="http://ffmpeg.org/">ffmpeg</a> can record the X server screen for you and store it directly for example in Flash Screen Video format. This is much more favourable than some other solutions in my opinion :-)</p>

<p>example: <code>ffmpeg -f x11grab -s 1024x600 -r 120 -i :0.0 -vcodec flashsv /tmp/out.flv</code></p>

<p><code>1024x600</code> is the screen size and <code>120</code> the rate. Important is the <code>.flv</code>-extension for the suitable container format.</p>]]></description>
         <link>http://anti.teamidiot.de/nei/2009/10/screencast_with_ffmpeg/</link>
         <guid>http://anti.teamidiot.de/nei/2009/10/screencast_with_ffmpeg/</guid>
        <dc:creator>Nei</dc:creator>
                  <category domain="http://www.sixapart.com/ns/types#category">Linux</category>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">ffmpeg</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">screencast</category>
        
         <pubDate>Fri, 30 Oct 2009 17:39:33 +0100</pubDate>
      </item>
            <item>
         <title>Disable ZeroCD on Huawei UMTS USB-sticks</title>
         <description><![CDATA[<p>The Huawei E1552 (and other) UMTS USB-stick provides a ZeroCD called flashdrive, which provides drivers and utilities. To disable it (and prevent it to be mounted all the time), you can use the following AT-command:</p>

<p><code><br />
at^u2diag=0<br />
</code><br />
(Source: <a href="http://forum.huawei.com/jive4/thread.jspa?threadID=324405&tstart=0&orderStr=8">Huawei forums</a>)</p>]]></description>
         <link>http://anti.teamidiot.de/nusse/2009/10/disable_zerocd_on_huawei_umts/</link>
         <guid>http://anti.teamidiot.de/nusse/2009/10/disable_zerocd_on_huawei_umts/</guid>
        <dc:creator>nusse</dc:creator>
                  <category domain="http://www.sixapart.com/ns/types#category">Linux</category>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">huawei</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">umts</category>
        
         <pubDate>Sat, 10 Oct 2009 21:33:58 +0100</pubDate>
      </item>
            <item>
         <title>calling C++ bind-bound functions with variable parameters </title>
         <description><![CDATA[<pre><code>/*</code></pre>

<p>  Consider this following small example program. </p>

<pre><code>*/
#include &lt;functional&gt;
#include &lt;iostream&gt;

using namespace std::placeholders;

/*</code></pre>

<p> We write a subroutine that outputs the multiple of its arguments, a and b.</p>

<pre><code>*/
void multiple(int a, int b, const std::string &amp; who) {
  std::cout &lt;&lt; who &lt;&lt; &quot;:\t&quot; &lt;&lt; a &lt;&lt; &quot;×&quot; &lt;&lt; b &lt;&lt; &quot;=&quot; &lt;&lt; a*b &lt;&lt; std::endl;
}

int main() {
  /*</code></pre>

<p>	We then call it from main.</p>

<pre><code> */
  multiple(2,3,&quot;direct&quot;);

  /*</code></pre>

<p>	Next, we want to use bind to bind some arguments and call it. Unsurprisingly, the output is the same.</p>

<pre><code> */
  std::bind(multiple,2,3,&quot;bind&quot;)();

  /*</code></pre>

<p>	We can also store this bound function and call it:</p>

<pre><code> */
  auto bound(std::bind(multiple,2,3,&quot;bound&quot;));
  bound();

  /*</code></pre>

<p>	Things get wicked, when we want to predefine only one parameter, though :(</p>

<pre><code> */
  //std::bind(multiple,2,_1,&quot;bindp&quot;)(3); // you wish!</code></pre>]]></description>
         <link>http://anti.teamidiot.de/nei/2009/10/calling_c_bindbound_functions/</link>
         <guid>http://anti.teamidiot.de/nei/2009/10/calling_c_bindbound_functions/</guid>
        <dc:creator>Nei</dc:creator>
                  <category domain="http://www.sixapart.com/ns/types#category">Programmierung</category>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">bind</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">c++</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">functional</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">g++</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">placeholder</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">std::bind</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">tr1</category>
        
         <pubDate>Sun, 04 Oct 2009 22:51:13 +0100</pubDate>
      </item>
      
   </channel>
</rss>