<?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>ADI64 feat. n0stradamus &#187; ADI64</title>
	<atom:link href="http://adrian.holfter.de/blog/author/adi64/feed/" rel="self" type="application/rss+xml" />
	<link>http://adrian.holfter.de/blog</link>
	<description>Reiche Eltern für alle!</description>
	<lastBuildDate>Wed, 16 May 2012 09:13:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>(Deutsch) ACTA in plain Deutsch</title>
		<link>http://adrian.holfter.de/blog/en/2012/02/acta-in-plain-deutsch/</link>
		<comments>http://adrian.holfter.de/blog/en/2012/02/acta-in-plain-deutsch/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 11:01:15 +0000</pubDate>
		<dc:creator>ADI64</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[ACTA]]></category>
		<category><![CDATA[Demonstration]]></category>
		<category><![CDATA[internet]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=728</guid>
		<description><![CDATA[Sorry, this entry is only available in Deutsch.]]></description>
			<content:encoded><![CDATA[<p>Sorry, this entry is only available in <a href="http://adrian.holfter.de/blog/author/adi64/feed/">Deutsch</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/en/2012/02/acta-in-plain-deutsch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solved: Broadcom BCM4306 + ndiswrapper</title>
		<link>http://adrian.holfter.de/blog/en/2011/12/english-solved-broadcom-bcm4306-ndiswrapper/</link>
		<comments>http://adrian.holfter.de/blog/en/2011/12/english-solved-broadcom-bcm4306-ndiswrapper/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 12:46:28 +0000</pubDate>
		<dc:creator>ADI64</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Archlinux]]></category>
		<category><![CDATA[b43legacy]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ndiswrapper]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=707</guid>
		<description><![CDATA[My Arch Linux desktop system uses a Belkin F5D7000 wifi card which caused some trouble lately. So, what are we talking about when I say Belkin F5D7000? That&#8217;s what lspci -vnn tells me about it: 03:06.0 Network controller [0280]: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller [14e4:4320] (rev 02) Subsystem: Belkin F5D7000 v1000 Wireless G [...]]]></description>
			<content:encoded><![CDATA[<p>My Arch Linux desktop system uses a Belkin F5D7000 wifi card which caused some trouble lately.<br />
So, what are we talking about when I say Belkin F5D7000? That&#8217;s what<em> lspci -vnn</em> tells me about it:</p>
<blockquote><p>03:06.0 Network controller [0280]: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller [14e4:4320] (rev 02)<br />
Subsystem: Belkin F5D7000 v1000 Wireless G Desktop Card [1799:7000]</p></blockquote>
<p>Some years ago, this card was working perfectly fine with the <em>bcm43xx</em> module. However, this module became deprecated and got replaced by the <em>b43</em> and <em>b43legacy</em> modules. My card now had to use the b43legacy module and that&#8217;s where the problems started:<br />
The connection speed was very slow and the connection dropped every few minutes. Trying to download a larger file became a pain. <em>dmesg</em> was full of these messages:</p>
<blockquote><p>b43legacy-phy0 ERROR: PHY transmission error</p></blockquote>
<p>Pasting that into google showed me that I was not alone with these issues, the only fix that seemed to work was dropping the b43legacy module and using ndiswrapper with a windows driver file. It took me some while to find a 64bit Windows driver file for that specific card <em>[contact me if you can't find one]</em> because it&#8217;s quite outdated, but I finally got one.</p>
<p>So I went ahead, installed ndiswrapper and the driver for it&#8230;</p>
<blockquote><p>adi64@tux ~ % sudo ndiswrapper -l<br />
bcmwl5 : driver installed<br />
device (14E4:4320) present</p></blockquote>
<p>&#8230;but wlan0 wouldn&#8217;t show up, despite the fact that ndiswrapper found the device:</p>
<blockquote><p>adi64@tux ~ % sudo rmmod b43legacy<br />
adi64@tux ~ % sudo modprobe ndiswrapper<br />
adi64@tux ~ % iwconfig<br />
lo        no wireless extensions.</p>
<p>eth0      no wireless extensions.</p></blockquote>
<p>There were no errors or any debug info from ndiswrapper in either dmesg or /proc/net/ndiswrapper/debug.</p>
<p>After googling the hell out of keywords like <em>b43legacy</em>, <em>bcm4306</em>, <em>ndiswrapper</em> etc. I found the <a href="http://ubuntuforums.org/showthread.php?p=5561757">Comprehensive ndiswrapper troubleshooting guide</a> on the Ubuntu forums which finally helped.<br />
In a nutshell: The <em>ssb</em> module claimed the device although being unable to do anything with it, therefore <em>ndiswrapper</em> couldn&#8217;t take control of the device.</p>
<p>Knowing this, the solution is simple. You need to blacklist the <em>b43legacy</em> and <em>ssb</em> modules and tell the kernel to load the ndiswrapper module.<br />
I opened up the new file<em> /etc/modprobe.d/b43legacy_blacklist.conf </em>and pasted in the following<em>:<br />
</em></p>
<blockquote><p>blacklist b43legacy<br />
blacklist ssb</p></blockquote>
<p>Then I added <em>ndiswrapper</em> to my MODULES Array in <em>/etc/rc.conf</em>.<br />
Doing a reboot and BAM! The card was working fine. Note however that you won&#8217;t be able to do things like Monitor Mode etc. with ndiswrapper as device driver.</p>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/en/2011/12/english-solved-broadcom-bcm4306-ndiswrapper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(Deutsch) 29. Bundeswettbewerb Informatik &#8211; 2. Runde</title>
		<link>http://adrian.holfter.de/blog/en/2011/07/29-bundeswettbewerb-informatik-2-runde/</link>
		<comments>http://adrian.holfter.de/blog/en/2011/07/29-bundeswettbewerb-informatik-2-runde/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 15:19:31 +0000</pubDate>
		<dc:creator>ADI64</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[29]]></category>
		<category><![CDATA[bundeswettbewerb informatik]]></category>
		<category><![CDATA[bwinf]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=626</guid>
		<description><![CDATA[Sorry, this entry is only available in Deutsch.]]></description>
			<content:encoded><![CDATA[<p>Sorry, this entry is only available in <a href="http://adrian.holfter.de/blog/author/adi64/feed/">Deutsch</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/en/2011/07/29-bundeswettbewerb-informatik-2-runde/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Our blog goes bilingual</title>
		<link>http://adrian.holfter.de/blog/en/2011/04/unser-blog-wird-bilingual/</link>
		<comments>http://adrian.holfter.de/blog/en/2011/04/unser-blog-wird-bilingual/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 14:53:00 +0000</pubDate>
		<dc:creator>ADI64</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[bilingual]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[zu viel Zeit]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=462</guid>
		<description><![CDATA[As you may have seen, you can now change your preferred language for this blog on the right hand side. During the next time, I will have a bit more free time on my hands than before and therefore I decided to translate most articles and pages. The big articles and pages have highest priority. [...]]]></description>
			<content:encoded><![CDATA[<p>As you may have seen, you can now change your preferred language for this blog on the right hand side.</p>
<p>During the next time, I will have a bit more free time on my hands than before and therefore I decided to translate most articles and pages. The big articles and pages have highest priority.</p>
<p>Enjoy reading our blog in English!</p>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/en/2011/04/unser-blog-wird-bilingual/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Erneuter Zuwachs</title>
		<link>http://adrian.holfter.de/blog/en/2011/02/erneuter-zuwachs/</link>
		<comments>http://adrian.holfter.de/blog/en/2011/02/erneuter-zuwachs/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 15:00:30 +0000</pubDate>
		<dc:creator>ADI64</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=385</guid>
		<description><![CDATA[Markus schreibt jetzt auch hin und wieder mit Ich stell mich mal kurz vor… ich bin ein Kumpel vom Adrian, der in etwa ähnliche technische Interessen hat. Auf der einen Seite hab ich so gut wie keine Zeit dafür, aber auf der anderen programmiere ich dann doch ab- und zu etwas oder mache etwas anderes [...]]]></description>
			<content:encoded><![CDATA[<p>Markus schreibt jetzt auch hin und wieder mit <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<blockquote><p>Ich stell mich mal kurz vor… ich bin ein Kumpel vom Adrian, der in etwa  ähnliche technische Interessen hat. Auf der einen Seite hab ich so gut  wie keine Zeit dafür, aber auf der anderen programmiere ich dann doch  ab- und zu etwas oder mache etwas anderes technisches. Da ich ein  Opensource Fan bin, würde ich meine Ergebnisse der Welt gerne zur  Verfügung stellen und werde es hier in unregelmäßigen Abständen – eben  sobald es etwas nützliches gibt – auch umsetzen <img src="../wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/en/2011/02/erneuter-zuwachs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>protobuf-messages mit boost::asio übers Netzwerk senden</title>
		<link>http://adrian.holfter.de/blog/en/2011/02/protobuf-messages-mit-boostasio-ubers-netzwerk-senden/</link>
		<comments>http://adrian.holfter.de/blog/en/2011/02/protobuf-messages-mit-boostasio-ubers-netzwerk-senden/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 14:05:33 +0000</pubDate>
		<dc:creator>ADI64</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[asio]]></category>
		<category><![CDATA[boost]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[protobuf]]></category>
		<category><![CDATA[protocol buffer]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=373</guid>
		<description><![CDATA[I really like the idea behind Google&#8217;s protocol buffers, especially for cross-program-interaction. Lately I wanted to send such a protobuf-Message via network using the cross-platform library boost::asio. Because I haven&#8217;t found a really basic example for doing this yet and had to ask for instructions over at Stack Overflow, I decided to provide a small [...]]]></description>
			<content:encoded><![CDATA[<p>I really like the idea behind <a href="http://code.google.com/p/protobuf/" target="_blank">Google&#8217;s protocol buffers</a>, especially for cross-program-interaction.<br />
Lately I wanted to send such a protobuf-Message via network using the cross-platform library <a href="http://www.boost.org/doc/libs/1_45_0/doc/html/boost_asio.html" target="_blank">boost::asio</a>.<br />
Because I haven&#8217;t found a really basic example for doing this yet and had to ask for instructions over at <a title="Stack Overflow" href="http://stackoverflow.com/questions/4810026/sending-protobuf-messages-with-boostasio/4810293#4810293" target="_blank">Stack Overflow</a>, I decided to provide a small snippet which &#8211; hopefully &#8211; explains basic usage.<br />
<span id="more-373"></span></p>
<p>Let&#8217;s assume we implemented a ClientRequest-Message which sends certain requests to a server, for example a request to register a new player to the game. The corresponding part in our .proto-file would look somewhat like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;">message ClientRequest <span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">enum</span> Operation <span style="color: #008000;">&#123;</span>
		REGISTER_PLAYER <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>
		<span style="color: #008000;">&#91;</span>...<span style="color: #008000;">&#93;</span>
	<span style="color: #008000;">&#125;</span>
	optional RegisterPlayerParameters register_player_parameters <span style="color: #000080;">=</span> <span style="color: #0000dd;">3</span><span style="color: #008080;">;</span>
	<span style="color: #008000;">&#91;</span>...<span style="color: #008000;">&#93;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
message RegisterPlayerParameters <span style="color: #008000;">&#123;</span>
	required PlayerInfo player_info <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>
	<span style="color: #008000;">&#91;</span>...<span style="color: #008000;">&#93;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
message PlayerInfo <span style="color: #008000;">&#123;</span>
	required string name <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>
	<span style="color: #008000;">&#91;</span>...<span style="color: #008000;">&#93;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Then our snippet to send this to a server would look like that:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> boost<span style="color: #008080;">::</span><span style="color: #007788;">asio</span><span style="color: #008080;">;</span>
boost<span style="color: #008080;">::</span><span style="color: #007788;">asio</span><span style="color: #008080;">::</span><span style="color: #007788;">io_service</span> io_service<span style="color: #008080;">;</span>
tcp<span style="color: #008080;">::</span><span style="color: #007788;">resolver</span> resolver<span style="color: #008000;">&#40;</span>io_service<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
tcp<span style="color: #008080;">::</span><span style="color: #007788;">resolver</span><span style="color: #008080;">::</span><span style="color: #007788;">query</span> query<span style="color: #008000;">&#40;</span>tcp<span style="color: #008080;">::</span><span style="color: #007788;">v4</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>, “127.0.0.1<span style="color: #008080;">?</span>, <span style="color: #0000dd;">12345</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// host and port</span>
tcp<span style="color: #008080;">::</span><span style="color: #007788;">resolver</span><span style="color: #008080;">::</span><span style="color: #007788;">iterator</span> iterator <span style="color: #000080;">=</span> resolver.<span style="color: #007788;">resolve</span><span style="color: #008000;">&#40;</span>query<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
sock <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> tcp<span style="color: #008080;">::</span><span style="color: #007788;">socket</span><span style="color: #008000;">&#40;</span>io_service<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
sock<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>connect<span style="color: #008000;">&#40;</span><span style="color: #000040;">*</span>iterator<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #666666;">// Protobuf-Messages</span>
ClientRequest req<span style="color: #008080;">;</span> <span style="color: #666666;">// the only one being initialized</span>
RegisterPlayerParameters<span style="color: #000040;">*</span> rpp<span style="color: #008080;">;</span> <span style="color: #666666;">// pointer, will be assigned later throuh req</span>
PlayerInfo<span style="color: #000040;">*</span> info<span style="color: #008080;">;</span> <span style="color: #666666;">// pointer, will be assigned later through rpp</span>
&nbsp;
req.<span style="color: #007788;">set_operation</span><span style="color: #008000;">&#40;</span>ClientRequest<span style="color: #008080;">::</span><span style="color: #007788;">REGISTER_PLAYER</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// set parameter</span>
&nbsp;
<span style="color: #666666;">// we want a pointer to the RegisterPlayerParameters-Object !inside! the ClientRequest-Object</span>
rpp <span style="color: #000080;">=</span> req.<span style="color: #007788;">mutable_register_player_parameters</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #666666;">// we want a pointer to the PlayerInfo-Object !inside! the RegisterPlayerParameters-Object</span>
info <span style="color: #000080;">=</span> rpp<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>mutable_player_info<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// mutable, damit wir es ändern können</span>
&nbsp;
<span style="color: #666666;">// Now we can set values</span>
info<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>set_name<span style="color: #008000;">&#40;</span>name<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
boost<span style="color: #008080;">::</span><span style="color: #007788;">asio</span><span style="color: #008080;">::</span><span style="color: #007788;">streambuf</span> b<span style="color: #008080;">;</span>
std<span style="color: #008080;">::</span><span style="color: #007788;">ostream</span> os<span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>b<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #666666;">// Protobuf wants to serialize to a stream (which in turn packs everything into an asio streambuffer which we can send easily)</span>
&nbsp;
<span style="color: #666666;">// get a packed version of the req object (remember, this will go to the asio streambuf b!)</span>
req.<span style="color: #007788;">SerializeToOstream</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>os<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #666666;">// Send the content of the streambuffer to our open socket</span>
boost<span style="color: #008080;">::</span><span style="color: #007788;">asio</span><span style="color: #008080;">::</span><span style="color: #007788;">write</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">*</span>sock, b<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/en/2011/02/protobuf-messages-mit-boostasio-ubers-netzwerk-senden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seagate Dockstar: USB-Stick schrotten vermeiden</title>
		<link>http://adrian.holfter.de/blog/en/2010/10/seagate-dockstar-usb-stick-schrotten-vermeiden/</link>
		<comments>http://adrian.holfter.de/blog/en/2010/10/seagate-dockstar-usb-stick-schrotten-vermeiden/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 17:21:29 +0000</pubDate>
		<dc:creator>ADI64</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Archlinux]]></category>
		<category><![CDATA[do it yourself]]></category>
		<category><![CDATA[Dockstar]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=340</guid>
		<description><![CDATA[Ich hatte ebenfalls eine Plugbox (Archlinux für ARM-Prozessoren) -Installation auf einer Seagate Dockstar, wie im Artikel von n0stradamus hier auch gut beschrieben ist, am Laufen. Für 20€ so ein Powerhouse ist einfach saugeil Mein System lief auf einem 1GB USB-Stick und lief eigentlich ziemlich super. Lief. Ja. Das ist der Knackpunkt: Mein USB-Stick ist ziemlich [...]]]></description>
			<content:encoded><![CDATA[<p>Ich hatte ebenfalls eine Plugbox (Archlinux für ARM-Prozessoren) -Installation auf einer Seagate Dockstar, wie im <a href="http://adrian.holfter.de/blog/2010/09/archlinux-auf-der-seagate-dockstar/">Artikel von n0stradamus hier</a> auch gut beschrieben ist, am Laufen. Für 20€ so ein Powerhouse ist einfach saugeil <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Mein System lief auf einem 1GB USB-Stick und lief eigentlich ziemlich super. Lief. Ja. Das ist der Knackpunkt: Mein USB-Stick ist ziemlich tot.</p>
<p><span id="more-340"></span>Das äußert sich darin, dass plötzlich irgendwelche Befehle nicht mehr tun, ich kryptische Errors um den Kopf geworfen bekomme und das System nicht mehr bootet, weil das ext2-fs so stark beschädigt ist, dass es nicht durch den routinemäßigen Check beim boot repariert werden kann, sondern manuell per e2fsck gefixt werden muss (von einem anderen pc aus).</p>
<p>Die Ursache dafür liegt darin, dass die in USB-Sticks und SD-Karten verbauten Flash-Chips zwar praktisch unendlich viele Lesevorgänge, aber nur ca. 10.000 &#8211; 100.000 Schreibzyklen pro Sektor verkraften. Das ist normalerweise absolut kein Problem, wenn man einfach nur &#8220;Daten&#8221; auf diesen Sticks zwischenspeichert. Außerdem versuchen die Hersteller meist, die Schreibvorgänge auf mehrere Sektoren zu verteilen, um ein Überschreiben von immergleichen Sektoren zu vermeiden. Letzteres kann aber natürlich nicht funktionieren, wenn der Stick quasi voll ist.</p>
<p>Wenn man aber ein Betriebssystem auf dem Stick betreibt, können diese Zyklen relativ schnell erreicht sein, vor allem durch Logfiles, Lockfiles und temporäre Daten. Auf diese Weise hat sich wie eingangs schon erwähnt mein (zugegeben ziemlich billiger und schon länger gebrauchter) USB-Stick verabschiedet.</p>
<p>Da viele Teile dermaßen beschädigt waren, dass das Reparieren verdammt aufwändig geworden wäre, habe ich das System von Neuem hochgezogen. Dabei habe ich mir die Frage gestellt: Wie kann ich vermeiden, dass das System wieder meinen Stick screwed? Als erstes kam mir die Idee, einfach das rootfs read-only zu mounten. Das hat aber zur Folge, sämtliche Schreiboperationen im RAM zu cachen. Da die Dockstar nur 128MB RAM hat, schied diese Möglichkeit aus. Als zweites kam mir die Idee, die ich jetzt auch umgesetzt habe:</p>
<h2>Flüchtige Daten in einer Ramdisk halten</h2>
<p>Das heißt, ich mounte mir einen Teil des spärlich vorhandenen RAMs als Datenträger und mappe ihn als Ersatz für die Verzeichnisse</p>
<ul>
<li>/var/log (Logfiles)</li>
<li>/var/lock (Sperr-Files)</li>
<li>/var/run (Daemon-PIDs)</li>
<li>/var/tmp (Temporäre Dateien)</li>
<li>/tmp (Temporäre Dateien).</li>
</ul>
<p>Dadurch fange ich fast alle Schreibzugriffe ab, welche im Dauerbetrieb eben anfallen. Änderungen an Configfiles etc. werden aber immernoch sofort auf den Stick geschrieben. Falls das System sich aufhängt, abstürzt oder ähnliche Scherze passieren, ist der &#8220;zusätzliche&#8221; Datenverlust also gering (nur die neueren Logfiles). Trotzdem: <strong>Hier werden einige Dateien nur im RAM vorgehalten. Wenn das System crasht oder die Daten vorm Ausschalten nicht von der Ramdisk auf den Stick gesichert werden, sind sie weg!</strong></p>
<p>Bevor ich mit der Anleitung beginne, sei hier die Seite<em> <a href="http://famvdploeg.com/blog/2008/03/putting-var-in-ram/" target="_blank">cat brain.stuff &gt; wordpress</a> </em>als Quelle genannt, da fast alle Informationen von dort stammen. Ich habe es lediglich zu Arch Linux / Plugbox Linux &#8220;geportet&#8221; und an meine Bedürfnisse angepasst.</p>
<h3>Anlegen der Verzeichnisse</h3>
<blockquote><p>mkdir /var/log-bak</p>
<p>mkdir /var/lock-bak</p>
<p>mkdir /var/run-bak</p>
<p>mkdir /var/tmp-bak</p>
<p>mkdir /tmp-bak</p>
<p>mkdir /run-bak</p>
<p>mkdir /mnt/ramdisk</p></blockquote>
<h3>Den Daemon anlegen</h3>
<p>Die Datei <em>/etc/rc.d/ramdisk</em> erstellen und folgendes hineinpasten:</p>
<blockquote><p>#!/bin/bash</p>
<p>. /etc/rc.conf<br />
. /etc/rc.d/functions</p>
<p>case &#8220;$1&#8243; in<br />
start)<br />
stat_busy &#8220;Copying files to ramdisk&#8221;</p>
<p>rm -Rf {/var/log-bak,/var/lock-bak,/var/run-bak,/var/tmp-bak,/tmp-bak,/run-bak}</p>
<p>mount &#8211;move /var/log /var/log-bak<br />
mount &#8211;move /var/lock /var/lock-bak<br />
mount &#8211;move /var/run /var/run-bak<br />
mount &#8211;move /var/tmp /var/tmp-bak<br />
mount &#8211;move /tmp /tmp-bak<br />
mount &#8211;move /run /run-bak</p>
<p>mkdir /mnt/ramdisk/var<br />
mkdir /mnt/ramdisk/var/log<br />
mkdir /mnt/ramdisk/var/lock<br />
mkdir /mnt/ramdisk/var/run<br />
mkdir /mnt/ramdisk/var/tmp<br />
mkdir /mnt/ramdisk/tmp<br />
mkdir /mnt/ramdisk/run<br />
mkdir /mnt/ramdisk/run/lock<br />
chmod 1777 /mnt/ramdisk/tmp<br />
chmod 1777 /mnt/ramdisk/var/lock<br />
chmod 1777 /mnt/ramdisk/var/tmp<br />
chmod 1777 /mnt/ramdisk/run</p>
<p>mount &#8211;bind /mnt/ramdisk/var/log /var/log<br />
mount &#8211;bind /mnt/ramdisk/var/lock /var/lock<br />
mount &#8211;bind /mnt/ramdisk/var/run /var/run<br />
mount &#8211;bind /mnt/ramdisk/var/tmp /var/tmp<br />
mount &#8211;bind /mnt/ramdisk/tmp /tmp<br />
mount &#8211;bind /mnt/ramdisk/run /run</p>
<p>cp -a -v /var/log-bak/* /var/log/ &gt;&gt; /var/log/ramdisk_sync.log<br />
cp -a -v /var/lock-bak/* /var/lock/ &gt;&gt; /var/log/ramdisk_sync.log<br />
cp -a -v /var/run-bak/* /var/run/ &gt;&gt; /var/log/ramdisk_sync.log<br />
cp -a -v /var/tmp-bak/* /var/tmp/ &gt;&gt; /var/log/ramdisk_sync.log<br />
cp -a -v /tmp-bak/* /tmp/ &gt;&gt; /var/log/ramdisk_sync.log<br />
cp -a -v /run-bak/* /run/ &gt;&gt; /var/log/ramdisk_sync.log</p>
<p>echo [`date +"%Y-%m-%d %H:%M"`] Ramdisk synced from HD &gt;&gt; /var/log/ramdisk_sync.log<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
add_daemon ramdisk<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy &#8220;Switching off ramdisk, direct hdd write&#8221;<br />
rsync -av &#8211;delete /var/log/ /var/log-bak/<br />
rsync -av &#8211;delete /var/lock/ /var/lock-bak/<br />
rsync -av &#8211;delete /var/run/ /var/run-bak/<br />
rsync -av &#8211;delete /var/tmp/ /var/tmp-bak/<br />
rsync -av &#8211;delete /tmp/ /tmp-bak/<br />
rsync -av &#8211;delete /run/ /run-bak/</p>
<p># Unmount ramdisk bind<br />
umount /mnt/ramdisk/var/log<br />
umount /mnt/ramdisk/var/lock<br />
umount /mnt/ramdisk/var/run<br />
umount /mnt/ramdisk/var/tmp<br />
umount /mnt/ramdisk/tmp<br />
umount /mnt/ramdisk/run</p>
<p># Unmount move<br />
umount /var/log-bak<br />
umount /var/lock-bak<br />
umount /var/run-bak<br />
umount /var/tmp-bak<br />
umount /tmp-bak<br />
umount /run-bak</p>
<p># Deleting directories<br />
rm -Rf /mnt/ramdisk/*</p>
<p>echo [`date +"%Y-%m-%d %H:%M"`] Ramdisk synced to HD &gt;&gt; /var/log/ramdisk_sync.log<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon ramdisk<br />
stat_done<br />
fi<br />
;;<br />
sync)<br />
echo &#8220;Syncing log and lock files to harddisk&#8221;<br />
rsync -av &#8211;delete /var/log/ /var/log-bak/<br />
rsync -av &#8211;delete /var/lock/ /var/lock-bak/<br />
rsync -av &#8211;delete /var/run/ /var/run-bak/<br />
rsync -av &#8211;delete /var/tmp/ /var/tmp-bak/<br />
rsync -av &#8211;delete /tmp/ /tmp-bak/<br />
rsync -av &#8211;delete /run/ /run-bak/</p>
<p>echo [`date +"%Y-%m-%d %H:%M"`] Ramdisk synced to HD &gt;&gt; /var/log/ramdisk_sync.log<br />
;;</p>
<p>restart)<br />
$0 stop<br />
$0 start<br />
;;</p>
<p>*)<br />
echo &#8220;usage: $0 {start|stop|sync}&#8221;<br />
esac<br />
exit 0</p></blockquote>
<h3>Die /etc/fstab anpassen</h3>
<p>Dort eine Zeile hinzufügen à la</p>
<blockquote><p>tmpfs                   /mnt/ramdisk    tmpfs   size=64m        0       0</p></blockquote>
<p>Ich benutze hier bewusst tmpfs und nicht ramfs, da tmpfs bei akutem Ram-Mangel auf swap ausweicht, ramfs dies aber nicht tut. Weiterhin limitiere ich die Größe für die Ramdisk auf 64MB. Die Ramdisk wächst aber dynamisch, belegt also nur Platz, welchen sie auch braucht. Die 64MB sind nur ein grob geschätzter Maximalwert.</p>
<h3>/etc/rc.conf anpassen</h3>
<p>Hier sollte der Daemon als erster gestartet werden, damit so wenige Applikationen wie möglich den (sehr) kurzen Ausfall der oben genannten Verzeichnisse verkraften müssen. Euer DAEMONS-Array könnte also so aussehen:</p>
<blockquote><p>DAEMONS=(<strong>ramdisk </strong>syslog-ng network openntpd netfs crond sshd)</p></blockquote>
<h3>Logrotate anpassen</h3>
<p>Ein Punkt, der sich erst nach einiger Benutzung als wichtig herausgestellt hat: Die Logfiles können sehr groß werden und damit den RAM füllen. Um das zu verhindern, sollten die Logs in kurzen Zeitabständen rotiert werden.</p>
<p>Dazu passen wir die /etc/logrotate.conf an. Meine sieht so aus:</p>
<blockquote><p>daily</p>
<p>rotate 3</p>
<p>size 16M</p>
<p>create</p>
<p>compress</p>
<p>tabooext + .pacorig .pacnew .pacsave</p>
<p>include /etc/logrotate.d</p>
<p>/var/log/wtmp {</p>
<p>weekly</p>
<p>create 0664 root root</p>
<p>rotate 1</p>
<p>}</p></blockquote>
<h3>Abschließende Worte</h3>
<p>Soweit, so gut. Beim nächsten Neustart sollte euer System also nun den größten Teil der Schreiboperationen im RAM vorhalten. Ganz eilige können auch einfach den Daemon starten, es sollte auch so funktionieren. Was passiert, wenn ein Prozess genau dann der Meinung ist, ein Logfile schreiben zu müssen, wenn der Daemon gerade Verzeichnisse herumschiebt, kann ich absolut nicht vorhersagen.</p>
<p>Wenn ihr Verbesserungsvorschläge, Tipps, Kritik oder sonstigen Senf zum Zugeben habt, immer her damit.</p>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/en/2010/10/seagate-dockstar-usb-stick-schrotten-vermeiden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++ Dynamische Arrays mit mehreren (2, 3, &#8230;) Dimensionen</title>
		<link>http://adrian.holfter.de/blog/en/2010/09/c-dynamische-arrays-mit-mehreren-2-3-dimensionen/</link>
		<comments>http://adrian.holfter.de/blog/en/2010/09/c-dynamische-arrays-mit-mehreren-2-3-dimensionen/#comments</comments>
		<pubDate>Sun, 12 Sep 2010 19:32:33 +0000</pubDate>
		<dc:creator>ADI64</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=327</guid>
		<description><![CDATA[&#8230; genau sowas suchte ich gerade über eine Stunde lang. Hätte ich einmal C++ RICHTIG gelernt und nicht alles zusammenklamüsert, wüsste ich sowas wahrscheinlich. Aber da der Grundkurs, den ich besucht habe, etwas arg verpeilt war und außer dem Klassenmodell und iostream kein C++ verwendete, sondern z.B. Speicher grundsätzlich mit &#8220;malloc&#8221; reservierte, war so etwas [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230; genau sowas suchte ich gerade über eine Stunde lang.</p>
<p>Hätte ich einmal C++ RICHTIG gelernt und nicht alles zusammenklamüsert, wüsste ich sowas wahrscheinlich. Aber da der Grundkurs, den ich besucht habe, etwas arg verpeilt war und außer dem Klassenmodell und iostream kein <em>C++</em> verwendete, sondern z.B. Speicher grundsätzlich mit &#8220;malloc&#8221; reservierte, war so etwas eben nicht drin.</p>
<p>Übrigens empfehlen die im &#8220;offiziellen&#8221; C++ Forum genau das, was ich auch im Hinterkopf hatte:<strong> geschachtelte Vektoren</strong>. Das wollte ich anfangs auch machen, dachte mir aber, dass es da doch was gescheites für geben müsste&#8230; mhja. <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Das hier ist also mehr so für google, damit das andere auch finden ;D</p>
<div id="bar"><strong>C++ : Forums : Articles : Multi-Dimensional Arrays</strong></div>
<p><a href="http://www.cplusplus.com/forum/articles/7459/"><strong>http://www.cplusplus.com/forum/articles/7459/</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/en/2010/09/c-dynamische-arrays-mit-mehreren-2-3-dimensionen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Praktikum beim EMBL =]</title>
		<link>http://adrian.holfter.de/blog/en/2010/09/praktikum-beim-embl/</link>
		<comments>http://adrian.holfter.de/blog/en/2010/09/praktikum-beim-embl/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 20:36:55 +0000</pubDate>
		<dc:creator>ADI64</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Biologie]]></category>
		<category><![CDATA[Dokumentation]]></category>
		<category><![CDATA[EMBL]]></category>
		<category><![CDATA[Informatik]]></category>
		<category><![CDATA[Praktikum]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=307</guid>
		<description><![CDATA[In meinen letzten 2 Wochen der Sommerferien mache ich ein Praktikum beim EMBL. Die erste Woche davon war letzte Woche, die nächste Woche wird die zweite werden. Ich arbeite in der GeneCore-Abteilung und vergleiche verschiedene (kommerzielle und open-source / freie) Programme zur Analyse von riesigen Mengen (we&#8217;re talking ~1 TB per run) von RNA-Seq-Daten mit [...]]]></description>
			<content:encoded><![CDATA[<p>In meinen letzten 2 Wochen der Sommerferien mache ich ein Praktikum beim <a title="Wikipedia: EMBL" href="http://de.wikipedia.org/wiki/EMBL" target="_blank">EMBL</a>. Die erste Woche davon war letzte Woche, die nächste Woche wird die zweite werden.</p>
<p>Ich arbeite in der GeneCore-Abteilung und vergleiche verschiedene (kommerzielle und open-source / freie) Programme zur Analyse von riesigen Mengen (we&#8217;re talking ~1 TB per run) von <a title="Wikipedia: RNA-Seq" href="http://en.wikipedia.org/wiki/RNA-Seq" target="_blank">RNA-Seq-Daten</a> mit dem Ziel, am Ende eine &#8220;beste Lösung&#8221; für jedes Anwendungsgebiet zu haben.</p>
<p>Dabei habe ich gemerkt, wie verdammt wichtig eine gute Dokumentation ist. Das Forschungsfeld um RNA-Seq ist noch sehr jung und daher steckt auch die Software noch in den Kinderschuhen. Es ist aber teilweise wirklich unglaublich, wie schlecht Teile der Software dokumentiert sind und wie viel Zeit nur dafür draufgeht, Parameter und mögliche Interferenzen zu &#8220;erraten&#8221;&#8230;</p>
<p>Für mich als Schüler ist die Schnellebigkeit dieses Forschungsfeldes einfach der pure Wahnsinn. Papers zu neuen Erkenntnissen schießen wie Pilze aus dem Boden und referenzieren andere Schriften, die teilweise erst vor unter einem Monat veröffentlicht wurden. Zum Vergleich: In der Schule haben wir in manchen Fächern über 20 Jahre alte Bücher&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/en/2010/09/praktikum-beim-embl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Burnout Paradise vs. Pendulum &#8211; Blood Sugar</title>
		<link>http://adrian.holfter.de/blog/en/2010/08/burnout-paradise-vs-pendulum-blood-sugar/</link>
		<comments>http://adrian.holfter.de/blog/en/2010/08/burnout-paradise-vs-pendulum-blood-sugar/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 14:50:00 +0000</pubDate>
		<dc:creator>ADI64</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[burnout paradise]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://adrian.holfter.de/blog/?p=298</guid>
		<description><![CDATA[Ein deutliches Zeichen von zu viel Zeit meinerseits. Best served in 720p Ja, wer bei YouTube geschaut hat, hat vielleicht gemerkt, dass das Video nicht August, sondern Mai entstanden ist. Ich wollte das eigentlich schon länger hier auf dem Blog posten, habs aber irgendwie verpennt&#8230;]]></description>
			<content:encoded><![CDATA[<p>Ein deutliches Zeichen von zu viel Zeit meinerseits. <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Best served in 720p <img src='http://adrian.holfter.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/vTtE4gc6mkQ?fs=1&amp;hl=de_DE&amp;rel=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/vTtE4gc6mkQ?fs=1&amp;hl=de_DE&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p style="font-size: 82%;">Ja, wer bei YouTube geschaut hat, hat vielleicht gemerkt, dass das Video nicht August, sondern Mai entstanden ist. Ich wollte das eigentlich schon länger hier auf dem Blog posten, habs aber irgendwie verpennt&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://adrian.holfter.de/blog/en/2010/08/burnout-paradise-vs-pendulum-blood-sugar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

