<?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>Krzysztof Burghardt’s blog &#187; Software</title>
	<atom:link href="http://blog.burghardt.pl/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.burghardt.pl</link>
	<description>Create. Break. Fix. Repeat.</description>
	<lastBuildDate>Mon, 05 Jul 2010 07:35:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>ESE Key Daemon 1.2.7 released</title>
		<link>http://blog.burghardt.pl/2010/07/ese-key-daemon-1-2-7-released/</link>
		<comments>http://blog.burghardt.pl/2010/07/ese-key-daemon-1-2-7-released/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 07:35:52 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[daemon]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[multimedia]]></category>

		<guid isPermaLink="false">http://blog.burghardt.pl/?p=432</guid>
		<description><![CDATA[<p>New version of ESE Key Daemon was released today.</p>
<p>New features include the ability to handle multiple key combinations and distinguish between key presses and releases. A problem with the handling of the last line in a configuration file when there is no newline on the last line is gone. Numeric keys are now also allowed in [...]]]></description>
			<content:encoded><![CDATA[<p>New version of <a href="/2007/12/ese-key-daemon/">ESE Key Daemon</a> was released today.</p>
<p>New features include the ability to handle multiple key combinations and distinguish between key presses and releases. A problem with the handling of the last line in a configuration file when there is no newline on the last line is gone. Numeric keys are now also allowed in the configuration file.</p>
<p>Download: <a href="http://www.burghardt.pl/files/esekeyd-1.2.7.tar.gz">esekeyd-1.2.7.tar.gz</a> (<a href="http://www.burghardt.pl/files/esekeyd-1.2.7.tar.gz.asc">.asc</a>)</p>
<p>MD5: 5937ad6d7815dbc6ab6983411a9f37d4<br />
SHA1: 07671be42b61973a3270aaf1b41c3467568ae7ac</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2010/07/ese-key-daemon-1-2-7-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integration of AA Google 404 with Atahualpa</title>
		<link>http://blog.burghardt.pl/2009/11/integration-of-aa-google-404-with-atahualpa/</link>
		<comments>http://blog.burghardt.pl/2009/11/integration-of-aa-google-404-with-atahualpa/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 01:41:55 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Atahualpa]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=361</guid>
		<description><![CDATA[<p>AskApache Google 404 default 404.php does not work properly with Atahualpa theme. To fix those problems create another 404.php file in /themes/atahualpa with this content:</p>
<p></p>
&#60;?php

ob_start&#40;&#41;;

include&#40;TEMPLATEPATH . '/functions/bfa_get_options.php'&#41;;
get_header&#40;&#41;;

if &#40;function_exists&#40;'aa_google_404'&#41;&#41;
&#160; &#160; aa_google_404&#40;&#41;;
else
&#123;
?&#62;
&#160; &#160; &#60;h2&#62;&#60;?php _e&#40;'Not Found','atahualpa'&#41;; ?&#62;&#60;/h2&#62;
&#160; &#160; &#60;p&#62;&#60;?php _e&#40;&#34;Sorry, but you are looking for something that isn't here.&#34;,&#34;atahualpa&#34;&#41;; ?&#62;&#60;/p&#62;
&#60;?php
&#125;

bfa_center_content&#40;$bfa_ata&#91;'center_content_bottom'&#93;&#41;;

get_footer&#40;&#41;;

exit&#40;&#41;;

?&#62;
<p>When it is done, choose wp-content/themes/atahualpa/404.php as 404 File [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wordpress.org/extend/plugins/askapache-google-404/">AskApache Google 404</a> default 404.php does not work properly with <a href="http://wordpress.org/extend/themes/atahualpa">Atahualpa</a> theme. To fix those problems create another 404.php file in <em>/themes/atahualpa</em> with this content:</p>
<p><span id="more-361"></span></p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<br />
<a href="http://www.php.net/ob_start"><span style="color: #990000;">ob_start</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span>TEMPLATEPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/functions/bfa_get_options.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
get_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color: #990000;">function_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'aa_google_404'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; aa_google_404<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">else</span><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp; &nbsp; &lt;h2&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Not Found'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'atahualpa'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h2&gt;<br />
&nbsp; &nbsp; &lt;p&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Sorry, but you are looking for something that isn't here.&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;atahualpa&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
bfa_center_content<span style="color: #009900;">&#40;</span><span style="color: #000088;">$bfa_ata</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'center_content_bottom'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
get_footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>When it is done, choose <em>wp-content/themes/atahualpa/404.php</em> as <strong>404 File Handling</strong> and enable AA Google 404.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/11/integration-of-aa-google-404-with-atahualpa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual destinations are faster than Camel routing</title>
		<link>http://blog.burghardt.pl/2009/10/virtual-destinations-are-faster-than-camel-routing/</link>
		<comments>http://blog.burghardt.pl/2009/10/virtual-destinations-are-faster-than-camel-routing/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 20:26:08 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[ActiveMQ]]></category>
		<category><![CDATA[Camel]]></category>
		<category><![CDATA[queue]]></category>
		<category><![CDATA[routing]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=328</guid>
		<description><![CDATA[<p>Routing messages from one input queue to two output queues in ActiveMQ can be done in two different ways. Apache Camel, a powerful rule-based routing engine often used with ActiveMQ, is a typical choice. Virtual composite queue is another solution. Which to choose? The faster.</p>
<p></p>
Apache Camel
<p>Camel configuration I use:</p>
&#60;beans
 &#160; &#160;xmlns:xsi=&#34;http://www.w3.org/2001/XMLSchema-instance&#34;
 &#160; &#160;xsi:schemaLocation=&#34;http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd&#34;&#62;

&#160; &#160; &#60;camelContext [...]]]></description>
			<content:encoded><![CDATA[<p>Routing messages from one input queue to two output queues in <a href="http://activemq.apache.org/">ActiveMQ</a> can be done in two different ways. <a href="http://camel.apache.org/">Apache Camel</a>, a powerful rule-based routing engine often used with <a href="http://activemq.apache.org/">ActiveMQ</a>, is a typical choice. <a href="http://activemq.apache.org/virtual-destinations.html">Virtual composite queue</a> is another solution. Which to choose? The faster.</p>
<p><span id="more-328"></span></p>
<h2>Apache Camel</h2>
<p>Camel configuration I use:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><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;beans</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp;<span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot;http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;camelContext</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;camel&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://camel.apache.org/schema/spring&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;route<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;from</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;activemq:INPUT-QUEUE&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;to</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;activemq:OUTPUT-1-QUEUE&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;to</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;activemq:OUTPUT-2-QUEUE&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/route<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/camelContext<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;activemq&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.apache.activemq.camel.component.ActiveMQComponent&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;connectionFactory&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.apache.activemq.ActiveMQConnectionFactory&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;brokerURL&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;vm://localhost?create=false&amp;amp;waitForStart=10000&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;userName&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${activemq.username}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;password&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${activemq.password}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/beans<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>Benchmark took 3 minutes 31 seconds to send 10 thousand messages through Camel:</p>
<pre>
$ time ./amqinject INPUT-QUEUE 10000
0.651u 0.490s 3:31.43 0.5%      0+0k 0+0io 0pf+0w
</pre>
<p>Unfortunately &#8220;Number Of Pending Messages&#8221; was always about 1024 and amqinject gets blocked in send() call:</p>
<pre>
INFO | Usage Manager memory limit reached on queue://INPUT-QUEUE. Producers will be throttled to the rate at which messages are removed from this destination to prevent flooding it. See http://activemq.apache.org/producer-flow-control.html for more info
</pre>
<h2>Virtual Composite Queue</h2>
<p>Virtual destinations are configured in &lt;broker&gt; tag. Here is my configuration:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;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">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;destinations<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;queue</span> <span style="color: #000066;">physicalName</span>=<span style="color: #ff0000;">&quot;INPUT-QUEUE&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;queue</span> <span style="color: #000066;">physicalName</span>=<span style="color: #ff0000;">&quot;OUTPUT-1-QUEUE&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;queue</span> <span style="color: #000066;">physicalName</span>=<span style="color: #ff0000;">&quot;OUTPUT-2-QUEUE&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/destinations<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;destinationInterceptors<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;virtualDestinationInterceptor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;virtualDestinations<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;compositeQueue</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;INPUT-QUEUE&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;forwardTo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;queue</span> <span style="color: #000066;">physicalName</span>=<span style="color: #ff0000;">&quot;OUTPUT-1-QUEUE&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;queue</span> <span style="color: #000066;">physicalName</span>=<span style="color: #ff0000;">&quot;OUTPUT-2-QUEUE&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/forwardTo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/compositeQueue<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/virtualDestinations<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/virtualDestinationInterceptor<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/destinationInterceptors<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>Amqinject never blocked and it took only <strong>2 minutes 29 seconds</strong> to complete:</p>
<pre>
% time ./amqinject INPUT-QUEUE 10000
0.718u 0.539s 2:29.33 0.8%      0+0k 0+0io 0pf+0w
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/10/virtual-destinations-are-faster-than-camel-routing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating from ActiveMQ-CPP/CMS version 2.2 to 3.0</title>
		<link>http://blog.burghardt.pl/2009/08/migrating-from-activemq-cppcms-version-2-2-to-3-0/</link>
		<comments>http://blog.burghardt.pl/2009/08/migrating-from-activemq-cppcms-version-2-2-to-3-0/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 00:02:55 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[ActiveMQ]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[TCP]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=326</guid>
		<description><![CDATA[<p>Migrating from ActiveMQ-CPP/CMS version 2.2.6 to 3.0.1 is very easy. There are only two minor problems to deal with.</p>
<p></p>
First problem: exceptions
<p>No idea what &#8220;N3cms12CMSExceptionE&#8221; is? Use getCause() on cms::CMSException
objects to get std::exception*. Do not call what() directly. Do not try to call what() from any base classes.</p>
catch &#40;cms::CMSException&#38; e&#41; &#123;
&#160; &#160; cout &#60;&#60; e.getCause&#40;&#41;-&#62;what&#40;&#41; &#60;&#60; endl;
&#125;
<p>And [...]]]></description>
			<content:encoded><![CDATA[<p>Migrating from <a href="http://activemq.apache.org/">ActiveMQ</a>-CPP/<a href="http://activemq.apache.org/cms/">CMS</a> version 2.2.6 to 3.0.1 is very easy. There are only two minor problems to deal with.</p>
<p><span id="more-326"></span></p>
<h2>First problem: exceptions</h2>
<p>No idea what &#8220;N3cms12CMSExceptionE&#8221; is? Use <em>getCause()</em> on <em>cms::CMSException</em><br />
objects to get <em>std::exception*</em>. Do not call <em>what()</em> directly. Do not try to call <em>what()</em> from any base classes.</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">catch</span> <span style="color: #008000;">&#40;</span>cms<span style="color: #008080;">::</span><span style="color: #007788;">CMSException</span><span style="color: #000040;">&amp;</span> e<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> e.<span style="color: #007788;">getCause</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>what<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>And now &#8220;N3cms12CMSExceptionE&#8221; is &#8220;No Matching Factory Registered for format := tcp&#8221;.</p>
<h2>Second problem: library initialization</h2>
<p>&#8220;No Matching Factory Registered for format := tcp&#8221; suggests that library was not initialized properly or some protocol-related modules was not loaded. Version 3.0 (and above) requires explicit initialization of ActiveMQ library.</p>
<p>To fix this problem include <em>activemq/library/ActiveMQCPP.h</em> and call <em>ActiveMQCPP::initializeLibrary()</em>.</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339900;">#include &lt;activemq/library/ActiveMQCPP.h&gt;</span><br />
<span style="color: #666666;">// ...</span><br />
activemq<span style="color: #008080;">::</span><span style="color: #007788;">library</span><span style="color: #008080;">::</span><span style="color: #007788;">ActiveMQCPP</span><span style="color: #008080;">::</span><span style="color: #007788;">initializeLibrary</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/08/migrating-from-activemq-cppcms-version-2-2-to-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimizing GNOME for Netbooks</title>
		<link>http://blog.burghardt.pl/2009/05/optimizing-gnome-for-netbooks/</link>
		<comments>http://blog.burghardt.pl/2009/05/optimizing-gnome-for-netbooks/#comments</comments>
		<pubDate>Mon, 04 May 2009 20:17:49 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[GNU]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Netbook]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=306</guid>
		<description><![CDATA[<p>GNOME can be easily optimized for Netbooks using configuration editor. Disabling animations, thumbnails and splash screen speeds up GNOME while scaling down icons saves space on desktop.</p>
<p>Metacity will give the user less feedback by using wireframes, avoiding animations, or other means if /apps/metacity/general/reduced_resources is set to true. This can be set with gconf-editor or from shell [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gnome.org/">GNOME</a> can be easily optimized for Netbooks using <a href="http://en.wikipedia.org/wiki/gconf-editor">configuration editor</a>. Disabling animations, thumbnails and splash screen speeds up GNOME while scaling down icons saves space on desktop.</p>
<p><a href="http://en.wikipedia.org/wiki/Metacity">Metacity</a> will give the user less feedback by using wireframes, avoiding animations, or other means if <em>/apps/metacity/general/reduced_resources</em> is set to <em>true</em>. This can be set with <em>gconf-editor</em> or from shell with <em>gconftool</em>:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;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">gconftool-<span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>metacity<span style="color: #000000; font-weight: bold;">/</span>general<span style="color: #000000; font-weight: bold;">/</span>reduced_resources <span style="color: #660033;">-t</span> bool <span style="color: #c20cb9; font-weight: bold;">true</span></div></div>
<p><span id="more-306"></span></p>
<p>When Metacity run on reduced resources it&#8217;s time to disable animations in panels and desktop:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;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">gconftool-<span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>panel<span style="color: #000000; font-weight: bold;">/</span>global<span style="color: #000000; font-weight: bold;">/</span>enable_animations <span style="color: #660033;">-t</span> bool <span style="color: #c20cb9; font-weight: bold;">false</span><br />
gconftool-<span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>panel<span style="color: #000000; font-weight: bold;">/</span>toplevels<span style="color: #000000; font-weight: bold;">/</span>bottom_panel_screen0<span style="color: #000000; font-weight: bold;">/</span>enable_animations <span style="color: #660033;">-t</span> bool <span style="color: #c20cb9; font-weight: bold;">false</span><br />
gconftool-<span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>panel<span style="color: #000000; font-weight: bold;">/</span>toplevels<span style="color: #000000; font-weight: bold;">/</span>panel_0<span style="color: #000000; font-weight: bold;">/</span>enable_animations <span style="color: #660033;">-t</span> bool <span style="color: #c20cb9; font-weight: bold;">false</span><br />
gconftool-<span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>desktop<span style="color: #000000; font-weight: bold;">/</span>gnome<span style="color: #000000; font-weight: bold;">/</span>interface<span style="color: #000000; font-weight: bold;">/</span>enable_animations <span style="color: #660033;">-t</span> bool <span style="color: #c20cb9; font-weight: bold;">false</span></div></div>
<p>Disabling splash screen:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;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">gconftool-<span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>gnome-session<span style="color: #000000; font-weight: bold;">/</span>options<span style="color: #000000; font-weight: bold;">/</span>show_splash_screen <span style="color: #660033;">-t</span> bool <span style="color: #c20cb9; font-weight: bold;">false</span></div></div>
<p>Disabling logout effect and shading and shading the background colors:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;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">gconftool-<span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>desktop<span style="color: #000000; font-weight: bold;">/</span>gnome<span style="color: #000000; font-weight: bold;">/</span>background<span style="color: #000000; font-weight: bold;">/</span>color_shading_type <span style="color: #660033;">-t</span> str <span style="color: #ff0000;">&quot;solid&quot;</span><br />
gconftool-<span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>gnome-session<span style="color: #000000; font-weight: bold;">/</span>options<span style="color: #000000; font-weight: bold;">/</span>logout_effect <span style="color: #660033;">-t</span> str <span style="color: #ff0000;">&quot;black&quot;</span></div></div>
<p>Finally Nautilus shouldn&#8217;t generate any images or documents thumbnails:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;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">gconftool-<span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>nautilus<span style="color: #000000; font-weight: bold;">/</span>preferences<span style="color: #000000; font-weight: bold;">/</span>show_icon_text <span style="color: #660033;">-t</span> str <span style="color: #ff0000;">&quot;never&quot;</span><br />
gconftool-<span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>nautilus<span style="color: #000000; font-weight: bold;">/</span>preferences<span style="color: #000000; font-weight: bold;">/</span>show_image_thumbnails <span style="color: #660033;">-t</span> str <span style="color: #ff0000;">&quot;never&quot;</span></div></div>
<p>Disable sounds on user events and playing sound from files under mouse:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;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">gconftool-<span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>nautilus<span style="color: #000000; font-weight: bold;">/</span>preferences<span style="color: #000000; font-weight: bold;">/</span>preview_sound <span style="color: #660033;">-t</span> str <span style="color: #ff0000;">&quot;never&quot;</span><br />
gconftool-<span style="color: #000000;">2</span> <span style="color: #660033;">-s</span> &nbsp;<span style="color: #000000; font-weight: bold;">/</span>desktop<span style="color: #000000; font-weight: bold;">/</span>gnome<span style="color: #000000; font-weight: bold;">/</span>sound<span style="color: #000000; font-weight: bold;">/</span>event_sounds <span style="color: #660033;">-t</span> bool <span style="color: #c20cb9; font-weight: bold;">false</span></div></div>
<p>When everything is disabled time to scale down icons in GNOME menu. This can be done in configuration file named <strong>~/.gtkrc-2.0</strong>. To scale down icons create file with this content:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;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">gtk-menu-images = <span style="color: #000000;">1</span><br />
gtk-button-images = <span style="color: #000000;">1</span><br />
gtk-icon-sizes = <span style="color: #ff0000;">&quot;panel-menu=16,16:panel=16,16:gtk-button=16,16:gtk-large-toolbar=16,16&quot;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/05/optimizing-gnome-for-netbooks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sptrace 1.4.2 released</title>
		<link>http://blog.burghardt.pl/2009/03/sptrace-142-released/</link>
		<comments>http://blog.burghardt.pl/2009/03/sptrace-142-released/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 09:00:06 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[gdb]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[LKM]]></category>
		<category><![CDATA[ltrace]]></category>
		<category><![CDATA[ptrace]]></category>
		<category><![CDATA[strace]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=292</guid>
		<description><![CDATA[<p>New version of sptrace was released today. Sptrace is a secure ptrace() Linux Kernel Module (LKM). It limits users&#8217; access to the ptrace() call. Module was updated to reflect changes in new kernel releases and tested with 2.6.26.</p>
<p></p>
<p>When someone not allowed to trace processes uses program that call ptrace() (like strace, ltrace or gdb) current and [...]]]></description>
			<content:encoded><![CDATA[<p>New version of <a href="/2007/12/limiting-access-to-ptrace-call-in-linux/">sptrace</a> was released today. Sptrace is a <strong>secure ptrace()</strong> Linux Kernel Module (LKM). It limits users&#8217; access to the <em>ptrace()</em> call. Module was updated to reflect changes in new kernel releases and tested with 2.6.26.</p>
<p><span id="more-292"></span></p>
<p>When someone not allowed to trace processes uses program that call <em>ptrace()</em> (like strace, ltrace or gdb) current and parent processes names, pids, uids and euids are logged, e.g.:</p>
<pre>
Mar 13 08:51:11 ghost kernel: [ 8086.730499] sptrace: ptrace() DENIED for (gdb:6810) UID(1000) EUID(1000), parent (gdb:6785) UID(1000) EUID(1000)
Mar 13 08:51:11 ghost kernel: [ 8086.984694] sptrace: ptrace() DENIED for (gdb:6785) UID(1000) EUID(1000), parent (tcsh:32216) UID(1000) EUID(1000)
Mar 13 08:51:44 ghost kernel: [ 8119.928920] sptrace: ptrace() DENIED for (gdb:6923) UID(1000) EUID(1000), parent (tcsh:32216) UID(1000) EUID(1000)
</pre>
<p>Program that call <em>ptrace()</em> will get EPERM error:</p>
<pre>
$ strace ls
strace: ptrace(PTRACE_TRACEME, ...): Operation not permitted
$ ltrace ls
PTRACE_TRACEME: Operation not permitted
PTRACE_SETOPTIONS: Operation not permitted
$ gdb -p 32215
GNU gdb 6.8-debian
[...]
This GDB was configured as "i486-linux-gnu".
Attaching to process 32215
ptrace: Operation not permitted.
</pre>
<p>Module log both allowed and denied <em>ptrace()</em> calls. Allowed traces as logged as:</p>
<pre>
Mar 11 19:14:48 ghost kernel: [ 6445.524669] sptrace: ptrace() by (ltrace:27558) UID(1000) EUID(1000), parent (ltrace:27557) UID(1000) EUID(1000)
Mar 11 19:14:48 ghost kernel: [ 6445.525460] sptrace: ptrace() by (ltrace:27557) UID(1000) EUID(1000), parent (tcsh:26606) UID(1000) EUID(1000)
</pre>
<p>By default <strong>sptrace</strong> deny access to <em>ptrace()</em> to all non root users (GID != 0). Root group (or wheel) is allowed to use this call. To disable tracing for all users, including those in root group pass parameter <strong>ptrace_group=-1</strong>, e.g.:</p>
<pre>
$ insmod ./sptrace.ko ptrace_group=-1
</pre>
<p>Download: <a href="http://www.burghardt.pl/files/sptrace-1.4.2.tar.gz">sptrace-1.4.2.tar.gz</a> (<a href="http://www.burghardt.pl/files/sptrace-1.4.2.tar.gz.asc">.asc</a>)</p>
<p>md5sum: 9a23198cbdcd256b11e2b0dc2c03b331<br />
sha1sum: 458f9b15e9a5b02cd18759b6b09a4b41d062d7cd</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/03/sptrace-142-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keep Doxyfile in sync with Autoconf</title>
		<link>http://blog.burghardt.pl/2009/03/keep-doxyfile-in-sync-with-autoconf/</link>
		<comments>http://blog.burghardt.pl/2009/03/keep-doxyfile-in-sync-with-autoconf/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 19:37:16 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Autoconf]]></category>
		<category><![CDATA[Doxyfile]]></category>
		<category><![CDATA[Doxygen]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=284</guid>
		<description><![CDATA[<p>Generating Doxygen configuration file &#8211; Doxyfile from Autoconf is simple and helps to avoid duplication of version numbers, input and output directories and packages names. Doxyfile can be generated like Makefiles from Doxyfile.in by configure script.</p>
<p></p>
<p>First generate Doxyfile skeleton like usual:</p>

$ doxygen -g Doxyfile.in

<p>Then open Doxyfile.in in $EDITOR and set following variables:</p>
PROJECT_NAME &#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Generating Doxygen configuration file &#8211; <em>Doxyfile</em> from Autoconf is simple and helps to avoid duplication of version numbers, input and output directories and packages names. <em>Doxyfile</em> can be generated like Makefiles from <em>Doxyfile.in</em> by <em>configure</em> script.</p>
<p><span id="more-284"></span></p>
<p>First generate <em>Doxyfile</em> skeleton like usual:</p>
<pre>
$ doxygen -g Doxyfile.in
</pre>
<p>Then open <em>Doxyfile.in</em> in $EDITOR and set following variables:</p>
<div class="codecolorer-container make default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="make codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PROJECT_NAME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004400;">=</span> <span style="color: #004400;">@</span>PACKAGE_NAME<span style="color: #004400;">@</span><br />
PROJECT_NUMBER &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004400;">=</span> <span style="color: #004400;">@</span>VERSION<span style="color: #004400;">@</span><br />
<br />
INPUT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #004400;">=</span> <span style="color: #004400;">@</span>top_srcdir<span style="color: #004400;">@</span><br />
OUTPUT_DIRECTORY &nbsp; &nbsp; &nbsp; <span style="color: #004400;">=</span> <span style="color: #004400;">@</span>top_builddir<span style="color: #004400;">@/</span>doc<br />
<br />
RECURSIVE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #004400;">=</span> YES</div></div>
<p>Finally add <em>Doxyfile</em> to <em>configure.ac</em> (or .in if you prefer .in convention):</p>
<div class="codecolorer-container make default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="make codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">AC_CONFIG_FILES<span style="color: #004400;">&#40;</span><span style="color: #004400;">&#91;</span>Makefile<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #004400;">...</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Doxyfile<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004400;">&#93;</span><span style="color: #004400;">&#41;</span><br />
AC_OUTPUT</div></div>
<p>Recreate <em>configure</em> script and run it (just run &#8220;make&#8221; and it will do all the magic for you).</p>
<p>Next time you change version, package name or anything else in Autoconf <em>Doxyfile</em> will be recreated with updated values.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/03/keep-doxyfile-in-sync-with-autoconf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ClamFS 1.0.0 has been released</title>
		<link>http://blog.burghardt.pl/2009/02/clamfs-100-has-been-released/</link>
		<comments>http://blog.burghardt.pl/2009/02/clamfs-100-has-been-released/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 14:18:45 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[ClamAV]]></category>
		<category><![CDATA[ClamFS]]></category>
		<category><![CDATA[Samba]]></category>
		<category><![CDATA[WINE]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=273</guid>
		<description><![CDATA[<p>ClamFS 1.0.0 has been released yesterday. It contains some new features that might be quite interesting for its users.</p>
<p></p>
Completed clamd results caching
<p>This was a long waiting feature. Version 0.9.1 cache only information about clean files. Infected files was scanned on every access. Starting from version 1.0.0 information about both clean and infected files are kept in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://clamfs.sourceforge.net/">ClamFS</a> <a href="http://freshmeat.net/releases/293686/">1.0.0</a> has been released yesterday. It contains some new features that might be quite interesting for its users.</p>
<p><span id="more-273"></span></p>
<h2>Completed clamd results caching</h2>
<p>This was a long waiting feature. Version 0.9.1 cache only information about clean files. Infected files was scanned on every access. Starting from version 1.0.0 information about both clean and infected files are kept in cache while files that cannot be scanned (mostly because of permission problems) are discarded from cache.</p>
<h2>Starting without clamd available</h2>
<p>A new &#8220;check&#8221; option was added to allow you to mount a ClamFS file system when clamd is not available, such as during an early stage of the boot process. To disable ClamAV Daemon (clamd) check on ClamFS startup set option check to no:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;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;clamd</span> <span style="color: #000066;">socket</span>=<span style="color: #ff0000;">&quot;/var/run/clamav/clamd.ctl&quot;</span> <span style="color: #000066;">check</span>=<span style="color: #ff0000;">&quot;no&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></div>
<h3>Mounting file systems from /etc/fstab</h3>
<p>With &#8220;check=no&#8221; mounting ClamFS file systems form <em>/etc/fstab</em> is possible using fuse mount helper (<em>/sbin/mount.fuse</em>). ClamFS will be started on boot with configuration file defined here provided as its argument. Simple definition of ClamFS mount point in <em>/etc/fstab</em> looks like:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;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">clamfs#/etc/clamfs/share.xml &nbsp;/clamfs/share &nbsp;fuse &nbsp;defaults &nbsp;0 &nbsp;0</div></div>
<h2>Read-only mounts</h2>
<p>The &#8220;readonly&#8221; option was added to the filesystem options allowing you to create a read-only protected file system. Just extend filesystem definition in config file with readonly option set to yes:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;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;filesystem</span> <span style="color: #000066;">root</span>=<span style="color: #ff0000;">&quot;/share&quot;</span> <span style="color: #000066;">mountpoint</span>=<span style="color: #ff0000;">&quot;/clamfs/share&quot;</span> <span style="color: #000066;">readonly</span>=<span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></div>
<h2>File system and cache statistics</h2>
<p>ClamFS has file system statistics that allow you to monitor and tune its performance. Statistics module keep track of file system usage and cache hits. Stats module is configured with &#8220;stats&#8221; tag. It can dump statistics periodically and on ClamFS dismount:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;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;stats</span> <span style="color: #000066;">atexit</span>=<span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #000066;">every</span>=<span style="color: #ff0000;">&quot;3600&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></div>
<p>Statistics are dumped to configured logging target. Here is an example of such statistics dumped to syslog:</p>
<pre>
Feb  8 14:52:51 ghost clamfs: --- begin of statistics ---
Feb  8 14:52:51 ghost clamfs: Early cache hit: 1038
Feb  8 14:52:51 ghost clamfs: Early cache miss: 1030
Feb  8 14:52:51 ghost clamfs: Late cache hit: 1038
Feb  8 14:52:51 ghost clamfs: Late cache miss: 0
Feb  8 14:52:51 ghost clamfs: Whitelist hit: 10
Feb  8 14:52:51 ghost clamfs: Blacklist hit: 108
Feb  8 14:52:51 ghost clamfs: Files bigger than maximal-size: 3
Feb  8 14:52:51 ghost clamfs: open() function called 2081 times (allowed: 1803, denied: 278)
Feb  8 14:52:51 ghost clamfs: Scan failed 278 times
Feb  8 14:52:51 ghost clamfs: --- end of statistics ---
</pre>
<h2>Better default extension blacklist</h2>
<p>Default blacklist in configuration file was extended. I advise all users to incorporate <a href="http://clamfs.svn.sourceforge.net/viewvc/clamfs/tags/clamfs-1.0.0/doc/clamfs.xml?view=markup">blacklist from version 1.0.0</a> into their configuration files.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2009/02/clamfs-100-has-been-released/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>ESE Key Daemon 1.2.4 released</title>
		<link>http://blog.burghardt.pl/2008/09/ese-key-daemon-124-released/</link>
		<comments>http://blog.burghardt.pl/2008/09/ese-key-daemon-124-released/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 19:10:58 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[daemon]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[funkey]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[userspace]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=144</guid>
		<description><![CDATA[<p>New version of ESE Key Daemon was released today.</p>
<p>Release notes:</p>

Fixed cross-compilation bug reported by hartleys.
Removed debian directory (will try to include esekeyd in Debian).
Removed old directory (Linux 2.4 users can use 1.2.3, but 2.4 support is no longer maintained).
Removed lib directory (any modern (g)libc has getopt).

<p>Download: esekeyd-1.2.4.tar.gz (.asc)</p>
<p>MD5: [...]]]></description>
			<content:encoded><![CDATA[<p>New version of <a href="/2007/12/ese-key-daemon/">ESE Key Daemon</a> was released today.</p>
<p>Release notes:</p>
<ul>
<li>Fixed cross-compilation bug reported by hartleys.</li>
<li>Removed debian directory (will try to <a href="http://bugs.debian.org/499917">include esekeyd in Debian</a>).</li>
<li>Removed old directory (Linux 2.4 users can use 1.2.3, but 2.4 support is no longer maintained).</li>
<li>Removed lib directory (any modern (g)libc has <a href="http://www.gnu.org/software/libc/manual/html_node/Getopt.html">getopt</a>).</li>
</ul>
<p>Download: <a href="http://www.burghardt.pl/files/esekeyd-1.2.4.tar.gz">esekeyd-1.2.4.tar.gz</a> (<a href="http://www.burghardt.pl/files/esekeyd-1.2.4.tar.gz.asc">.asc</a>)</p>
<p>MD5: 5eb8d1b02cdd99d0681e946768e529db<br />
SHA1: 12395b670dbf9ae93573e9cd5f57c51c3572a8aa</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2008/09/ese-key-daemon-124-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Web browser anonymity threats</title>
		<link>http://blog.burghardt.pl/2008/05/web-browser-anonymity-threats/</link>
		<comments>http://blog.burghardt.pl/2008/05/web-browser-anonymity-threats/#comments</comments>
		<pubDate>Tue, 13 May 2008 22:05:35 +0000</pubDate>
		<dc:creator>Krzysztof Burghardt</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[anonymity]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[identity]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[proxy servers]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[web browser]]></category>

		<guid isPermaLink="false">http://www.burghardt.pl/?p=81</guid>
		<description><![CDATA[<p>Anonymity in important for many people. Few years ago, it was problematic issue only for hackers, human rights workers and anonymity freaks. They want to keep they identity in secret for obvious reasons. They were traced only by law enforcement agencies and government. Today everything is much more difficult. Hundreds of advertising agencies trying to reveal [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.eff.org/issues/anonymity">Anonymity</a> in important for many people. Few years ago, it was problematic issue only for hackers, human rights workers and anonymity freaks. They want to keep they identity in secret for obvious reasons. They were traced only by law enforcement agencies and government. Today everything is much more difficult. Hundreds of advertising agencies trying to reveal identity of people to target their commercials better.</p>
<p>Web browser can give them so many information. For example in which languages you speak (browser shares your language preferences with sites you visit)., in which city you live (this can be obtained from IP), how big is your computer display (web page can get your display resolution), what video player or office suite you have installed (they can query installed browser plugins) and much more...</p>
<p><span id="more-81"></span></p>
<h2>Server side</h2>
<p>Various information are available from <a href="http://en.wikipedia.org/wiki/PHP">PHP</a> and <a href="http://en.wikipedia.org/wiki/Apache HTTP Server">Apache</a>.</p>
<p>This include IP address, hostname (<a href="http://en.wikipedia.org/wiki/Reverse_DNS_lookup">reverse DNS lookup</a>), source port and sometimes user name:</p>
<pre>
Your IP: 38.107.191.93Your hostname: 38.107.191.93Your source port: 17958Your username: </pre>
<p>Those basic information are available from <strong>_SERVER</strong> <a href="http://en.wikipedia.org/wiki/Associative_array">associative array</a> members named <strong>REMOTE_ADDR</strong>, <strong>REMOTE_PORT</strong> and <strong>REMOTE_USER</strong>.</p>
<p>Here is an example how to get hostname quering DNS using <em>gethostbyaddr()</em>:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;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: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <a href="http://www.php.net/gethostbyaddr"><span style="color: #990000;">gethostbyaddr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;REMOTE_ADDR&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>In the same way we can obtain name and version of browser (<strong>HTTP_USER_AGENT</strong>). You are using:</p>
<pre>
CCBot/1.0 (+http://www.commoncrawl.org/bot.html)</pre>
<p><strong>HTTP_REFERER</strong> reveals site you come form. Currently:</p>
<pre>
</pre>
<p>We are able to check what browser accepts as a response (<strong>HTTP_ACCEPT</strong>, <strong>HTTP_ACCEPT_ENCODING</strong>, <strong>HTTP_ACCEPT_CHARSET</strong>):</p>
<pre>
HTTP_ACCEPT: text/html,application/xhtml+xml,text/xml;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5HTTP_ACCEPT_ENCODING: gzipHTTP_ACCEPT_LANGUAGE: en-us,en;q=0.5HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7</pre>
<p>Those settings may leak your language and, if you leave default settings, your browser identity.</p>
<h3>Proxy</h3>
<p>Proxy servers often adds new headers to those sent by browser. We can access them using <strong>HTTP_X_FORWARDED_FOR</strong> and <strong>HTTP_FORWARDED</strong> . Some proxy servers sets also headers like <strong>HTTP_CLIENT_IP</strong>, <strong>HTTP_VIA</strong>, <strong>HTTP_PROXY_CONNECTION</strong>, <strong>HTTP_XROXY_CONNECTION</strong>.</p>
<p>Currently they are set to:</p>
<pre>
X-Forwarded-For: Forwarded: Client-IP: Via: PROXY: XROXY: </pre>
<p>If none of above is set user is probably using direct connection. However some proxy servers (often called "high anonymous proxy" or "elite proxy") forward requests without adding any headers or even removing some headers that leaks browser identity.</p>
<h2>Client side</h2>
<p>Web browser may leak user identity to anyone who is able to run <a href="http://en.wikipedia.org/wiki/JavaScript">JavaScript</a>. By default browsers run any script embedded into web page.</p>
<pre>
<script language="JavaScript">
jsver = "1.0";
</script><script language="JavaScript1.1">
jsver = "1.1";
</script><script language="JavaScript1.2">
jsver = "1.2";
</script><script language="JavaScript1.3">
jsver = "1.3";
</script><script language="JavaScript1.4">
jsver = "1.4";
</script><script language="JavaScript1.5">
jsver = "1.5";
</script><script language="JavaScript1.6">
jsver = "1.6";
</script><script language="JavaScript1.7">
jsver = "1.7";
</script><script language="JavaScript1.8">
jsver = "1.8";
</script><script language="JavaScript1.9">
jsver = "1.9";
</script><script language="JavaScript">document.write("JavaScript is <strong>enabled</strong> in your browser (version ", jsver, ")");</script><noscript>JavaScript is <strong>disabled</strong> in your browser.</noscript>
</pre>
<p>Browser identity is hold in <strong>navigator</strong> object. Its name is in <strong>navigator.appName</strong> Currently:</p>
<pre>
<script language="JavaScript">document.write(navigator.appName);</script><noscript>JavaScript disabled</noscript>
</pre>
<p>Browser code name (<strong>navigator.appCodeName</strong>):</p>
<pre>
<script language="JavaScript">document.write(navigator.appCodeName);</script><noscript>JavaScript disabled</noscript>
</pre>
<p>Browser version (<strong>navigator.appVersion</strong>):</p>
<pre>
<script language="JavaScript">document.write(navigator.appVersion);</script><noscript>JavaScript disabled</noscript>
</pre>
<p>Finally, platform it is running on (<strong>navigator.platform</strong>):</p>
<pre>
<script language="JavaScript">document.write(navigator.platform);</script><noscript>JavaScript disabled</noscript>
</pre>
<p>History length (or how many pages were visited - <strong>history.length</strong>):</p>
<pre>
<script language="JavaScript">document.write(history.length);</script><noscript>JavaScript disabled</noscript>
</pre>
<p>Screen size and dept is hold in <strong>screen</strong> object. Example code to obtain screen properties:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;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">document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>screen.<span style="color: #660066;">width</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot; x &quot;</span><span style="color: #339933;">,</span>screen.<span style="color: #660066;">height</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot; x &quot;</span><span style="color: #339933;">,</span> screen.<span style="color: #660066;">colorDepth</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot; bpp (available for browser: &quot;</span><span style="color: #339933;">,</span> window.<span style="color: #660066;">screen</span>.<span style="color: #660066;">availWidth</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot; x &quot;</span><span style="color: #339933;">,</span> window.<span style="color: #660066;">screen</span>.<span style="color: #660066;">availHeight</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Result of the above:</p>
<pre>
<script language="JavaScript">document.write(screen.width," x ",screen.height, " x ", screen.colorDepth, " bpp (available for browser: ", window.screen.availWidth, " x ", window.screen.availHeight, ")");</script><noscript>JavaScript disabled</noscript>
</pre>
<p>Referrer can be read from <strong>document.referrer</strong>:</p>
<pre>
<script language="JavaScript">document.write(document.referrer);</script><noscript>JavaScript disabled</noscript>
</pre>
<p>Using simple loop one can iterate trough installed plugins:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;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: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">plugins</span>.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> navigator.<span style="color: #660066;">plugins</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; plugin <span style="color: #339933;">=</span> navigator.<span style="color: #660066;">plugins</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>plugin.<span style="color: #000066;">name</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot; (&quot;</span><span style="color: #339933;">,</span> plugin.<span style="color: #660066;">filename</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;)<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Result of above code:</p>
<pre>
<script language="JavaScript">
if (navigator.plugins.length) {
  for (i = 0; i < navigator.plugins.length; i++) {
    plugin = navigator.plugins[i];
    document.write(plugin.name, " (", plugin.filename, ")\n");
  }
}
</script><noscript>JavaScript disabled</noscript>
</pre>
<h3>Java</h3>
<p>If Java is enabled JavaScript can use Java VM to obtain more information from OS. <strong>navigator.javaEnabled()</strong> returns true or false if Java is enabled.</p>
<pre>
<script language="JavaScript">if (navigator.javaEnabled()) document.write("Java is enabled");else document.write("Java is disabled");</script><noscript>JavaScript is disabled. Unable to check availability of Java Runtime Environment.</noscript>
</pre>
<p>JavaScript with small help of Java can obtain client IP address with:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;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: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">javaEnabled</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; addr<span style="color: #339933;">=</span>java.<span style="color: #660066;">net</span>.<span style="color: #660066;">InetAddress</span>.<span style="color: #660066;">getLocalHost</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; host<span style="color: #339933;">=</span>addr.<span style="color: #660066;">getHostName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; ip<span style="color: #339933;">=</span>addr.<span style="color: #660066;">getHostAddress</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>ip<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot; (hostname: &quot;</span><span style="color: #339933;">,</span> host<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Results:</p>
<pre>
<script language="JavaScript">
if (navigator.javaEnabled()) {
  addr=java.net.InetAddress.getLocalHost();
  host=addr.getHostName();
  ip=addr.getHostAddress();
  document.write(ip, " (hostname: ", host, ")");
} else {
  document.write("Java disabled");
}
</script><noscript>JavaScript disabled. Unable to use Java Runtime Environment.</noscript>
</pre>
<p>Or with alternative version:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;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: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">javaEnabled</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; host<span style="color: #339933;">=</span> window.<span style="color: #660066;">location</span>.<span style="color: #660066;">host</span><span style="color: #339933;">;</span><br />
&nbsp; port<span style="color: #339933;">=</span>window.<span style="color: #660066;">location</span>.<span style="color: #660066;">port</span> <span style="color: #339933;">||</span> <span style="color: #CC0000;">80</span><span style="color: #339933;">;</span><br />
&nbsp; sock<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> java.<span style="color: #660066;">net</span>.<span style="color: #660066;">Socket</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; sock.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> java.<span style="color: #660066;">net</span>.<span style="color: #660066;">InetSocketAddress</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'0.0.0.0'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; sock.<span style="color: #660066;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> java.<span style="color: #660066;">net</span>.<span style="color: #660066;">InetSocketAddress</span><span style="color: #009900;">&#40;</span>host<span style="color: #339933;">,</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>port<span style="color: #009900;">&#41;</span><span style="color: #339933;">?</span><span style="color: #CC0000;">80</span><span style="color: #339933;">:</span>port<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; addr<span style="color: #339933;">=</span>sock.<span style="color: #660066;">getLocalAddress</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; host<span style="color: #339933;">=</span>addr.<span style="color: #660066;">getHostName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; ip<span style="color: #339933;">=</span>addr.<span style="color: #660066;">getHostAddress</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>ip<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot; (hostname: &quot;</span><span style="color: #339933;">,</span> host<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Java disabled&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Results:</p>
<pre>
<script language="JavaScript">
if (navigator.javaEnabled()) {
  host= window.location.host;
  port=window.location.port || 80;
  sock=new java.net.Socket();
  sock.bind(new java.net.InetSocketAddress('0.0.0.0', 0));
  sock.connect(new java.net.InetSocketAddress(host, (!port)?80:port));
  addr=sock.getLocalAddress();
  host=addr.getHostName();
  ip=addr.getHostAddress();
  document.write(ip, " (hostname: ", host, ")");
} else {
  document.write("Java disabled");
}
</script><noscript>JavaScript disabled. Unable to use Java Runtime Environment.</noscript>
</pre>
<h3>Java applets</h3>
<p>Another possibility to obtain IP address of client is using <a href="http://en.wikipedia.org/wiki/Java_applet">Java applets</a>. Here is sample applet that tries to connect back to web server and reveal client address:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">// &lt;applet code=&quot;ShowIP&quot; width=&quot;240&quot; height=&quot;30&quot;&gt;&lt;/applet&gt;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.applet.*</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.*</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.*</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ShowIP <span style="color: #000000; font-weight: bold;">extends</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aapplet+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Applet</span></a> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> m_ip<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_ip <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asocket+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Socket</span></a><span style="color: #009900;">&#40;</span>getDocumentBase<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getHost</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, getDocumentBase<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getPort</span><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: #006633;">getLocalAddress</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getHostAddress</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Exception</span></a> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_ip <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;unknown&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> stop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> paint<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Agraphics+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Graphics</span></a> g<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; g.<span style="color: #006633;">drawString</span><span style="color: #009900;">&#40;</span>m_ip, <span style="color: #cc66cc;">10</span>, <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Applet in action:<br />
<applet codebase="/wp-content/uploads/2008/04/" code="ShowIP" width="240" height="30"></applet></p>
<h3>ActiveX and other threats</h3>
<p><a href="http://en.wikipedia.org/wiki/ActiveX">ActiveX</a> object can reveal client identity, too. Fortunately AvtiveX works only in <a href="http://en.wikipedia.org/wiki/Internet_Explorer">Internet Explorer</a> on Windows. Maybe also Flash's Action Script can be used to achieve this. If you known any other possibilities let me known.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.burghardt.pl/2008/05/web-browser-anonymity-threats/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
