<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Mark's Blog</title>
	
	<link>http://mark.ossdl.de</link>
	<description>de arte technologiæ</description>
	<lastBuildDate>Tue, 22 May 2012 17:30:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ossdl/mark" /><feedburner:info uri="ossdl/mark" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>ossdl/mark</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2Fossdl%2Fmark" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fossdl%2Fmark" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/ossdl/mark" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fossdl%2Fmark" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fossdl%2Fmark" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fossdl%2Fmark" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2Fossdl%2Fmark" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2Fossdl%2Fmark" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><item>
		<title>Redis vs Filesystem as Page Cache for WordPress</title>
		<link>http://feedproxy.google.com/~r/ossdl/mark/~3/EU8WMIq5qMI/</link>
		<comments>http://mark.ossdl.de/2012/02/redis-vs-filesystem-as-page-cache-for-wordpress/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 12:47:42 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[technology related]]></category>
		<category><![CDATA[CDN]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Redis]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://mark.ossdl.de/?p=7497</guid>
		<description><![CDATA[I&#8217;ve been curious about how Redis compares to plain filesystem as page cache for WordPress running behind Nginx. Bottom line: the filesystem along with Linux file cache is way faster. Benchmarks have been conducted on a random KVM and WordPress. The latter&#8217;s plugins do not matter, because pages are only generated once and then cached. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been curious about how Redis compares to plain filesystem as page cache for WordPress running behind Nginx. Bottom line: the filesystem along with Linux file cache is way faster.</p>
<p>Benchmarks have been conducted on a random KVM and WordPress. The latter&#8217;s plugins do not matter, because pages are only generated once and then cached.</p>
<p>The first blog, the one using a plain filesystem as cache, has been run with <a href="http://wpscp.trac.armadillo.homeip.net/">WP Super Cache plus</a> on EXT4.<br />
The second one utilized my plugin <a href="https://github.com/wmark/CDN-Linker/tree/caching">CDN Linker; see the caching branch</a> for its source code. Nginx has been 1.1.12-r2 with HttpRedis 0.3.5; Redis 2.4.5.</p>
<p>Tests have been conducted by:</p>
<pre class="brush: bash">/usr/sbin/ab2 -n 50000 -c 5 -H 'Accept-Encoding: gzip' -k [url]</pre>
<p>Results:</p>
<ul>
<li><strong>filesystem</strong> &ndash; 17000 &#8211; 19000 requests per second, about 50-60 ns per request</li>
<li><strong>Redis</strong> &ndash; 5000 &#8211; 5200 requests per second, about 194 ns per request</li>
<li>Redis w/o keepalive connection from Nginx &ndash; 1700-1900 rps, ~500 ns per request</li>
</ul>
<p>I suspect that even if I connected Redis to Nginx through unix sockets (and not the usual TCP sockets) <i>requests per second</i> would only double, still significantly falling behind filesystem as cache. Nanoseconds per request would drop, though, but I do not believe that I will see anything near a three- or five-fold increase.</p>
]]></content:encoded>
			<wfw:commentRss>http://mark.ossdl.de/2012/02/redis-vs-filesystem-as-page-cache-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mark.ossdl.de/2012/02/redis-vs-filesystem-as-page-cache-for-wordpress/</feedburner:origLink></item>
		<item>
		<title>liebe Fernsehköche – cut the crap (Kochverhalten von Studenten)</title>
		<link>http://feedproxy.google.com/~r/ossdl/mark/~3/2b7IIk-3GXI/</link>
		<comments>http://mark.ossdl.de/2011/08/liebe-fernsehkoche-cut-the-crap-kochverhalten-von-studenten/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 15:47:34 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Gedankengut]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Studentenleben]]></category>

		<guid isPermaLink="false">http://mark.ossdl.de/?p=7376</guid>
		<description><![CDATA[Liebe Fernsehköche, Ich kann es nicht mehr mit ansehen (hätte ich noch einen Fernseher) oder hören. &#8220;Studenten sind faul und ernähren sich ungesund. Wir helfen euch!&#8221; &#8211; ihr habt echt keine Ahnung oder nehmt nur selektiv wahr, um eure Shows oder Bücher abzusetzen. Bedenkt, dass &#8220;Essen Machen&#8221; folgende Tätigkeiten beinhaltet: Erwerb der Zutaten ihr Vorhalten [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://mark.ossdl.de/wp-content/uploads/2011/08/ein-random-Koch.jpg" alt="" title="" width="560" height="198" class="alignnone size-full wp-image-7377" /><br />
Liebe Fernsehköche,</p>
<p>Ich kann es nicht mehr mit ansehen (hätte ich noch einen Fernseher) oder hören. &#8220;Studenten sind faul und ernähren sich ungesund. Wir helfen euch!&#8221; &#8211; ihr habt echt keine Ahnung oder nehmt nur selektiv wahr, um eure Shows oder Bücher abzusetzen. </p>
<p>Bedenkt, dass &#8220;Essen Machen&#8221; folgende Tätigkeiten beinhaltet:</p>
<ol>
<li>Erwerb der Zutaten</li>
<li>ihr Vorhalten (Kühlschrank und so)</li>
<li>Zubereitung</li>
<li>Wiederherstellen von Küche, Geschirr und Werkzeug</li>
</ol>
<p>&#8230; und das alles kostet Zeit. Wer davon wenig hat, der stellt selbst selten her, der hat als Student sicher schon Fermentation, Schimmel oder Fäulnis an Zutaten im Kühlschrank erlebt, die in bester Absicht zu Kochen (man kam ja nicht zu) erworben wurden. Nicht auf dem allmorgentlichen Frischmarkt &#8211; wir haben noch Veranstaltungen, Job und Klausuren! &#8211; sondern bei Gelegenheit in einem Supermarkt. Ohne Zutaten Frust beim Zubereiten, weniger auf Vorrat, weniger Grund ausschweifend Einkaufen zu gehen.</p>
<p>Während ihr in der Ausbildung Geld fürs Lernen bekommen habt, muss manch einer von uns auch noch Jobben. Darüberhinaus ich will euch sehen, wie ihr nach der Konstruktion eines Oszillographen (E-Tech), einem Semester Kryptologie (Informatik), dem Durcharbeiten von Kants Anthologie des Geistes (Philosophie oder Germanistik) oder der Beschäftigung mit Charismatikern zur Zeit Jesus (Theologie) samt abschließender Prüfung oder Hausarbeit noch energetisiert durch die Küche hüpft und in irgendeine Kamera lächelt. Und das war nur ein Zehntel eines Semesters. Vergesst die gute Note nicht. Etc. (Okay, wir könnten das. Aber nicht zehn Mal.)</p>
<p>Ich verrate euch auch ein Geheimnis: Gestern gab es bei uns Nürnberger Rostbratwürste samt kräutergefüllter Kartoffelecken; eine Mahlzeit davor Mousse au Chocolat mit Kornflakes. Und Rote Beete Suppe (Barszcz) macht man ohne Sahne, ihr Banausen. Ein wenig was können wir doch. Wenn wir Zeit dazu haben. Vielen Dank auch.</p>
]]></content:encoded>
			<wfw:commentRss>http://mark.ossdl.de/2011/08/liebe-fernsehkoche-cut-the-crap-kochverhalten-von-studenten/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mark.ossdl.de/2011/08/liebe-fernsehkoche-cut-the-crap-kochverhalten-von-studenten/</feedburner:origLink></item>
		<item>
		<title>how to set up a linux box as IPv6 router</title>
		<link>http://feedproxy.google.com/~r/ossdl/mark/~3/HOOeO8T5JmQ/</link>
		<comments>http://mark.ossdl.de/2011/08/how-to-set-up-a-linux-box-as-ipv6-router/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 20:03:27 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[technology related]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[BIND]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[know-how]]></category>
		<category><![CDATA[PowerDNS]]></category>
		<category><![CDATA[SheevaPlug]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows Server 2008]]></category>

		<guid isPermaLink="false">http://mark.ossdl.de/?p=7361</guid>
		<description><![CDATA[It doesn´t matter whether your ISP provides IPv6 or you are behind an antediluvian router. As long as you have a spare box running Linux &#8211; or better yet, a SheevaPlug &#8211; you can welcome your LAN to the future in less than five minutes. And here is how: Sign up with Hurricane Electric for [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="" src="http://mark.ossdl.de/wp-content/uploads/2011/08/computer1950x440.jpg" class="aligncenter" width="440" height="330" /><br />
It doesn´t matter whether your ISP provides IPv6 or you are behind an antediluvian router. As long as you have a spare box running Linux  &#8211; or better yet, a <a href="http://mark.ossdl.de/tag/sheevaplug/">SheevaPlug</a> &#8211; you can welcome your LAN to the future in less than five minutes. And here is how: <span id="more-7361"></span></p>
<ol>
<li>Sign up with <a href="http://tunnelbroker.org/" target="_blank">Hurricane Electric for an IPv6 tunnel</a>.</li>
<li>There, have a &#8220;regular tunnel&#8221; created.</li>
<li>Jot down the tunnel&#8217;s data.</li>
<li>Set up the tunnel at your router-to-be.</li>
<li>Turn on IPv6 at every of your local computers.</li>
</ol>
<h4 style="border-bottom: 1px dashed #ccc">prerequisites</h4>
<p>In this example I will use the data of my IPv6 subnet:</p>
<blockquote><p><strong>IPv6 Tunnel Endpoints</strong><br />
Server IPv4 Address: 216.66.80.98<br />
Server IPv6 Address: 2001:470:145:76c::1/64<br />
Client IPv4 Address: 92.196.95.188<br />
Client IPv6 Address: 2001:470:145:76c::2/64<br />
<strong>Routed IPv6 Prefixes</strong><br />
Routed /64: 2001:470:146:76c::/64</p></blockquote>
<p>Make sure your Linux kernel has at least these features:</p>
<blockquote><p># zgrep -F IPV6 /proc/config.gz<br />
CONFIG_IPV6=y<br />
CONFIG_IPV6_SIT=y<br />
CONFIG_IPV6_TUNNEL=y</p></blockquote>
<p>&#8230; which is the case for most of the recent GNU distributions.</p>
<h4 style="border-bottom: 1px dashed #ccc">the tunnel network interface</h4>
<p>Assuming you are running <strong>Gentoo Linux</strong>, edit <code>/etc/conf.d/net</code> with your favourite text editor so it looks like this:</p>
<pre class="brush: text">dns_servers_eth0=(
        "::1"
        "127.0.0.1"
)

config_eth0=(
        "192.168.1.7 netmask 255.255.255.0 broadcast 192.168.1.255"
        "2001:470:146:76c::7/64"
)
routes_eth0=(
        "default via 192.168.1.1"
)

#### HE tunnel
RC_NEED_he6="net.eth0"
iptunnel_he6=(
        "mode sit remote 216.66.80.98 local 192.168.1.7 ttl 255 dev eth0"
)
mtu_he6="1280"
config_he6=( "2001:470:145:76c::2/64" )
routes_he6=( "default via 2001:470:145:76c::1 dev he6" )
</pre>
<p>I run a DNS server locally. If you don&#8217;t then skip <strong>lines 1-5</strong>.<br />
<strong>Line 7</strong>, 192.168.1.7 is the local IPv4 address of my Linux box; nothing has been changed here.<br />
What you see in <strong>line 8</strong> is the IPv6 address of the box &#8211; an arbitrary one I have chosen from the &#8220;routed /64 IPv6 network&#8221;. </p>
<p><strong>From line 14 on</strong> is the tunnel&#8217;s data. The &#8220;remote&#8221; is the IPv4 address which handles the other side of the tunnel. Make sure to use the address of the endpoint you have selected! Local address is the one from my and your LAN. Not your publicly visible IPv4 address, except the machine we are setting everything up is your actual router or in a DMZ. We can safely assume that is not the case.</p>
<p>Most probably you have noticed that the <strong>last two IPv6 addresses</strong> are not in the routed /64 subnet. Those are the &#8220;client&#8221; and &#8220;server&#8221; IPv6 addresses of the tunnel.</p>
<p>In order to have that new network interface started automatically you have to:</p>
<pre class="brush: bash">cd /etc/init.d
ln -s net.lo net.he6
rc-update add net.he6 default
/etc/init.d/net.he6 start</pre>
<p>Although your tunnel is expected to work immediately, it took about two days for my (endpoint in Zurich) before it went online. The delay&#8217;s cause has been on Tunnelbroker&#8217;s side.</p>
<p>You can see if it is working by a ping to the endpoint&#8217;s IPv6 address:</p>
<pre class="brush: bash">ping6 -c2 2001:470:145:76c::1</pre>
<h4 style="border-bottom: 1px dashed #ccc">distributing IPv6 addresses to your LAN</h4>
<p><img alt="" src="http://mark.ossdl.de/wp-content/uploads/2011/08/alloc-ipv6.png" class="alignnone" width="400" height="242" /><br />
For that you will need <strong><em>radvd</em></strong>. Setup is straightforward:</p>
<pre class="brush: bash">emerge net-misc/radvd
rc-update add radvd default
nano /etc/radvd.conf
/etc/init.d/radvd start</pre>
<p>Its configuration file looks like this:</p>
<pre class="brush: text">interface eth0
{
        IgnoreIfMissing on;
        AdvSendAdvert on;
        AdvLinkMTU 1280;
        MaxRtrAdvInterval 300;
        prefix 2001:470:146:76c::/64
        {
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr on;
        };
        RDNSS 2001:470:146:76c::7
        {
        };
};</pre>
<p>Yes, that is the &#8220;route IPv6 /64 network&#8221; from above and the bottom IPv6 address is the one from my Linux box which is the IPv6 router.</p>
<p>That&#8217;s all. You have IPv6 in your LAN and (eventually, due to the delay I experienced above) a fully working IPv6 upstream connection, dash tunnel. Now come some extras.</p>
<h4 style="border-bottom: 1px dashed #ccc">clients: ditch Windows&#8217;s transitory IPv6 protocols</h4>
<p>You don&#8217;t need <a href="http://www.microsoft.com/germany/technet/datenbank/articles/600330.mspx" target="_blank">Teredo</a> and all the other strange stuff you most probably have not used anyway, anymore. You can deactivate it easily by:</p>
<pre class="brush: bash">netsh interface teredo set state disabled
netsh interface ipv6 6to4 set state state=disabled undoonstop=disabled
netsh interface ipv6 isatap set state state=disabled</pre>
<h4 style="border-bottom: 1px dashed #ccc">clients: enable IPv6 privacy extensions</h4>
<p><img alt="" src="http://mark.ossdl.de/wp-content/uploads/2011/08/adr-ipv6.png" class="alignnone" width="400" height="285" /><br />
If you don&#8217;t enable <strong>IPv6 privacy extensions</strong> on all your local computers, they will auto-configure themselves addresses from their MAC. Their unique network identifiers. These IPv6 addresses have always the same suffix &#8211; no matter what the prefix is &#8211; making them globally traceable. You can easily spot them by paying attention to the &#8220;ff:fe&#8221; substring in the second half of a particular IPv6 address.</p>
<p>Here is a <strong>list of popular devices and their IPv6 privacy extension status</strong>: http://www.heise.de/netze/artikel/IPv6-Privacy-Extensions-einschalten-1204783.html<br />
(&#8220;Ab Werk aktiv&#8221; means &#8220;enabled by default&#8221;. One line is incorrect: <em>Windows Server 2008 R2</em> has them enabled by default.)</p>
<p>For <strong>older Android versions</strong> you will want to use this app: https://market.android.com/details?id=to.doc.android.ipv6config (Ipv6 Config)</p>
<h4 style="border-bottom: 1px dashed #ccc">server: DNS for Ipv6</h4>
<p>Your own local DNS server (if you run one, that is) should listen on IPv6 requests. Check whether this already is the case:</p>
<pre class="brush: bash">netstat -tuanp | grep -F -e :53 | grep -F 'cp6'</pre>
<p>Otherwise, for <strong>BIND9</strong> you will have to alter <code>/etc/bind/named.conf</code>:</p>
<pre class="brush: text">options {
        forwarders {
                // HE
                2001:470:140::2; 74.82.42.42;
        };
        listen-on-v6 { any; };
        allow-recursion {
                127.0.0.1; ::1;
                192.168.0.0/16;
                2001:470:146:76c::/64; 2001:470:145:76c::2;
        };
};
</pre>
<p><strong>PowerDNS</strong> is configured by <code>/etc/powerdns/recursor.conf</code> (note the brackets in line 1):</p>
<pre class="brush: text">local-address=127.0.0.1, [::1]
allow-from=127.0.0.1, ::1, 192.168.0.0/16, 2001:470:146:76c::/64, 2001:470:145:76c::2
query-local-address6=::1, 2001:470:145:76c::2
aaaa-additional-processing=on</pre>
<h4 style="border-bottom: 1px dashed #ccc">server: Google, Youtube and IPv6</h4>
<p>Although Youtube&#8217;s sites are delivered by IPv4 only, videos are pulled in through IPv6 if available to you. Unfortunately Youtube&#8217;s country-of-origin takes into account the IPv4 address. That means, if you lived in Germany or any other country and received messages such as &#8220;this video is not available in your country&#8221; you will want to access everything via your new IPv6 endpoint which ends probably somewhere else. In the UK or Switzerland, for example. So you need an IPv6 address for that remaining pages.</p>
<p>Google currently provides IPv6 address for its services on a white-list basis only. Luckily Hurricane Electric&#8217;s network is listed on it. So, here we go:</p>
<pre class="brush: bash"># dig aaaa @2001:470:140::2 +short www.youtube.com
youtube-ui.l.google.com.
2a00:1450:8007::5d
2a00:1450:8006::68
2a00:1450:4008:c00::5d</pre>
<h4 style="border-bottom: 1px dashed #ccc">fin</h4>
<p>Sites are neither faster nor slower with IPv6. But the tunnelling will add about 20ms (or more) to the latency. Most games connect to IPv4 servers only; surfing you won&#8217;t notice that small delay.</p>
]]></content:encoded>
			<wfw:commentRss>http://mark.ossdl.de/2011/08/how-to-set-up-a-linux-box-as-ipv6-router/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mark.ossdl.de/2011/08/how-to-set-up-a-linux-box-as-ipv6-router/</feedburner:origLink></item>
		<item>
		<title>Did you know fcron?</title>
		<link>http://feedproxy.google.com/~r/ossdl/mark/~3/vTKageky5Io/</link>
		<comments>http://mark.ossdl.de/2011/05/did-you-know-fcron/#comments</comments>
		<pubDate>Thu, 19 May 2011 13:39:33 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[technology related]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[os tools]]></category>

		<guid isPermaLink="false">http://mark.ossdl.de/?p=5698</guid>
		<description><![CDATA[One of the first things I replaced years ago, when I have started with Gentoo, was the cron daemon. Now I use Thibault Godouet&#8217;s fcron &#8211; which understands that vintage cron syntax and more &#8211; and since then have never looked back. For example, you can set nice(10) levels, or have runs excluded from being [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://mark.ossdl.de/wp-content/uploads/2011/05/cuckoo-clock.jpg" alt="" title="" width="103" height="80" class="alignleft size-full wp-image-5706" />One of the first things I replaced years ago, when I have started with <a href="/2009/11/why-i-prefer-gentoo/">Gentoo</a>, was the cron daemon. Now I use Thibault Godouet&#8217;s <em><a href="http://fcron.free.fr/">fcron</a></em> &#8211; which understands that vintage cron syntax and more &#8211; and since then have never looked back. <span id="more-5698"></span></p>
<p>For example, you can set <code>nice(10)</code> levels, or have runs excluded from being logged by <code>nolog</code> flag or suppress emails by <code>mail(false)</code>. One of the things I like the most is <code>first(5)</code>, which executes the given command 5 minutes after booting; <code>@lavgor,lavg</code> selects the best moment within an interval or time-span. Oh, before I forget it. <a href="http://fcron.free.fr/doc/en/fcrontab.5.html">Take a look on</a> <code>%nightly</code>, <code>%hourly</code> and friends.</p>
<p>And to be honest, syntax like <code>10 4   */2   *   *</code> *is* rather cryptic. With <em>fcron</em> you can write <code>2d</code>, which is not only shorter but easier to read.</p>
<p>My crontab begins as follows:</p>
<pre class="brush:bash"># &amp;  -  classic cron syntax
# @  -  frequency or timespan (every 30 minutes; with options: best moment within every 30 minutes)
# %  -  (once) within time interval

# classic cron syntax:
#
# * * * * * command to be executed
# - - - - -
# | | | | |
# | | | | +- - - - day of week (0 - 6) (Sunday=0)
# | | | +- - - - - month (1 - 12)
# | | +- - - - - - day of month (1 - 31)
# | +- - - - - - - hour (0 - 23)
# +- - - - - - - - minute (0 - 59)</pre>
<p>Want to delete files from <code>/tmp</code> which have not been accessed for week or more? That&#8217;s how:</p>
<pre class="brush: text">@ 1d    root  "find /tmp -atime +7 -exec rm -r '{}' \;"</pre>
<p>Using Gentoo? Have your portage tree updated when your server is idle:</p>
<pre class="brush: text">@lavgor,lavg(0.3),nice(5),mail(no) 3d  root  "eix-sync"</pre>
<p>Need to run some logfile analyzer? The intervals are seen as one and Awstats is run within it once per night:</p>
<pre class="brush: text">%nightly,mail(no)  * 22-23,3-5  root  /root/bin/runawstats.sh</pre>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://mark.ossdl.de/2011/05/did-you-know-fcron/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mark.ossdl.de/2011/05/did-you-know-fcron/</feedburner:origLink></item>
		<item>
		<title>Warum Facebooks Like-Button schlecht ist und welche Plugins man im Browser haben sollte.</title>
		<link>http://feedproxy.google.com/~r/ossdl/mark/~3/kVgf82ayxMA/</link>
		<comments>http://mark.ossdl.de/2011/05/warum-facebooks-like-button-schlecht-ist-und-welche-plugins-man-im-browser-haben-sollte/#comments</comments>
		<pubDate>Tue, 17 May 2011 17:55:15 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Gedankengut]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Datenschutz]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://mark.ossdl.de/?p=5685</guid>
		<description><![CDATA[Kleine, vielleicht 1&#215;1 Pixel große Bildchen werden ungesehen auf seiner Seite (oder HTML Email) eingebunden und von einem anderem Rechner geladen. Etwa einem anderen als dem deines Email-Anbieters. Dieser Rechner wiederum schreibt schlicht mit, wer &#8211; d.h. von welcher IP-Adresse oder mit welchem besonderen Code oder Cookie &#8211; das Bild abgerufen hat, wann und von [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-5686" title="mailboxes-room" src="http://mark.ossdl.de/wp-content/uploads/2011/05/mailboxes-room.jpg" alt="" width="535" height="133" /></p>
<p>Kleine, vielleicht 1&#215;1 Pixel große Bildchen werden ungesehen auf seiner Seite (oder HTML Email) eingebunden und von einem anderem Rechner geladen. Etwa einem anderen als dem deines Email-Anbieters. Dieser Rechner wiederum schreibt schlicht mit, wer &#8211; d.h. von welcher IP-Adresse oder mit welchem besonderen Code oder Cookie &#8211; das Bild abgerufen hat, wann und von welcher Seite aus (&#8220;Referrer&#8221;). Das Prinzip nennt man bei den Kleinstbildern &#8220;<strong>Webbug</strong>&#8221; und generell &#8220;<strong>Tracking</strong>&#8221; &#8211; das Verfolgen und Mitschneiden von Benutzerbewegungen durch das Informationsangebot des Internets.</p>
<p>Diese Spuren vermengt <strong>ergeben dann ein &#8220;Benutzerprofil&#8221;</strong>, eine Akte, ein Dossier über &#8211; dich. <span id="more-5685"></span> Google, Flattr, Facebook (FB) und andere sind leicht in der Lage solche Profile anzulegen. <strong>Facebooks &#8220;like&#8221; Button</strong> beispielsweise findest du häufiger. Er ist zwar kein Bild, wird aber dennoch immer von FBs Rechnern geladen und ermöglicht ihnen <a href="http://www.heise.de/security/artikel/Das-verraet-Facebooks-Like-Button-1230906.html" target="_blank">das Tracking</a>. Viele Werbeanzeigen werden übrigens auch von Rechnern Dritter geholt und führen zur gleichen Problematik.</p>
<p>Du kannst das alles unterbinden, indem du diese Teile von Homepages von vornherein nicht durch deinen Browser herunterladen lässt. Am einfachsten geht das über ein, zwei <strong>Plugins</strong>. Für den <strong>Firefox</strong> empfehle ich zu <a href="https://addons.mozilla.org/de/firefox/addon/adblock-plus/">AdBlock Plus</a> noch <a href="https://addons.mozilla.org/en-US/firefox/addon/ghostery/">Ghostery</a>; beide gibt es auch für <strong>Google Chrome</strong> (Downloads hier: <a href="https://chrome.google.com/webstore/detail/mlomiejdfkolichcflejclcbmpeaniij">Ghostery</a>, <a href="https://chrome.google.com/webstore/detail/gighmmpiobklfepjocnamgkkbiglidom">AdBlock</a>). Der &#8220;Like&#8221; Knopf wird so nur noch auf der Facebook Seite angezeigt, sonst nirgends.</p>
<p>Die Lösung, eine solche Sammlung erst gar nicht zuzulassen, ist es leider nicht. Aber zumindest ein erster Schritt um die Schwere des Mißbrauchs deiner persönlichen Daten zu verringern.</p>
]]></content:encoded>
			<wfw:commentRss>http://mark.ossdl.de/2011/05/warum-facebooks-like-button-schlecht-ist-und-welche-plugins-man-im-browser-haben-sollte/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mark.ossdl.de/2011/05/warum-facebooks-like-button-schlecht-ist-und-welche-plugins-man-im-browser-haben-sollte/</feedburner:origLink></item>
		<item>
		<title>new home for the RSS feeds</title>
		<link>http://feedproxy.google.com/~r/ossdl/mark/~3/U1vBrYn-adY/</link>
		<comments>http://mark.ossdl.de/2011/05/new-home-for-the-rss-feeds/#comments</comments>
		<pubDate>Sun, 15 May 2011 16:35:32 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mark.ossdl.de/?p=5682</guid>
		<description><![CDATA[Location of RSS feeds of my/this blog move as the latter will be separate in two categories.]]></description>
			<content:encoded><![CDATA[<p>Scott Hanselman once gave <a href="http://techzulu.com/scott-hanselman-how-to-make-your-blog-suck-less/">the advice</a> that splitting your blog into separate parts would make ones blog suck. But I want to blog more about my own experiences and musings and that in German. And as I believe it will annoy my readers to have German and English posts mixed, on one page or feed, I have decided to publish two disjunct categories and for every of them separate feeds.</p>
<p>Therefore, if you read my blog with some RSS reader then please visit it with your browser for a new RSS feed link. Else you won&#8217;t get any new updates in the future.<br />
If you want to follow both categories, the one about development and technology related stuff or the new one, then I am afraid you will have to subscribe to the two feeds.</p>
<p>And well, yes, this time I have to disappoint Scott.</p>
<p>How do you think about my new blog structure? Room for improvement? Drop me a line or two. <img src='http://mark.ossdl.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://mark.ossdl.de/2011/05/new-home-for-the-rss-feeds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mark.ossdl.de/2011/05/new-home-for-the-rss-feeds/</feedburner:origLink></item>
		<item>
		<title>tips for http request minimizations</title>
		<link>http://feedproxy.google.com/~r/ossdl/mark/~3/ic-rpILpvHc/</link>
		<comments>http://mark.ossdl.de/2011/02/tips-for-http-request-minimizations/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 20:14:25 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[technology related]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[know-how]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://mark.ossdl.de/?p=5372</guid>
		<description><![CDATA[Clicking on the front page of my blog resulted in about 13 http requests. Unnecessarily, has been my opinion. By some trivial steps which you can repeat, I have reduced that to three. A reduction of 77%. But, see it yourself on following waterfall charts. Here&#8217;s how I have done that and what you can [...]]]></description>
			<content:encoded><![CDATA[<p>Clicking on the front page of my blog resulted in <strong>about 13 http requests</strong>. Unnecessarily, has been my opinion. By some trivial steps which you can repeat, I have <strong>reduced that to three</strong>. A <strong>reduction of 77%</strong>. But, see it yourself on following waterfall charts. </p>
<p>Here&#8217;s how I have done that and what you can do to optimize your blog: <span id="more-5372"></span></p>
<ol>
<li>Examine what elements (pictures, css) are loaded on every page.</li>
<li>Concatenate your CSS and JS files, minimizing them, to only one each.</li>
<li>Embed pictures into CSS.</li>
<li>Embed some of the pictures directly into HTML code.</li>
</ol>
<h4 style="border-bottom: 1px dashed #ccc; margin-top: 1em;">merge all CSS and JS files into a single one</h4>
<p>The most easiest way to accomplish (2) is like that:</p>
<pre class="brush: bash">ALL_CSS="unified-$(date +%Y%m%d).css"
for FILE in your.css css.css files.css another.css; do
    cat $FILE &gt;&gt; $ALL_CSS
done
clean_and_minimize_css.sh $ALL_CSS</pre>
<p>See my <a href="http://mark.ossdl.de/wp-content/uploads/2011/02/merger.sh">merger.sh</a> script for inspiration, for which you will need the <a href="http://mark.ossdl.de/wp-content/uploads/2011/02/remove_comments.sed">remove_comments.sed</a>, too.</p>
<p>After that optimization the waterfall chart for my first page was: <br />
<div class="wp-caption aligncenter" style="width: 285px"><a href="http://mark.ossdl.de/wp-content/uploads/2011/02/request-minimization-before.png"><img alt="thumbnail - before http request minimizations" src="http://mark.ossdl.de/wp-content/uploads/2011/02/request-minimization-before_th.png" width="275" height="78" /></a><p class="wp-caption-text">before http request minimizations</p></div><br />
That is 13 requests.</p>
<h4 style="border-bottom: 1px dashed #ccc; margin-top: 1em;">embed images into CSS</h4>
<p>The third &#8220;column&#8221; of <strong>six images was due to my WordPress theme</strong>, Spotlight. Like the CSS file they are <strong>loaded once and are expected to be cached by the browser</strong>. Therefore I have embedded the images into that style sheet file by:</p>
<pre class="brush: bash">cd myblog/wp-content/themes/
for I in spotlight/images/top.gif ...; do
    sed -i -e "s#/wp-content/themes/${I}#data:$(file -b --mime-type ${I});base64,$(base64 -w0 ${I})#g" unified-20110211.css;
done</pre>
<p>Obviously <cite>unified-20110211.css</cite> is my merged CSS file. The result was <strong>six requests less at the cost of 0.5 KB more data</strong> due to the <em>base64 encoding</em>; despite <em>gzip compression</em> of the CSS afterwards, that is. But unlike snappier transfer of data, the time for requesting resources (the &#8220;request-response delay&#8221;) is not accelerated by faster Internet connections. Therefore it has been a good trade-off which resulted in that new loading graph:<br />
<div class="wp-caption aligncenter" style="width: 285px"><a href="http://mark.ossdl.de/wp-content/uploads/2011/02/request-minimization-step-1-embed-images-in-css.png"><img alt="thumbnail - before http request minimizations" src="http://mark.ossdl.de/wp-content/uploads/2011/02/request-minimization-step-1-embed-images-in-css_th.png" width="275" height="47" /></a><p class="wp-caption-text">after embedding of images into CSS</p></div></p>
<p>Most probably you will want to stop optimizing your blog here. The next steps do only pay off if you have some relatively popular and thus frequently read sites, whose readers seldom decide to read other articles.</p>
<h4 style="border-bottom: 1px dashed #ccc; margin-top: 1em;">embed CSS into HTML for the front page</h4>
<p>To minimize the amount of requests per visitor clicking on the <strong>front page (and some very popular</strong>, too) I embedded CSS into HTML of these pages by modifying <code>header.php</code> of the template:</p>
<pre class="brush: text">< ?php if (is_home() || is_front_page()) { ?>
<style type="text/css" media="screen"><!--
<?php readfile($_SERVER['DOCUMENT_ROOT'].'/wp-content/themes/unified-20110211.css'); ?>
--></style>

< ?php } else { ?>
<link rel="stylesheet" href="http://mark.ossdl.de/wp-content/themes/unified-20110211.css" type="text/css" media="screen" />
< ?php } ?></pre>
<p>(Click on &#8220;&lt;&gt;&#8221; if the code doesn&#8217;t display correctly.)<br />
One request less, 0.1 KB more data; but the page is displayed slightly, unnoticeable faster:<br />
<div class="wp-caption aligncenter" style="width: 285px"><a href="http://mark.ossdl.de/wp-content/uploads/2011/02/request-minimization-step-2-embed-css-in-html.png"><img alt="thumbnail - before http request minimizations" src="http://mark.ossdl.de/wp-content/uploads/2011/02/request-minimization-step-2-embed-css-in-html_th.png" width="275" height="41" /></a><p class="wp-caption-text">CSS file in HTML HEAD</p></div><br />
In general <strong>it is better to leave the style sheets as linked file</strong>. That way it will be cached and won&#8217;t add to the transferred data if your visitor clicks on more than one page. But again, my goal was to drive requests to a minimum for my front page.</p>
<h4 style="border-bottom: 1px dashed #ccc; margin-top: 1em;">embed images into HTML</h4>
<p>Finally I have <strong>embedded the three images</strong> which are <strong>displayed on every page</strong> into HTML. You can do that by this PHP fragment:</p>
<pre class="brush: text">function img_embed($iurl, $mime = 'image/png') {
        if (is_home() || is_front_page()) {
                echo chunk_split('data:'.$mime.';base64,'
                    .base64_encode(
                        file_get_contents($_SERVER['DOCUMENT_ROOT'].$iurl)
                ));
        } else {
                echo get_option('siteurl').$iurl;
        }
} ?>
<img src="<?php img_embed('/wp-content/themes/feed-icon32x32.png'); ?/>" /></pre>
<p>The same as above applies here: Better allow your visitor&#8217;s browser to cache the files, and don&#8217;t embed them.</p>
<p>Embedding data into CSS or HTML works with Firefox, Chrome and even Safari, but not with Internet Explorer 7 and older. For the latter I don&#8217;t care anymore and, well, version 9 is already in the wild.</p>
<h4 style="border-bottom: 1px dashed #ccc; margin-top: 1em;">result: 13 requests down to 3</h4>
<p>From 13 requests down to 3 for the front- and popular pages, and 6 requests less for any other page. Here is the before and after:</p>
<div><div class="wp-caption alignleft" style="width: 285px"><a href="http://mark.ossdl.de/wp-content/uploads/2011/02/request-minimization-before.png"><img alt="thumbnail - before http request minimizations" src="http://mark.ossdl.de/wp-content/uploads/2011/02/request-minimization-before_th.png" width="275" height="78" /></a><p class="wp-caption-text">before: 13 requests</p></div><br />
<div class="wp-caption alignleft" style="width: 285px"><a href="http://mark.ossdl.de/wp-content/uploads/2011/02/request-minimization-step-3-embed-images-in-html.png"><img alt="thumbnail - before http request minimizations" src="http://mark.ossdl.de/wp-content/uploads/2011/02/request-minimization-step-3-embed-images-in-html_th.png" width="275" height="26" /></a><p class="wp-caption-text">after: only 3 requests</p></div></div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://mark.ossdl.de/2011/02/tips-for-http-request-minimizations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mark.ossdl.de/2011/02/tips-for-http-request-minimizations/</feedburner:origLink></item>
		<item>
		<title>consolidation of servers – apologies for broken links</title>
		<link>http://feedproxy.google.com/~r/ossdl/mark/~3/TuhMOmgnh-c/</link>
		<comments>http://mark.ossdl.de/2011/02/consolidation-of-servers-apologies-for-broken-links/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 19:19:29 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Hetzner]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://mark.ossdl.de/?p=5324</guid>
		<description><![CDATA[I consolidate all my servers this week. That includes moving data around and eliminating subdomains in favour of one or two central storages. Therefore, please accept my apologies should you encounter broken links, HTTP errors 500 or unavailable sites. Feel free to write me if you need some of the expected data urgently, and I [...]]]></description>
			<content:encoded><![CDATA[<p>I consolidate all my servers this week. That includes moving data around and eliminating subdomains in favour of one or two central storages.<br />
Therefore, <strong>please accept my apologies should you encounter broken links</strong>, HTTP errors 500 <strong>or unavailable sites</strong>. Feel free to write me if you need some of the expected data urgently, and I try to move that part first.</p>
<p>By the way, the new destination is several KVM instances on a server from Hetzner&#8217;s and Amazon CloudFront.</p>
]]></content:encoded>
			<wfw:commentRss>http://mark.ossdl.de/2011/02/consolidation-of-servers-apologies-for-broken-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mark.ossdl.de/2011/02/consolidation-of-servers-apologies-for-broken-links/</feedburner:origLink></item>
		<item>
		<title>ZMQ and PyZMQ for Windows</title>
		<link>http://feedproxy.google.com/~r/ossdl/mark/~3/V8aBD15zXho/</link>
		<comments>http://mark.ossdl.de/2011/01/zmq-and-pyzmq-for-windows/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 14:14:22 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[EVE MC2]]></category>
		<category><![CDATA[binary]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[communications]]></category>
		<category><![CDATA[distributed system]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[systems architecture]]></category>
		<category><![CDATA[web application]]></category>

		<guid isPermaLink="false">http://mark.ossdl.de/?p=5309</guid>
		<description><![CDATA[Here&#8217;s the libraries and pyzmq-2.0.10 binaries for Windows (32bit) and Python 2.7: pyzmq-2.0.10.win32-py2.7.exe To install them: extract the ZIP run pyzmq-2.0.10.win32-py2.7.exe &#8211; it is a distfiles installer copy libzmq.dll into the directory where your Python.exe is (not in the DLL folder of Python, where it won&#8217;t get found) Update 2011-04-10: The ZMQ team has begun [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-5311" src="http://mark.ossdl.de/wp-content/uploads/2011/01/zmq-async-io.png" alt="" width="137" height="123" /><br />
Here&#8217;s the libraries and <cite>pyzmq-2.0.10</cite> binaries <strong>for Windows (32bit) and Python 2.7</strong>: <span id="more-5309"></span></p>
<blockquote style="margin-bottom: 2em;"><p><a href="http://mark.ossdl.de/wp-content/uploads/2011/01/pyzmq-2.0.10.win32-py2.7.exe.zip">pyzmq-2.0.10.win32-py2.7.exe</a></p></blockquote>
<p>To install them:</p>
<ol>
<li>extract the ZIP</li>
<li>run <cite>pyzmq-2.0.10.win32-py2.7.exe</cite> &#8211; it is a distfiles installer</li>
<li>copy <cite>libzmq.dll</cite> into the directory where your <em>Python.exe</em> is (not in the DLL folder of Python, where it won&#8217;t get found)</li>
</ol>
<p><strong>Update 2011-04-10:</strong> The ZMQ team has begun to publish Windows binaries themself <a href="https://github.com/zeromq/pyzmq" rel="nofollow">at their Github page</a> (there, click on &#8220;Downloads-&gt;view wall&#8221;).</p>
]]></content:encoded>
			<wfw:commentRss>http://mark.ossdl.de/2011/01/zmq-and-pyzmq-for-windows/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://mark.ossdl.de/2011/01/zmq-and-pyzmq-for-windows/</feedburner:origLink></item>
		<item>
		<title>Hetzner EQ Server + KVM and subnet</title>
		<link>http://feedproxy.google.com/~r/ossdl/mark/~3/ofqruuWaoV0/</link>
		<comments>http://mark.ossdl.de/2011/01/hetzner-eq-server-kvm-and-subnet/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 01:01:27 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[technology related]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[Hetzner]]></category>
		<category><![CDATA[know-how]]></category>
		<category><![CDATA[KVM]]></category>
		<category><![CDATA[networks]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[XEN]]></category>

		<guid isPermaLink="false">http://mark.ossdl.de/?p=5260</guid>
		<description><![CDATA[Last week I have rented an EQ series server from Hetzner&#8217;s with four IPs and an additional subnet. After having installed Gentoo on that host I have wanted to assign all these IP addresses to XEN/KVM virtual servers (henceforth called &#8220;guests&#8221;). Unfortunately most tutorials on the net suggest to dedicate one as bridge gateway address. [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I have rented an EQ series server from Hetzner&#8217;s with four IPs and an additional subnet. After having installed Gentoo on that host I have wanted to assign all these IP addresses to XEN/KVM virtual servers (henceforth called &#8220;guests&#8221;). Unfortunately <a href="http://www.samshome.net/?p=21&amp;page=3">most tutorials</a> on the net suggest to dedicate one as bridge gateway address. Yet I even want to not spare a single one, and came up with this: <span id="more-5260"></span></p>
<ul>
<li>You can set up a bridge by the means of <cite>net-misc/bridge-utils</cite> without adding an interface to it.</li>
<li>Connect your guests to that bridge.</li>
<li>On the host, enable IP forwarding and have requests to any guest IP forwarded to that bridge.</li>
<li>On the guests, set the host&#8217;s IP as gateway address.</li>
</ul>
<p>Without (4) no packets from the LAN, constituted by the bridge, can find their way to the Internet and by (3) vice versa.</p>
<p>Provided following IPs (which you should change to yours):</p>
<dl>
<dt>main and thus host&#8217;s IP</dt>
<dd>188.40.1.17</dd>
<dt>three additional IPs</dt>
<dd>188.40.1.43</dd>
<dd>188.40.1.44</dd>
<dd>188.40.1.51</dd>
<dt>additional subnet</dt>
<dd>178.40.1.40/27</dd>
</dl>
<p>You will have to do:</p>
<ol>
<li>On the host, install packages:
<pre class="brush: bash">emerge -n net-misc/bridge-utils sys-apps/iproute2</pre>
</li>
<li>On the host, edit <cite>/etc/conf.d/net</cite> so it reads:
<pre class="brush: text">modules=( "iproute2")

# IP with mask, and gateway - as assigned by Hetzner's DHCP
config_eth0=( "188.40.1.17/26")
routes_eth0=( "default via 188.40.1.1")

# Hetzner nameserver; could be your DNS resolver
dns_servers_eth0=(
        "213.133.98.98"
        "213.133.99.99"
        "213.133.100.100"
)

brctl_br0=( "setfd 0" "sethello 2" "stp off")
config_br0=("188.40.1.17/32")
depend_br0() {
        need net.eth0
}

postup() {
        if [ "${IFACE}" = "br0" ]; then
                # repeat that line for every IP but host's IP
                route add 188.40.1.43 br0
        fi
}</pre>
</li>
<li>On the host, enable IP forwarding:
<pre class="brush: bash"># add "net.ipv4.ip_forward = 1" to /etc/sysctl.conf
sysctl -w net.ipv4.ip_forward=1</pre>
<p>You will have to restrict forwarding to your own IPs by <cite>iptables</cite>. (See <a href="http://blog.sven-lauritzen.de/archives/19-Netzwerkkonfiguration-mit-kvm-bei-Hetzner.html">Sven Lauritzen&#8217;s blogpost</a> for an example.)</li>
<li>On the host, have the bridge started automatically:
<pre class="brush: bash">cd /etc/init.d
ln -s net.lo net.br0
rc-update add net.br0 default</pre>
<p>You could start <cite>br0</cite> right away if you want.</li>
<li>On every guest <cite>/etc/conf.d/net</cite> should look like:
<pre class="brush: text">modules=( "iproute2" )
config_eth0=( "188.40.1.43/32 peer 188.40.1.17")
routes_eth0=( "default via 188.40.1.17")
dns_servers_eth0=(
        "213.133.98.98"
        "213.133.99.99"
        "213.133.100.100"
)</pre>
<p>&#8230; where the first in <cite>eth0</cite> is the guest&#8217;s IP and the other as well as the in <cite>routes_eth0</cite> host&#8217;s. With the &#8220;peer&#8221; thing the host is reachable by that guest without having to be in the same subnet.</li>
</ol>
<p>By that you won&#8217;t waste a single IP address.</p>
]]></content:encoded>
			<wfw:commentRss>http://mark.ossdl.de/2011/01/hetzner-eq-server-kvm-and-subnet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mark.ossdl.de/2011/01/hetzner-eq-server-kvm-and-subnet/</feedburner:origLink></item>
	</channel>
</rss>

