<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Invalidmagic&#039;s Blog</title>
	<atom:link href="http://invalidmagic.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://invalidmagic.wordpress.com</link>
	<description>technical quirks &#38; misc</description>
	<lastBuildDate>Wed, 21 Dec 2011 16:14:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='invalidmagic.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/4974f4b907ca56e591e80323c809251b?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Invalidmagic&#039;s Blog</title>
		<link>http://invalidmagic.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://invalidmagic.wordpress.com/osd.xml" title="Invalidmagic&#039;s Blog" />
	<atom:link rel='hub' href='http://invalidmagic.wordpress.com/?pushpress=hub'/>
		<item>
		<title>n900 findings</title>
		<link>http://invalidmagic.wordpress.com/2011/12/11/n900-findings/</link>
		<comments>http://invalidmagic.wordpress.com/2011/12/11/n900-findings/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 17:33:40 +0000</pubDate>
		<dc:creator>invalidmagic</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[qt]]></category>
		<category><![CDATA[package manager]]></category>
		<category><![CDATA[n900]]></category>

		<guid isPermaLink="false">http://invalidmagic.wordpress.com/?p=1036</guid>
		<description><![CDATA[repairing the n900 camera i own a nokia n900 and i&#8217;m very happy with it. some time ago it fell of my pocket and then the 5mega pixel camera didn&#8217;t work anymore as well as the flashlight. i&#8217;m a big fan of QR codes and i was often using the flashlight so this was a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=1036&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1><a href="http://invalidmagic.files.wordpress.com/2011/12/315px-nokia_n900-1.jpg"><img class="alignright size-thumbnail wp-image-1042" title="N900" src="http://invalidmagic.files.wordpress.com/2011/12/315px-nokia_n900-1.jpg?w=150&#038;h=114" alt="315px-Nokia_N900-1" width="150" height="114" /></a>repairing the n900 camera</h1>
<p>i own a nokia n900 and i&#8217;m very happy with it. some time ago it <strong>fell of my pocket</strong> and then the <strong>5mega pixel camera didn&#8217;t work anymore as well as the flashlight</strong>. i&#8217;m a big fan of QR codes and i was often using the flashlight so this was a problem.</p>
<p>the funny thing is that reflashing the device [2] made it work again. now i wonder why the camera is working again. the camera module is plugged to the n900 as can be seen in the videos on youtube, just search for it [3]. maybe while hitting the ground the camera was disconnected from the device while the device was running and that screwed the firmware? i don&#8217;t have a clue but i think it is worth mentioning.</p>
<h2>0. symptoms</h2>
<p>once the camera was not working i had problems:</p>
<ul>
<li>starting the n900 (coldstart) if still connected to any charger, it simply would not boot</li>
<li>starting the camera application; it would report something like: camera device not ready or something similar and instantly close the widget</li>
<li>flashlight did not work anymore</li>
</ul>
<h2>1. the backup</h2>
<h3>1.1 create a backup using the backup tool coming with the n900</h3>
<p>this is a really great tool, don&#8217;t forget to check all the 4 points in the list &#8216;what to backup&#8217;.</p>
<p>also consider to read [4] (i didn&#8217;t do that but on this page there are some screenshots of the backup util i&#8217;m referring to).</p>
<h3>1.2 dpkg and a list of all files in &#8216;opt&#8217;</h3>
<p>maybe that is of use later so i note down all files and installed packages:</p>
<blockquote><p>ls -la opt &gt; opt_fils</p>
<p>dpkg -l &gt; dpkg_l</p></blockquote>
<h3>1.3 now make a backup of all files</h3>
<p>as i also develop for the n900 i had already a working ssh root login:</p>
<blockquote><p>rsync -av &#8211;progress &#8211;delete n900:/home/user .</p></blockquote>
<h2>2. eMMC/VANILLA</h2>
<p>RX-51_2009SE_10.2010.13-2.VANILLA_PR_EMMC_MR0_ARM.bin</p>
<blockquote><p>./flasher-3.5 -F ../RX-51_2009SE_10.2010.13-2.VANILLA_PR_EMMC_MR0_ARM.bin -f</p></blockquote>
<h2>3. FIASCO/Rootfs</h2>
<p>RX-51_2009SE_20.2010.36-2_PR_COMBINED_MR0_ARM.bin</p>
<blockquote><p>./flasher-3.5 -F ../RX-51_2009SE_20.2010.36-2_PR_COMBINED_MR0_ARM.bin -f -R</p></blockquote>
<h2>4. restoring the backup</h2>
<p>once the device was booted after the udpate the camera was working. what a relief! but i didn&#8217;t know where to copy the backup as the folder using the &#8216;mass storage usb&#8217; feature was nearly empty. so i created a new one and connected it again using usb later. after the backup directory was migrated to the device i disconnected the usb cable and restored my 50mb backup. took quite some time and after the final reboot the device also installs the software which was removed in step 2 and 3. i decided to skip this and to install only needed software manually.</p>
<p><strong>note: after the backup is restored and the n900 restarted the wlan starts working again.</strong></p>
<h2>5. restoring the applications</h2>
<p>a list of software i installed:</p>
<ul>
<li>gainroot</li>
<li>openssh client and server</li>
</ul>
<div>one these applications are installed plug in the usb adapter and set the device into &#8216;pc suite mode&#8217; and use gainroot to type:</div>
<blockquote>
<div>ifconfig usb0 10.0.0.1/24 up</div>
</blockquote>
<div>on the host computer type:</div>
<blockquote>
<div>ip a add 10.0.0.2/24 dev usb0</div>
<div>ip l set usb0 up</div>
<div>ssh root@10.0.0.1</div>
</blockquote>
<div>to find applications use the app catalog on the n900 but to find the associated package i did:</div>
<blockquote>
<div>apt-cache search adblock | grep plus</div>
<div>(and similar commands)</div>
</blockquote>
<div>all other applications can be installed using apt-get via usb or wlan:</div>
<ul>
<li>rsync</li>
<li>adblock plus</li>
<li>adflashblock-css</li>
<li>agenda timer</li>
<li>battery-eye</li>
<li>countdown timer</li>
<li>datetoday home desktop widget</li>
<li>evopedia</li>
<li>flashlight</li>
<li>convert</li>
<li>gpsjinni</li>
<li>headphone daemon</li>
<li>healthcheck</li>
<li>htop</li>
<li>iptraf</li>
<li>irssi</li>
<li>mad-developer</li>
<li>mappero</li>
<li>mbarcode</li>
<li>mbarcode qr code plugin</li>
<li>mbarcode webrequest plugin</li>
<li>mbarcode wifi plugin</li>
<li>mclock</li>
<li>mstardict</li>
<li>nmap</li>
<li>ogg support</li>
<li>orrery</li>
<li>password safe</li>
<li>personal ip address</li>
<li>quicknote</li>
<li>recaller</li>
<li>tuner</li>
<li>view contact info with bigger font</li>
<li>wifieye</li>
<li>wifi switcher</li>
<li>foreca weather applet</li>
</ul>
<div>using the ssh shell one can type this on the device as root:</div>
<div>
<blockquote><p>apt-get install adblock-plus-1.0<br />
apt-get install adflashblock-css agenda rsync<br />
apt-get install battery-eye wifi-switcher countdowntimer datetoday-home-widget evopedia flashlight-applet<br />
apt-get install gpsjinni headphoned healthcheck htop network-monitor irssi mad-developer<br />
apt-get install maemo-mapper mbarcode-plugin-qrcode mbarcode-plugin-wifi mbarcode-plugin-webrequest mbarcode mbarcode-core<br />
apt-get install mclock mstardict nmap ogg-support decoders-support orrery pwsafe<br />
apt-get install personal-ip-address quicknote recaller tuner contact-zoom wifieye foreca-weather-applet</p></blockquote>
</div>
<div>other software i newly installed</div>
<div>
<ul>
<li>monav</li>
<li>snuggle</li>
<li>wallet</li>
<li>mdbus2</li>
</ul>
<div>again &#8211; using the ssh shell one can type this on the device as root:</div>
</div>
<blockquote><p>apt-get install monav-routing-daemon snuggle qtwallet mdbus2</p></blockquote>
<h2>6. remove the photo click sound and the intro animation</h2>
<p>ssh into the n900 and type:</p>
<blockquote><p>rm ./opt/usr/share/hildon-welcome/media/Hands-v32-h264.avi ./home/opt/usr/share/hildon-welcome/media/Hands-v32-h264.avi</p>
<p>rm /usr/share/sounds/camera_snd_title_*wav</p>
<p>reboot</p></blockquote>
<h1>random notes</h1>
<ul>
<li>after the reinstallation everything is much faster now. the settings dialog loads twice as fast and the desktop feels much smoother.</li>
<li>application load times are similar to before</li>
<li>for some programs i had to copy files from my backup to the device manually:</li>
<ul>
<li>my documents</li>
<li>evopedia dumps</li>
<li>monav map data</li>
<li>my camera pictures</li>
<li>osm2go</li>
<li>mstardict</li>
<li>music</li>
<li>quicknote</li>
</ul>
<li>monav is probably one of the coolest programs for the n900,<strong> thanks very much to Christian Vetter and Christoph Eckert</strong></li>
</ul>
<h1>links</h1>
<p>[1] <a href="http://maemo.cloud-7.de/Gallery-N900-exploded/">http://maemo.cloud-7.de/Gallery-N900-exploded/</a></p>
<p>[2] <a href="https://wiki.maemo.org/Updating_the_tablet_firmware#Updating_.26_Flashing_your_device">https://wiki.maemo.org/Updating_the_tablet_firmware#Updating_.26_Flashing_your_device</a></p>
<p>[3] <a href="http://www.google.de/search?q=Nokia+N900+Disassemble&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:de:official&amp;client=firefox-a">http://www.google.de/search?q=Nokia+N900+Disassemble&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:de:official&amp;client=firefox-a</a></p>
<p>[4] <a href="http://prokonsul.blogspot.com/2011/01/make-backup-and-restore-from-it-on-n900.html">http://prokonsul.blogspot.com/2011/01/make-backup-and-restore-from-it-on-n900.html</a></p>
<p>[5] <a href="http://natisbad.org/N900/n900-commented-hardware-specs.html">http://natisbad.org/N900/n900-commented-hardware-specs.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/invalidmagic.wordpress.com/1036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/invalidmagic.wordpress.com/1036/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/invalidmagic.wordpress.com/1036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/invalidmagic.wordpress.com/1036/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/invalidmagic.wordpress.com/1036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/invalidmagic.wordpress.com/1036/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/invalidmagic.wordpress.com/1036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/invalidmagic.wordpress.com/1036/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/invalidmagic.wordpress.com/1036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/invalidmagic.wordpress.com/1036/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/invalidmagic.wordpress.com/1036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/invalidmagic.wordpress.com/1036/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/invalidmagic.wordpress.com/1036/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/invalidmagic.wordpress.com/1036/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=1036&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://invalidmagic.wordpress.com/2011/12/11/n900-findings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/41bd958b820be8240c15687f848c6056?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">invalidmagic</media:title>
		</media:content>

		<media:content url="http://invalidmagic.files.wordpress.com/2011/12/315px-nokia_n900-1.jpg?w=150" medium="image">
			<media:title type="html">N900</media:title>
		</media:content>
	</item>
		<item>
		<title>kdevelop on nixos</title>
		<link>http://invalidmagic.wordpress.com/2011/10/17/kdevelop-on-nixos/</link>
		<comments>http://invalidmagic.wordpress.com/2011/10/17/kdevelop-on-nixos/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 22:18:02 +0000</pubDate>
		<dc:creator>invalidmagic</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[package manager]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://invalidmagic.wordpress.com/?p=1027</guid>
		<description><![CDATA[kdevelop on nixos issue 1 i&#8217;ve adapted to a nixos only desktop and i&#8217;m facing new problems every day, lately i wanted to use kdevelop but it wasn&#8217;t able to import a normal &#8216;Makefile&#8217;based project. next i installed lots of packages somehow mentioned at [1]. still that alone didn&#8217;t help so i ran: kbuildsycoca4 kbuildsycoca4 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=1027&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1><a href="http://invalidmagic.files.wordpress.com/2010/12/nixos-lores.png"><img class="alignright size-full wp-image-704" title="nixos-lores" src="http://invalidmagic.files.wordpress.com/2010/12/nixos-lores.png?w=500" alt=""   /></a>kdevelop on nixos</h1>
<h2>issue 1</h2>
<p>i&#8217;ve adapted to a nixos only desktop and i&#8217;m facing new problems every day, lately i wanted to use kdevelop but it wasn&#8217;t able to import a normal &#8216;Makefile&#8217;based project. next i installed lots of packages somehow mentioned at [1]. still that alone didn&#8217;t help so i ran:</p>
<blockquote><p>kbuildsycoca4</p></blockquote>
<p>kbuildsycoca4 is a utility which generates a cache of .desktop files and such to be used by programs. PovAddict#kde-devel@irc.freenode.net recommended to set KDEDIRS correctly because when doing so running kbuildsycoca4 manually wouldn&#8217;t be neccessary.</p>
<p>not sure how to solve this problem correctly yet but in case i find out i will add it to this post.</p>
<h2>issue 2</h2>
<p>another point which bugs me is that auto-completion doesn&#8217;t work correctly as there is no such thing as /usr/include on nixos as one might expect when coming from a different linux distribution. didn&#8217;t find a solution here yet either&#8230;</p>
<h1>links</h1>
<p>[1] <a href="http://techbase.kde.org/Projects/KDevelop4/HowToCompile">http://techbase.kde.org/Projects/KDevelop4/HowToCompile</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/invalidmagic.wordpress.com/1027/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/invalidmagic.wordpress.com/1027/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/invalidmagic.wordpress.com/1027/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/invalidmagic.wordpress.com/1027/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/invalidmagic.wordpress.com/1027/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/invalidmagic.wordpress.com/1027/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/invalidmagic.wordpress.com/1027/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/invalidmagic.wordpress.com/1027/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/invalidmagic.wordpress.com/1027/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/invalidmagic.wordpress.com/1027/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/invalidmagic.wordpress.com/1027/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/invalidmagic.wordpress.com/1027/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/invalidmagic.wordpress.com/1027/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/invalidmagic.wordpress.com/1027/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=1027&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://invalidmagic.wordpress.com/2011/10/17/kdevelop-on-nixos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/41bd958b820be8240c15687f848c6056?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">invalidmagic</media:title>
		</media:content>

		<media:content url="http://invalidmagic.files.wordpress.com/2010/12/nixos-lores.png" medium="image">
			<media:title type="html">nixos-lores</media:title>
		</media:content>
	</item>
		<item>
		<title>system services on nixos</title>
		<link>http://invalidmagic.wordpress.com/2011/10/10/system-services-on-nixos/</link>
		<comments>http://invalidmagic.wordpress.com/2011/10/10/system-services-on-nixos/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 18:30:18 +0000</pubDate>
		<dc:creator>invalidmagic</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[package manager]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://invalidmagic.wordpress.com/?p=1020</guid>
		<description><![CDATA[how to integrate a daemon into nixos in this short article i want to show how services can be added/used in nixos. i personally find the nixos way a quite easy and &#8216;clean&#8217; approach! as i integrated cntlm my goals were: easy to use password must be stored in a safe place service should not [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=1020&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1><a href="http://invalidmagic.files.wordpress.com/2010/12/nixos-lores.png"><img class="alignright size-full wp-image-704" title="nixos-lores" src="http://invalidmagic.files.wordpress.com/2010/12/nixos-lores.png?w=500" alt=""   /></a>how to integrate a daemon into nixos</h1>
<p>in this short article i want to show how services can be added/used in nixos. i personally find the nixos way a quite easy and &#8216;clean&#8217; approach!</p>
<p>as i integrated cntlm my goals were:</p>
<ul>
<li><strong>easy to use</strong></li>
<li><strong>password</strong> must be stored in a <strong>safe place</strong></li>
<li><strong>service should not be run as root</strong> but as a special user: <strong>cntlm</strong></li>
</ul>
<div>it helped a lot to look at similar scripts like the sshd integration but i also used &#8220;NixOS: A Purely functional Linux Distribution&#8221; [1] which is describing most aspects which are needed to get a service up and running.</div>
<div>seen as a developer one has to write two nix expressions:</div>
<div>
<ul>
<li><strong>cntlm/default.nix</strong><br />
the script which describes the software cntlm</li>
<li><strong>nixos/modules/services/networking/cntlm.nix</strong><br />
the script which descirbes the service</li>
</ul>
<div>seen as a user one has to modify only one nix expression:</div>
<div>
<ul>
<li><strong>/etc/nixos/configuration.nix</strong><br />
the place where all the configuration happens</li>
</ul>
</div>
</div>
<h2>/etc/nixos/nixpkgs/pkgs/tools/networking/cntlm/default.nix</h2>
<p>this nix expression describes the cntlm software and is quite simple as it basically fetches the software/compiles it/installs it into the system. however, a user does not have to install this software using:</p>
<ul>
<li>nix-env -i cntlm</li>
</ul>
<div>still this would be possible, and a normal user/root user could use the software in his profile this way.</div>
<div>anyway here is the script:</div>
<pre>     1  { stdenv, fetchurl, which}:
     2
     3  stdenv.mkDerivation {
     4    name = "cntlm-0.35.1";
     5
     6    src = fetchurl {
     7      url = mirror://sourceforge/cntlm/cntlm-0.35.1.tar.gz;
     8      sha256 = "7b3fb7184e72cc3f1743bb8e503a5305e96458bc630a7e1ebfc9f3c07ffa6c5e";
     9    };
    10
    11    buildInputs = [ which ];
    12
    13    installPhase = ''
    14      ensureDir $out/bin; cp cntlm $out/bin/;
    15      ensureDir $out/share/; cp COPYRIGHT README VERSION doc/cntlm.conf $out/share/;
    16      ensureDir $out/man/; cp doc/cntlm.1 $out/man/;
    17    '';
    18
    19    meta = {
    20      description = "Cntlm is an NTLM/NTLMv2 authenticating HTTP proxy";
    21      homepage = http://cntlm.sourceforge.net/;
    22      license = stdenv.lib.licenses.gpl2;
    23      maintainers = [ stdenv.lib.maintainers.qknight ];
    24    };
    25  }</pre>
<p>the only point of interest might be the buildInputs (line 11) which includes which. in this build script &#8216;which gcc&#8217; is used to test if gcc is installed.</p>
<h2>/etc/nixos/nixos/modules/services/networking/cntlm.nix</h2>
<p>this expression is used to <strong>integrate cntlm as a system service.</strong></p>
<pre>     1  { config, pkgs, ... }:
     2
     3  with pkgs.lib;
     4
     5  let
     6
     7    cfg = config.services.cntlm;
     8    uid = config.ids.uids.cntlm;
     9
    10  in
    11
    12  {
    13
    14    options = {
    15
    16      services.cntlm= {
    17
    18        enable = mkOption {
    19          default = false;
    20          description = ''
    21            Whether to enable the cntlm, which start a local proxy.
    22          '';
    23        };
    24
    25        username = mkOption {
    26          description = ''
    27            Proxy account name, without the possibility to include domain name ('at' sign is interpreted literally).
    28          '';
    29        };
    30
    31        domain = mkOption {
    32          description = ''Proxy account domain/workgroup name.'';
    33        };
    34
    35        password = mkOption {
    36          default = "/etc/cntlm.password";
    37          type = with pkgs.lib.types; string;
    38          description = ''Proxy account password. Note: use chmod 0600 on /etc/cntlm.password for security.'';
    39        };
    40
    41        netbios_hostname = mkOption {
    42          default = config.networking.hostName;
    43          description = ''
    44            The hostname of your workstation.
    45          '';
    46        };
    47
    48        proxy = mkOption {
    49          description = ''
    50            A list of NTLM/NTLMv2 authenticating HTTP proxies.
    51
    52            Parent proxy, which requires authentication. The same as proxy on the command-line, can be used more than  once  to  specify  unlimited
    53            number  of  proxies.  Should  one proxy fail, cntlm automatically moves on to the next one. The connect request fails only if the whole
    54            list of proxies is scanned and (for each request) and found to be invalid. Command-line takes precedence over the configuration file.
    55          '';
    56        };
    57
    58        port = mkOption {
    59          default = [3128];
    60          description = "Specifies on which ports the cntlm daemon listens.";
    61        };
    62
    63       extraConfig = mkOption {
    64          default = "";
    65          description = "Verbatim contents of cntlm.conf.";
    66       };
    67
    68      };
    69
    70    };
    71
    72
    73    ###### implementation
    74
    75    config = mkIf config.services.cntlm.enable {
    76      users.extraUsers = singleton {
    77          name = "cntlm";
    78          description = "cntlm system-wide daemon";
    79          home = "/var/empty";
    80      };
    81
    82      jobs.cntlm = {
    83          description = "cntlm is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy.";
    84          startOn = "started network-interfaces";
    85          environment = {
    86          };
    87
    88      preStart = '' '';
    89
    90      daemonType = "fork";
    91
    92      exec =
    93        ''
    94          ${pkgs.cntlm}/bin/cntlm -U cntlm \
    95          -c ${pkgs.writeText "cntlm_config" cfg.extraConfig}
    96        '';
    97      };
    98
    99      services.cntlm.extraConfig =
   100        ''
   101          # Cntlm Authentication Proxy Configuration
   102          Username        ${cfg.username}
   103          Domain          ${cfg.domain}
   104          Password        ${cfg.password}
   105          Workstation     ${cfg.netbios_hostname}
   106          ${concatMapStrings (entry: "Proxy ${entry}\n") cfg.proxy}
   107
   108          ${concatMapStrings (port: ''
   109            Listen ${toString port}
   110          '') cfg.port}
   111        '';
   112    };
   113  }
notable parts are:</pre>
<ul>
<li>(line 1-13) <strong>if interested in general nix language: read [1] page 6,7</strong> (and 5 might also be interesting)</li>
<li>(line 18-66) where a<strong> list of options is declared</strong> (some with default arguments; some without default argument which will enforce the user to set them)</li>
<li>(line 76-79) where the <strong>service is started as a different user</strong> (security measure)</li>
<li>(line 92-97) where the <strong>configuration is generated on the fly</strong> (yes <strong>cntlm.conf is generated everytime the configuration in /etc/nixos/configuration.nix is changed</strong>). a user using the cntlm service on nixos does not change the cntlm.conf manually)</li>
<li>(line 99-111) where a <strong>minimal configuration</strong> (extract of the example cntlm.conf) <strong>is parameterized</strong>.</li>
<li>(line 106) where a <strong>list of items is transformed into a multi line structure</strong> where:<br />
<strong>cfg.proxy = [ "foo" "bar" "baz" ];</strong><br />
is transformed into:<br />
<strong>Proxy foo</strong><br />
<strong>Proxy bar</strong><br />
<strong>Proxy baz</strong></li>
</ul>
<h2>how to make use of the above expressions</h2>
<p><strong>a user has to append this configuration into /etc/nixos/configuration.nix</strong> and cntlm will be installed/configured and started</p>
<pre>  services.cntlm = {
    enable=true;
    username="myusername";
    domain="mydomain";
    proxy=[ "192.168.3.5:1234" ];
  };</pre>
<h2>summary</h2>
<p>in <strong>contrast to most other distributions nixos makes not only packaging subject to a &#8216;clean&#8217; package management but also configuration management (/etc stuff) and runtime management</strong>. this is a very clean design helping to avoid lots of pitfalls.</p>
<h2>links</h2>
<pre>[1] <a href="http://www.st.ewi.tudelft.nl/~dolstra/pubs/nixos-jfp-final.pdf">http://www.st.ewi.tudelft.nl/~dolstra/pubs/nixos-jfp-final.pdf</a></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/invalidmagic.wordpress.com/1020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/invalidmagic.wordpress.com/1020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/invalidmagic.wordpress.com/1020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/invalidmagic.wordpress.com/1020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/invalidmagic.wordpress.com/1020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/invalidmagic.wordpress.com/1020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/invalidmagic.wordpress.com/1020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/invalidmagic.wordpress.com/1020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/invalidmagic.wordpress.com/1020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/invalidmagic.wordpress.com/1020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/invalidmagic.wordpress.com/1020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/invalidmagic.wordpress.com/1020/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/invalidmagic.wordpress.com/1020/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/invalidmagic.wordpress.com/1020/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=1020&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://invalidmagic.wordpress.com/2011/10/10/system-services-on-nixos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/41bd958b820be8240c15687f848c6056?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">invalidmagic</media:title>
		</media:content>

		<media:content url="http://invalidmagic.files.wordpress.com/2010/12/nixos-lores.png" medium="image">
			<media:title type="html">nixos-lores</media:title>
		</media:content>
	</item>
		<item>
		<title>diploma thesis: Multi-Platform Software Package Management</title>
		<link>http://invalidmagic.wordpress.com/2011/09/24/diploma-thesis-multi-platform-software-package-management/</link>
		<comments>http://invalidmagic.wordpress.com/2011/09/24/diploma-thesis-multi-platform-software-package-management/#comments</comments>
		<pubDate>Sat, 24 Sep 2011 00:50:38 +0000</pubDate>
		<dc:creator>invalidmagic</dc:creator>
				<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[p2p]]></category>
		<category><![CDATA[package manager]]></category>
		<category><![CDATA[qt]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[society]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://invalidmagic.wordpress.com/?p=1013</guid>
		<description><![CDATA[finally &#8230; the online publication of my diploma thesis (DT) is here, it can be found online [1] including the source at [2]. i hope that the terminology introduced in this DT (chap 9) will be used. this is of course also true for concepts engineered in (chap 7). candies can be found here: - [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=1013&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>finally &#8230; the online<strong> publication of my diploma thesis</strong> (DT) is here, it can be found online [1] including the source at [2].</p>
<p>i hope that the terminology introduced in this DT (chap 9) will be used. this is of course also true for concepts engineered in (chap 7).</p>
<pre>candies can be found here:
 - chap 4: components used in a package manager
 - chap 4.6: <strong>different integration levels of a package manager</strong>
 - chap 5.13: ways to replicate a system
 - chap 5.15 ff
 - chap 6.2: evopedia deployment summary
 - chap 7 <strong>(you might want to read this a few times, it is quite complex)</strong>
 - chap 9: <strong>here i introduce some new terminology in package management</strong>
           (probably a _must read_)</pre>
<p>see also the README for in [2] for further information.</p>
<h1>links</h1>
<p>[1] <a href="https://github.com/qknight/Multi-PlatformSoftwarePackageManagement/blob/master/Multi-PlatformSoftwarePackageManagement.pdf">https://github.com/qknight/Multi-PlatformSoftwarePackageManagement/blob/master/Multi-PlatformSoftwarePackageManagement.pdf</a></p>
<p>[2] <a href="https://github.com/qknight/Multi-PlatformSoftwarePackageManagement">https://github.com/qknight/Multi-PlatformSoftwarePackageManagement</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/invalidmagic.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/invalidmagic.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/invalidmagic.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/invalidmagic.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/invalidmagic.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/invalidmagic.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/invalidmagic.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/invalidmagic.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/invalidmagic.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/invalidmagic.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/invalidmagic.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/invalidmagic.wordpress.com/1013/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/invalidmagic.wordpress.com/1013/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/invalidmagic.wordpress.com/1013/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=1013&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://invalidmagic.wordpress.com/2011/09/24/diploma-thesis-multi-platform-software-package-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/41bd958b820be8240c15687f848c6056?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">invalidmagic</media:title>
		</media:content>
	</item>
		<item>
		<title>Filing a ticket on OTRS 3.0.6 on Windows Server 2008 is slow like hell!</title>
		<link>http://invalidmagic.wordpress.com/2011/08/03/filing-a-ticket-on-otrs-3-0-6-on-windows-server-2008-is-slow-like-hell/</link>
		<comments>http://invalidmagic.wordpress.com/2011/08/03/filing-a-ticket-on-otrs-3-0-6-on-windows-server-2008-is-slow-like-hell/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 15:40:46 +0000</pubDate>
		<dc:creator>invalidmagic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://invalidmagic.wordpress.com/?p=1004</guid>
		<description><![CDATA[problem description when filing a telephone or email ticket often several recipients are contacted via email. dependent on the otrs configuration this is done in sync, so that a user gets success or fail for message sending in realtime. that means if no local mailserver is used it can be quite time consuming. for example: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=1004&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_1006" class="wp-caption alignright" style="width: 294px"><a href="http://invalidmagic.files.wordpress.com/2011/08/acquia_marina_logo.jpg"><img class="size-full wp-image-1006 " title="acquia_marina_logo" src="http://invalidmagic.files.wordpress.com/2011/08/acquia_marina_logo.jpg?w=500" alt=""   /></a><p class="wp-caption-text">http://otrs.org/</p></div>
<h1>problem description</h1>
<p>when filing a telephone or email ticket often several recipients are contacted via email. dependent on the otrs configuration this is done in sync, so that a user gets success or fail for message sending in realtime. that means if no local mailserver is used it can be quite time consuming.</p>
<p>for example: filing a ticket here for say the &#8216;inhouse support crew&#8217; would issue 5 emails and using an external mailserver that means:</p>
<ul>
<li>5x 1,2 seconds ~= 5-8 seconds</li>
</ul>
<p>where the otrs-GUI is frozen for the user after clicking &#8216;create&#8217;. dependent on how busy the remote email server is this can hinder usability quite fast.</p>
<p>so this post might be interesting for everyone who wants to use otrs but does not also operate a in-house mailserver.</p>
<h1>my setup</h1>
<ul>
<li>otrs 3.0.6</li>
<li>windows server 2008 r2</li>
<li>no local mailserver</li>
</ul>
<h1>the solution</h1>
<p><strong>windows server 2008 has support for a  local smtp server (smart host setup or satellite system setup)</strong> which can be used as relay. this setup is very easy is much better than using an external mailserver directly because the <strong>microsoft smtp relay server has also a local queue</strong> so messages won&#8217;t get lost if there is a partial network failure.</p>
<p>so basically i used [1], [2], [3], [4] to create the setup.</p>
<p>important points where:</p>
<ul>
<li><strong>using smtp.mail.emea.microsoftonline.com</strong></li>
<li><strong>tls encryption</strong></li>
<li><strong>user/pass authentification</strong></li>
</ul>
<div>after the configuration is final:</div>
<div><strong>test the setup using: &#8216;telnet localhost 25&#8242; and type the commands as found in [5].</strong></div>
<h1><strong>the ms smtp relay queue</strong></h1>
<div>one should keep an eye on the queue which is in: <strong>c:\inetpub\mailroot\Queue</strong></div>
<h1>the otrs configuration</h1>
<div>use the <strong>webinterface</strong> and <strong>login as root@localhost</strong>:</div>
<div>in otrs one has to login, go to admin-&gt;sysconfig-&gt;type smtp into the search bar, then &#8216;Core::Sendmail&#8217;, in there configure:</div>
<div>
<ul>
<li>SendMailModule -&gt; <strong>SMTP</strong></li>
<li>SendMailModule::Host -&gt;<strong> localhost</strong></li>
<li>SendMailModule::Port -&gt; <strong>25</strong></li>
<li><strong>disable AuthUser/AuthPassword</strong></li>
</ul>
<div>finally you are done and should file a ticket (which is known to produce an email as a side-effect) and check if that mail is sent.</div>
</div>
<div><strong>Note: i like that this smtp relay has a local queue, that is what i&#8217;ve been missing on linux for ages&#8230; (which is quite sad)</strong></div>
<h1>links</h1>
<p>[1] <a href="http://www.itsolutionskb.com/2008/11/installing-and-configuring-windows-server-2008-smtp-server/">http://www.itsolutionskb.com/2008/11/installing-and-configuring-windows-server-2008-smtp-server/</a></p>
<p>[2] <a href="http://www.petri.co.il/configure_iis_to_be_a_smart_host_for_exchange.htm">http://www.petri.co.il/configure_iis_to_be_a_smart_host_for_exchange.htm</a></p>
<p>[3] <a href="http://www.cmsconnect.com/praetor/webhelpg2/chapter_2_-_pre-installation_considerations/Configuring_the_SMTP_Server.htm">http://www.cmsconnect.com/praetor/webhelpg2/chapter_2_-_pre-installation_considerations/Configuring_the_SMTP_Server.htm</a></p>
<p>[4] <a href="http://www.geeksengine.com/article/php-microsoft-smtp.html">http://www.geeksengine.com/article/php-microsoft-smtp.html</a></p>
<p>[5] <a href="http://www.astahost.com/info.php/Sending-Mail-Telnet_t3325.html">http://www.astahost.com/info.php/Sending-Mail-Telnet_t3325.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/invalidmagic.wordpress.com/1004/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/invalidmagic.wordpress.com/1004/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/invalidmagic.wordpress.com/1004/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/invalidmagic.wordpress.com/1004/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/invalidmagic.wordpress.com/1004/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/invalidmagic.wordpress.com/1004/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/invalidmagic.wordpress.com/1004/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/invalidmagic.wordpress.com/1004/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/invalidmagic.wordpress.com/1004/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/invalidmagic.wordpress.com/1004/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/invalidmagic.wordpress.com/1004/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/invalidmagic.wordpress.com/1004/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/invalidmagic.wordpress.com/1004/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/invalidmagic.wordpress.com/1004/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=1004&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://invalidmagic.wordpress.com/2011/08/03/filing-a-ticket-on-otrs-3-0-6-on-windows-server-2008-is-slow-like-hell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/41bd958b820be8240c15687f848c6056?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">invalidmagic</media:title>
		</media:content>

		<media:content url="http://invalidmagic.files.wordpress.com/2011/08/acquia_marina_logo.jpg" medium="image">
			<media:title type="html">acquia_marina_logo</media:title>
		</media:content>
	</item>
		<item>
		<title>new nixos.org mediawiki theme</title>
		<link>http://invalidmagic.wordpress.com/2011/06/20/new-nixos-org-mediawiki-theme/</link>
		<comments>http://invalidmagic.wordpress.com/2011/06/20/new-nixos-org-mediawiki-theme/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 10:29:40 +0000</pubDate>
		<dc:creator>invalidmagic</dc:creator>
				<category><![CDATA[taspring]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://invalidmagic.wordpress.com/?p=976</guid>
		<description><![CDATA[the wiki.nixos.org mediawiki theme for some time i am hosting muse-sequencer.org with a mediawiki but i never was able to design a nice custom layout like it is done on spring RTS [1] for example. however, i often use the &#8216;clean&#8217; theme which looks much better than the standard mediawiki theme. anyway, there are times [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=976&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>the wiki.nixos.org mediawiki theme</h1>
<p>for some time i am hosting muse-sequencer.org with a mediawiki but i never was able to design a nice custom layout like it is done on spring RTS [1] for example. however, i often use the &#8216;clean&#8217; theme which looks much better than the standard mediawiki theme.</p>
<p>anyway, there are times when you need a &#8216;custom theme&#8217;, especially when you have to integrate a custom menu bar (as shown in the top part of the nixos-wiki-theme screenshot below). the advantage is that the wiki page feels &#8216;integrated&#8217; into the page and especially as the top level menubar helps to navigate the site it can be used to get out of the wiki again.</p>
<p><strong>therefore, not integrating the main navigation menu into the wiki stylesheet causes a huge hit on usability as users have to alter the URL filed in order to get back to the other pages.</strong> <strong>and the wiki not looking like the rest of the pages also degrades the look and feel.</strong></p>
<p><a href="http://invalidmagic.files.wordpress.com/2011/06/nixos_mediawiki_theme.png"><img class="aligncenter size-full wp-image-977" title="nixos_mediawiki_theme" src="http://invalidmagic.files.wordpress.com/2011/06/nixos_mediawiki_theme.png?w=500&#038;h=332" alt="" width="500" height="332" /></a></p>
<p>for quite some time i did not want to learn that much CSS and php/html but lately the integration of wiki.nixos.org into the nixos.org domain made me think otherwise and so i started to hack a new stylesheet [2] based on the &#8216;clean&#8217; skin [3] i already debugged for my page &#8216;lastlog.de&#8217;.</p>
<p><strong>i needed about 9hours</strong> to make the design final and <strong>i would like to thank zmlka@irc.freenode.net#nixos for his help and fine tuning</strong>!  <strong>i would also like to thank viric<strong>@irc.freenode.net#nixos</strong></strong> for his general attributions towards a nice mediawiki.nix modification which makes it easy to handle several third party mediawiki stylesheets. i might upload these modifications upstream (nixpkgs) soon &#8211; if i find the time.</p>
<p>i hope nixos.org folks will use the new style soon!</p>
<h1>external and internal links</h1>
<p>one nice thing i discovered while creating the nixos mediawiki theme was that it is very easy to add external links. i always thought this to be very complicated.</p>
<p>the nixos-mediawiki-theme does have two menues: a top level menu (header) and a bottom menu (footer). i used <strong>require_once(..),</strong> which is a <strong>php command</strong>, to include &#8216;header.php&#8217; and &#8216;footer.php&#8217;.</p>
<p>this way the style can be extended without having to touch the the style. this is especially nice as nixos wants a stateless packages and one can set the &#8216;links&#8217; from the /etc/nixos/configuration.nix context.</p>
<p>another nice thing is that it is very easy to add &#8216;internal&#8217; links, that means: the menu generated from &#8216;header.php&#8217; can be used to add links which will also end in the mediawiki:</p>
<p>this will create an external link:</p>
<ul>
<li>&lt;li&gt;&lt;a href=&#8221;http://nixos.org/nixos/&#8221;&gt;NixOS&lt;/a&gt;&lt;/li&gt;</li>
</ul>
<p>this will create an internal link</p>
<ul>
<li>&lt;li&gt;&lt;a href=&#8221;demo&#8221;&gt;Demo&lt;/a&gt;&lt;/li&gt;</li>
</ul>
<h1>conclusion</h1>
<p>although it was very time consuming for me to write this stylesheet (except for my &#8216;ajax patterns&#8217; [4] project i&#8217;ve never done that before) i learned quite much about stylesheets, thus i encourage you to do the same for your page. soon i will write a little guide how to do that in more detail.</p>
<p><strong>it is also worth mentioning that CSS can be used to make the content 100% independent of the position in the page but contrary to all my expectations this might not be a default for most pages</strong>.</p>
<p>i would also like to <strong>recommend firefox+firebug</strong> as this helps to analyze css/html errors and also helps to make experimental modifications on the fly!</p>
<h1>links</h1>
<p>[1] <a href="https://springrts.com">https://springrts.com</a></p>
<p>[2]<a href="https://github.com/qknight/nixos"> https://github.com/qknight/nixos</a></p>
<p>[3] <a href="https://github.com/qknight/clean">https://github.com/qknight/clean</a></p>
<p>[4] <a href="http://lastlog.de/wiki/index.php/Ajax_patterns">http://lastlog.de/wiki/index.php/Ajax_patterns</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/invalidmagic.wordpress.com/976/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/invalidmagic.wordpress.com/976/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/invalidmagic.wordpress.com/976/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/invalidmagic.wordpress.com/976/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/invalidmagic.wordpress.com/976/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/invalidmagic.wordpress.com/976/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/invalidmagic.wordpress.com/976/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/invalidmagic.wordpress.com/976/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/invalidmagic.wordpress.com/976/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/invalidmagic.wordpress.com/976/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/invalidmagic.wordpress.com/976/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/invalidmagic.wordpress.com/976/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/invalidmagic.wordpress.com/976/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/invalidmagic.wordpress.com/976/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=976&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://invalidmagic.wordpress.com/2011/06/20/new-nixos-org-mediawiki-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/41bd958b820be8240c15687f848c6056?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">invalidmagic</media:title>
		</media:content>

		<media:content url="http://invalidmagic.files.wordpress.com/2011/06/nixos_mediawiki_theme.png" medium="image">
			<media:title type="html">nixos_mediawiki_theme</media:title>
		</media:content>
	</item>
		<item>
		<title>ubuntu cachefs experiments</title>
		<link>http://invalidmagic.wordpress.com/2011/06/15/ubuntu-cachefs-experiments/</link>
		<comments>http://invalidmagic.wordpress.com/2011/06/15/ubuntu-cachefs-experiments/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 10:03:01 +0000</pubDate>
		<dc:creator>invalidmagic</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://invalidmagic.wordpress.com/?p=946</guid>
		<description><![CDATA[motivation the main purpose is a &#8216;high availability&#8217; file storage with with two servers: main and failover. the main server has two raid systems: one with fast disks and moderate disk sizes and another raid with slow but very big disks the idea is to find a way to use the fast raid for file-caching [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=946&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>motivation</h1>
<p>the main purpose is a &#8216;high availability&#8217; file storage with with two servers: main and failover. the main server has two raid systems:</p>
<ul>
<li>one with <strong>fast</strong> disks and <strong>moderate disk sizes</strong> and</li>
<li>another raid with <strong>slow</strong> but very <strong>big disks</strong></li>
</ul>
<p>the idea is to find a way to use the fast raid for<strong> file-caching similar to ZFS or BTRFS&#8217;.</strong></p>
<p><a href="http://invalidmagic.files.wordpress.com/2011/06/serverlayout.png"><img class="aligncenter size-medium wp-image-965" title="serverlayout" src="http://invalidmagic.files.wordpress.com/2011/06/serverlayout.png?w=300&#038;h=153" alt="" width="300" height="153" /></a></p>
<p>the goal of this experimental setup is to experiment with <strong>fscache</strong> [1]. so far it seems that fscache is either bound to NFS, AFS or ISOFS (or a similar network fs technology).</p>
<p>experiment using:</p>
<ul>
<li><strong>virtualbox 3.x</strong> on gentoo linux</li>
<li><strong>ubuntu 10.10 (guest)</strong></li>
<li>currently only main is in the experimental setup and <strong>DRBD is not used yet</strong></li>
<li><strong>not shown</strong> in the diagram is the PV/VG/LV stuff (LVM)</li>
</ul>
<p>there are two interesting documentations:</p>
<ul>
<li>[3] how to use fscache</li>
<li>[4] how fscache is implemented (and how to debug it)</li>
</ul>
<h1>setup using nfs</h1>
<p>this is a small setup to test if the mount and fscache are working on the target platform. in this case it was working great with ubuntu 10.10 desktop. setup steps:</p>
<ol>
<li>using [2] we install the needed tools on ubuntu linux:<br />
<strong>apt-get install nfs-kernel-server nfs-common</strong></li>
<li>cat /etc/exports<br />
<strong>/media/share 127.0.0.1(async,no_subtree_check,rw,insecure,all_squash)</strong></li>
<li>nfs-kernel-server neustarten:<br />
<strong>/etc/init.d/nfs-kernel-server restart</strong></li>
<li>change the permissions on /media/share<br />
<strong>chmod 0777 /media/share</strong></li>
<li>only to test if the nfs export works we do:<br />
<strong>mount -t nfs 127.0.0.1:/media/share /mnt/mounted-Share</strong></li>
<li>after a successful test we unmount it:<br />
<strong>umount /mnt/mounted-Share</strong></li>
<li>create the cacheDir disk:<br />
<strong>dd if=/dev/zero bs=1M count=512 of=cacheLoopDevice.dd</strong><br />
<strong>mkfs.ext4 /mnt/cacheLoopDevice.dd</strong><br />
according to [3]:<br />
<strong>tune2fs -o user_xattr /mnt/cacheLoopDevice.dd</strong><br />
<strong>mount -o loop,user_xattr /mnt/cacheLoopDevice.dd /mnt/cacheDir</strong></li>
<li>enable the cachefilesd daemon:<br />
<strong>vi /etc/default/cachefilesd # remove the # before RUN=yes</strong><br />
change the <strong>dir=&#8230;</strong> in /etc/cachefilesd.conf:<br />
<strong>dir /mnt/cacheDir<br />
/etc/init.d/cachefilesd restart</strong></li>
<li>finally let&#8217;s mount it again but this time using &#8216;fscache&#8217;:<br />
<strong>mount 127.0.0.1:/media/share /mnt/cached-Share/ -o fsc</strong><br />
<strong></strong></li>
<li>let&#8217;s do a functionality tests:<br />
<strong> touch /mnt/cached-Share/a</strong><br />
<strong> ls -la /media/share</strong></li>
</ol>
<h1>setup using <del>nfs</del> &#8211; no networking filesystem</h1>
<p>as shown in the two following examples, it does not work with ext2 or ext4. it seems as if fscache forces the use of NFS/AFS/ISOFS.</p>
<h2>ext2</h2>
<blockquote><p><strong>mkfs.ext2 /dev/sdb1 </strong><br />
<strong>mount /dev/sdb1 /mnt/cached-Share/ </strong><br />
<strong>umount /mnt/cached-Share/</strong><br />
<strong>mount /dev/sdb1 /mnt/cached-Share/ -o fsc</strong></p></blockquote>
<p>the error message (response to the shell command):</p>
<blockquote><p>mount: wrong fs type, bad option, bad superblock on /dev/sdb1,<br />
missing codepage or helper program, or other error<br />
In some cases useful info is found in syslog &#8211; try<br />
dmesg | tail  or so</p></blockquote>
<h2>ext4</h2>
<blockquote><p><strong>mkfs.ext4 /dev/sdb1 </strong><br />
<strong>mount /dev/sdb1 /mnt/cached-Share/ </strong><br />
<strong>umount /mnt/cached-Share/</strong><br />
<strong>mount /dev/sdb1 /mnt/cached-Share/ -o fsc</strong></p></blockquote>
<p>the error message (response to the shell command):</p>
<blockquote><p>mount: wrong fs type, bad option, bad superblock on /dev/sdb1,<br />
missing codepage or helper program, or other error<br />
In some cases useful info is found in syslog &#8211; try<br />
dmesg | tail  or so</p></blockquote>
<p>the error message in (/var/log/messages):</p>
<blockquote><p>[  846.008443] EXT4-fs (sdb1): Unrecognized mount option &#8220;fsc&#8221; or missing value</p></blockquote>
<h1>some performance experiments</h1>
<p>to answer the question if all this setup is worth the effort, lets&#8217; make some experiments:</p>
<ul>
<li>time cp /usr/src/linux /mnt/cached-Share/</li>
<li>grep &#8220;__&#8221; /usr/src/linux -R</li>
<li>time rm -Rf /mnt/cached-Share/usr</li>
</ul>
<p><strong>please note:</strong> i&#8217;ve changed the described setup a little bit: the virtual machine guest was given a virtual disk which was stored on a SSD driver.</p>
<p><strong>performance tests inside a virtualbox guests seem to be worthless. i have to repeat similar tests on the target machine. but using a local NFS just to get &#8216;fscache&#8217; working seems to be a bad design IMHO. we&#8217;ll see if it is worth it.<br />
</strong></p>
<h1>conclusion</h1>
<p>seems hot-data can be used with the <strong>NFS workaround</strong> but <strong>not without it</strong>. in contrast: zfs/btrfs have direct support for adding &#8216;hot&#8217; data cache:</p>
<ul>
<li>btrfs: &#8216;<strong>hot data relocation</strong>&#8216; functionality [5]</li>
<li>zfs: this is referred to as &#8216;<strong>Separate Cache Devices</strong>&#8216; [6]  or &#8216;<strong>ssd caching</strong>&#8216; [7]</li>
</ul>
<p>it would be nice to have a similar feature to <strong>fscache</strong> but for any filesystem (not limited to NFS/AFS/ISOFS) with the ability to be added dynamically (maybe using <strong>remount</strong>, so one does not have to unmount/mount the filesystem).</p>
<p><strong>Edit:</strong> bcache [8] is what i actually wanted.</p>
<h1>links</h1>
<p>[1] <a href="http://en.wikipedia.org/wiki/CacheFS">http://en.wikipedia.org/wiki/CacheFS</a></p>
<p>[2] <a href="http://www.ubuntu-forum.de/artikel/32272/nfs-server-unter-ubuntu-einrichten.htm">http://www.ubuntu-forum.de/artikel/32272/nfs-server-unter-ubuntu-einrichten.htm</a></p>
<p>[3] /usr/share/doc/cachefilesd/howto.txt.gz (coming with deb-package: <strong>cachefilesd</strong>)</p>
<p>[4] /usr/src/linux/Documentation/filesystems/caching/fscache.txt (found on my Gentoo system in 2.6.36-gentoo-r5)</p>
<p>[5] <a href="http://lwn.net/Articles/397643/">http://lwn.net/Articles/397643/</a> (Btrfs: Add hot data tracking functionality)</p>
<p>[6] <a href="http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide#Separate_Cache_Devices">http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide#Separate_Cache_Devices</a></p>
<p>[7]  <a href="http://blogs.oracle.com/brendan/entry/test">http://blogs.oracle.com/brendan/entry/test</a></p>
<p>[8] <a href="http://bcache.evilpiepirate.org/">http://bcache.evilpiepirate.org/</a></p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/invalidmagic.wordpress.com/946/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/invalidmagic.wordpress.com/946/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/invalidmagic.wordpress.com/946/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/invalidmagic.wordpress.com/946/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/invalidmagic.wordpress.com/946/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/invalidmagic.wordpress.com/946/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/invalidmagic.wordpress.com/946/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/invalidmagic.wordpress.com/946/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/invalidmagic.wordpress.com/946/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/invalidmagic.wordpress.com/946/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/invalidmagic.wordpress.com/946/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/invalidmagic.wordpress.com/946/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/invalidmagic.wordpress.com/946/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/invalidmagic.wordpress.com/946/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=946&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://invalidmagic.wordpress.com/2011/06/15/ubuntu-cachefs-experiments/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/41bd958b820be8240c15687f848c6056?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">invalidmagic</media:title>
		</media:content>

		<media:content url="http://invalidmagic.files.wordpress.com/2011/06/serverlayout.png?w=300" medium="image">
			<media:title type="html">serverlayout</media:title>
		</media:content>
	</item>
		<item>
		<title>mediawiki::skin::clean relocated</title>
		<link>http://invalidmagic.wordpress.com/2011/06/02/mediawikiskinclean-relocated/</link>
		<comments>http://invalidmagic.wordpress.com/2011/06/02/mediawikiskinclean-relocated/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 09:47:35 +0000</pubDate>
		<dc:creator>invalidmagic</dc:creator>
				<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://invalidmagic.wordpress.com/?p=926</guid>
		<description><![CDATA[mediawiki has various built in skins but i usually prefered the &#8216;clean&#8217; skin from Kevin Hughes (shown in the screenshot). lately i had massive problems as i was moving from a gentoo server to a nix os server probably caused by different php versions but i&#8217;m not absolutely sure. anyway as the clean skin [1] [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=926&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://invalidmagic.files.wordpress.com/2011/06/mediawiki-skin-clean.png"><img class="aligncenter size-full wp-image-927" title="mediawiki-skin-clean" src="http://invalidmagic.files.wordpress.com/2011/06/mediawiki-skin-clean.png?w=500&#038;h=242" alt="" width="500" height="242" /></a><a href="http://invalidmagic.files.wordpress.com/2011/06/mediawiki-skin-clean.png"><br />
</a>mediawiki has various built in skins but i usually prefered the &#8216;clean&#8217; skin from Kevin Hughes (shown in the screenshot).</p>
<p>lately i had massive problems as i was moving from a <strong>gentoo server</strong> to a <strong>nix os server</strong> probably caused by different php versions but i&#8217;m not absolutely sure. anyway as the clean skin [1] was broken with the more recent php version.</p>
<h2>wasn&#8217;t it the fault of different mediawiki versions?</h2>
<p>i did copy my old mediawiki (and the clean skin) on a 1:1 basis to my nix os based server resulting in the same layout problems compared to using the most recent mediawiki from scratch.</p>
<p>therefore i conclude that issues i fixed are not caused by mediawiki.</p>
<h2>the fix</h2>
<p>finally i decided to hack the skin to make it work again and i came up with 3 small modifications to the code and the skin was working again! after contacting <strong>Kevin Hughes </strong>about my changes<strong> he decided to release the next version of his skin cc-by-sa/3.0</strong> which is great!</p>
<p>but he also said that he is not hosting the skin anymore, that means: <strong>the clean skin has a new home [2]</strong> (namely my repository). of course, as it is open source now you can also host it on any other page. but i would welcome other modifications to be done collaboratively.</p>
<p><strong>dear kevin hughes &#8211; thank you so much for that great skin!</strong></p>
<h1>links</h1>
<p>[1] <a href="http://mediawiki2u.com/">http://mediawiki2u.com/</a></p>
<p>[2] <a href="https://github.com/qknight/clean">https://github.com/qknight/clean</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/invalidmagic.wordpress.com/926/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/invalidmagic.wordpress.com/926/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/invalidmagic.wordpress.com/926/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/invalidmagic.wordpress.com/926/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/invalidmagic.wordpress.com/926/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/invalidmagic.wordpress.com/926/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/invalidmagic.wordpress.com/926/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/invalidmagic.wordpress.com/926/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/invalidmagic.wordpress.com/926/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/invalidmagic.wordpress.com/926/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/invalidmagic.wordpress.com/926/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/invalidmagic.wordpress.com/926/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/invalidmagic.wordpress.com/926/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/invalidmagic.wordpress.com/926/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=926&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://invalidmagic.wordpress.com/2011/06/02/mediawikiskinclean-relocated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/41bd958b820be8240c15687f848c6056?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">invalidmagic</media:title>
		</media:content>

		<media:content url="http://invalidmagic.files.wordpress.com/2011/06/mediawiki-skin-clean.png" medium="image">
			<media:title type="html">mediawiki-skin-clean</media:title>
		</media:content>
	</item>
		<item>
		<title>converting a VirtualBox image to a libvirt</title>
		<link>http://invalidmagic.wordpress.com/2011/05/20/converting-a-virtualbox-image-to-a-libvirt/</link>
		<comments>http://invalidmagic.wordpress.com/2011/05/20/converting-a-virtualbox-image-to-a-libvirt/#comments</comments>
		<pubDate>Fri, 20 May 2011 16:02:30 +0000</pubDate>
		<dc:creator>invalidmagic</dc:creator>
				<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[package manager]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://invalidmagic.wordpress.com/?p=916</guid>
		<description><![CDATA[motivation i have a gentoo system inside a virtualbox but i wanted to make some &#8216;long term tests&#8217; so i decided to migrate it to a libvirt machine which is running &#8216;fedora core 15 beta&#8217;. problems converting the image first i tried to migrate the &#8216;Gentoo 64 (portage).vdi&#8217; directly to a libvirt image, using [2]. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=916&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1><a href="http://invalidmagic.files.wordpress.com/2011/05/libvirtlogo.png"><img class="alignright size-thumbnail wp-image-918" title="libvirtLogo" src="http://invalidmagic.files.wordpress.com/2011/05/libvirtlogo.png?w=150&#038;h=120" alt="source: http://libvirt.org/" width="150" height="120" /></a>motivation</h1>
<p>i have a gentoo system inside a virtualbox but i wanted to make some &#8216;long term tests&#8217; so i decided to migrate it to a libvirt machine which is running &#8216;fedora core 15 beta&#8217;.</p>
<h1>problems converting the image</h1>
<p>first i tried to migrate the &#8216;Gentoo 64 (portage).vdi&#8217; directly to a libvirt image, using [2]. but anything i tried: afterwards the image was never bootable so i decided to use ssh to copy all the files instead.</p>
<ol>
<li>boot both virtual machines using the &#8216;<strong>grml64-mediaum_2010.12.iso</strong>&#8216;.</li>
<li>assign the ip addresses<br />
while i was using on the virtualbox side using: vboxnet0 in a host only networking schema i used a bridge on the other machine which involved lots of manual configuration as: disable networkmanager (on fedora core, remember?), removing the eth0 configuration (which happens to be called em1); adding a new configuration for the bridge br0 (using eth0).</li>
<li>finally i could ping from the virtualbox image to the libvirt guest system</li>
<li>i used &#8216;<strong>rsync -av /mnt/gentoo -e ssh 192.168.66.20:/mnt/gentoo</strong>&#8216;<br />
Note: both local gentoo systems were mounted into /mnt/gentoo</li>
<li>but libvirt used a ide host controller (which was very slow)<br />
therefore i manually removed the ide controller and replaced it by a <strong>VirtIO Disk using &#8216;qcow2&#8242; as storage format and &#8216;Virtio&#8217; as bus</strong>.</li>
<li>after all the copying i installed grub (grub-1.99rc1) but the original system had a grub1 config!<br />
the conversion was not simple!</li>
</ol>
<h2>The grub pitfall</h2>
<p>virtualbox image using grub1:</p>
<blockquote><p><strong>cat /boot/grub/menu.lst</strong></p>
<p>default 0<br />
timeout 30<br />
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz</p>
<p>title Gentoo Linux 2.6.24-r7<br />
root (hd0,0)<br />
kernel /boot/kernel-genkernel-x86_64-2.6.36-gentoo-r5  root=/dev/ram0 real_root=/dev/sda1<br />
initrd /boot/initramfs-genkernel-x86_64-2.6.36-gentoo-r5</p></blockquote>
<p>in comparison: &#8216;libvirt guest&#8217; using grub2</p>
<blockquote><p><strong>cat /boot/grub/grub.cfg</strong></p>
<p><strong>set default=0</strong><br />
<strong>set timeout=30</strong></p>
<p><strong>menuentry &#8220;Gentoo Linux 2.6.36-gentoo-r5&#8243; {</strong><br />
<strong>        insmod part_msdos</strong><br />
<strong>        insmod ext2</strong><br />
<strong> set root=(hd0,msdos1)</strong><br />
<strong>linux</strong> /boot/kernel-genkernel-x86_64-2.6.36-gentoo-r5  root=/dev/ram0 real_root=<strong>/dev/vda1</strong><br />
initrd /boot/initramfs-genkernel-x86_64-2.6.36-gentoo-r5<br />
<strong>}</strong></p></blockquote>
<p><strong>Note</strong>: i marked the differences.</p>
<p><strong>Note:</strong> take care of the different filename as well!</p>
<p>anyway: in the grml shell you can install grub into /dev/vda using:</p>
<blockquote><p><strong>grub-install &#8211;root-directory=/mnt/gentoo /dev/vda</strong></p></blockquote>
<h2>the kernel configuration pitfall</h2>
<p>a <strong>libvirt guest</strong> must be aware of <strong>/dev/vda (virtIO)</strong> but my genkernel was not. also i lacked ext4 support. so it is a good idea to included this into the kernel (i had it included as modules but it did not work well).</p>
<p>cat /etc/kernels/kernel-config-x86_64-2.6.36-gentoo-r5 | grep -i virt | grep -v &#8220;^#&#8221;</p>
<blockquote><p>CONFIG_VIRT_TO_BUS=y<br />
CONFIG_VIRTIO_BLK=y<br />
CONFIG_VIRTIO_NET=y<br />
CONFIG_VIRTIO_CONSOLE=y<br />
CONFIG_HW_RANDOM_VIRTIO=y<br />
CONFIG_VIRTUALIZATION=y<br />
CONFIG_VIRTIO=y<br />
CONFIG_VIRTIO_RING=y<br />
CONFIG_VIRTIO_PCI=y<br />
CONFIG_VIRTIO_BALLOON=y</p></blockquote>
<p>just use &#8216;genkernel&#8217; to build the new kernel (and don&#8217;t forget the ext4 support as i did).</p>
<h1>fedora core network problems</h1>
<p>i basically used [3] to make it work. the benefit is now that <strong>em1 is not used</strong> directly but the system uses <strong>br0</strong> to access the internet.</p>
<p><strong>PRO:</strong> the libvirt guests do get their own &#8216;mac address&#8217;, thus are separated from being able to see each others traffic.</p>
<h1>fedora core yum problems</h1>
<p>i also tried to install virtualbox and followed the instructions found on virtualbox.org but soon i had the problem that the virtualbox kernel modules won&#8217;t build and need &#8216;kernel-devel&#8217; but after installing the kernel-devel package using &#8216;yum install kernel-devel&#8217; <strong>there was a mismatch between &#8216;used kernel&#8217; and &#8216;kernel-devel&#8217; headers.</strong></p>
<h1>summary</h1>
<p>libvirt and the &#8216;virtual machine manager&#8217; are very nice:</p>
<ul>
<li>i like that it is so easy to start a virtual machine when the host machine boots.</li>
<li>i also like the &#8216;virtual machine manager&#8217; as it <strong>shows cpu/disk io/network io nicely</strong><br />
(but that is not limited to libvirt virtualizations).</li>
<li><strong>fedora core 15 beta</strong> was running quite nicely (except that it crashed while i was writing this article)<br />
so i can at least say: <strong>it ran for straight 6hours without crash ;P</strong></li>
</ul>
<h1>links</h1>
<p>[1] <a href="http://libvirt.org/">http://libvirt.org/</a></p>
<p>[2] <a href="http://blog.loxal.net/2009/04/how-to-convert-vdi-to-vmdk-converting.html">http://blog.loxal.net/2009/04/how-to-convert-vdi-to-vmdk-converting.html</a></p>
<p>[3] <a href="http://www.howtoforge.com/virtualization-with-kvm-on-a-fedora-11-server">http://www.howtoforge.com/virtualization-with-kvm-on-a-fedora-11-server</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/invalidmagic.wordpress.com/916/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/invalidmagic.wordpress.com/916/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/invalidmagic.wordpress.com/916/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/invalidmagic.wordpress.com/916/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/invalidmagic.wordpress.com/916/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/invalidmagic.wordpress.com/916/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/invalidmagic.wordpress.com/916/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/invalidmagic.wordpress.com/916/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/invalidmagic.wordpress.com/916/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/invalidmagic.wordpress.com/916/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/invalidmagic.wordpress.com/916/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/invalidmagic.wordpress.com/916/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/invalidmagic.wordpress.com/916/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/invalidmagic.wordpress.com/916/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=916&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://invalidmagic.wordpress.com/2011/05/20/converting-a-virtualbox-image-to-a-libvirt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/41bd958b820be8240c15687f848c6056?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">invalidmagic</media:title>
		</media:content>

		<media:content url="http://invalidmagic.files.wordpress.com/2011/05/libvirtlogo.png?w=150" medium="image">
			<media:title type="html">libvirtLogo</media:title>
		</media:content>
	</item>
		<item>
		<title>shinken 0.6 on gentoo</title>
		<link>http://invalidmagic.wordpress.com/2011/05/18/906/</link>
		<comments>http://invalidmagic.wordpress.com/2011/05/18/906/#comments</comments>
		<pubDate>Wed, 18 May 2011 08:58:07 +0000</pubDate>
		<dc:creator>invalidmagic</dc:creator>
				<category><![CDATA[gentoo]]></category>

		<guid isPermaLink="false">http://invalidmagic.wordpress.com/?p=906</guid>
		<description><![CDATA[motivation recently i had problems with the deployment of an experimental &#8216;shinken&#8216; [1],  a monitoring tool, on gentoo. most of the installation was &#8216;straightforward&#8217;. but i had a problem with livestatus in combination to &#8216;thruk&#8216; [2]. Note: i basically used the shinken guide [3] for fast and easy testing of shinken gentoo linux in virtualbox [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=906&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_165" class="wp-caption alignright" style="width: 130px"><a href="http://invalidmagic.files.wordpress.com/2009/11/200px-gentoo_linux_logo_matte-svg.png"><img class="size-full wp-image-165 " title="200px-Gentoo_Linux_logo_matte.svg" src="http://invalidmagic.files.wordpress.com/2009/11/200px-gentoo_linux_logo_matte-svg.png?w=500" alt="gentoo linux logo (copied from commons.wikipedia.org)"   /></a><p class="wp-caption-text">gentoo</p></div>
<h1>motivation</h1>
<p>recently i had problems with the deployment of an<strong> experimental</strong> &#8216;<strong>shinken</strong>&#8216; [1],  a monitoring tool, on gentoo. most of the installation was &#8216;straightforward&#8217;. but i had a problem with livestatus in combination to &#8216;<strong>thruk</strong>&#8216; [2].</p>
<p><strong>Note:</strong> i basically used the <strong>shinken guide [3]</strong> for fast and easy testing of shinken</p>
<ul>
<li>gentoo linux in virtualbox</li>
<li>shinken 0.6</li>
<li>thruk-1.0.3 (using the perl webserver; NOT using apache2)</li>
</ul>
<h1>dependencies</h1>
<p>this list contains packages which are not essentially (as the apache and mysql stuff) but it&#8217;s basically all packages i&#8217;ve installed to make it work, so just pick what you need:</p>
<blockquote><p>sys-apps/portage-2.1.9.25<br />
app-emulation/emul-linux-x86-baselibs-20100915-r1<br />
sys-kernel/gentoo-sources-2.6.36-r5<br />
sys-kernel/genkernel-3.4.10.907<br />
app-arch/xz-utils-4.999.9_beta<br />
sys-kernel/gentoo-sources-2.6.36-r5<br />
sys-boot/grub-0.97-r10<br />
sys-kernel/genkernel-3.4.10.907<br />
app-portage/eix-0.20.5<br />
net-misc/dhcpcd-5.2.8<br />
app-admin/eselect-vi-1.1.7-r1<br />
sys-libs/gpm-1.20.6<br />
app-admin/eselect-ctags-1.13<br />
app-portage/eix-0.20.5<br />
sys-apps/iproute2-2.6.35-r2<br />
dev-util/ctags-5.7<br />
app-editors/vim-core-7.3.50<br />
app-editors/vim-7.3.50<br />
app-vim/gentoo-syntax-20100215<br />
dev-python/setuptools-0.6.15<br />
dev-python/pyro-3.12<br />
dev-python/pyro-4.3<br />
app-admin/metalog-1<br />
virtual/logger-0<br />
net-libs/libpcap-1.1.1<br />
net-analyzer/nmap-5.21-r1<br />
app-editors/gentoo-editor-2<br />
virtual/pam-0<br />
net-mail/mailbase-1<br />
mail-mta/ssmtp-2.62-r8<br />
virtual/mta-0<br />
app-admin/sudo-1.7.4_p5<br />
dev-libs/oniguruma-5.9.2<br />
dev-db/mysql-init-scripts-1.2<br />
dev-libs/apr-1.4.4<br />
app-admin/eselect-php-0.6.2<br />
dev-libs/libmcrypt-2.5.8-r2<br />
dev-util/pkgconfig-0.25-r2<br />
sys-apps/ed-1.4<br />
dev-perl/Net-Daemon-0.43<br />
perl-core/Storable-2.20<br />
perl-core/File-Spec-3.31<br />
virtual/perl-Sys-Syslog-0.27<br />
dev-libs/libpcre-8.12<br />
dev-libs/apr-util-1.3.11<br />
virtual/perl-Storable-2.20<br />
virtual/perl-File-Spec-3.31<br />
app-admin/apache-tools-2.2.17<br />
dev-perl/PlRPC-0.202.0<br />
www-servers/apache-2.2.17<br />
dev-perl/DBI-1.615<br />
dev-db/mysql-5.0.91<br />
virtual/mysql-5.0<br />
dev-perl/DBD-mysql-4.01.7<br />
dev-lang/php-5.3.6<br />
media-libs/gd-2.0.35-r1<br />
dev-perl/GD-2.44<br />
dev-perl/yaml-0.71<br />
app-misc/screen-4.0.3-r4<br />
dev-perl/JSON-2.27<br />
perl-core/Compress-Raw-Zlib-2.024<br />
app-arch/unzip-6.0-r1<br />
app-vim/genutils-2.5<br />
virtual/perl-MIME-Base64-3.08<br />
dev-perl/URI-1.55<br />
app-misc/beep-1.2.2-r1<br />
dev-libs/eventlog-0.2.12<br />
app-text/build-docbook-catalog-1.4<br />
app-text/sgml-common-0.6.3-r5<br />
dev-libs/libgpg-error-1.10<br />
app-text/docbook-xsl-stylesheets-1.75.2<br />
dev-libs/libgcrypt-1.4.6<br />
dev-libs/libxslt-1.1.26-r1<br />
app-text/docbook-xml-dtd-4.3-r1<br />
dev-util/gtk-doc-am-1.16<br />
dev-libs/glib-2.28.6<br />
app-admin/syslog-ng-3.1.4<br />
net-analyzer/nagios-plugins-1.4.14-r2<br />
app-misc/realpath-1.15-r1<br />
app-portage/gentoolkit-0.2.4.6.1-r1<br />
dev-python/simplejson-2.1.3<br />
dev-db/sqlite-3.7.5<br />
dev-python/pysqlite-2.6.3</p></blockquote>
<h1>problem with livestatus</h1>
<p>i&#8217;ve missed a line in the README of shinken and therefore the livestatus service on port 50000 was not enabled. but there was no &#8216;good&#8217; error message mentioning what actually got wrong.</p>
<p>thruk reported (in the webinterface):</p>
<blockquote><p>No Backend available</p></blockquote>
<p>shinken reported (/var/lib/shinken/brokerd.log):</p>
<blockquote><p>[broker-1] Warning : the module type livestatus for Livestatus was not found in modules!</p></blockquote>
<p>But that was fixed after i installed:</p>
<ul>
<li>dev-db/sqlite-3.7.5</li>
<li>dev-python/pysqlite-2.6.3</li>
</ul>
<p>and restarted shinken.</p>
<h2>debugging</h2>
<p>look into:</p>
<ul>
<li>/etc/shinken/  (config files)</li>
<li>/var/lib/shinken (log files)</li>
</ul>
<p>optinally one can restart a single module of the shinken service with debugging:</p>
<blockquote><p>/etc/init.d/shinken-broker -d restart</p></blockquote>
<h2>solution</h2>
<h1>links</h1>
<p>[1] <a href="http://www.shinken-monitoring.org/">http://www.shinken-monitoring.org/</a></p>
<p>[2] <a href="http://www.thruk.org/">http://www.thruk.org/</a></p>
<p>[3] <a href="http://www.shinken-monitoring.org/wiki/shinken_10min_start">http://www.shinken-monitoring.org/wiki/shinken_10min_start</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/invalidmagic.wordpress.com/906/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/invalidmagic.wordpress.com/906/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/invalidmagic.wordpress.com/906/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/invalidmagic.wordpress.com/906/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/invalidmagic.wordpress.com/906/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/invalidmagic.wordpress.com/906/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/invalidmagic.wordpress.com/906/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/invalidmagic.wordpress.com/906/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/invalidmagic.wordpress.com/906/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/invalidmagic.wordpress.com/906/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/invalidmagic.wordpress.com/906/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/invalidmagic.wordpress.com/906/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/invalidmagic.wordpress.com/906/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/invalidmagic.wordpress.com/906/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=invalidmagic.wordpress.com&amp;blog=7740335&amp;post=906&amp;subd=invalidmagic&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://invalidmagic.wordpress.com/2011/05/18/906/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/41bd958b820be8240c15687f848c6056?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">invalidmagic</media:title>
		</media:content>

		<media:content url="http://invalidmagic.files.wordpress.com/2009/11/200px-gentoo_linux_logo_matte-svg.png" medium="image">
			<media:title type="html">200px-Gentoo_Linux_logo_matte.svg</media:title>
		</media:content>
	</item>
	</channel>
</rss>
