<?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>Bluehorn's Blog</title>
	<atom:link href="http://www.landschoff.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.landschoff.net/blog</link>
	<description>Ramblings of Torsten Landschoff</description>
	<lastBuildDate>Sat, 20 Feb 2010 22:25:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Watching TV with vlc on Linux via T-Home Entertain</title>
		<link>http://www.landschoff.net/blog/2010/02/watching-tv-with-vlc-on-linux-via-t-home-entertain/</link>
		<comments>http://www.landschoff.net/blog/2010/02/watching-tv-with-vlc-on-linux-via-t-home-entertain/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 22:25:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.landschoff.net/blog/?p=159</guid>
		<description><![CDATA[For quite a while we are receiving TV via Internet. The original reason is that I got at most 2 MBit/s via ADSL due to line noise, but VDSL supports 25 MBit/s on the same line. Of course, you couldn&#8217;t order the DSL line without also getting a phone flat rate and IPTV.
Most of the [...]]]></description>
			<content:encoded><![CDATA[<p>For quite a while we are receiving TV via Internet. The original reason is that I got at most 2 MBit/s via ADSL due to line noise, but VDSL supports 25 MBit/s on the same line. Of course, you couldn&#8217;t order the DSL line without also getting a phone flat rate and IPTV.</p>
<p>Most of the channels are encrypted and can only be received with the original &#8220;Media Receiver&#8221;, which is a proprietary (and Microsoft) solution. But at least, I can watch the public service broadcasts using <a href="http://www.ard-digital.de/index.php?id=14028&#038;languageid=1">these playlists</a> for VLC or mplayer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.landschoff.net/blog/2010/02/watching-tv-with-vlc-on-linux-via-t-home-entertain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse 3.5.1 mouse event problems with gtk &gt;= 2.18</title>
		<link>http://www.landschoff.net/blog/2010/01/eclipse-3-5-1-mouse-event-problems-with-gtk-2-18/</link>
		<comments>http://www.landschoff.net/blog/2010/01/eclipse-3-5-1-mouse-event-problems-with-gtk-2-18/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 11:59:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[gtk]]></category>

		<guid isPermaLink="false">http://www.landschoff.net/blog/?p=155</guid>
		<description><![CDATA[Recently, Eclipse started ignoring clicks on dialog buttons for me. This seems to be due to some changes in gtk 2.18. It does not use native windows for all widgets anymore, and SWT seems to rely on it.
Thanks to this blog post, I have this fix in my bashrc:
1alias eclipse=&#34;GDK_NATIVE_WINDOWS=true eclipse&#34;
The Debian bug tracker also [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, Eclipse started ignoring clicks on dialog buttons for me. This seems to be due to some changes in gtk 2.18. It does not use native windows for all widgets anymore, and SWT seems to rely on it.</p>
<p>Thanks to <a href="http://www.bernie.net.my/blog/2009/10/16/gtk2-2182-1-breaks-eclipse-351/">this blog post</a>, I have this fix in my bashrc:</p>
<div class="codecolorer-container bash mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><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;">alias</span> <span style="color: #007800;">eclipse</span>=<span style="color: #ff0000;">&quot;GDK_NATIVE_WINDOWS=true eclipse&quot;</span></div></td></tr></tbody></table></div>
<p>The Debian bug tracker also knows about <a href="http://bugs.debian.org/552480">this problem</a>, which is partly fixed for the eclipse packages. Bad luck that I am using a download from eclipse.org.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.landschoff.net/blog/2010/01/eclipse-3-5-1-mouse-event-problems-with-gtk-2-18/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>quiltrc for Debian packaging</title>
		<link>http://www.landschoff.net/blog/2010/01/quiltrc-for-debian-packaging/</link>
		<comments>http://www.landschoff.net/blog/2010/01/quiltrc-for-debian-packaging/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 14:50:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[debian quilt]]></category>

		<guid isPermaLink="false">http://www.landschoff.net/blog/?p=149</guid>
		<description><![CDATA[Working on another laptop, I was missing my quiltrc settings. I think, I got them from a this email by Marco d&#8217;Itri. Perhaps it is of help to somebody (for example, when I go searching for it again).
BTW, I changed it locally to check only for debian folder in parent directories and create debian/patches automatically [...]]]></description>
			<content:encoded><![CDATA[<p>Working on another laptop, I was missing my quiltrc settings. I think, I got them from a <a href="http://lists.debian.org/debian-devel/2008/05/msg00065.html">this email by Marco d&#8217;Itri</a>. Perhaps it is of help to somebody (for example, when I go searching for it again).</p>
<p>BTW, I changed it locally to check only for <tt>debian</tt> folder in parent directories and create <tt>debian/patches</tt> automatically if needed:</p>
<div class="codecolorer-container bash mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><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;">for</span> d <span style="color: #000000; font-weight: bold;">in</span> . .. ..<span style="color: #000000; font-weight: bold;">/</span>.. ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>.. ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>.. ..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..; <span style="color: #000000; font-weight: bold;">do</span><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;">-d</span> <span style="color: #007800;">$d</span><span style="color: #000000; font-weight: bold;">/</span>debian <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$d</span><span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span>patches <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #007800;">$d</span><span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span>patches<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">fi</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">QUILT_PATCHES</span>=debian<span style="color: #000000; font-weight: bold;">/</span>patches<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #000000; font-weight: bold;">done</span></div></td></tr></tbody></table></div>
<p>I&#8217;d rather end up with a <tt>patches</tt> dir inside the <tt>debian</tt> folder instead of having it at a random place in the package sources when adding the first quilt patch.</p>
<p>I wonder if we should ship this with the quilt package!?</p>
<p><b>Update:</b> After discussion with James Vega on IRC, the quiltrc evolved into this version:</p>
<div class="codecolorer-container bash mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">d</span>=.<br />
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$d</span>/debian&quot;</span> <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">readlink</span> <span style="color: #660033;">-e</span> <span style="color: #007800;">$d</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; &nbsp; <span style="color: #007800;">d</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$d</span>/..&quot;</span><br />
<span style="color: #000000; font-weight: bold;">done</span><br />
<br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$d</span>/debian&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">QUILT_PATCHES</span>=debian<span style="color: #000000; font-weight: bold;">/</span>patches<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$d</span><span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span>patches <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #007800;">$d</span><span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span>patches<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #000000; font-weight: bold;">fi</span></div></td></tr></tbody></table></div>
<p>This works with any directory depth while the original would only support 5 levels from the package base directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.landschoff.net/blog/2010/01/quiltrc-for-debian-packaging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>libtool silently skips shared libraries without -rpath</title>
		<link>http://www.landschoff.net/blog/2009/12/libtool-silently-skips-shared-libraries-without-rpath/</link>
		<comments>http://www.landschoff.net/blog/2009/12/libtool-silently-skips-shared-libraries-without-rpath/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 16:04:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Observations]]></category>
		<category><![CDATA[libtool]]></category>

		<guid isPermaLink="false">http://www.landschoff.net/blog/?p=139</guid>
		<description><![CDATA[Ouch! This is the second time I am running into this so I&#8217;ll write it up this time.
I used libtool via automake for building a python module. Quite unhelpfully, libtool happens to build only the static library. It does that even though I passed the -module option, which should make it clear that a static [...]]]></description>
			<content:encoded><![CDATA[<p>Ouch! This is the second time I am running into this so I&#8217;ll write it up this time.</p>
<p>I used libtool via automake for building a python module. Quite unhelpfully, libtool happens to build only the static library. It does that even though I passed the <tt>-module</tt> option, which should make it clear that a static library does not help at all. There is also no mention why it skips the shared library.</p>
<p>After some research, my memory came back: libtool requires to pass the <tt>-rpath</tt> option to actually build shared libraries. I did not want to pass that options, since it is <a href="http://www.netfort.gr.jp/~dancer/column/libpkg-guide/libpkg-guide.html#rpath">considered harmful</a> where multiple variants of a library are available. It is even less useful in my specific case, as the module is only used inside the source tree for unit testing.</p>
<p>Solution: I changed the <tt>Makefile.am</tt> to use</p>
<div class="codecolorer-container make mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="make codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">_helper_la_LDFLAGS <span style="color: #004400;">=</span> <span style="color: #004400;">-</span>module <span style="color: #004400;">-</span>rpath <span style="color: #004400;">/</span>freaking<span style="color: #004400;">/</span>libtool<span style="color: #004400;">/</span>requires<span style="color: #004400;">/</span>at<span style="color: #004400;">/</span>least<span style="color: #004400;">/</span>a<span style="color: #004400;">/</span>dummy<span style="color: #004400;">/</span>path</div></td></tr></tbody></table></div>
<p>Interestingly, the same scheme (apart from the wording) is used in libtool&#8217;s own source.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.landschoff.net/blog/2009/12/libtool-silently-skips-shared-libraries-without-rpath/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hitting the dynamic linker wall&#8230;</title>
		<link>http://www.landschoff.net/blog/2009/12/hitting-the-dynamic-linker-wall/</link>
		<comments>http://www.landschoff.net/blog/2009/12/hitting-the-dynamic-linker-wall/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 17:01:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[dlopen]]></category>
		<category><![CDATA[dynamic linker]]></category>

		<guid isPermaLink="false">http://www.landschoff.net/blog/?p=127</guid>
		<description><![CDATA[I was working on replacing some mockup code for testing an internal library with python. Basically, the C code is incredibly big and I would rather mock the 3rd party API we are using in python. I wrote a generator to create wrapping code that forwards the C API calls to my python module.
Now that [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on replacing some mockup code for testing an internal library with python. Basically, the C code is incredibly big and I would rather mock the 3rd party API we are using in python. I wrote a generator to create wrapping code that forwards the C API calls to my python module.</p>
<p>Now that most of the work is finished, I get the following error message from my python mock:</p>
<div class="codecolorer-container python mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Traceback <span style="color: black;">&#40;</span>most recent call last<span style="color: black;">&#41;</span>:<br />
&nbsp; File <span style="color: #483d8b;">&quot;simple_mockup.py&quot;</span>, line 2, <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #66cc66;">&lt;</span>module<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">threading</span><br />
&nbsp; File <span style="color: #483d8b;">&quot;/usr/lib/python2.5/threading.py&quot;</span>, line 11, <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #66cc66;">&lt;</span>module<span style="color: #66cc66;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">time</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span> <span style="color: #ff7700;font-weight:bold;">as</span> _time, sleep <span style="color: #ff7700;font-weight:bold;">as</span> _sleep<br />
<span style="color: #008000;">ImportError</span>: /usr/lib/python2.5/lib-dynload/<span style="color: #dc143c;">time</span>.<span style="color: black;">so</span>: undefined <span style="color: #dc143c;">symbol</span>: PyExc_ValueError</div></td></tr></tbody></table></div>
<p>What&#8217;s going on here? This issue reminds me of a <a href="http://lists.debian.org/debian-gtk-gnome/1999/05/msg00095.html">bug of my ancient Debian times</a> which affected loading of GTK theme engines from python-gtk. The bug (#38138) is so old, it&#8217;s not even in the BTS archive anymore&#8230;</p>
<p>The problem is illustrated by the following example program (consisting of three files):</p>
<dl>
<dt>demo.c</dt>
<dd>
<div class="codecolorer-container c mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">#include &lt;Python.h&gt;</span><br />
<br />
<span style="color: #993333;">void</span> test_python<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; Py_Initialize<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; PyRun_SimpleString<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;import threading<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
</dd>
<dt>main.c</dt>
<dd>
<div class="codecolorer-container c mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;height:350px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br /></div></td><td><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">#include &lt;stdio.h&gt;</span><br />
<span style="color: #339933;">#include &lt;dlfcn.h&gt;</span><br />
<br />
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #993333;">const</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>error<span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #993333;">void</span> <span style="color: #339933;">*</span>handle <span style="color: #339933;">=</span> dlopen<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;./demo.so&quot;</span><span style="color: #339933;">,</span> RTLD_LAZY <span style="color: #339933;">|</span> EXTRA_RTLD_FLAGS<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #993333;">void</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>test_python<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #339933;">**</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>test_python <span style="color: #339933;">=</span> dlsym<span style="color: #009900;">&#40;</span>handle<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;test_python&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>error <span style="color: #339933;">=</span> dlerror<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; fprintf<span style="color: #009900;">&#40;</span>stderr<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> error<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Calling test_python @ %p in shared object @ %p.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> test_python<span style="color: #339933;">,</span> handle<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>test_python<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; dlclose<span style="color: #009900;">&#40;</span>handle<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Feels fine, finishing.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
</dd>
<dt>run_it.sh</dt>
<div class="codecolorer-container bash mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><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;">#! /bin/sh</span><br />
<br />
<span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-shared</span> <span style="color: #000000; font-weight: bold;">`</span>python-config --includes<span style="color: #000000; font-weight: bold;">`</span> <span style="color: #660033;">-o</span> demo.so demo.c <span style="color: #000000; font-weight: bold;">`</span>python-config --ldflags<span style="color: #000000; font-weight: bold;">`</span><br />
<br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Running example with default RTLD flags:&quot;</span><br />
<span style="color: #c20cb9; font-weight: bold;">gcc</span> -DEXTRA_RTLD_FLAGS=0 <span style="color: #660033;">-o</span> main main.c <span style="color: #660033;">-ldl</span><br />
.<span style="color: #000000; font-weight: bold;">/</span>main<br />
<span style="color: #7a0874; font-weight: bold;">echo</span><br />
<br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Passing RTLD_GLOBAL in addition:&quot;</span><br />
<span style="color: #c20cb9; font-weight: bold;">gcc</span> -DEXTRA_RTLD_FLAGS=RTLD_GLOBAL <span style="color: #660033;">-o</span> main main.c <span style="color: #660033;">-ldl</span><br />
.<span style="color: #000000; font-weight: bold;">/</span>main<br />
<span style="color: #7a0874; font-weight: bold;">echo</span></div></td></tr></tbody></table></div>
</dl>
<p>On my system, this results in the following output:</p>
<pre>
torsten@pulsar:~/sh_bug$ ./run_it.sh
Running example with default RTLD flags:
Calling test_python @ 0xb77084bc in shared object @ 0x96bc018.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.5/threading.py", line 11, in <module>
    from time import time as _time, sleep as _sleep
ImportError: /usr/lib/python2.5/lib-dynload/time.so: undefined symbol: PyExc_ValueError
Feels fine, finishing.

Passing RTLD_GLOBAL in addition:
Calling test_python @ 0xb783f4bc in shared object @ 0x95e1018.
Feels fine, finishing.
</pre>
<p>Sucky. So embedding Python into an application is easy but if you want to use the interpreter and its modules from a plugin, you are out of luck. Somebody knows a way around this problem? The only solution I can think of is to link libpython.so into each of the python plugins.</p>
<h3>Update: Work around</h3>
<p>Small update: For my current problem, the work around is to run the application with the python library preloaded: <tt>LD_PRELOAD=/usr/lib/libpython2.5.so.1.0 app</tt>. Back to adding functionality&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.landschoff.net/blog/2009/12/hitting-the-dynamic-linker-wall/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Restoring a package selection on new system</title>
		<link>http://www.landschoff.net/blog/2009/12/restoring-a-package-selection-on-new-system/</link>
		<comments>http://www.landschoff.net/blog/2009/12/restoring-a-package-selection-on-new-system/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 20:45:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://www.landschoff.net/blog/?p=121</guid>
		<description><![CDATA[I am moving from my old Debian development system to a new one, changing architectures from i386 to amd64. So I need to do a fresh install, but basically I want to keep my package selection.
Conventional wisdom is to use dpkg --get-selections and dpkg --set-selections to preserve the package selection. However, this does not keep [...]]]></description>
			<content:encoded><![CDATA[<p>I am moving from my old Debian development system to a new one, changing architectures from i386 to amd64. So I need to do a fresh install, but basically I want to keep my package selection.</p>
<p>Conventional wisdom is to use <tt>dpkg --get-selections</tt> and <tt>dpkg --set-selections</tt> to preserve the package selection. However, this does not keep the information about automatically installed packages.</p>
<p>Instead, I used
<pre>aptitude search '?installed?not(?automatic)' -F %p &gt; packages.txt</pre>
<p> to dump the packages I installed manually. Installing these was a matter of running:
<pre>aptitude install `cat packages.txt`</pre>
<p> In fact this was taking so long that I loaded the packages in batches using
<pre>cat packages.txt|xargs -n 100 aptitude install --schedule-only; aptitude</pre>
<p>While I was at it, it ran
<pre>aptitude remove '?obsolete'</pre>
<p> on the original system, killing of a few hundred packages that accumulated since 2003.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.landschoff.net/blog/2009/12/restoring-a-package-selection-on-new-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenVPN and DHCP: Good idea?</title>
		<link>http://www.landschoff.net/blog/2009/12/openvpn-and-dhcp-good-idea/</link>
		<comments>http://www.landschoff.net/blog/2009/12/openvpn-and-dhcp-good-idea/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 22:23:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oops]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://www.landschoff.net/blog/?p=118</guid>
		<description><![CDATA[Great, I spent a few hours today to set up a nice OpenVPN server. Nice in that I wanted the (Windows) clients to be able to access the company network like they were connected locally.
My idea was to use the OpenVPN tap mode and let the DHCP server at work assign IPs to the VPN [...]]]></description>
			<content:encoded><![CDATA[<p>Great, I spent a few hours today to set up a nice OpenVPN server. Nice in that I wanted the (Windows) clients to be able to access the company network like they were connected locally.</p>
<p>My idea was to use the OpenVPN tap mode and let the DHCP server at work assign IPs to the VPN clients.</p>
<p>This turned out to be a dumb idea. After I got everything going, I noticed the following message in syslog (which probably scrolled by previously in the debug drivel):</p>
<blockquote><p>NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x.  Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet.</p></blockquote>
<p>Hmm, sure, I guess that will exclude every second incoming VPN connection.</p>
<p><b>Summary</b>: <em>Think about IP space clashes before setting up a VPN.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.landschoff.net/blog/2009/12/openvpn-and-dhcp-good-idea/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New on Debian planet</title>
		<link>http://www.landschoff.net/blog/2009/11/new-on-debian-planet/</link>
		<comments>http://www.landschoff.net/blog/2009/11/new-on-debian-planet/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 21:35:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://www.landschoff.net/blog/?p=112</guid>
		<description><![CDATA[Now that there is some content here, I added myself to the Planet Debian blog aggregator. Sorry for my weird head image, the shadow looked much better in Gimp. I&#8217;ll have to correct that on another day&#8230;
Thanks to Holger Levsen for pointing me at the wiki entry which describes how a Debian developer can add [...]]]></description>
			<content:encoded><![CDATA[<p>Now that there is some content here, I added myself to the <a href="http://planet.debian.org/">Planet Debian</a> blog aggregator. Sorry for my weird head image, the shadow looked much better in Gimp. I&#8217;ll have to correct that on another day&#8230;</p>
<p>Thanks to Holger Levsen for pointing me at the <a href="http://wiki.debian.org/PlanetDebian">wiki entry</a> which describes how a Debian developer can add himself to the Planet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.landschoff.net/blog/2009/11/new-on-debian-planet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New development box &#8211; installation woes</title>
		<link>http://www.landschoff.net/blog/2009/11/new-development-box-installation-woes/</link>
		<comments>http://www.landschoff.net/blog/2009/11/new-development-box-installation-woes/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 19:06:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[debian-installer]]></category>

		<guid isPermaLink="false">http://www.landschoff.net/blog/?p=97</guid>
		<description><![CDATA[I got a new computer at home a week ago and finally got around to assemble all the parts. Which wasn&#8217;t as easy as expected, especially fitting the CPU cooler was a hard fight.
Specs
For the curious, here are the specs:

CPU
AMD Phenom II X4 965 (4&#215;3.4 GHz)
Mainboard
MSI 790GX-G65
Graphics
ATI Radeon HD 3300 (on-board)
RAM
8 GB, DDR3
Hard drives
2x SATA [...]]]></description>
			<content:encoded><![CDATA[<p>I got a new computer at home a week ago and finally got around to assemble all the parts. Which wasn&#8217;t as easy as expected, especially fitting the CPU cooler was a hard fight.</p>
<h2>Specs</h2>
<p>For the curious, here are the specs:</p>
<dl>
<dt>CPU</dt>
<dd>AMD Phenom II X4 965 (4&#215;3.4 GHz)</dd>
<dt>Mainboard</dt>
<dd>MSI 790GX-G65</dd>
<dt>Graphics</dt>
<dd>ATI Radeon HD 3300 (on-board)</dd>
<dt>RAM</dt>
<dd>8 GB, DDR3</dd>
<dt>Hard drives</dt>
<dd>2x SATA 1.5 TB (by Western Digital)</dd>
</dl>
<h2>Ubuntu installation</h2>
<p>For testing and having a first look, I installed Ubuntu karmic koala (amd64). Installation went like a breeze, everything was detected and worked out of the box. Well, kind of &#8211; graphics performance was dreadful. Which was kind of expected.</p>
<h2>Debian installation</h2>
<p>I originally thought about using Debian only inside virtual machines or change roots. Still, Ubuntu does not really feel like &#8220;the real thing&#8221;. So I went to install Debian, aiming at a sid/unstable installation.</p>
<p>The first boot using the official squeeze snapshot netinst image (Binary-1 20091128-11:21) went fine. Up to the first prompt: No input was possible. Probably a problem with the USB keyboard I had connected (Logitech wireless). Out of curiosity I tried the graphical installer, which did not even get so far. It was stuck in an endless loop trying to start an X11 server.</p>
<p>So I dug for a PS/2 connected keyboard and had more luck. I got to the point where the installer searches for the CD-ROM drive. As I did not want to dismantle my old system yet, I used an external USB DVD/RW drive. This was not detected by the installer so I was unable to continue installation. I guess, the NIC driver was also on the disc so no ethernet either.</p>
<p>Today I installed the DVD burner into the tower and had more luck. It still amazes me how easy it is to create my default storage setup using d-i (LVM on RAID). However,  the installer failed to reread the partitions after I created two on each drive, interestingly telling me about <tt>/dev/sda2</tt> being busy. Perhaps a left-over swap partition from the Ubuntu install? Anyway, after running fdisk manually and writing the same partition table again, I was able to continue.</p>
<p>The remaining d-i steps went fine, with just a nuisance: I was asked for the console font setting &#8211; twice. And I had no idea what it was asking of me, AFAIK UTF-8 should be fine for all possible uses. I selected <em># Latin1 and Latin5 &#8211; western Europe and Turkic languages</em>. Not that I will see the console unless Xorg fails to run&#8230;</p>
<p>After having the base system running, I rebooted without selecting any more software, partly because I knew that the resync on md1 will need restarting after booting into the new system.</p>
<p>The new system booted fine and I called aptitude to install <tt>build-essential</tt>, Xorg and both KDE and Gnome desktops. This pulled in MySQL via <tt>akonadi-server</tt> (ouch!) and I was asked for a MySQL root password. Seriously, I don&#8217;t care, this is a desktop system. I tend to forget the password anyway and the last time, root was able to reset it. So I just hit <em>Enter</em>, leaving no password set. This lead to the installation asking me two more times for the password, which really sucks given that the server is only used by Akonadi for whatever reason and the last time I looked, it creates its own MySQL configuration.</p>
<p>Albeit my old system is 8 years old, the new system still seemed slower. Which of course is due to disk latencies, given that <tt>/dev/md1</tt> was being synchronized in the background.</p>
<p>Anyway, I was eager to test the desktop experience and started gdm. X came up fine, but again I had no mouse and no keyboard (USB mouse, keyboard connected as well as PS/2 keyboard). I also was unable to switch to a VT, so I logged in remotely and rebooted the new system.</p>
<p>After the reboot, hal obviously picked up the input devices and X11 worked fine now. At this point, I stopped as the sunday almost passed already.</p>
<p>Summary: Debian installation still needs some improvements I think. Maybe our distribution is just too stable, after all my last install is 3 years back &#8211; due to a disk crash&#8230;</p>
<h3>Relevant Debian bugs</h3>
<ul>
<li><a href="http://bugs.debian.org/558679">#558679</a>: My installation report with some logs included.
<li><a href="http://bugs.debian.org/558681">#558681</a>: Nagging about MySQL root password.
<li><a href="http://bugs.debian.org/558686">#558686</a>: Failure to reload partition table.
<li><a href="http://bugs.debian.org/545933">#545933</a>: No USB keyboard support
<li><a href="http://bugs.debian.org/315553">#315553</a>: Installation from optical drive on usb fails (but this is for kernel 2.4)
<li><a href="http://bugs.debian.org/558691">#558691</a>: No keyboard and mouse after fresh installation of xserver-xorg.
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.landschoff.net/blog/2009/11/new-development-box-installation-woes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>schroot and LVM snapshots</title>
		<link>http://www.landschoff.net/blog/2009/11/schroot-and-lvm-snapshots/</link>
		<comments>http://www.landschoff.net/blog/2009/11/schroot-and-lvm-snapshots/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 21:04:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://www.landschoff.net/blog/?p=76</guid>
		<description><![CDATA[For the roundcube packages I wrote about before, I needed a lenny build system. I did not want to load the required packages to the production server. I used to use debootstrap for this but I wanted to keep a clean base system without copying around all the time.
After a bit of searching, I stumbled [...]]]></description>
			<content:encoded><![CDATA[<p>For the roundcube packages I wrote about before, I needed a <a href="http://www.debian.org/releases/lenny">lenny</a> build system. I did not want to load the required packages to the production server. I used to use <a href="http://packages.debian.org/debootstrap">debootstrap</a> for this but I wanted to keep a clean base system without copying around all the time.</p>
<p>After a bit of searching, I stumbled across <a href="http://packages.debian.org/schroot">schroot</a>, which turned out to be a really useful package. The blog post <a href="http://www.enricozini.org/2008/tips/joys-of-schroot/">&#8220;Joys of Schroot&#8221;</a> by Enrico had me going in no time (thanks Enrico!).</p>
<p>Since I built a number of packages multiple times, I did not want to download the required dependencies each time. I also did not want to do any tricks with <a href="http://packages.debian.org/approx">approx</a> as suggested by Enrico. Instead, I added another bind-mount to <tt>/etc/schroot/mount-defaults</tt>:</p>
<pre>
/var/cache/apt/archives	/var/cache/apt/archives		none	rw,bind		0	0
</pre>
<p>With this simple change, the chroots now share the apt cache with my main system.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.landschoff.net/blog/2009/11/schroot-and-lvm-snapshots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
