<?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>he1ix&#039; blog</title>
	<atom:link href="http://www.he1ix.org/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.he1ix.org</link>
	<description>my 2 cents</description>
	<lastBuildDate>Sun, 29 Aug 2010 17:45:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>recovering JPGs from a corrupted filesystem</title>
		<link>http://www.he1ix.org/?p=595</link>
		<comments>http://www.he1ix.org/?p=595#comments</comments>
		<pubDate>Sun, 29 Aug 2010 17:45:11 +0000</pubDate>
		<dc:creator>he1ix</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://www.he1ix.org/?p=595</guid>
		<description><![CDATA[	as usually, we took tons of pictures during our last vacation, so eventually the memory card (a SD card) ran out of space. luckily, I had another SD within reach, so we just swapped them and went on&#8230;
arriving at home, I started downloading the pictures. when I plugged in the second card, loads of error-messages [...]]]></description>
			<content:encoded><![CDATA[	<p>as usually, we took tons of pictures during our last vacation, so eventually the memory card (a SD card) ran out of space. luckily, I had another SD within reach, so we just swapped them and went on&#8230;<br />
arriving at home, I started downloading the pictures. when I plugged in the second card, loads of error-messages appeared, indicating a badly broken FAT32 filesystem. none of the newly taken pictures was there <img src='http://www.he1ix.org/wp/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  <span id="more-595"></span></p>

	<p>first, I tried to repair the filesystem using <em>fsck.vfat</em> (part of the <em>dosfstools</em> suite), without any success. so I finally just made a plain dump using <em>dd</em>, planning to work on the dump rather than on the real SD card.</p>

	<p>so I made my way to google and found <a href="http://sid.rstack.org/static/articles/d/i/g/Digital_photos_recovery.html">Cédric Blancher&#8217;s wiki entry about recovering digital photos</a>. lots of very useful information what to do:</p>

	<p><strong>1. examine dd-image with <em>hexedit</em></strong></p>

	<p>the starting signature for a <span class="caps">JPEG</span> file is <code>0xFFD8</code>, the corresponding end-signature is <code>0xFFD9</code>. so just looking for those chars gives you the hex-offsets of the start and end of a picture:</p>


<div class="wp_codebox"><table><tr id="p5958"><td class="code" id="p595code8"><pre class="bash" style="font-family:monospace;">hexedit image.dd
<span style="color: #7a0874; font-weight: bold;">&#91;</span>...<span style="color: #7a0874; font-weight: bold;">&#93;</span>
0385C000   FF D8 FF E1  <span style="color: #000000;">79</span> FE <span style="color: #000000;">45</span> <span style="color: #000000;">78</span>  <span style="color: #000000;">69</span> <span style="color: #000000;">66</span> 00 00  <span style="color: #000000;">49</span> <span style="color: #000000;">49</span> 2A 00  ....y.Exif..II<span style="color: #000000; font-weight: bold;">*</span>.
0385C010   08 00 00 00  0D 00 0F 01  02 00 0A 00  00 00 AA 00  ................
0385C020   00 00 <span style="color: #000000;">10</span> 01  02 00 09 00  00 00 B4 00  00 00 <span style="color: #000000;">12</span> 01  ................
0385C030   03 00 01 00  00 00 08 00  00 00 1A 01  05 00 01 00  ................
0385C040   00 00 BE 00  00 00 1B 01  05 00 01 00  00 00 C6 00  ................
0385C050   00 00 <span style="color: #000000;">28</span> 01  03 00 01 00  00 00 02 00  00 00 <span style="color: #000000;">31</span> 01  ..<span style="color: #7a0874; font-weight: bold;">&#40;</span>...........1.
0385C060   02 00 0A 00  00 00 CE 00  00 00 <span style="color: #000000;">32</span> 01  02 00 <span style="color: #000000;">14</span> 00  ..........2.....
0385C070   00 00 D8 00  00 00 <span style="color: #000000;">13</span> 02  03 00 01 00  00 00 02 00  ................
0385C080   00 00 <span style="color: #000000;">69</span> <span style="color: #000000;">87</span>  04 00 01 00  00 00 7C 02  00 00 A5 C4  ..i.......<span style="color: #000000; font-weight: bold;">|</span>.....
0385C090   07 00 D0 00  00 00 EC 00  00 00 D2 C6  07 00 <span style="color: #000000;">40</span> 00  ..............<span style="color: #000000; font-weight: bold;">@</span>.
0385C0A0   00 00 BC 01  00 00 D3 C6  07 00 <span style="color: #000000;">80</span> 00  00 00 FC 01  ................
0385C0B0   00 00 <span style="color: #000000;">20</span> <span style="color: #000000;">28</span>  00 00 <span style="color: #000000;">50</span> <span style="color: #000000;">61</span>  6E <span style="color: #000000;">61</span> <span style="color: #000000;">73</span> 6F  6E <span style="color: #000000;">69</span> <span style="color: #000000;">63</span> 00  .. <span style="color: #7a0874; font-weight: bold;">&#40;</span>..Panasonic.
0385C0C0   <span style="color: #000000;">44</span> 4D <span style="color: #000000;">43</span> 2D  <span style="color: #000000;">46</span> 5A <span style="color: #000000;">32</span> <span style="color: #000000;">38</span>  00 00 B4 00  00 00 01 00  DMC-FZ28........
<span style="color: #7a0874; font-weight: bold;">&#91;</span>...<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></td></tr></table></div>


	<p>so the beginning of the above file is at offset <code>0x0385C000</code>. unfortunately, there are some problems&#8230;</p>

	<p>first, the end-marker proved to be unreliable. to solve this, I just had a look at the size other pictures taken with this camera and discovered that the maximum filesize is roughly 5.1 MB. so just dumping 5.5 MB from the starting marker should make its job&#8230;<br />
second, the SD card contained a lot more <span class="caps">JPG</span>s than just those taken with this camera. so I decided to have a look at the <span class="caps">EXIF</span> data that follows the header right away and contains the name of the cam in plain text: &#8220;<span class="caps">DMC</span>-FZ28&#8221;. so just look for that string and then find the last occurence of the start-marker before&#8230;<br />
last, it is a pity job to extract the offsets manually and is at maximum to be meant for testing. to do such a test-extraction, you just need the offset and the size of the chunk you want to cut out (both values converted to the block-size used with <em>dd</em>) . so here&#8217;s how to do that manually (note that <em>bash</em> can convert from hex to decimal by using <code>$((...))</code>):</p>


<div class="wp_codebox"><table><tr id="p5959"><td class="code" id="p595code9"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">BS</span>=<span style="color: #000000;">1024</span>
<span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=image.dd <span style="color: #007800;">of</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>.jpg <span style="color: #007800;">bs</span>=<span style="color: #800000;">${BS}</span> <span style="color: #007800;">skip</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>0x0385C000<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${BS}</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">count</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">5529600</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${BS}</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></td></tr></table></div>


	<p><strong>2. extract offsets with <em>hexdump</em></strong></p>

	<p>since I didn&#8217;t want to do this for all pictures manually, I used <em>hexdump</em> and grep to go fishing for the offset-values. as mentioned above, I looked for the string identifying the camera model. figure out how much additional lines you need for the starting-marker (in this case it&#8217;s 12, hence the <code>grep -B 12</code>):</p>


<div class="wp_codebox"><table><tr id="p59510"><td class="code" id="p595code10"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">hexdump</span> <span style="color: #660033;">-C</span> image.dd  <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-B</span> <span style="color: #000000;">12</span> FZ28 <span style="color: #000000; font-weight: bold;">&gt;</span> markers</pre></td></tr></table></div>


	<p>in my case the starting markers were always at the beginning of a line, so extracting the offsets from the above file just works like this:</p>


<div class="wp_codebox"><table><tr id="p59511"><td class="code" id="p595code11"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'  ff d8 '</span> markers <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-c</span> <span style="color: #000000;">1</span>-<span style="color: #000000;">8</span> <span style="color: #000000; font-weight: bold;">&gt;</span> offsets</pre></td></tr></table></div>


	<p><strong>3. extract <span class="caps">JPEG</span>s using <em>dd</em> and the gathered offsets</strong></p>

	<p>for better readability, let&#8217;s define a simple function to dump the <span class="caps">JPEG</span>s:</p>


<div class="wp_codebox"><table><tr id="p59512"><td class="code" id="p595code12"><pre class="bash" style="font-family:monospace;">dumpjpg<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #007800;">BS</span>=<span style="color: #000000;">1024</span>
    <span style="color: #007800;">FNAME</span>=<span style="color: #800000;">${1}</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;dumping to <span style="color: #007800;">${FNAME}</span>&quot;</span>
    <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=..<span style="color: #000000; font-weight: bold;">/</span>TRIFOO.dd <span style="color: #007800;">of</span>=<span style="color: #800000;">${FNAME}</span>.jpg <span style="color: #007800;">bs</span>=<span style="color: #800000;">${BS}</span> <span style="color: #007800;">skip</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #800000;">${1}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${BS}</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">count</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">5529600</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${BS}</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">status</span>=noxfer
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>


	<p>then, do the actual work:</p>


<div class="wp_codebox"><table><tr id="p59513"><td class="code" id="p595code13"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> offset <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">cat</span> offsets<span style="color: #7a0874; font-weight: bold;">&#41;</span> ; <span style="color: #000000; font-weight: bold;">do</span>
    dumpjpg 0x<span style="color: #800000;">${offset}</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>


	<p>I <strong>love</strong> Linux <img src='http://www.he1ix.org/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

	<p>Having succeeded in recovering approximately 100 files this way, I just discovered (on <a href="http://www.ubuntugeek.com/recover-deleted-files-with-foremostscalpel-in-ubuntu.html">ubuntugeek.org</a>) the existance of special tools that do exactly the same:</p>


<div class="wp_codebox"><table><tr id="p59514"><td class="code" id="p595code14"><pre class="bash" style="font-family:monospace;">foremost <span style="color: #660033;">-q</span> <span style="color: #660033;">-t</span> jpg <span style="color: #660033;">-i</span> image.dd</pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://www.he1ix.org/?feed=rss2&amp;p=595</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>installing redmine on debian/lenny using mod_passenger</title>
		<link>http://www.he1ix.org/?p=572</link>
		<comments>http://www.he1ix.org/?p=572#comments</comments>
		<pubDate>Thu, 05 Aug 2010 16:57:17 +0000</pubDate>
		<dc:creator>he1ix</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[devel]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.he1ix.org/?p=572</guid>
		<description><![CDATA[	this is based on redmine-1.0.0

	we need a more recent version of rails and rubygems than those shipped with lenny, so first add the backports-repository to your sources.list:


deb http://www.backports.org/debian lenny-backports main contrib non-free


	then, update your package list:


sudo apt-get update


	and install the above mentioned packages


sudo aptitude -t lenny-backports install rails rubygems


	in addition, librmagick and ruby&#8217;s mysql bindings [...]]]></description>
			<content:encoded><![CDATA[	<p>this is based on redmine-1.0.0</p>

	<p>we need a more recent version of <code>rails</code> and <code>rubygems</code> than those shipped with lenny, so first add the backports-repository to your sources.list:</p>

<pre>
deb http://www.backports.org/debian lenny-backports main contrib non-free
</pre>

	<p>then, update your package list:</p>


<div class="wp_codebox"><table><tr id="p57225"><td class="code" id="p572code25"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update</pre></td></tr></table></div>


	<p>and install the above mentioned packages<span id="more-572"></span></p>


<div class="wp_codebox"><table><tr id="p57226"><td class="code" id="p572code26"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #660033;">-t</span> lenny-backports <span style="color: #c20cb9; font-weight: bold;">install</span> rails rubygems</pre></td></tr></table></div>


	<p>in addition, librmagick and ruby&#8217;s mysql bindings are required:</p>


<div class="wp_codebox"><table><tr id="p57227"><td class="code" id="p572code27"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> librmagick-ruby1.8 libmysql-ruby1.8</pre></td></tr></table></div>


	<p>next, we need an additional gem called <code>rack</code> which is not available as a debian package in the required version (has to be 1.0.1 sharp). thus, we install it locally in a separate directory below <code>/opt/</code>. so lets create a directory for the gems, set the path accordingly and install the gem:</p>


<div class="wp_codebox"><table><tr id="p57228"><td class="code" id="p572code28"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby_gems
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">whoami</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby_gems
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GEM_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby_gems
gem <span style="color: #c20cb9; font-weight: bold;">install</span> rack <span style="color: #660033;">-v</span>=1.0.1</pre></td></tr></table></div>


	<p>create a database and a corresponding user in mysql:</p>


<div class="wp_codebox"><table><tr id="p57229"><td class="code" id="p572code29"><pre class="mysql" style="font-family:monospace;"><a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=CREATE"><span style="color: #990099; font-weight: bold;">CREATE</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DATABASE"><span style="color: #990099; font-weight: bold;">DATABASE</span></a> redmine CHARACTER <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=SET"><span style="color: #990099; font-weight: bold;">SET</span></a> utf8<span style="color: #000033;">;</span>
<a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=CREATE"><span style="color: #990099; font-weight: bold;">CREATE</span></a> <a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/information-functions.html"><span style="color: #000099;">USER</span></a> <span style="color: #008000;">'redmine'</span>@<span style="color: #008000;">'localhost'</span> IDENTIFIED BY <span style="color: #008000;">'my<span style="color: #008080; font-weight: bold;">_</span>password'</span><span style="color: #000033;">;</span>
<a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=GRANT"><span style="color: #990099; font-weight: bold;">GRANT</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ALL"><span style="color: #990099; font-weight: bold;">ALL</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=PRIVILEGES"><span style="color: #990099; font-weight: bold;">PRIVILEGES</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ON"><span style="color: #990099; font-weight: bold;">ON</span></a> redmine.<span style="color: #CC0099;">*</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=TO"><span style="color: #990099; font-weight: bold;">TO</span></a> <span style="color: #008000;">'redmine'</span>@<span style="color: #008000;">'localhost'</span><span style="color: #000033;">;</span></pre></td></tr></table></div>


	<p>of course we need to download redmine itself, which can be found on <a href="http://rubyforge.org/frs/?group_id=1850">rubyforge.org</a>. we&#8217;ll put it somewhere in <code>/opt/</code> as well, so:</p>


<div class="wp_codebox"><table><tr id="p57230"><td class="code" id="p572code30"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> xzf redmine-1.0.0.tar.gz
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> redmine-1.0.0 <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>redmine
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>config
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-v</span> database.yml.example database.yml
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-v</span> email.yml.example email.yml
<span style="color: #c20cb9; font-weight: bold;">vim</span> database.yml
<span style="color: #c20cb9; font-weight: bold;">vim</span> email.yml
rake generate_session_store
<span style="color: #007800;">RAILS_ENV</span>=production rake db:migrate
<span style="color: #007800;">RAILS_ENV</span>=production rake redmine:load_default_data
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> root.root .
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data.www-data files log tmp public<span style="color: #000000; font-weight: bold;">/</span>plugin_assets
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> root.root <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby_gems
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>redmine<span style="color: #000000; font-weight: bold;">/</span>public<span style="color: #000000; font-weight: bold;">/</span> redmine</pre></td></tr></table></div>


	<p>make sure the apache modules mod_rewrite and mod_passenger are enabled, then edit your apache virtualhost configuration and add the following section:</p>


<div class="wp_codebox"><table><tr id="p57231"><td class="code" id="p572code31"><pre class="apache" style="font-family:monospace;">    <span style="color: #adadad; font-style: italic;"># &lt;redmine stuff&gt;</span>
    &lt;<span style="color: #000000; font-weight:bold;">Directory</span> /var/www/redmine&gt;
        RailsEnv production
        RailsBaseURI /redmine
        <span style="color: #00007f;">Options</span> -MultiViews
        <span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">all</span>
    &lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;
    <span style="color: #adadad; font-style: italic;"># &lt;/redmine stuff&gt;</span></pre></td></tr></table></div>


	<p>since we have installed the rack-gem in a non-standard location, we have to pass this information along to the ruby-process. in an interactive shell-session, this can be done by simply exporting the relevant variable(s). since our ruby is called by apache, we have to append this into <code>/etc/apache/envvars</code> (see <a href="http://stackoverflow.com/questions/79474/setting-environment-variables-for-phusion-passenger-applications">stackoverflow #79474</a> and <a href="http://blog.phusion.nl/2009/06/17/phusion-passenger-223-released-bug-fix-edition/">blog-entry 223 on phusion</a> for more information):</p>


<div class="wp_codebox"><table><tr id="p57232"><td class="code" id="p572code32"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-s</span> <span style="color: #660033;">-H</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'export GEM_HOME=/opt/ruby_gems'</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache<span style="color: #000000; font-weight: bold;">/</span>envvars
<span style="color: #7a0874; font-weight: bold;">exit</span></pre></td></tr></table></div>


	<p>now the last obstacle is the way phusion passenger handles privileges for the script to call: it runs a Rails application as the owner of environment.rb (see <a href="http://rubyforge.org/tracker/index.php?func=detail&#038;aid=23105&#038;group_id=126&#038;atid=577">rubyforge issue #23105</a> for details), so we need to do a final chown on that file to make sure redmine has write-access to the files owned by www-data (this is certainly a security-issue, so creating a separate user for redmine instead of using www-data is by far the more elegant solution&#8230;)</p>


<div class="wp_codebox"><table><tr id="p57233"><td class="code" id="p572code33"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> www-data.www-data config<span style="color: #000000; font-weight: bold;">/</span>environment.rb</pre></td></tr></table></div>


	<p>that should be all, now restart apache and navigate to your redmine-installation:</p>


<div class="wp_codebox"><table><tr id="p57234"><td class="code" id="p572code34"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> apache2ctl graceful</pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://www.he1ix.org/?feed=rss2&amp;p=572</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>adjusting temp- and swap-path in GIMPportable on windows</title>
		<link>http://www.he1ix.org/?p=554</link>
		<comments>http://www.he1ix.org/?p=554#comments</comments>
		<pubDate>Mon, 02 Aug 2010 16:43:32 +0000</pubDate>
		<dc:creator>he1ix</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[portable]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.he1ix.org/?p=554</guid>
		<description><![CDATA[	By default, GIMP-portable tries to use a folder below the one it has been started from for temp and swap. That&#8217;s just fine if you use it on your usb-stick, but it bugs you with an error message if GIMP is supplied from a read-only network drive: &#8220;Unable to open a test swap file.&#8221;

	This can [...]]]></description>
			<content:encoded><![CDATA[	<p>By default, <span class="caps">GIMP</span>-portable tries to use a folder below the one it has been started from for temp and swap. That&#8217;s just fine if you use it on your usb-stick, but it bugs you with an error message if <span class="caps">GIMP</span> is supplied from a read-only network drive: &#8220;Unable to open a test swap file.&#8221;</p>

	<p>This can be fixed by editing (or creating) the system-wide <code>gimprc</code> file, which is located in <code>\Data\settings\</code> &#8230;</p>

	<p>First, I tried to use the windows-style <code>%APPDATA%</code> variable, but <span class="caps">GIMP</span> does not interpret it correctly. Digging a bit in the <a href="http://opensourcepack.blogspot.com/2010_01_01_archive.html">web</a> revealed the way how to do it, they have to be used in shell-style including curly brackets like this:</p>


<div class="wp_codebox"><table><tr id="p55436"><td class="code" id="p554code36"><pre class="python" style="font-family:monospace;"><span style="color: black;">&#40;</span>temp-path <span style="color: #483d8b;">&quot;${APPDATA}<span style="color: #000099; font-weight: bold;">\\</span>gimp-2.6&quot;</span><span style="color: black;">&#41;</span>
<span style="color: black;">&#40;</span>swap-path <span style="color: #483d8b;">&quot;${APPDATA}<span style="color: #000099; font-weight: bold;">\\</span>gimp-2.6&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: black;">&#40;</span>undo-size 512M<span style="color: black;">&#41;</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://www.he1ix.org/?feed=rss2&amp;p=554</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>andLinux &#8220;Cannot open display&#8221; problems&#8230;</title>
		<link>http://www.he1ix.org/?p=551</link>
		<comments>http://www.he1ix.org/?p=551#comments</comments>
		<pubDate>Mon, 19 Jul 2010 16:13:41 +0000</pubDate>
		<dc:creator>he1ix</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[investigate]]></category>
		<category><![CDATA[virtual]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.he1ix.org/?p=551</guid>
		<description><![CDATA[	make it short:

	-&#62; open windows firewall, tcp port 6000
-&#62; adjust the Xming startup command, include a full path for the logfile, e.g. &#8220;C:\Temp\Xming.log&#8221; instead of a filename only]]></description>
			<content:encoded><![CDATA[	<p>make it short:</p>

	<p>-&gt; open windows firewall, tcp port 6000<br />
-&gt; adjust the Xming startup command, include a full path for the logfile, e.g. &#8220;C:\Temp\Xming.log&#8221; instead of a filename only</p>]]></content:encoded>
			<wfw:commentRss>http://www.he1ix.org/?feed=rss2&amp;p=551</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitoring MySQL queries</title>
		<link>http://www.he1ix.org/?p=542</link>
		<comments>http://www.he1ix.org/?p=542#comments</comments>
		<pubDate>Wed, 12 May 2010 15:49:27 +0000</pubDate>
		<dc:creator>he1ix</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://www.he1ix.org/?p=542</guid>
		<description><![CDATA[	Monitor All SQL Queries in MySQL is a very nice (though short) posting about how to debug and monitor what&#8217;s going on inside your DBMS. There&#8217;s supposed to exist a similar tool for MSSQL called &#8220;Profiler&#8221;.]]></description>
			<content:encoded><![CDATA[	<p><a href="http://www.howtogeek.com/howto/database/monitor-all-sql-queries-in-mysql/">Monitor All <span class="caps">SQL</span> Queries in MySQL</a> is a very nice (though short) posting about how to debug and monitor what&#8217;s going on inside your <span class="caps">DBMS</span>. There&#8217;s supposed to exist a similar tool for <span class="caps">MSSQL</span> called &#8220;Profiler&#8221;.</p>]]></content:encoded>
			<wfw:commentRss>http://www.he1ix.org/?feed=rss2&amp;p=542</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how is the nautilus thumbnail-filename related with the file it belongs to?</title>
		<link>http://www.he1ix.org/?p=538</link>
		<comments>http://www.he1ix.org/?p=538#comments</comments>
		<pubDate>Thu, 06 May 2010 19:41:56 +0000</pubDate>
		<dc:creator>he1ix</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.he1ix.org/?p=538</guid>
		<description><![CDATA[	found it somewhere in ubuntuforums.org:


echo -n 'file:///path/to/file/name.jpg' &#124; md5sum


]]></description>
			<content:encoded><![CDATA[	<p>found it somewhere in ubuntuforums.org:</p>


<div class="wp_codebox"><table><tr id="p53838"><td class="code" id="p538code38"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">'file:///path/to/file/name.jpg'</span> <span style="color: #000000; font-weight: bold;">|</span> md5sum</pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://www.he1ix.org/?feed=rss2&amp;p=538</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>list obsolete and/or locally installed packages in debian/ubuntu</title>
		<link>http://www.he1ix.org/?p=534</link>
		<comments>http://www.he1ix.org/?p=534#comments</comments>
		<pubDate>Mon, 03 May 2010 17:29:43 +0000</pubDate>
		<dc:creator>he1ix</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.he1ix.org/?p=534</guid>
		<description><![CDATA[	aptitude has a specific list-category to display those when using the curses-GUI, but I do not like it. fortunately, you can use the search-command from the cli-interface with the appropriate search-pattern:


aptitude search &#34;?obsolete&#34;


	or as a shorthand:


aptitude search &#34;~o&#34;


	See the aptitude Reference Guide for more information.]]></description>
			<content:encoded><![CDATA[	<p>aptitude has a specific list-category to display those when using the curses-<span class="caps">GUI</span>, but I do not like it. fortunately, you can use the search-command from the cli-interface with the appropriate search-pattern:</p>


<div class="wp_codebox"><table><tr id="p53441"><td class="code" id="p534code41"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> search <span style="color: #ff0000;">&quot;?obsolete&quot;</span></pre></td></tr></table></div>


	<p>or as a shorthand:</p>


<div class="wp_codebox"><table><tr id="p53442"><td class="code" id="p534code42"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> search <span style="color: #ff0000;">&quot;~o&quot;</span></pre></td></tr></table></div>


	<p>See the <a href="http://algebraicthunk.net/~dburrows/projects/aptitude/doc/en/ch02s03.html">aptitude Reference Guide</a> for more information.</p>]]></content:encoded>
			<wfw:commentRss>http://www.he1ix.org/?feed=rss2&amp;p=534</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>enable debug logging in mozilla lightning</title>
		<link>http://www.he1ix.org/?p=532</link>
		<comments>http://www.he1ix.org/?p=532#comments</comments>
		<pubDate>Mon, 03 May 2010 16:01:12 +0000</pubDate>
		<dc:creator>he1ix</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[lightning]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://www.he1ix.org/?p=532</guid>
		<description><![CDATA[	add the following lines (or adjust if already there) in your thunderbird-profile&#8217;s &#8220;prefs.js&#8221;


user_pref(&#34;calendar.debug.log&#34;, true);
user_pref(&#34;calendar.debug.log.verbose&#34;, true);
]]></description>
			<content:encoded><![CDATA[	<p>add the following lines (or adjust if already there) in your thunderbird-profile&#8217;s &#8220;prefs.js&#8221;</p>

<pre>
user_pref(&quot;calendar.debug.log&quot;, true);
user_pref(&quot;calendar.debug.log.verbose&quot;, true);
</pre>]]></content:encoded>
			<wfw:commentRss>http://www.he1ix.org/?feed=rss2&amp;p=532</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>lightning-plugin for ubuntu&#8217;s 64-bit thunderbird in 10.04 [updated]</title>
		<link>http://www.he1ix.org/?p=530</link>
		<comments>http://www.he1ix.org/?p=530#comments</comments>
		<pubDate>Mon, 03 May 2010 15:30:23 +0000</pubDate>
		<dc:creator>he1ix</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[caldav]]></category>
		<category><![CDATA[groupware]]></category>
		<category><![CDATA[lightning]]></category>
		<category><![CDATA[thunderbird]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.he1ix.org/?p=530</guid>
		<description><![CDATA[	http://www.secudb.de/~seuffert/mozilla/

	UPDATE:

	http://releases.mozilla.org/pub/mozilla.org/calendar/lightning/releases/1.0b1/contrib/linux-x86_64/]]></description>
			<content:encoded><![CDATA[	<p>http://www.secudb.de/~seuffert/mozilla/</p>

	<p><span class="caps">UPDATE</span>:</p>

	<p>http://releases.mozilla.org/pub/mozilla.org/calendar/lightning/releases/1.0b1/contrib/linux-x86_64/</p>]]></content:encoded>
			<wfw:commentRss>http://www.he1ix.org/?feed=rss2&amp;p=530</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>where to locate purchased music on an iPod Touch / iPhone</title>
		<link>http://www.he1ix.org/?p=528</link>
		<comments>http://www.he1ix.org/?p=528#comments</comments>
		<pubDate>Thu, 29 Apr 2010 14:05:34 +0000</pubDate>
		<dc:creator>he1ix</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[iPod]]></category>

		<guid isPermaLink="false">http://www.he1ix.org/?p=528</guid>
		<description><![CDATA[	it&#8217;s in /var/mobile/Media/Purchases/]]></description>
			<content:encoded><![CDATA[	<p>it&#8217;s in /var/mobile/Media/Purchases/</p>]]></content:encoded>
			<wfw:commentRss>http://www.he1ix.org/?feed=rss2&amp;p=528</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
