<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>just-imho: tech</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/" />
    <link rel="self" type="application/atom+xml" href="http://tech.just-imho.net/atom.xml" />
    <id>tag:tech.just-imho.net,2011-12-03://2</id>
    <updated>2012-01-05T12:12:25Z</updated>
    <subtitle>a blog about Linux and Open Source in general</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 5.12</generator>

<entry>
    <title>Bringing GVFS to a good use</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/2012/01/bringing-gvfs-to-a-good-use.html" />
    <id>tag:tech.just-imho.net,2012://2.350</id>

    <published>2012-01-05T12:07:46Z</published>
    <updated>2012-01-05T12:12:25Z</updated>

    <summary>One of the GNOME features I really liked since the beginning of my GNOME usage is the ability to mount various network file system by a few clicks and keystrokes. It enables me to quickly access NFS shares or files...</summary>
    <author>
        <name>Patrick Schönfeld</name>
        <uri>http://www.just-imho.net</uri>
    </author>
    
        <category term="System Administration" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="debian" label="Debian" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="gnome" label="Gnome" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="gvfs" label="GVFS" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://tech.just-imho.net/">
        <![CDATA[One of the GNOME features I really liked since the beginning of my GNOME usage is the ability to mount various network file system by a few clicks and keystrokes. It enables me to quickly access NFS shares or files via SFTP. But so far these mounts weren't actually mounts in a classical sense, so they were only rudimentary useful.<br /><br />As a user who often works with terminals I was always halfway happy with that feature and halfway not:<br /><br />- Applications have to be aware and enabled to make use of that feature, so its often neccessary to workaround problems (e.g. movie players not able to open a file on a share)<br />- No shell access to files<br /><br />Previously this GNOME feature was realised with an abstraction layer called <a href="http://en.wikipedia.org/wiki/GnomeVFS">GNOME VFS</a>, which all applications needed to use if they wanted to provide access to the "virtual mounts". It did no efforts to actually re-use common mechanisms of Un*x-like systems, like mount points. So it were doomed to fail at certain degrees.<br /><br />Today GNOME uses a new mechanism, called <a href="http://en.wikipedia.org/GVFS">GVFS</a>. Its realized by a shared library and daemon components communicating over DBUS. At first glance it does not seem to change anything, so I was rather disappointed. But then I heard rumors, that Ubuntu was actually making these mounts available in a special mount point in ~/.gvfs.<br />My Debian GNOME installation were not.<br /><br />So I investigated a bit and found evidence about a daemon called <i>gvfs-fuse-daemon</i>, which eventually is handling that. After that I figured this daemon to be in a package called <a href="http://packages.debian.org/search?keywords=gvfs-fuse">gvfs-fuse</a> and learned that installing it and restarting my GNOME session is actually all needed to do.<br />Now getting shell access to my GNOME "Connect to server" mounts is actually possible, which makes these mounts really useful after all. Only thing to find out is, if e.g. the video player example now works from Nautilus. But if it doesn't I'm still able to use it via a shell.<br /><br /><i>The solution is quiet obvious, on the one side. But totally non-obvious on the other.</i><br /><br />A common user eventually will not find that solutin without aid. After all the package name does not really suggest what the package is used for, since its referring to technologies instead of the problem it solves. Which is understandable. What I don't understand is, why this package is not a dependency of the gnome meta package. But I haven't yet asked the maintainer, so I cannot really blame anybody.<br /><br />However: Now GVFS is actually useful. ]]>
        
    </content>
</entry>

<entry>
    <title>Why Gnome3 sucks (for me)</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/2011/12/why-gnome3-sucks-for-me.html" />
    <id>tag:tech.just-imho.net,2011://2.297</id>

    <published>2011-12-11T09:08:00Z</published>
    <updated>2011-12-16T09:16:32Z</updated>

    <summary>When I started using Linux, I started with a desktop environment (KDE) and then tried a lot of (standalone) window managers, including but not limited to Enlightenment, Blackbox, Fluxbox and Sawfish. But I was never really satisfied as it felt...</summary>
    <author>
        <name>Patrick Schönfeld</name>
        <uri>http://www.just-imho.net</uri>
    </author>
    
        <category term="System Administration" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="awesome" label="Awesome" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="gnome" label="Gnome" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="gnome3" label="Gnome3" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="xmonad" label="Xmonad" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://tech.just-imho.net/">
        <![CDATA[When I started using Linux, I started with a desktop environment (KDE) and then tried a lot of (standalone) window managers, including but not limited to Enlightenment, Blackbox, Fluxbox and Sawfish. But I was never really satisfied as it felt as if something was missing. <br />It then came, that I became a user of a desktop environment again. Now I have been a <a href="http://www.gnome.org">GNOME</a> user for at least five years.<div><br /></div><div>Among the users of desktop environments, I'm probably not a typical user. In 2009 my setup drifted from a more or less standard GNOME 2.3 to a combination of GNOME and a tiling window manager, which I called <a href="http://tech.just-imho.net/2009/04/gnomad-gnome-xmonad.html">Gnomad</a>, as a logical continuation of something I've done for a long time since using computers: Simplifying tasks, which are not my main business.<br />I just didn't want to care about the hundred techniques to auto mount an USB stick or similar tasks, which are handed just fine by a common Desktop Environment. And I didn't want to care about arranging windows, because after all the arrangement of my windows was always more or less the same.</div><div><br /></div><div>But there were rumors that GNOME3 significantly changed the user experience and I wanted to give it a try at some point in the future. This try was forced by latest updates in Debian unstable, so I tested it for some days.<br /><br /><b>Day 1: Getting to know each other</b><br />My first day was GNOME3 was a non-working-day. When I'm at home I'm mostly using my computer for some chatting and surfing in the web, so I don't have great demands on the <br />Window manager/Desktop Environment. <br />Accordingly the very first experience with GNOME3 was mostly a good one, except some minor issues.<br />The first thing to notice in a positive way, is the activities screen. I guess this one is inspired by Mac Exposé, but its nevertheless a nice thing, as it provides an overview over opened applications.<br />Apart from that, its possible to launch applications from there. The classical application menu is gone, but this one is better. One can either choose with the mouse or start typing the applications name and it will incrementally search for it and show it immediately. Hitting Enter is enough to launch the application.<br />Additionally, on the left, there is a launcher for your favorite applications.<br /><br /><i>This one lead to the first question mark above my head.</i></div><div><br />I had opened a terminal via this launcher and now wanted to open another terminal, after I switched to a different workspace.</div><div>So I just clicked it again and had to notice that GNOME developers and I have a different perception, of whats intuitive, because that click<br />led me back to the terminal on the first workspace. It took me some minutes to realize how I'm able to start a second terminal, by just right clicking on the icon and click on Open new window or similar.<br /><br /><b>Day 2: Doing productive work</b></div><div>The next day was a work day and I was on a customer appointment to do support/maintenance tasks. On this appointments my notebook is not my primary work machine and so I could softly go over to using GNOME3 when doing productive work.<br />I can say that it worked, although I soon started to miss some keystrokes which I'm used to. Like switching workspaces with Meta4+Number or at least switch workspaces by cycling through them with STRG+Alt+Left and Right Arrow Keys. While the first is a shortcut specific to my GNOmad setup, the latter is something I knew back from the good old Gnome2 days. <br />It just vanished from the default keybindings and did nothing. Appearently, as I learned afterwards, it has been decided to use the Up/Down arrow keys instead.<br /><br />While for new users this will not be a problem at all, this is really hard for someone using GNOME for about 5 years as these are keystrokes one is really used to.<br /><br /><b>Day 3: Going mulithead</b></div><div><b><br /></b></div><div>The appointment ended on the third day at afternoon, so when I came back into the office, I had the chance to test the whole thing in my usual work environment. At office I have my notebook attached to a docking station which has a monitor attached to it. So usually I work in dual head mode, with my primary work screen being the bigger external screen.<br /><br /><i>That was the point, where GNOME3 became painful.</i></div><div><i><br /></i></div><div>At first everything was fine. GNOME3 detected the second monitor and made it available for use with the correct resolution. But things started to become ugly, when I actually wanted to work with it. GNOME3 decided that the internal screen is the primary screen, so the panel (or what has stood around from it) was on that screen. I can live with that, as thats basically the same with GNOME2, but the question was: How to start an application in a way that its started on the big screen?<br />I knew that I couldn't just use the keystrokes I'm used to, like Meta4+p, which were bound to launching dmenu in my GNOmad setup, as I knew that I was not running GNOmad at present. So I thought hard and remembered that GNOME had a run dialog itself, bound to Alt+F2. Relieved I noticed, that this shortcut had not gone away. I typed 'chromium' and waited. A message appeared telling me that the file was not found. Okay. No, wait. What? I did not uninstall it, so I guess it should be there.<br />I tried several other applications and all were told not to be available. Most likely this is a bug and bugs happen but this was really serious for me.<br /><br />Another approach was to use the activity screen. At first I used it manually, by moving the mouse to there, launch chromium (surprise, surprise, it was still there) and moved it to the right screen, because I haven't found a shorter way to do that. There must be a better way to that, I thought and so I googled. Actually there are more then one better way to do it.</div><div><br /></div><div><ol><li>There is a hidden hot spot in the corner of the second screen, too. If one finds and moves the mouse over it, the activity screen will open on the primary monitor and on the secondary monitor, but the application list is only one the first. One can now type what he wants to start, hit Enter and Tada its on the screen where my mouse is. Not very intuitive, in my opinion, and I really would prefer if I had the same level of choice on the second screen.</li><li>I can hit Meta4 and its opening the activitiy screen. From there everything is the same as described above.</li></ol><div><br /></div><div>There were many other small quirks that disturbed me, like that the desktop has vanished away (I used it seldom, but it was irritating that it wasn't there anymore), shortcuts I were missing and so on.&nbsp;&nbsp;lot of this is really specific to me being used to my previous setup, but I can't help myself but I really need those little helpers.<br /><br />So, at some point I decided to go back to GNOmad again, knowing that I will run into the next problem again, because I would have to permanently disable the new gnome3 mode and instead launch GNOME in the fallback mode. Luckily that is as easy as typing the following in a terminal</div></div><div><br /></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>gsettings set org.gnome.desktop.session session-name 'gnome-fallback'</div></blockquote><div><br /></div><div>I quickly got this working again, but had to notice another cruel thing in GNOME3, that even disturbed my GNOmad experience. GNOME3 now binds to Meta4+p to a function, which switches internal/extern monitor setting, and now that is a real PITA.<br /><br />From this point on another journey began, that eventually ended in switch to a Gnome/Awesome setup but this is a different story for a different time.</div>]]>
        
    </content>
</entry>

<entry>
    <title>Migrating from blogspot to Movable Type</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/2011/12/migrating-from-blogspot-to-movable-type.html" />
    <id>tag:tech.just-imho.net,2011://2.296</id>

    <published>2011-12-10T16:56:47Z</published>
    <updated>2011-12-10T21:02:08Z</updated>

    <summary><![CDATA[A while ago I decided to migrate my existing blogspot blog to an own domain and webspace again.&nbsp;My reasoning was mostly, that blogspot lacked some features, which I'd like to have in my blog.Additionally, my requirements have changed a bit...]]></summary>
    <author>
        <name>Patrick Schönfeld</name>
        <uri>http://www.just-imho.net</uri>
    </author>
    
        <category term="System Administration" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="blog" label="Blog" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype" label="Movable Type" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://tech.just-imho.net/">
        <![CDATA[A while ago I decided to migrate my existing blogspot blog to an own domain and webspace again.&nbsp;My reasoning was mostly, that blogspot lacked some features, which I'd like to have in my blog.<br />Additionally, my requirements have changed a bit since I originally moved to blogspot and, last but not least, Blogspot was a compromise anyway.<br /><br /><div>So I started re-evaluating a possible software platform for my blog. In my numerous previous attempts to start blogging (there were several blogs of me in the internet since at least 2006), before I moved to Blogspot, I used Wordpress. But there were quiet some reasons against it, one of the biggest concerns being its security history. Also, while I worked a lot with PHP in the past years, I have developed a serious antipathy against software written in PHP, which I couldn't just ignore.<br /><br />In the end, the decision fell on <a href="http://www.movabletype.org">Movable Type</a>, because its written in Perl, which is the language I prefer for most of my projects, because its features were matching my wishes (mostly) and because I heard some good opinions about it. Also it is used by my employer for our <a href="http://blog.credativ.com">company blog</a>.<br /><br /><b>So the next question was: How to migrate?</b><br /><br />I decided to use Movable Type 5, although, at present, it seems not to be the communities choice. At least the list of plugins supporting MT5 is really short. Foremost there was no plugin to import blogger posts, which, after all, was the most important thing about the migration.<br />Luckily there is such a plugin for Movable Type and so I basically did the following:</div><div><br /></div><div><ol><li>Install Movable Type 4</li><li>Install the <a href="http://plugins.movabletype.org/bloggerimporter/">Blogger Import Plugin</a></li><li>Import posts (it supports either the export file of blogger or directly importing posts via the Google API)</li><li>Upgrade to Movable Type 5</li><li>Check the result</li></ol><div><b>Check the results, or: The missing parts</b></div></div><div><br />Obviously such an import is not perfect. Some posts contain images or in-site links. The importer is not able to detect that and honestly it would have a hard time to track that anyway.<br />So as soon as content is migrated, its time to look for the missing parts.<br /><br />The process to find missing parts is basically very easy and common&nbsp;among&nbsp;the various missing parts:<br />Just search for your blogspot URL via the Search &amp; Replace option in the Movable Type administration.<br /><br /></div><div>Now how to fix that? For links its quiet easy (although I forgot about them in the first run), as long as the permalinks have kept the same scheme.<br />In my case that is the case, since I decided to use the Preferred Archive option "Entry" in the blog settings for the new blog and the default (if there is an option, because I don't know)<br />in Blogspot. The importer does import the Basename of the document, so fixing links is just a matter of replacing the domain part of the URL.<br /><br />For images its some more work. One has to get the images somehow and upload them in Movable Type. Eventually it then boils down to search and replace, but I decided to do that manually, since I only have a very low number of images in my posts so far.<br /><br /><b></b>After that I did everything else, which is not specific to the migration, like picking a template, modifying it to my wishes, considering the additions of plugin etc.<br />And here we are. There were some issues during the migration, which I haven't handled here. I will blog about them another time.</div>]]>
        <![CDATA[<br />]]>
    </content>
</entry>

<entry>
    <title>PHP and big numbers</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/2011/12/php-and-big-numbers.html" />
    <id>tag:tech.just-imho.net,2011://2.67</id>

    <published>2011-12-01T07:23:00Z</published>
    <updated>2011-12-10T20:18:34Z</updated>

    <summary>One would expect, that one of the most used script languages of the world would be ableto do proper comparisons of numbers, even big numbers, right?Well, PHP is not such a language, at least not on 32bit systems.Given a script...</summary>
    <author>
        <name>Patrick Schönfeld</name>
        <uri>http://www.just-imho.net</uri>
    </author>
    
        <category term="Programming" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="coding" label="Coding" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="debian" label="Debian" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="php" label="PHP" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="wtf" label="WTF" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://tech.just-imho.net/">
        <![CDATA[<p>One would expect, that one of the most used script languages of the world would be ableto do proper comparisons of numbers, even big numbers, right?Well, PHP is not such a language, at least not on 32bit systems.Given a script like this:<br /></p><blockquote></blockquote><blockquote class="tr_bq"><blockquote class="tr_bq">&lt;?</blockquote><blockquote class="tr_bq">$t1 = "1244431010010381771";</blockquote><blockquote class="tr_bq">$t2 = "1244431010010381772";</blockquote><blockquote class="tr_bq">if ($t1 == $t2) {</blockquote><blockquote class="tr_bq">&nbsp; &nbsp; print "equal\n";</blockquote><blockquote class="tr_bq">}</blockquote><blockquote class="tr_bq">?&gt;</blockquote></blockquote><br />A current PHP version will output:<br /><br />schoenfeld@homer ~ % php5 test.php<br />equal<br /><br />It will do the right thing on 64bit systems (not claiming that the numbers are equal).Interesting enough: An equal-type-equality check (see <a href="http://tech.just-imho.net/2009/10/php-and-great-operator.html">my article</a> from a few years ago) will not tell that the two numbers are equal.<p></p>
]]>
        

    </content>
</entry>

<entry>
    <title>LDAP performance is poor..</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/2011/11/ldap-performance-is-poor.html" />
    <id>tag:tech.just-imho.net,2011://2.64</id>

    <published>2011-11-30T13:07:00Z</published>
    <updated>2011-12-01T21:08:59Z</updated>

    <summary>Todays rant of the day:In a popular LDAP directory management tool, not to be named, there is a message indicating that the performance of the LDAP server is poor. While this might still be true: Honestly, building LDAP filters like...</summary>
    <author>
        <name>Patrick Schönfeld</name>
        <uri>http://www.just-imho.net</uri>
    </author>
    
        <category term="Misc" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="debian" label="Debian" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ldap" label="LDAP" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="wtf" label="WTF" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://tech.just-imho.net/">
        <![CDATA[<p>Todays rant of the day:In a popular LDAP directory management tool, not to be named, there is a message indicating that the performance of the LDAP server is poor. While this might still be true: Honestly, building LDAP filters like you and then complaining about the LDAP server is like, lets say, searching papers in the whole city, while you know they are certainly located within a single drawer, in a single closet, in a single room of your apartment and  blaming the city council because your search took so damn long.What a mockery.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Struggling with Advanced Format during a LVM to RAID migration</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/2011/09/struggling-with-advanced-format-during.html" />
    <id>tag:tech.just-imho.net,2011://2.63</id>

    <published>2011-09-17T10:37:00Z</published>
    <updated>2011-12-14T10:07:36Z</updated>

    <summary><![CDATA[Recently I decided to invest in another harddisk for my&nbsp;atom system. That system, I built up almost two years ago, has become the central system in my home network, serving as a fileserver to host my personal data, some git...]]></summary>
    <author>
        <name>Patrick Schönfeld</name>
        <uri>http://www.just-imho.net</uri>
    </author>
    
        <category term="System Administration" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="lvm" label="LVM" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mdadm" label="mdadm" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="raid" label="RAID" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://tech.just-imho.net/">
        <![CDATA[<p>Recently I decided to invest in another harddisk for my&nbsp;atom system. That system, I built up almost two years ago, has become the central system in my home network, serving as a fileserver to host my personal data, some git repositories etc., streaming server and since I switched to a cable internet connection it also serves as a router/firewall.Originally, I bought that disk to backup some data, of the systems in the network, but I realized that all data on this system were hosted on a single 320GB 2,5" disk and it became clear to me, that, in absense of a proper backup strategy, I at least should provide some redundancy.</p>

<p>So I decided, once the disk was in place, that the whole system should move to a RAID1 over the two disks. Basically this is not that hard as it may seem at a first glance, but I had some problems due to a new sector size in some recent harddisks, which is called Advanced Format.</p>

<p>But lets begin from the start. The basic idea of such a migration is:</p>

<ol>
<li style="text-align: left;">Install mdadm with apt-get. Make sure to answer 'all' to the question which devices need to be activated in order to boot the system.<br /><br /></li>
<li>Partition the new disk (almost) identical.Because the new drive is somewhat bigger that wouldn't make sense, but at least the two partitions which should be mirrored on the second disk, need to be identical.Usually this is achieved easily by using
<blockquote>sfdisk -d /dev/sda | sfdisk /dev/second/sdb</blockquote>
In this case, it wasn't that easy. But I will come to that in a minute.
<br /><br /></li>
<li style="text-align: left;">Change the type of the partitions to 'FD' (Linux RAID autodetect) with fdisk<br /><br /></li>
<li>Erase evidence of an eventual old RAID from the partitions, which is probably pointless on a brand-new disk, but we want to be sure:
<blockquote>mdadm --zero-superblock /dev/sdb1mdadm --zero-superblock /dev/sdb2</blockquote></li>
<li>Create two DEGRADED raid1 arrays from the partitions:<blockquote>mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 missingmdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sdb2 missing</blockquote></li>
<li style="text-align: left;">Create filesystem on the first raid device, which will become /boot.<br /><br /></li>
<li>Mount that filesystem somewhere temporary and move the contents of /boot to it:<blockquote>mount /dev/md0 /mnt/somewhere</blockquote></li>
<li style="text-align: left;">Unmount /boot, edit fstab to mount /boot from /dev/md0 and re-mount /boot (from md0)<br /><br /></li><li>Create mdadm configuration with mdadm and append it to /etc/mdadm/mdadm.conf:
<blockquote>mdadm --examine --scan &gt;&gt; /etc/mdadm/mdadm.conf</blockquote></li>
<li>Update the initramfs and grub (no manual modification needed with grub2 on my system)and install grub into the MBR of the second disk.
<blockquote>update-initramfs -uupdate-grubgrub-install /dev/sdb</blockquote></li>
<li style="text-align: left;">The first point to pray: Reboot the system to verify it can boot from the new /boot.<br /><br /></li><li>Create a physical volume on /dev/md1:
<blockquote>pvcreate /dev/md1</blockquote></li>
<li>Extend the volume group to contain that device:
<blockquote>vgextend <volgroup_name> /dev/md1</volgroup_name></blockquote></li>
<li>Move the whole volume group physically from the first disk to the degraded RAID:
<blockquote>vgmove <volgroup_name> /dev/md1</volgroup_name></blockquote>
(Wait for it to complete... takes some time ;)<br /><br /></li>
<li>Reduce first disk from the VG:<blockquote>vgreduce <volgroup_name> /dev/sda2</volgroup_name></blockquote></li><li>Prepare it for addition to the RAID (see step 3 and 4) and add it:
<blockquote>mdadm --add /dev/md0 /dev/sda1mdadm --add /dev/md1 /dev/sda2</blockquote></li>
<li style="text-align: left;">Hooray! Watch into /proc/mdstat. You should see that the RAID is recovering.<br /><br /></li>
<li style="text-align: left;">When recovery is finished pray another time and hope that system is still booting with it running from the RAID entirely. If it does: Finished :-)</li>
</ol>

<p>Now to the problem with the advanced format:There is some action taking place with the hardware vendors to move to a new sector size. Physically my new device has a size of 4096 bytes per sector. Somewhat different to the 512 bytes disks used to have the last decade.</p>

<p>Logically it still has 512 bytes per sector. As far as I understand this is achieved by placing 8 logical sectors into one physical sector, so when partitioning a new disk the alignment of the disk has to be so that partitions start in a sector which is a multiple of 8.</p>

<p>That, obviously, wasn't the case with the old partitioning on my first disk. So I had to manually create partitions by specifying start points manually and making sure they are dividable by 8.Otherwise fdisk would complain about the layout on the disk.This does not work with cfdisk, because it does not accept manual alignment parameters and unfortunately the partitions it creates do have a wrong alignment. So good old fdisk and some calculations how many sectors are needed and where to start, to the rescue.</p>

<p>So the layout is now:</p>

<blockquote><br />
Device Boot&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Blocks&nbsp;&nbsp; Id&nbsp; System<br />
/dev/sdb1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2048&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 291154&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 144553+&nbsp; fd&nbsp; Linux raid autodetect<br />
/dev/sdb2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 291160&nbsp;&nbsp; 625139334&nbsp;&nbsp; 312424087+&nbsp; fd&nbsp; Linux raid autodetect<br />
</blockquote>
]]>
        

    </content>
</entry>

<entry>
    <title>On Debian discussions</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/2011/04/on-debian-discussions.html" />
    <id>tag:tech.just-imho.net,2011://2.71</id>

    <published>2011-04-28T08:45:00Z</published>
    <updated>2011-12-10T20:19:45Z</updated>

    <summary><![CDATA[In my article "Last time I've used network-manager"&nbsp;I made a claim for which I've been&nbsp;criticized by some people, including Stefano, our current (and just re-elected) DPL.&nbsp;&nbsp;I said that a certain pattern, which showed up in a certain thread, were a...]]></summary>
    <author>
        <name>Patrick Schönfeld</name>
        <uri>http://www.just-imho.net</uri>
    </author>
    
        <category term="Debian" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="debian" label="Debian" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://tech.just-imho.net/">
        <![CDATA[<p>In my article <a href="http://tech.just-imho.net/2011/04/last-time-ive-used-network-manager.html">"Last time I've used network-manager"</a>&nbsp;I made a claim for which I've been&nbsp;criticized by some people, including Stefano, our current (and just re-elected) DPL.&nbsp;&nbsp;I said that a certain pattern, which showed up in a certain thread, were a prototype for discussions in the Debian surroundings.<strike></strike><br /><br />Actually I have to commit, that this was a very generalizing statement, making my own point against the discussion point back directly at myself.<br />Because as Stefano said correctly there has been some progress in the Debian discussion cult. <br />Indeed, there are examples of threads, were discussions followed another scheme.<br />But to my own advocacy I have to say that such changes are like little plants (in the botanical sense). They take their time to grow and as long as they are so very new, they are very vulnerable to all small interruptions. Regardless of how tiny those interruptions may seem.<br /><br />I've been following Debian discussions for 6 or 7 years. That scheme I was describing was that which had the most visibility of all Debian discussions. <i>Almost every</i> discussion which were important for a broader audience followed that scheme. It <i>has</i> a reason that Debian is <i>famous</i> for flamewars.<br />In a way its quiet similar to the network-manager perception, some people have. Negative impressions manifest themselves. Especially if they have <i>years</i> of time.<br />Positive impressions does not have a chance to manifest themselves as long as the progress is not visible enough to survive small&nbsp;interruptions.<br /><br />I hope that I didn't cause to much damage with my comment, which got cited (context-less) on other sites. Hopefully the Debian discussion cult will improve further to a point where there is no difference between the examples of very good, constructive discussions we already have in some parts of the project and the project-wide decision-making-discussions which affect a broad audience and often led to flamewars.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Directory-dependent shell configuration with zsh (Update)</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/2011/04/directory-dependent-shell-configuration.html" />
    <id>tag:tech.just-imho.net,2011://2.72</id>

    <published>2011-04-28T06:08:00Z</published>
    <updated>2011-12-01T21:09:00Z</updated>

    <summary><![CDATA[For a while I've been struggling with a little itch. I'm using my company notebook for company work and for Debian related stuff.&nbsp;Now, whenever I switch between those two contexts, I had to manually fix the environment configuration. This is...]]></summary>
    <author>
        <name>Patrick Schönfeld</name>
        <uri>http://www.just-imho.net</uri>
    </author>
    
        <category term="System Administration" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="coding" label="Coding" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="debian" label="Debian" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="zsh" label="zsh" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://tech.just-imho.net/">
        <![CDATA[<p>For a while I've been struggling with a little itch. I'm using my company notebook for company work and for Debian related stuff.&nbsp;Now, whenever I switch between those two contexts, I had to manually fix the environment configuration. This is mostly related to environment variables, because tools like dch et cetera rely on some, which need to be different for the different contexts, like DEBEMAIL.<br />A while ago I had the idea to use directory dependent configuration for that purpose, but I never found the time and mood to actually fix my itch.<br />Somewhere in the meanwhile I applied a quick hack ("case $PWD in ...; do export...; esac") to my zsh configuration to ease the pain, but it still did not feel right.<br /><br /><hr><b>For the impatient: <a href='#quickstart'>Below</a> you find a way to just use whats described here. The rest of the article just contains detailed information on how to implement something like this.</b><br /><hr><br />The other day I were cleaning up and extending my zsh configuration and it came to my mind again. I then thought about what my requirements are and how I could solve it. First I thought about using a ready solution, like <a href="http://michael-prokop.at/blog/2009/05/30/directory-specific-shell-configuration-with-zsh/">the one</a> in the&nbsp;<a href="http://grml.org/zsh/#grmlzshconfig">Grml Zsh configuration</a>, but at that point I did not remember it (it needed a hint by a co-worker *after* I finished the first version of my solution). Then I came up with my requirements:<br /><br /><ul><li><b>Separate profile changing logic from configuration (as far as possible):</b>I don't want to re-dive into a script logic&nbsp;every time&nbsp;I decide to change something, like adding a variable or changing it. Generally I find a declarative approach much cleaner.</li><li><b>Avoid repeating myself</b><br />Basically all I do when switching profiles is to change environment variables. Usually I don't want my shell to do extraordinary things, like brewing coffee when I switch the context, so I'd like to avoid typing an "export foobar.." for every single environment variable and every single profile.</li></ul><div>It lead to a configuration approach as a first start. When thinking about how to represent the configuration I looked into the supported data types in zsh. zsh supports arrays, which is perfect for my need. I came up with something like that:</div><blockquote><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"> typeset -A EMAILS ENV_DEBIAN ENV_COMPANY<br />EMAILS=(<br />&nbsp;&nbsp;"private" &nbsp; &nbsp; "foo@bar.org"<br />&nbsp;&nbsp;"company" &nbsp; &nbsp; "baz@foo.org"<br />&nbsp;&nbsp;"debian" &nbsp; &nbsp; &nbsp;"schoenfeld@debian.org"<br />)<br />ENV_DEBIAN=(<br />&nbsp;&nbsp;"DEBEMAIL" &nbsp;"$EMAILS[debian]"<br />&nbsp;&nbsp;"EMAIL" &nbsp; &nbsp; "$EMAILS[debian]"<br />&nbsp;)<br />ENV_COMPANY=(<br />&nbsp;&nbsp;"DEBEMAIL" &nbsp;"$EMAILS[company]"<br />)</span></blockquote>The next part was selecting the right profile. In the first version I used the old case logic, but it was breaking my separate logic and configuration&nbsp;paradigm. Approximate at this point the co-worker lead me to the grml approach, which I borrowed an idea from:<br /><br /><blockquote><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><br /># Configure profile mappings                                                    <br />zstyle ':chpwd:profiles:*company*' profile company                           <br />zstyle ':chpwd:profiles:*debian*' profile debian<br /></span></blockquote><br />and the following code to lookup profile based on $PWD:<br /><blockquote><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><br /><i>1</i> function detect_env_profile {                                                   <br /><i>2</i> &nbsp;&nbsp;local profile                                                               <br /><i>3</i> &nbsp;&nbsp;zstyle -s ":chpwd:profiles:${PWD}" profile profile || profile='default'     <br /><i>4</i> &nbsp;&nbsp;profile=${(U)profile}                                                       <br /><i>5</i> &nbsp;&nbsp;if [ "$profile" != "$ENV_PROFILE" ]; then                                   <br /><i>6</i> &nbsp;&nbsp;print "Switching to profile: $profile"                                  <br /><i>7</i> &nbsp;&nbsp;fi                                                                          <br /><i>8</i> &nbsp;&nbsp;ENV_PROFILE="$profile"<br /><i>9</i> } <br /></span></blockquote><br />For an explanation: zstyle is a zsh-builtin which is used to "define and lookup styles", as the manpage says, or put different: Another way to store and lookup configuration values.<br />Its nice for my purpose, because it allows storing patterns instead of plain configuration values which can be compared against $PWD easily with all of the zsh globbing magic. This is basically whats done in line 3. zstyle then sets $profile to the matching zstyle configuration in the :chpwd:profiles: context or to 'default' if no matching zstyle is found.<br /><br />The (almost) last part is putting it together with code to switch the profile:<br /><blockquote><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><br /><i>1</i> function switch_environment_profiles {                                          <br /><i>2</i> &nbsp;&nbsp;detect_env_profile                                                          <br /><i>3</i> &nbsp;&nbsp;config_key="ENV_$ENV_PROFILE"                                               <br /><i>4</i> &nbsp;&nbsp;for key value in ${(kvP)config_key}; do                                     <br /><i>5</i> &nbsp;&nbsp;&nbsp;&nbsp;export $key=$value                                                      <br /><i>6</i> &nbsp;&nbsp;done                                                                        <br /><i>7</i>}<br /></span></blockquote>The only non-obvious part in this are lines 3 and 4. Remember, the profiles were defined as ENV_PROFILE, where PROFILE is the name of the profile. We cannot know that key in advance, therefore we have to construct the right environment variable from the result of detect_env_profile. We do that in line 3 and lookup this environment variable in line 4.<br />The deciding aspect for that is the P-flag in the parameter expansion. It tells zsh that we do not want the value of $config_key, but instead the value of $WHATEVER_CONFIG_KEY_EXPANDS_TO.<br />The other flags <i>k</i> and <i>v</i> tell zsh that, from the array, we want both: keys and values. If we'd omitted those flags it would have given us the values only.<br />We then loop over that to configure the environment. Easy, hu?<br /><br />We would be finished, if this would do anything. The code above needs to be called. Lucky for us thats pretty easy to achieve, as zsh has a hook for when a directory is changed. Making all this work is simply a matter of adding something like this:<br /><blockquote><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><br />function chpwd() {<br />&nbsp;&nbsp;switch_environment_profiles<br />}<br /></span></blockquote>Now, one could say, that the solution in the grml configuration has an advantage. It allows calling arbitrary commands on profile changing, which might be useful to *unset* variables in a given profile or whatever you could think of.<br />Well, its a matter of three lines to extend the above code for that feature:<br /><br /><blockquote><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><br /># Taken from grml zshrc, allow chpwd_profile_functions()                    <br />if (( ${+functions[chpwd_profile_$ENV_PROFILE]} )) ; then                       <br />&nbsp;&nbsp;chpwd_profile_${ENV_PROFILE}                                                <br />fi<br /></span><br /></blockquote>to the end of switch_environment_profiles and now its possible to additionally add a function chpwd_profile_PROFILE which is called whenever the profile is changed to that profile.<br /><hr><a name="quickstart"></a><br /><b>USAGE</b>: I have put the functions into a file which can be included into your zsh configuration, which can be found <a href="https://github.com/aptituz/zsh/blob/master/directory-based-environment-configuration">on github</a>.<br />Please see this <a href="https://github.com/aptituz/zsh/blob/master/README">README</a> and the comments in the file itself on further usage instructions.</p>]]>
        
    </content>
</entry>

<entry>
    <title>password-gorilla 1.5.3.4 ACCEPTED into unstable</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/2011/04/password-gorilla-1534-accepted-into.html" />
    <id>tag:tech.just-imho.net,2011://2.69</id>

    <published>2011-04-19T06:16:00Z</published>
    <updated>2011-12-01T21:09:00Z</updated>

    <summary><![CDATA[The password-gorilla package has lacked some love since a while and at some point in time I&nbsp;orphaned&nbsp;it.That happened due to the fact, that the upstream author was pretty unresponsive and inactive and my own TCL skills are very limited. As...]]></summary>
    <author>
        <name>Patrick Schönfeld</name>
        <uri>http://www.just-imho.net</uri>
    </author>
    
        <category term="Debian" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="debian" label="Debian" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://tech.just-imho.net/">
        <![CDATA[<p>The password-gorilla package has lacked some love since a while and at some point in time I&nbsp;orphaned&nbsp;it.<br />That happened due to the fact, that the upstream author was pretty unresponsive and inactive and my own TCL skills are very limited. As a result password-gorilla package was in a bad state, at least from a user point of view, with several (apparently) random happening error message and alike, stalling feature development etc.<br /><br />But in the meanwhile there was a promising event arising. A guy, named&nbsp;Zbigniew Diaczyszyn, wrote me a mail that he intended to continue upstream development. Well, meanwhile is kind of an understatement. That first mail already happened in December 2009. And he asked me, if I'd like to continue maintaining password-gorilla in Debian. I agreed to that, but as promising as it sounded to have a new upstream, I was not sure if that would work out. However: My doubt were not justified.<br /><br />In the time between 2009 and now&nbsp;Zbigniew managed to become the official upstream (with the&nbsp;accreditation of the previous upstream), create a github project for it and make several releases.<br /><span class="Apple-tab-span" style="white-space: pre;"><br /></span><br />I know there are several people out there who tested password-gorilla. I know there were magazine reviews including the old version, which were a bit buggy with recent tcl/tk versions. It made a quiet good multi-platform password manager, with support for very common password file formats, stand in a bad light.<br />I recommend previous users of password-gorilla to try the new version, which recently has been <br /><i>uploaded to unstable.</i><br /><div><br /></div></p>]]>
        
    </content>
</entry>

<entry>
    <title>Last time I&apos;ve used network-manager..</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/2011/04/last-time-ive-used-network-manager.html" />
    <id>tag:tech.just-imho.net,2011://2.83</id>

    <published>2011-04-15T07:04:00Z</published>
    <updated>2011-12-01T21:09:00Z</updated>

    <summary>Theres an ongoing thread on the Debian mailing lists about making network-manager installed by default on new Debian installations. I won&apos;t say much about the thread. Its just a prototype example for Debian project discussions: Discuss everything to death and...</summary>
    <author>
        <name>Patrick Schönfeld</name>
        <uri>http://www.just-imho.net</uri>
    </author>
    
        <category term="Debian" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="debian" label="Debian" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://tech.just-imho.net/">
        <![CDATA[<p>Theres an ongoing thread on the Debian mailing lists about making network-manager installed by default on new Debian installations. I won't say much about the thread. Its just a prototype example for Debian project discussions: Discuss everything to death and if its dead discuss a little more. And - very important - always restate the same arguments as often as you can. Or if its not your own argument you restate, restate the arguments of others. Ending with 100 times stated the same argument. Even if its already disproved.<br /><br />I don't have a strong opinion about the topic in itself. However there is something I find kinda funny. A statement brought up by the people who strongly oppose network-manager as a default.<br />A statetement I've heard so often that I can't count it anymore.<br /><br /><blockquote><i>The last time I've tried network-manager it sucked.</i></blockquote>It often comes in different masquerades, like:<br /><br /><ul><li>network-manager is crap.</li><li>network-manager is totally unusable</li><li>network-manager does not even manage to keep the network connection during upgrades</li></ul><div>But it basically boils down to that basic essence of the sentence I've written above. Sometimes I ask people who express this opinion a simple question:</div><div><br /></div><blockquote><i>When did you test network-manager the last time?</i></blockquote><div>The answers are different but again the basic essence of the answers is mostly the same (even if people would never say it <i>that</i> way):</div><div><br /></div><blockquote><i>A long time ago. Must have been around Etch.</i></blockquote><div>And guess what: There was a time when I had a similar opinion. Must have been around Etch.<br />During the life cycle of network-manager between Etch and now a lot has happened. I restarted using network-manager at some point of the Lenny development.<br />My daily driver for the management of my network connections on my notebook. Yes, together with ifupdown because, yes, network-manager does not support every possible network-setup with all of the special cases possible. But it supports auto-configuring of wired and wireless devices. Connecting to a new encrypted network, either in a WLAN or in a 802.1x LAN, using UMTS devices, using tethering with a smart phone. And everything: on a few mouse-clicks.</div><div><br /></div><div>Yes, it had some rough edges in that life cycle. Yes, it had that nasty upgrade bug, which was <i>very annoying.</i></div><div>But face it: It developed a lot. Here are some numbers:</div><div><br /></div><div>Diffstat between the etch version and the lenny version:</div><div><div>&nbsp;362 files changed, 36589 insertions(+), 36684 deletions(-)</div></div><div><br /></div><div>Diffstat between the Lenny version and the current version in sid:</div><div>&nbsp;763 files changed, 112713 insertions(+), 56361 deletions(-)</div><div><div><br /></div><div>The upgrade bug has been solved recently. Late. But better late then never.</div><div><br /></div><div>So what does that mean? It means that, if your last network-manager experience was made with Lenny or even worse around Etch, you should better give it another try, if you are interested in knowing what you talk about. For now it seems that a lot of people do <i>not know. Not even in a distance.</i></div></div></p>]]>
        
    </content>
</entry>

<entry>
    <title>Let me introduce DPKG::Log and dpkg-report</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/2011/02/let-me-introduce-dpkglog-and-dpkg.html" />
    <id>tag:tech.just-imho.net,2011://2.77</id>

    <published>2011-02-25T09:39:00Z</published>
    <updated>2011-12-03T18:47:40Z</updated>

    <summary>We have customers, which require a report about what we&apos;ve done during maintenance windows. Usually this includes a report about upgrades, newly installed packages etc. and obviously everything we&apos;ve done apart from that.Till now we&apos;ve prepared them manually. For a...</summary>
    <author>
        <name>Patrick Schönfeld</name>
        <uri>http://www.just-imho.net</uri>
    </author>
    
        <category term="Debian" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="debian" label="Debian" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="dpkg" label="dpkg" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://tech.just-imho.net/">
        <![CDATA[We have customers, which require a report about what we've done during maintenance windows. Usually this includes a report about upgrades, newly installed packages etc. and obviously everything we've done apart from that.<br />Till now we've prepared them manually. For a greater bunch of systems this is a big PITA, because to be somehow useful you have to collect the data for all systems and after that, prepare a report where you have:<br /><ul><li>The upgrades done on all systems (e.g. a libc or kernel update)<br /><br />seperated from<br /></li><li>the updates specific to a certain system or system class</li></ul><br />Its also error-prone because humans make mistakes.<br /><br />Perl to the rescue!<br />At least the part about generating a report about installed/upgraded/removed packages could be automated, because dpkg writes a well-formed logfile in /var/log/dpkg.log. But I noticed that there appearently is no library specialised at parsing that file. Its not a big deal, because the format of that file is really simple, but a proper library would be nice anyway.<br />And so I wrote <a href="http://search.cpan.org/%7Eaptituz/DPKG-Log-1.20/">such a library</a>.<br />It basically takes a logfile, reads it line by line and stores each line parameterized into a generic object.<br /><br />Its features include:<br /><ul><li>Parsing the logfile (obviously)</li><li>Storing each line in a logfile as a DPKG::Log::Entry object that holds informations about the entry type (e.g. action or status update), the package associated (if any), timestamp, verbatim line, line number etc.</li></ul><ul><li>Limiting the number of lines parsed to a time range specified by DateTime objects</li></ul><br />Based on that, I wrote another library DPKG::Log::Analyse, which takes a log, parses it with DPKG::Log and then extracts the more relevant information such as installed packages, upgraded packages, removed packages etc.<br /><br />This, in turn, features:<br />- Info about&nbsp;newly installed packages<br />- Info about removed packages<br />- Info about upgraded packages<br />- Info about packages which got installed and removed again<br />- Info about packages which stayed halfinstalled or halfconfigured at the end of the logfile (or defined reporting period)<br /><br /><br />These libraries are already uploaded to CPAN and packaged for Debian.<br />They passed the NEW queue very quickly and are therefore available for Sid:<br /><br /><a href="http://packages.debian.org/sid/libdpkg-log-perl">http://packages.debian.org/sid/libdpkg-log-perl</a><br /><br />As an example use (and for my own use case, as stated above), I wrote dpkg-report, which uses the module and a Template::Toolkit based template to generate a report about what happened in the given logfile.<br />It currently misses some documentation, but it works somehow like this:<br /><br /><b>Report for a single host over the full log:</b><br /><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">dpkg-report</blockquote><br /><b>Report for a single host for the last two days:</b><br /><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">dpkg-report --last-two-days</blockquote><br /><b>Report for multiple hosts (and logfiles)</b>:<br />The script expects that each log file has the name <systemname>.dpkg.log so that it can guess the hostname from the system and can grab all such log files from a directory if a directory is specified as log-file arguments:</systemname><br /><br /><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">dpkg-report --log-file /path/to/logs</blockquote><br />This will generate a report about all systems without any merging.<br /><br /><b>Report for multiple hosts with merging:</b><br /><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">dpkg-report --log-file /path/to/logs --merge</blockquote><br />This will do the following:<br /><ul><li>Report packages which where installed/removed/etc. on <i>all</i> systems <i>seperate</i> from the upgrades only done&nbsp;on the specific systems</li><li>If systems start with a common name and end on a number (e.g. mail1, mail2, mail3 etc.), report packages which where installed on all systems with that common name <i>seperate</i> from the upgrades only done on the specific systems</li><li>For a specific system list only the changes on that particular system and nothing else.</li></ul>A (fictive) report could look some what like this:<br /><br /><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">dpkg-Report for all:<br />------------------------<br />Newly Installed:<br />abc<br />Removed:<br />foo<br />Upgraded:<br />bar (0.99-12 - 1.00-1)<br />dpkg-Report for test*:<br />------------------------<br />Newly Installed:<br />blub<br />dpkg-Report for test1:<br />------------------------<br />Upgraded:<br />baz (1.0.0-1 -&gt; 1.0.0-2)<br />dpkg-Report for test2:<br />------------------------<br />Upgraded:<br />zab (0.9.7 -&gt; 0.9.8)</blockquote><br />Currently this report generator is only included in the source package or in the git(hub) repository of the library. I wonder if it makes sense to let the source package build another binary package for it.<br />But its only a 238 lines perl script with a dependency on the perl library so I'm unsure if it warrants a new binary package. What do others think?]]>
        
    </content>
</entry>

<entry>
    <title>FAI, my notebook and me</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/2010/09/fai-my-notebook-and-me.html" />
    <id>tag:tech.just-imho.net,2010://2.87</id>

    <published>2010-09-26T14:45:00Z</published>
    <updated>2011-12-01T21:09:00Z</updated>

    <summary>I use to take my (company) notebook with me on business travels.Two times I now had the unlucky situation that something bad happened to it on such an occassion. Whenever you get in the situation that you need to reinstall...</summary>
    <author>
        <name>Patrick Schönfeld</name>
        <uri>http://www.just-imho.net</uri>
    </author>
    
        <category term="System Administration" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="debian" label="Debian" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="fai" label="FAI" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://tech.just-imho.net/">
        <![CDATA[<p>I use to take my (company) notebook with me on business travels.<br />Two times I now had the unlucky situation that something bad happened to it on such an occassion. Whenever you get in the situation that you need to reinstall your system in a hotel room you'll might have the same wish that I got: A way to quickly bring the system in a state where I could work with it.<br /><br />Well, I used <a href="http://fai-project.org/">FAI</a> a while back for a customer. Its a real great tool for automated installations and I really prefer it over debian-installer preseeding. Apart from the fact that the partitioning is way easier it also gives me the power to complete the whole installation up to a point where I've got almost nothing to do anymore. It also features an installation completely from CD or USB-Stick which makes it suitable for me.<br /><br />However, my notebook installation has a little "caveat" which made that a little bit more harder as previously thought. As it is a notebook and I carry company data on it it has to be encrypted. Disk encryption at a whole.<br />The stable FAI version does <i>not</i> support this.<br />The problem is: The current support for crypto in setup-storage (FAIs disk setup tool) is not very far. Supported is the creating of a LUKS container with a keyfile, saving this keyfile to the FAI $LOGDIR and creating a crypttab.<br />Unfortunately for a root filesystem this would leave us with an unbootable system, because this requires manual interaction. And on the other hand using a keyfile for a cryptoroot is a no-go anyway. We want a passphrase.<br />On a side-note: cryptoroot support with a keyfile is more complex than with a passphrase, as you have to provide a script that knows how to get to the key.<br /><br />So I started experiments with scripts in the FAI-configuration that added a passphrase, changed the crypttab and recreated the crypttab. That worked, although it was very ugly.<br />&nbsp;But due to a good <a href="https://lists.uni-koeln.de/pipermail/linux-fai/2010-September/008315.html">coorperation</a> with Michael Tautschnig, a FAI- and Debian-Developer, on this, the FAI experimental version 4.0~beta2+experimental18<br />now supports LUKS-volumes with a passphrase that can be specified in the disk_config. <br /><br />Now its actually possible to setup a system like mine with FAI out-of-the-box. One thing (apart from the FAI configuration and setup as you want and need it) has to be done, anyway:<br />The initrd support of cryptsetup requires busybox (otherwise you will see a lot of "command not found" errors and you system won't boot) and it requires initramfs-tools, which is standard nowadays.<br />So you <i>have</i> to make sure that these packages are in your package config!<br /><br />So now I can define a FAI-profile for my notebook, create a partial fai mirror with the packages it needs and put all this together on an USB stick with fai-cd (don't worry about the name, it can be used to create ISO images as well). I can carry this with me and if I need it I stick it into my notebook and let FAI automatically reinstall my system. Nice :)<br /><br /><b>Update:</b> Somebody asked me, weither he understood me right, that I'd put my LUKS passphrase on a FAI usbstick clear-text. Obviously, the answer is and should be NO. What I do and what I'd suggest to others: Use a default passphrase in the FAI configuration, install with it - after all on a fresh installation there is not much to protect - and once it is finished *change* the passphrase to something secure by adding a new keyslot and removing the old.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Getting the mp3 mess into control</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/2010/08/getting-mp3-mess-into-control.html" />
    <id>tag:tech.just-imho.net,2010://2.23</id>

    <published>2010-08-19T14:46:00Z</published>
    <updated>2011-12-01T21:08:57Z</updated>

    <summary>I have some mp3 files in my collection. Some years ago, back in the times, when I was a Windows-User, I used &quot;The Godfather&quot;, to keep the chaos under control. This software, although not Open Source, is really good at...</summary>
    <author>
        <name>Patrick Schönfeld</name>
        <uri>http://www.just-imho.net</uri>
    </author>
    
        <category term="Misc" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="debian" label="Debian" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="Perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://tech.just-imho.net/">
        <![CDATA[<p>I have some mp3 files in my collection. Some years ago, back in the times, when I was a Windows-User, I used "<a href="http://users.otenet.gr/%7Edtou20/index.html">The Godfather</a>", to keep the chaos under control. This software, although not Open Source, is really good at what it does. And it does almost everything to organize mp3s. From (mass-)tagging to auto-renaming to auto-sorting your mp3s. But this wouldn't be a blog entry by me if this became... a praise to a windows software so..<br /><br />When I became a daily Linux User I searched for alternatives. With GUI or without a GUI, but I did not really find an application that suited my needs. As far as tagging and renaming was concerned it wasn't that hard. There are really excellent command line tools (lltag, id3, etc.) and rumours have been heard that there are also GUI tools.<br />But what I still did not find is a simple, yet flexible, tool to sort a huge collection of mp3s into a flexible structure on the filesystem like "The Godfather" was able to do since.. ehh.. a lot of years.<br /><br />So the day before yesterday I finally decided to write one on my own and came up with an ~ 280 lines perl script (POD-documentation included) which does exactly what I want and is simple. <br />It does no tagging.<br />It does no renaming.<br />All it does is <i>sorting</i> mp3s into a given template-based directory hierarchy based on their ID3 tag.<br /><br />At this point a warning is due. I'm sharing that script with you under the terms of the GPL. BUT it still needs testing and therefore you probably do not want to use it without its safety measures (e.g. dry-run or copy instead of move) to avoid data loss. And notice that although it has been written with portability in mind, it has only been tested on a <a href="http://www.debian.org/">Debian GNU/Linux</a> system.<br /><br />The script is hosted at github. <a href="http://github.com/aptituz/mp3sort/blob/master/mp3sort.pl">Here</a> (or <a href="http://github.com/aptituz/mp3sort/raw/master/mp3sort.pl">raw</a> to download it directly).<br /><br />After I've talked to a co-worker about the script, he told me that <a href="http://packages.debian.org/squeeze/arename">arename</a> would do what I want. So you probably don't want to use my script, because arename is probably more tested and much more sophisticated. But on the other hand I had a quick look at the arename manpage and its so utterly feature-loaded, that it cannot avoid a certain complexicity. My tool is simple.<br />And there is another advantage. If you want arename to handle a certain amount of mp3s you have to use your shell magic to find the files and pipe it to arename. My script finds all mp3s recursively from where you let it start (default is $PWD so be careful) and will happily move it into a hierarchy under a directory you ask it to. For the simple job of sorting mp3s its probably easier to use.<br /><br /><span style="font-size: x-small;">(Oh and if its worth nothing, it <i>might</i> still be of use as a simple programming example, how one <i>could</i> solve this problem in Perl)</span></p>]]>
        
    </content>
</entry>

<entry>
    <title>Facebook aggressively advertising dubious features</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/2010/07/facebook-aggressively-advertising.html" />
    <id>tag:tech.just-imho.net,2010://2.24</id>

    <published>2010-07-15T12:57:00Z</published>
    <updated>2011-12-14T10:10:59Z</updated>

    <summary>Yesterday some confusion arised on my side when I saw a new facebook advertising campaign in my facebook account (yes, I am a member of facebook, although I&apos;m aware of the privacy concerns). Basically it was saying that I should...</summary>
    <author>
        <name>Patrick Schönfeld</name>
        <uri>http://www.just-imho.net</uri>
    </author>
    
        <category term="Misc" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="debian" label="Debian" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="facebook" label="Facebook" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="socialnetworks" label="Social Networks" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://tech.just-imho.net/">
        <![CDATA[<p>Yesterday some confusion arised on my side when I saw a new facebook advertising campaign in my facebook account (yes, I <span style="font-style: italic;">am</span> a member of facebook, although I'm aware of the privacy concerns). Basically it was saying that I should try the friends finder and that some of my friends (showing and naming me three of them) would have used it already.<br /><br />Some background:<br />The friends finder feature of facebook is a feature that asks for the <span style="font-weight: bold;">password</span> of your e-mail account. It will then crawl through your emails to find contacts that might already be on facebook but not connected to you (in a facebook sense).<br /><br />My first feeling was: Oh my god. How can it be that friends (and family) of mine are so naive? Especially since there were people included which I consider to be quiet clever. But honestly: Who would be so naive to give an unknown company direct unsupervised (you can't tell what they really do) access to your mail account? Would you give it to your friend? Your husband? Your father? I guess the answer will be "No" in the most cases and these people are most likely people you trust. Well, I know, you could state similar things for Googlemail who crawl your mails to show you personalized advertising. And in fact you are right. But if one decides to use gmail for your email hosting you have to trust them anyway. Like you have to trust anybody else you retain to host your mails (who could do the same but just don't tell you). But in <span style="font-style: italic;">this</span> case its a third party, Facebook.<br /><br />But if you now think that this becomes a rant against my friends: You are wrong. Over the day I found out that it basically shows up all my friends in a rotation. Every time I open the start page it randomly picks three people from my friend list and shows them to me, telling the same lie to me all over again.<br /><br />So what do we have here? Facebook tries to advertise the most dubious feature they have in the most aggressive way one could imagine. By pretending wrong facts. Wouldn't that even be an element of crime in Germany ("Irreführung" §5 UWG or maybe also §4 UWG, "unsachliche Beeinflussung")?<br /><br />Facebook, you can do better.<br /><br /><span style="font-weight: bold;">Update: </span>Stefano raised a good point. I didn't actually make clear that it has been verified that those people actually did not use the "feature":<br /><br />1. I asked some of them. They said, they didn't use it and were in fact surprised that I asked.<br />2. Others told me they saw that ad stating that <span style="font-style: italic;">I</span> used the feature. I definitely did not use this "feature".<br />3. Probably weak: IMHO its highly unlikely that <span style="font-style: italic;">all</span> of my friends used that feature and at the point I've written this it had already shown my whole friend list.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Ubuntu considering critical bugs an &quot;invalid&quot; bug?</title>
    <link rel="alternate" type="text/html" href="http://tech.just-imho.net/2010/04/ubuntu-considering-critical-bugs.html" />
    <id>tag:tech.just-imho.net,2010://2.16</id>

    <published>2010-04-07T13:46:00Z</published>
    <updated>2011-12-14T10:08:58Z</updated>

    <summary>I just discovered that bug report over at Ubuntu.Short summary:They have a script in upstart which is not meant to be run manually and if you do it will erase your whole file system. Additionally it seems that the fact...</summary>
    <author>
        <name>Patrick Schönfeld</name>
        <uri>http://www.just-imho.net</uri>
    </author>
    
        <category term="Debian" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="bugs" label="Bugs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ubuntu" label="Ubuntu" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://tech.just-imho.net/">
        <![CDATA[<p>I just discovered <a href="https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/557177">that</a> bug report over at Ubuntu.<br /><span style="font-weight: bold;">Short summary:</span><br />They have a script in upstart which is not meant to be run manually and if you do it <span style="font-weight: bold;">will erase your whole file system</span>. Additionally it seems that the fact that you shall not run that script is not communicated anywhere.<br /><br />That alone isn't the most spectacular about it. Bugs happen. Whats spectacular about it is how a Canonical employee and member of the TechBoard (for people who don't know it: The people who decide about the technical direction Ubuntu takes)  handles that bug. One quote of him to reflect it all:<br /><p></p><blockquote>Sorry, the only response here is "Don't Do That Then"</blockquote><br />So what we have here is a classical case of bad programming. The problem in question is that the script expects a certain environment variable to be set. Fair enough. However it does not check if its set at all and instead of failing or using a sensible default it simply sticks to undefined behaviour. What we have here is a classical programming mistake every beginner tends to do. People who start programming often forget (or don't know) that every external value we rely on must be considered untrustworthy. Therefore a good practice is to check those values.<p></p><p>In this case someone decided that this is useless because they suffer from the wrong assumption that nobody ever calls it manually and the other wrong assumption that caller of the scriptwill always set the environment variable correctly. This is a double-fail.<br /></p><p>Now the developer in question does not accept that (someone else indicated why the behaviour of the script is dangerous), he simply says that the bug is invalid. Thats really a pity.<br /></p></p>]]>
        
    </content>
</entry>

</feed>

