<?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>handyfloss &#187; howto</title>
	<atom:link href="http://handyfloss.net/tag/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://handyfloss.net</link>
	<description>Because FLOSS is handy, isn&#039;t it?</description>
	<lastBuildDate>Thu, 08 Jul 2010 19:34:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>The nightmare of tagging multiple photos with digiKam, and a hacky way around it. Part II</title>
		<link>http://handyfloss.net/2010.07/the-nightmare-of-tagging-multiple-photos-with-digikam-and-a-hacky-way-around-it-part-ii/</link>
		<comments>http://handyfloss.net/2010.07/the-nightmare-of-tagging-multiple-photos-with-digikam-and-a-hacky-way-around-it-part-ii/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 17:13:20 +0000</pubDate>
		<dc:creator>isilanes</dc:creator>
				<category><![CDATA[Free software and related beasts]]></category>
		<category><![CDATA[about me]]></category>
		<category><![CDATA[digikam]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[FLOSS]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[logic]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://handyfloss.net/?p=1110</guid>
		<description><![CDATA[Yesterday I posted about how to put multiple tags in tons of pictures, with digiKam. Apparently, the method I described there does not work (blame it on digiKam, of course). Still, the post makes for an interesting reading (hey, I am the author. What would I say?). Here I&#8217;ll describe a new way to acomplish [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday <a href="http://handyfloss.net/2010.07/the-nightmare-of-tagging-multiple-photos-with-digikam-and-a-hacky-way-around-it/">I posted about how to put multiple tags in tons of pictures</a>, with <a href="http://en.wikipedia.org/wiki/digiKam">digiKam</a>. Apparently, the method I described there does not work (blame it on digiKam, of course). Still, the post makes for an interesting reading (hey, I am the author. What would I say?).</p>
<p>Here I&#8217;ll describe a new way to acomplish what the previous method couldn&#8217;t. If you want to know what on Earth I&#8217;m talking about, read the <b>The problem</b> section of <a href="http://handyfloss.net/2010.07/the-nightmare-of-tagging-multiple-photos-with-digikam-and-a-hacky-way-around-it/">the previous post</a>.</p>
<p><b>Fairy tale-like solution</b></p>
<p>I found out how to implement a solution much like the one in the <b>Fairy tale solution</b> section of my previous post. Question: what is the next best thing to a single keystroke to tag a file? Answer: a single mouse click.</p>
<p>Following our ideal method, we will do a visual scan of all photos, one by one, succesively tagging (or ignoring) each file in which a certain person appears (or doesn&#8217;t). The tagging will be done by a single mouse click (right hand always on mouse), and the photos will advance with space bar strokes (left thumb always on space bar).</p>
<p>To do so, one must go to the first picture in the set, and maximize it. Next, open the right panel, and go to the <i>Captions/Tags</i> tab. Find the tag of the person you are dealing with in the tag tree, and place the mouse over it. See the following screenshot (click on it to maximize):</p>
<div align="center">
<a href="http://isilanes.org/pics/blog/digikam/digikam_tag_01.jpg"><img src="http://isilanes.org/pics/blog/digikam/digikam_tag_01.small.jpg"></a></p>
<p>I assure you the fabled person A is hidding somewhere within those Cuban trees</p>
</div>
<p>Now, place your left hand on the keyboard (to hit the space bar), and let the fun begin. Each time person A appears in a photo, left-click with the mouse (never ever move the pointer from the tag. Space bar will make the photos advance wherever the mouse pointer is). When it doesn&#8217;t, ignore and go on. When you reach the last pic, rinse, and repeat for persons B through Z.</p>
<p>With this method I tagged 197 pictures in under one hour yesterday. A bit over 3 pictures tagged per minute does not look too impressive, but the 197 pictures contained 9 different persons (9 tags to apply), each one of which appeared in roughly 30 pictures. This means I did 9 slide shows of all the pictures, applying a total of more than 250 tags.</p>
<p><b>Linearly scaling method</b></p>
<p>The above method is very fast with respect to each tag applied. However it scales up quite badly, because it is slower the more pictures one has to tag (obviously), <b>and</b> also the more different tags one is applying (one full scan of the picture set per individual tag to apply). The dependency with pic count is unavoidable, but let&#8217;s see if we can devise a way to reduce the impact of the latter.</p>
<p>We begin by grouping all the potential tags (say, all people who appear in the set of pictures) within a single parent tag (see following screenshot):</p>
<div align="center">
<a href="http://isilanes.org/pics/blog/digikam/digikam_tag_02.jpg"><img src="http://isilanes.org/pics/blog/digikam/digikam_tag_02.small.jpg"></a></p>
<p>A&#8217;s friend, C, is somewhere over there, as well. Do you C him?</p>
</div>
<p>Now, we can follow steps similar to the ones above, for the fairy tale method, but for each picture we will apply tags for <i>all</i> people appearing in it. This will make tagging each picture slower, but will require a single pass. Doesn&#8217;t a single N-times-slower pass take as long as N fast passes? Yes. But recall our single pass here will not take N times longer (assuming N people to tag for). A lot of pictures with no people on it will be just as fast to (not) tag as in the method above, plus most photos will feature one or two people, and very seldom will all N people appear together, so this single pass will not be N-times slower than our N passes above.</p>
<p><b>[Update]:</b> After writing this post, I put the second method here to test, and tagged almost 1300 pics in one hour!</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://handyfloss.net/2010.07/the-nightmare-of-tagging-multiple-photos-with-digikam-and-a-hacky-way-around-it/" title="The nightmare of tagging multiple photos with digiKam, and a hacky way around it (July 6, 2010)">The nightmare of tagging multiple photos with digiKam, and a hacky way around it</a> (1)</li>
	<li><a href="http://handyfloss.net/2008.10/usable-compiz-fusion-zoom-to-window/" title="Usable Compiz Fusion: zoom to window (October 1, 2008)">Usable Compiz Fusion: zoom to window</a> (0)</li>
	<li><a href="http://handyfloss.net/2010.03/speed-up-pygtk-and-cairo-by-reusing-images/" title="Speed up PyGTK and Cairo by reusing images (March 18, 2010)">Speed up PyGTK and Cairo by reusing images</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://handyfloss.net/2010.07/the-nightmare-of-tagging-multiple-photos-with-digikam-and-a-hacky-way-around-it-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The nightmare of tagging multiple photos with digiKam, and a hacky way around it</title>
		<link>http://handyfloss.net/2010.07/the-nightmare-of-tagging-multiple-photos-with-digikam-and-a-hacky-way-around-it/</link>
		<comments>http://handyfloss.net/2010.07/the-nightmare-of-tagging-multiple-photos-with-digikam-and-a-hacky-way-around-it/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 17:38:49 +0000</pubDate>
		<dc:creator>isilanes</dc:creator>
				<category><![CDATA[Free software and related beasts]]></category>
		<category><![CDATA[about me]]></category>
		<category><![CDATA[digikam]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[FLOSS]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[logic]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[zsh]]></category>

		<guid isPermaLink="false">http://handyfloss.net/?p=1096</guid>
		<description><![CDATA[[Update and big fat warning]: apparently, renaming or moving files does mess with the tags the image already has. A way around this, and maybe a generally good idea (use your own judgement on that one), is to make digiKam save the tags as metadata into the picture files themselves. On the con side, tagging [...]]]></description>
			<content:encoded><![CDATA[<p><b>[Update and big fat warning]:</b> <i>apparently, renaming or moving files does mess with the tags the image already has. A way around this, and maybe a generally good idea (use your own judgement on that one), is to make digiKam save the tags as <a href="http://en.wikipedia.org/wiki/metadata">metadata</a> into the picture files themselves. On the con side, tagging your pictures will actually modify the files (maybe you don&#8217;t want that), but on the pro side, the tags will travel along with the files, no matter what name or location they have (even to other computers, which may or may not be what you want).</i></p>
<p><b>[Update #2]:</b> <i>apparently the metadata approach doesn&#8217;t work either. It seems that each time a tag is assigned, the metadata is immediately saved (which is great), but only the tags digiKam is aware of at that moment. Also, digiKam is not immediately aware of the tag metadata of the pics it&#8217;s showing (you have to tell him so, I think). Let&#8217;s say you tag a pic as &#8220;A&#8221;. Metadata for &#8220;A&#8221; is saved. OK. Now, you change the name of the file, and digiKam loses track of it. You rename back, and digiKam thinks the picture has no tag (the metadata is obviously still there, inside the file, but digiKam doesn&#8217;t read it until you tell it to). Now, you assign tag &#8220;B&#8221; to the picture, expecting the file to end up with both tags: A and B. Tough luck. The split second you tag the file with &#8220;B&#8221;, it is written to the metadata (OK), but only tag B is written (the only one digiKam is aware of at that moment), so tag &#8220;A&#8221; is lost. In two words: the following post is full of crap. If a third word is allowed, let me say that digiKam is too.</i></p>
<p>First off, let me admit that my problem might have a simple solution. Maybe my goal is much simpler to achieve than I think. But what I am doing seems fairly common to me, and a pain-free recipe to do it escapes me.</p>
<p><b>The problem</b></p>
<p>I use <a href="http://en.wikipedia.org/wiki/digiKam">digiKam</a> to manage my photo collection. A very handy  (and basic) function of digiKam is to tag photos. I tag photos with three criteria: where it was taken (e.g. &#8220;Donostia&#8221;), the event it can be framed within (e.g. &#8220;Wedding of A and B&#8221;), and a tag per person that appears in it (e.g. &#8220;John Smith&#8221;, &#8220;Jane Doe&#8221; and &#8220;Janet Johnson&#8221;). It involves some work, but afterwards I can really easily find say, all pictures in which John Smith and Jane Doe appear together, in any place but Donostia. Why I would want to do that is anyone&#8217;s guess, but that&#8217;s offtopic.</p>
<p>Every time I have a batch of photos (say, a wedding or some holidays), I sit down in front of my computer, and tag evey one of them. Tagging by event is a breeze (99.9% of the time, the whole batch of pics belongs to the same event), and tagging by location is also simple (each pic has a single location, and many, if not all, share that location). However, tagging by person is a bit trickier. Each photo can have many (or no) people appearing on it, plus it takes a bit of attention to spot all people appearing.</p>
<p>When tagging by people, two approaches can be taken:</p>
<ol>
<li>Parse photo by photo, tagging each one once per person appearing on it. Don&#8217;t move to the next photo until tags for eveyone appearing on current one have been asigned.</li>
<li>Parse whole batch, once per person. You pick a person, select all pics where she appears, then you tag all of them simultaneously. Repeat for each person.</li>
</ol>
<p>I have found that, for large amounts of pictures, the second approach is fairly superior. However, it is not problem-free. Firstly, multiple selection is only possible in a grid view. That is, pictures are presented as <a href="http://en.wikipedia.org/wiki/thumbnails">thumbnails</a>, aligned in columns and rows. Even in the largest possible size for such pictures, often times there are many photos that are too small to spot all people in them. Secondly, having selected some dozens of pictures out of some hundreds, and mistakenly unselecting them by clicking where you shouldn&#8217;t, or failing to hold the Ctrl key when clicking (or whatever error whose probability to happen increases with the amount of pictures to tag) is just painful.</p>
<p><b>Fairy tale solution</b></p>
<p>I realized a hybrid method would be advantageous, but that&#8217;s where the problem comes: I find no simple way to accomplish it. I would like to be able to do the following comfortably: inspect the photos one by one, tagging each one in which person A appears. When all are tagged, repeat for person B, and so on. Right now this approach will take longer than either approaches above, because it borrows the worse characteristics from both (one-by-one tagging of method 1, scanning all the photos repeatedly, once per person, from method 2). The reason for that is that asigning a single tag to a single photo is cumbersome. You right-click on the photo, then select &#8220;Assign Tag&#8221; from the menu that appears, then choose a tag from the drop-down menu (and submenus if case be). </p>
<p>There is no shortcut that one can assign to some tag, or, even better, a single-key shortcut for &#8220;assign to this photo the last tag I have assigned to the previous one&#8221;. If there was, my hybrid approach would be really fast: take person A, appearing in picture 1. Tag pic 1 with &#8220;A&#8221;. Then go picture by picture (a single hit of the space bar), either ignoring the pics where person &#8220;A&#8221; does not appear, or pressing the &#8220;apply last tag&#8221; shortcut (a single keystroke) where she does.</p>
<p><b>Hacky solution</b></p>
<p>Of the tools that digiKam offers, which one can modify a photo in a way that the contents are not touched, yet we can group them afterwards based on that change? Easy: rename (F2 key). When you press F2, a rename dialog appears, with a field where you can enter the new name for the currently selected pic. The good thing is the field is already filled with the current name of the photo. So, if you want to rename a photo to, say, the same name but with a trailing dot, all you have to do is press the sequence: F2 + . + Enter. </p>
<p>Now, how on Earth would the renaming help? Well, we could use the above &#8220;trick&#8221; to quickly rename all pictures in which person A appears, making all of them have the same name, but with a trailing dot added. Then, we could Alt-Tab to a terminal, cd to the dir where the photos reside, and execute the following (<a href="http://en.wikipedia.org/wiki/Z shell">zsh</a> syntax, translate to your favorite shell):</p>
<div class="codeblock">
% mkdir totag<br />
% for file in *.; mv $file totag/`echo $file | sed &#8216;s/.$//&#8217;`
</div>
<p>That will put all files ending in a dot inside a subfolder called &#8220;totag&#8221;, renaming them back to their original name (chopping off the last character, which would be the dot). Don&#8217;t forget the fact that these files happen to be all in which person A appears. <del datetime="2010-07-07T17:02:30+00:00">Recall as well that digiKam keeps track of the tags applied to each photo by its <a href="http://en.wikipedia.org/wiki/md5sum">md5sum</a> (OK, I made that up, but it must be true), so moving files around and/or renaming them (both things are one and the same, actually) doesn&#8217;t mess with the tags.</del> (see warning at the top of this post).</p>
<p>So, once all pics with person A reside in folder &#8220;totag&#8221;, we can Alt-Tab back to digiKam, go to that folder, select all pics, and tag them all at once. After that, Alt-Tab to the terminal, and execute:</p>
<div class="codeblock">
% mv totag/* .
</div>
<p>The real beauty of using a shell for that (even with the apparently complicated command with the for loop above), is that you can reuse the commands trivially. For person B, once all relevant photos have been renamed with a dot, Alt-Tab to the terminal, hit the Up arrow twice, then Enter, and you will move and rename all files again in just three keystrokes (two of them being the same key hit twice). Alt-Tab to digiKam, tag all pics in the &#8220;totag&#8221; dir. Alt-Tab to the terminal, Up+Up+Enter (which now executes the <tt>mv</tt>), and you have the files in the main dir again.</p>
<p><b>Conclusion</b></p>
<p>Yeah, I bet right now you are considering whether my idea of what is &#8220;simple&#8221; or &#8220;comfortable&#8221; is seriously off. I&#8217;d still vote for the &#8220;Reapply last tag&#8221; shortcut in digiKam. It would make a three-keystroke step (F2+.+Enter, to rename) a single keystroke one (reapply last tag with shortcut), plus would make the steps involving the terminal unnecessary. But reality is a bitch, and we don&#8217;t have such a shortcut. I could either just rant about it on my blog, or go ahead and find a solution myself. I chose to do both :^)</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://handyfloss.net/2010.07/the-nightmare-of-tagging-multiple-photos-with-digikam-and-a-hacky-way-around-it-part-ii/" title="The nightmare of tagging multiple photos with digiKam, and a hacky way around it. Part II (July 8, 2010)">The nightmare of tagging multiple photos with digiKam, and a hacky way around it. Part II</a> (0)</li>
	<li><a href="http://handyfloss.net/2008.10/usable-compiz-fusion-zoom-to-window/" title="Usable Compiz Fusion: zoom to window (October 1, 2008)">Usable Compiz Fusion: zoom to window</a> (0)</li>
	<li><a href="http://handyfloss.net/2010.03/speed-up-pygtk-and-cairo-by-reusing-images/" title="Speed up PyGTK and Cairo by reusing images (March 18, 2010)">Speed up PyGTK and Cairo by reusing images</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://handyfloss.net/2010.07/the-nightmare-of-tagging-multiple-photos-with-digikam-and-a-hacky-way-around-it/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Scrobbling to Last.fm with Amarok 2.3 and no Kwallet</title>
		<link>http://handyfloss.net/2010.06/scrobbling-to-last-fm-with-amarok-2-3-and-no-kwallet/</link>
		<comments>http://handyfloss.net/2010.06/scrobbling-to-last-fm-with-amarok-2-3-and-no-kwallet/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 11:42:33 +0000</pubDate>
		<dc:creator>isilanes</dc:creator>
				<category><![CDATA[Free software and related beasts]]></category>
		<category><![CDATA[about me]]></category>
		<category><![CDATA[amarok]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[FLOSS]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[last.fm]]></category>
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://handyfloss.net/?p=1084</guid>
		<description><![CDATA[I am not a great KWallet fan (probably due to ignorance), so when I introduce my Last.fm credentials in Amarok I get this warning that they will be saved in plain text (because Kwallet is not running). That didn&#8217;t bother me much, until recently. As it happens, my computer at work (Amarok 2.3 on Arch [...]]]></description>
			<content:encoded><![CDATA[<p>I am not a great <a href="http://en.wikipedia.org/wiki/KWallet">KWallet</a> fan (probably due to ignorance), so when I introduce my <a href="http://en.wikipedia.org/wiki/Last.fm">Last.fm</a> credentials in <a href="http://en.wikipedia.org/wiki/Amarok (software)">Amarok</a> I get this warning that they will be saved in plain text (because Kwallet is not running). That didn&#8217;t bother me much, until recently. As it happens, my computer at work (Amarok 2.3 on <a href="http://en.wikipedia.org/wiki/Arch Linux">Arch Linux</a>) does not scrobble (publish) the tracks I play into Last.fm. </p>
<p>The root of the problem seems to be that my Last.fm credentials are not actually saved. If I go to <i>Settings -> Configure Amarok -> Internet Services -> Last.fm</i>, I can write my &#8220;Username&#8221; and &#8220;Password&#8221; there. If I click on &#8220;Test login&#8221;, it will report a success for valid credentials, and a failure for wrong ones. If I click &#8220;OK&#8221;  (that is, save and exit), the aforementioned warning about Kwallet not running appears (no big deal so far), and if I choose to accept the proposal of saving the password in plain text Amarok seems to accept it. The problem is, it doesn&#8217;t really. My tracks don&#8217;t get scrobbled, and if I go to the Last.fm settings again, the credentials are empty.</p>
<p>In my computer at home, with an identical Amarok 2.3 on Arch Linux and with no Kwallet, the credentials do get saved, and the scrobbling does work. It might well be because I alreadly applied the trick I will explain next (and I don&#8217;t remember having done it). I came accross the solution at <a href="https://bugs.launchpad.net/ubuntu/+source/amarok/+bug/555688">bug report 555688</a> at <a href="http://en.wikipedia.org/wiki/ Launchpad_(website)">Launchpad</a>, the Ubuntu bugtracking site.</p>
<p>The solution is simple. Edit the following file:</p>
<div class="codeblock">
~/.kde4/share/config/amarokrc
</div>
<p>and add the following (section <code>[Service_LastFm]</code> will most likely already exist):</p>
<div class="codeblock">
[Service_LastFm]<br />
fetchSimilar=true<br />
ignoreWallet=yes<br />
password=YOURPASSWORD<br />
scrobble=true<br />
username=YOURUSERNAME
</div>
<p>where <code>YOURPASSWORD</code> and <code>YOURUSERNAME</code> must obviously be changed for the appropriate values.</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://handyfloss.net/2009.04/my-ubuntu-jaunty-jackalope-upgrade-plan/" title="My Ubuntu Jaunty Jackalope upgrade plan (April 27, 2009)">My Ubuntu Jaunty Jackalope upgrade plan</a> (0)</li>
	<li><a href="http://handyfloss.net/2008.10/usable-compiz-fusion-zoom-to-window/" title="Usable Compiz Fusion: zoom to window (October 1, 2008)">Usable Compiz Fusion: zoom to window</a> (0)</li>
	<li><a href="http://handyfloss.net/2009.06/ubuntu-error-the-installer-needs-to-remove-operating-system-files/" title="Ubuntu error: the installer needs to remove operating system files (June 18, 2009)">Ubuntu error: the installer needs to remove operating system files</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://handyfloss.net/2010.06/scrobbling-to-last-fm-with-amarok-2-3-and-no-kwallet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Speed up PyGTK and Cairo by reusing images</title>
		<link>http://handyfloss.net/2010.03/speed-up-pygtk-and-cairo-by-reusing-images/</link>
		<comments>http://handyfloss.net/2010.03/speed-up-pygtk-and-cairo-by-reusing-images/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 12:15:24 +0000</pubDate>
		<dc:creator>isilanes</dc:creator>
				<category><![CDATA[Free software and related beasts]]></category>
		<category><![CDATA[about me]]></category>
		<category><![CDATA[cairo]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[FLOSS]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[neo freerunner]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://handyfloss.net/?p=1022</guid>
		<description><![CDATA[As you might have read in this blog, I own a Neo FreeRunner since one year ago. I have used it far less than I should have, mostly because it&#8217;s a wonderful toy, but a lousy phone. The hardware is fine, although externally quite a bit less sexy than other smartphones such as the iPhone. [...]]]></description>
			<content:encoded><![CDATA[<p>As you might have read in this blog, <a href="http://handyfloss.net/2009.01/first-impressions-on-a-neo-freerunner/">I own a Neo FreeRunner since one year ago</a>. I have used it far less than I should have, mostly because it&#8217;s a wonderful toy, but a lousy phone. The hardware is fine, although externally quite a bit less sexy than other smartphones such as the iPhone. The software, however, is not very mature. Being as open as it is, different Linux-centric distros have been developed for it, but I haven&#8217;t been able to find one that converts the Neo into an everyday use phone.</p>
<p>But let&#8217;s cut the rant, and stick to the issue: that the Neo is a nice playground for a computer geek. Following my desire to play, I installed <a href="http://wiki.openmoko.org/wiki/Debian">Debian</a> on it. Next, I decided to make some GUI programs for it, such a screen locker. I found <a href="http://wiki.openmoko.org/wiki/Zedlock">Zedlock</a>, a program written in Python, using GTK+ and Cairo. Basically, Zedlock paints a lock on the screen, and refuses to disappear until you paint a big &#8220;Z&#8221; on the screen with your finger. Well, that&#8217;s what it&#8217;s <i>supposed</i> to do, because the 0.1 version available at the Openmoko wiki is not functional. However, with Zedlock I found just what I wanted: a piece of software capable of doing really cool graphical things on the screen of my Neo, while being simple enough for me to understand.</p>
<p>Using Zedlock as a base, I am starting to have real fun programming GUIs, but a problem has quickly arisen: their response is slow. My programs, as all GUIs, draw an image on the screen, and react to tapping in certain places (that is, buttons) by doing things that require that the image on the screen be modified and repainted. This repainting, done as in Zedlock, is too slow. To speed things up, I googled the issue, and found <a href="http://stackoverflow.com/questions/2172525/why-is-my-simple-python-gtkcairo-program-running-so-slowly-stutteringly">a StackOverflow question</a> that suggested the obvious route: to cache the images. Let&#8217;s see how I did it, and how it turned out.</p>
<h2>Material</h2>
<p>You can download the three Python scripts, plus two sample PNGs, from: <a href="http://isilanes.org/pub/blog/pygtk/">http://isilanes.org/pub/blog/pygtk/</a>.</p>
<h2>Version 0</h2>
<p>You can download this program <a href="http://isilanes.org/pub/blog/pygtk/p0.py">here</a>. Its main loop follows:</p>
<pre class="brush:python">
C = Canvas()

# Main window:
C.win = gtk.Window()
C.win.set_default_size(C.width, C.height)

# Drawing area:
C.canvas = gtk.DrawingArea()
C.win.add(C.canvas)
C.canvas.connect('expose_event', C.expose_win)

C.regenerate_base()

# Repeat drawing of bg:
try:
  C.times = int(sys.argv[1])
except:
  C.times = 1

gobject.idle_add(C.regenerate_base)
C.win.show_all()

# Main loop:
gtk.main()
</pre>
<p>As you can see, it generates a GTK+ window (line 04), with a DrawingArea inside (line 08), and then executes the <code>regenerate_base()</code> function every time the main loop is idle (line 20). <code>Canvas()</code> is a class whose structure is not relevant for the discussion here. It basically holds all variables and relevant functions. The <code>regenerate_base()</code> function follows:</p>
<pre class="brush:python">
def regenerate_base(self):

    # Base Cairo Destination surface:
    self.DestSurf = cairo.ImageSurface(cairo.FORMAT_ARGB32, self.width, self.height)
    self.target   = cairo.Context(self.DestSurf)

    # Background:
    if self.bg == 'bg1.png':
      self.bg = 'bg2.png'
    else:
      self.bg = 'bg1.png'

    self.i += 1

    image       = cairo.ImageSurface.create_from_png(self.bg)
    buffer_surf = cairo.ImageSurface(cairo.FORMAT_ARGB32, self.width, self.height)
    buffer      = cairo.Context(buffer_surf)
    buffer.set_source_surface(image, 0,0)
    buffer.paint()

    self.target.set_source_surface(buffer_surf, 0, 0)
    self.target.paint()

    # Redraw interface:
    self.win.queue_draw()

    if self.i > self.times:
      sys.exit()

    return True
</pre>
<p>As you can see, it paints the whole window with a PNG file (lines 15-25), choosing alternately <code>bg1.png</code> and <code>bg2.png</code> each time it is called (lines 07-11). Since the re-painting is done every time the main event loop is idle, it just means that images are painted to screen as fast as possible. After a given amount of re-paintings, the script exits.</p>
<p>You can run the code above by placing two suitable PNGs (480&#215;640 pixels) in the same directory as the above code. If an integer argument is given to the script, it re-paints the window that many times, then exits (default, just once). You can time this script by executing, e.g.:</p>
<div class="codeblock">
% /usr/bin/time -f %e ./p0.py 1000
</div>
<h2>Version 1</h2>
<p>You can download this version <a href="http://isilanes.org/pub/blog/pygtk/p1.py">here</a>. </p>
<p>The first difference with <code>p1.py</code> is that the <code>regenerate_base()</code> function has been separated into the first part (<code>generate_base()</code>), which is executed only once at program startup (see below), and all the rest, which is executed every time the background is changed.</p>
<pre class="brush:python">
def generate_base(self):

    # Base Cairo Destination surface:
    self.DestSurf = cairo.ImageSurface(cairo.FORMAT_ARGB32, self.width, self.height)
    self.target   = cairo.Context(self.DestSurf)
</pre>
<p>The main difference, though, is that two new functions are introduced:</p>
<pre class="brush:python">
  def mk_iface(self):

    if not self.bg in self.buffers:
      self.buffers[self.bg] = self.generate_buffer(self.bg)

    self.target.set_source_surface(self.buffers[self.bg], 0, 0)
    self.target.paint()

  def generate_buffer(self, fn):

    image       = cairo.ImageSurface.create_from_png(fn)
    buffer_surf = cairo.ImageSurface(cairo.FORMAT_ARGB32, self.width, self.height)
    buffer      = cairo.Context(buffer_surf)
    buffer.set_source_surface(image, 0,0)
    buffer.paint()

    # Return buffer surface:
    return buffer_surf
</pre>
<p>The function <code>mk_iface()</code> is called within <code>regenerate_base()</code>, and draws the background. However, the actual generation of the background image (the Cairo surface) is done in the second function, <code>generate_buffer()</code>, and only happens once per each background (i.e., twice in total), because <code>mk_iface()</code> reuses previously generated (and cached) surfaces.</p>
<h2>Version 2</h2>
<p>You can download this version <a href="http://isilanes.org/pub/blog/pygtk/p2.py">here</a>.</p>
<p>The difference with Revision 1 is that I eliminated some apparently redundant procedures for creating surfaces upon surfaces. As a result, the <code>generate_base()</code> function disappears again. I get rid of the <code>DestSurf</code> and <code>C.target</code> variables, so the <code>mk_iface()</code> and <code>expose_win()</code> functions end up as follows:</p>
<pre class="brush:python">
  def mk_iface(self):

    if not self.bg in self.buffers:
      self.buffers[self.bg] = self.generate_buffer(self.bg)

    buffer = self.canvas.window.cairo_create()
    buffer.set_source_surface(self.buffers[self.bg],0,0)
    buffer.paint()

  def expose_win(self, drawing_area, event):

    nm = 'bg1.png'

    if not nm in self.buffers:
      self.buffers[nm] = self.generate_buffer(nm)

    ctx = drawing_area.window.cairo_create()
    ctx.set_source_surface(self.buffers[nm], 0, 0)
    ctx.paint()
</pre>
<p>A side effect is that I can get also rid of the forced redraws of <code>self.win.queue_draw()</code>.</p>
<h2>Results</h2>
<p>I have run the three versions above, varying the <code>C.times</code> variable, i.e., making a varying number of reprints. The command used (actually inside a script) would be something like the one mentioned above:</p>
<div class="codeblock">
% /usr/bin/time -f %e ./p0.py 1000
</div>
<p>The following table sumarizes the results for Flanders and Maude (see <a href="http://handyfloss.net/my-computers/">my computers</a>), a desktop P4 and my Neo FreeRunner, respectively. All times in seconds.</p>
<div align="center">
<table cellspacing="12">
<tr>
<td><i>Flanders</i></td>
</tr>
<tr>
<td><b>Repaints</b></td>
<td><b>Version 0</b></td>
<td><b>Version 1</b></td>
<td><b>Version 2</b></td>
</tr>
<tr>
<td>1</td>
<td>0.26</td>
<td>0.43</td>
<td>0.33</td>
</tr>
<tr>
<td>4</td>
<td>0.48</td>
<td>0.40</td>
<td>0.42</td>
</tr>
<tr>
<td>16</td>
<td>0.99</td>
<td>0.43</td>
<td>0.40</td>
</tr>
<tr>
<td>64</td>
<td>2.77</td>
<td>0.76</td>
<td>0.56</td>
</tr>
<tr>
<td>256</td>
<td>9.09</td>
<td>1.75</td>
<td>1.15</td>
</tr>
<tr>
<td>1024</td>
<td>37.03</td>
<td>6.26</td>
<td>3.44</td>
</tr>
</table>
</div>
<div align="center">
<table cellspacing="12">
<tr>
<td><i>Maude</i></td>
</tr>
<tr>
<td><b>Repaints</b></td>
<td><b>Version 0</b></td>
<td><b>Version 1</b></td>
<td><b>Version 2</b></td>
</tr>
<tr>
<td>1</td>
<td>4.17</td>
<td>4.70</td>
<td>5.22</td>
</tr>
<tr>
<td>4</td>
<td>8.16</td>
<td>6.35</td>
<td>6.41</td>
</tr>
<tr>
<td>16</td>
<td>21.58</td>
<td>14.17</td>
<td>12.28</td>
</tr>
<tr>
<td>64</td>
<td>75.14</td>
<td>44.43</td>
<td>35.76</td>
</tr>
<tr>
<td>256</td>
<td>288.11</td>
<td>165.58</td>
<td>129.56</td>
</tr>
<tr>
<td>512</td>
<td>561.78</td>
<td>336.58</td>
<td>254.73</td>
</tr>
</table>
</div>
<p>Data in the tables above has been fitted to a linear equation, of the form <i>t = A + B n</i>, where <i>n</i> is the number of repaints. In that equation, parameter <i>A</i> would represent a startup time, whereas <i>B</i> represents the time taken by each repaint. The linear fits are quite good, and the values for the parameters are given in the following tables (units are milliseconds, and milliseconds/repaint):</p>
<div align="center">
<table cellspacing="12">
<tr>
<td><i>Flanders</i></td>
</tr>
<tr>
<td><b>Parameter</b></td>
<td><b>Version 0</b></td>
<td><b>Version 1</b></td>
<td><b>Version 2</b></td>
</tr>
<tr>
<td><i>A</i></td>
<td>291</td>
<td>366</td>
<td>366</td>
</tr>
<tr>
<td><i>B</i></td>
<td>36</td>
<td>6</td>
<td>3</td>
</tr>
</table>
</div>
<div align="center">
<table cellspacing="12">
<tr>
<td><i>Maude</i></td>
</tr>
<tr>
<td><b>Parameter</b></td>
<td><b>Version 0</b></td>
<td><b>Version 1</b></td>
<td><b>Version 2</b></td>
</tr>
<tr>
<td><i>A</i></td>
<td>453</td>
<td>3218</td>
<td>4530</td>
</tr>
<tr>
<td><i>B</i></td>
<td>1092</td>
<td>648</td>
<td>487</td>
</tr>
</table>
</div>
<p>Darn it! I have mixed feelings for the results. In the desktop computer (Flanders), the gains are huge, but hardly noticeable. Cacheing the images (Version 1) makes for a 6x speedup, whereas Version 2 gives another twofold increase in speed (a total of 12x speedup!). However, from a user&#8217;s point of view, a 36 ms refresh is just as immediate as a 6 ms refresh.</p>
<p>On the other hand, on the Neo, the gains are less spectacular: the total gain in speed for Version 2 is a mere 2x. Anyway, half-a-second repaints instead of one-second ones <i>are</i> noticeable, so there&#8217;s that.</p>
<p>And at least I had fun and learned in the process! :^)</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://handyfloss.net/2009.06/changing-font-style-in-pygtk-combobox/" title="Changing font style in PyGTK ComboBox (June 10, 2009)">Changing font style in PyGTK ComboBox</a> (0)</li>
	<li><a href="http://handyfloss.net/2009.07/plzma-py-a-wrapper-for-parallel-implementation-of-lzma-compression/" title="plzma.py: a wrapper for parallel implementation of LZMA compression (July 23, 2009)">plzma.py: a wrapper for parallel implementation of LZMA compression</a> (3)</li>
	<li><a href="http://handyfloss.net/2009.12/chopzip-a-parallel-implementation-of-arbitrary-compression-algorithms/" title="ChopZip: a parallel implementation of arbitrary compression algorithms (December 20, 2009)">ChopZip: a parallel implementation of arbitrary compression algorithms</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://handyfloss.net/2010.03/speed-up-pygtk-and-cairo-by-reusing-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Avoiding time_increment_bits problem when encoding bad header MPEG4 videos to Ogg Theora</title>
		<link>http://handyfloss.net/2010.01/avoiding-time_increment_bits-problem-when-encoding-bad-header-mpeg4-videos-to-ogg-theora/</link>
		<comments>http://handyfloss.net/2010.01/avoiding-time_increment_bits-problem-when-encoding-bad-header-mpeg4-videos-to-ogg-theora/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 21:23:02 +0000</pubDate>
		<dc:creator>isilanes</dc:creator>
				<category><![CDATA[Free software and related beasts]]></category>
		<category><![CDATA[about me]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[FLOSS]]></category>
		<category><![CDATA[format war]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[support]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[YouTube]]></category>

		<guid isPermaLink="false">http://handyfloss.net/?p=990</guid>
		<description><![CDATA[There is some debate going on lately about the migration of YouTube to HTML5, and whether they (i.e. YouTube&#8217;s owner, Google) should support H.264 or Theora as standard codecs for the upcoming &#60;video&#62; tag. See, for example, how the FSF asks for support for Theora. The thing is, I discovered x264 not so long ago, [...]]]></description>
			<content:encoded><![CDATA[<p>There is some debate going on lately about the migration of YouTube to <a href="http://en.wikipedia.org/wiki/HTML5">HTML5</a>, and whether they (i.e. YouTube&#8217;s owner, Google) should support <a href="http://en.wikipedia.org/wiki/H.264">H.264</a> or <a href="http://en.wikipedia.org/wiki/Theora">Theora</a> as standard codecs for the upcoming &lt;video&gt; tag. See, for example, <a href="http://www.fsf.org/blogs/community/youtube-ogg">how the FSF asks for support for Theora</a>.</p>
<p>The thing is, I discovered <a href="http://en.wikipedia.org/wiki/x264">x264</a> not so long ago, and I thought it was a &#8220;free version&#8221; of H.264. I began using it to reencode the medium-to-low quality videos I keep (e.g., movies and series). The resulting quality/file size ratio stunned me. I could reencode most material downloaded from e.g. p2p sources to 2/3 of their size, keeping the copy indistinguishable from the original with the bare eye.</p>
<p>However, after realizing that x264 is just a free implementation of the proprietary H.264 codec, and in the wake of the H.264/Theora debate, I decided to give Ogg Theora a go. I expected a fair competitor to H.264, although still noticeably behind in quality/size ratio. And that I found. I for one do not care if I need a 10% larger file to attain the same quality, if it means using free formats, so I decided to adopt Theora for everyday reencoding.</p>
<p>After three paragraphs of introduction, let&#8217;s get to the point. Which is that reencoding some files with <a href="http://en.wikipedia.org/wiki/ffmpeg2theora">ffmpeg2theora</a> I would get the following error:</p>
<div class="codeblock">
<pre>
% ffmpeg2theora -i example_video.avi -o output.ogg
[avi @ 0x22b7560]Something went wrong during header parsing, I will ignore it and try to continue anyway.
[NULL @ 0x22b87f0]hmm, seems the headers are not complete, trying to guess time_increment_bits
[NULL @ 0x22b87f0]my guess is 15 bits ;)
[NULL @ 0x22b87f0]looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag
Input #0, avi, from 'example_video.avi':
  Metadata:
    Title           : example_video.avi
  Duration: 00:44:46.18, start: 0.000000, bitrate: 1093 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 624x464, 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0.1: Audio: mp3, 48000 Hz, 2 channels, s16, 32 kb/s
  [audio disabled].

[mpeg4 @ 0x22b87f0]hmm, seems the headers are not complete, trying to guess time_increment_bits
[mpeg4 @ 0x22b87f0]my guess is 16 bits ;)
[mpeg4 @ 0x22b87f0]hmm, seems the headers are not complete, trying to guess time_increment_bits
[mpeg4 @ 0x22b87f0]my guess is 16 bits ;)
[mpeg4 @ 0x22b87f0]looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag
    Last message repeated 1 times
[mpeg4 @ 0x22b87f0]warning: first frame is no keyframe
</pre>
</div>
<p>I searched the web for solutions, but to no avail. Usually pasting literal errors in Google yields good results, but in this case I only found developer forums where this bug was discussed. What I haven&#8217;t found is simple instructions on how to avoid it in practice.</p>
<p>Well, here it goes my simple solution: pass it through <a href="http://en.wikipedia.org/wiki/MEncoder">MEncoder</a> first. Where the following fails:</p>
<div class="codeblock">
% ffmpeg2theora -i input.avi -o output.ogg
</div>
<p>the following succeeds:</p>
<div class="codeblock">
% mencoder input.avi -ovc copy -oac copy -o filtered.avi<br />
% ffmpeg2theora -i filtered.avi -o output.ogg
</div>
<p>I guess that what happens is basically that mencoder takes the &#8220;raw&#8221; video data in <tt>input.avi</tt> and makes a copy into <tt>filtered.avi</tt> (which ends up being exactly the same video), building sane headers in the process.</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://handyfloss.net/2008.10/usable-compiz-fusion-zoom-to-window/" title="Usable Compiz Fusion: zoom to window (October 1, 2008)">Usable Compiz Fusion: zoom to window</a> (0)</li>
	<li><a href="http://handyfloss.net/2010.07/the-nightmare-of-tagging-multiple-photos-with-digikam-and-a-hacky-way-around-it-part-ii/" title="The nightmare of tagging multiple photos with digiKam, and a hacky way around it. Part II (July 8, 2010)">The nightmare of tagging multiple photos with digiKam, and a hacky way around it. Part II</a> (0)</li>
	<li><a href="http://handyfloss.net/2010.07/the-nightmare-of-tagging-multiple-photos-with-digikam-and-a-hacky-way-around-it/" title="The nightmare of tagging multiple photos with digiKam, and a hacky way around it (July 6, 2010)">The nightmare of tagging multiple photos with digiKam, and a hacky way around it</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://handyfloss.net/2010.01/avoiding-time_increment_bits-problem-when-encoding-bad-header-mpeg4-videos-to-ogg-theora/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Reverse SSH to twart over-zealous firewalls</title>
		<link>http://handyfloss.net/2010.01/reverse-ssh-to-twart-over-zealous-firewalls/</link>
		<comments>http://handyfloss.net/2010.01/reverse-ssh-to-twart-over-zealous-firewalls/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 13:18:54 +0000</pubDate>
		<dc:creator>isilanes</dc:creator>
				<category><![CDATA[Free software and related beasts]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[FLOSS]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[networks]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://handyfloss.net/?p=951</guid>
		<description><![CDATA[I guess it is not very uncommon, since it has happened twice to me, in two sites I have worked. &#8220;Over-cautious&#8221; sysadmins decide that the University, Institute, Corporation, or whatever, would be safer if connections to the LAN from outside of it were banned, including the port 22. In an effort to avoid making security [...]]]></description>
			<content:encoded><![CDATA[<p>I guess it is not very uncommon, since it has happened twice to me, in two sites I have worked. &#8220;Over-cautious&#8221; sysadmins decide that the University, Institute, Corporation, or whatever, would be safer if connections to the <a href="http://en.wikipedia.org/wiki/LAN">LAN</a> from outside of it were banned, including the <a href="http://en.wikipedia.org/wiki/Secure Shell">port 22</a>. In an effort to avoid making security trample service (how considerate!) the usual solution to allow remote conection is to use <a href="http://en.wikipedia.org/wiki/VPN">VPN</a>.</p>
<p>While VPN might have some advantages over SSH, I prefer the latter by far, and don&#8217;t think a proper SSH setup has any lack of security, specially comparing to poorly implemented VPNs. For example, I would never trust something as vital as VPN software to a private company, yet most popular VPNs are proprietary (at least the University of the Basque Country uses the Cisco VPN). It is at least paradoxical that a free and open SSH implementation as e.g. <a href="http://en.wikipedia.org/wiki/OpenSSH">OpenSSH</a>, tested in such a throughout way, and for so long, is dumped, and a black-box solution developed by a profit-driven organization is used instead.</p>
<p>But I digress. I am not interesting in justifying why I want SSH. What I want to show here is a trick I learned reading <a href="http://www.tuxradar.com/content/command-line-tricks-smart-geeks">tuxradar.com</a>. Esentially, allows one to connect (with SSH) from machine A to machine B, even if machine B has all ports closed (so SSH-ing using another port would be useless either).</p>
<p>The idea (see below) is to connect from machine B to A, which is allowed (and is also the exact reverse of what we actually want to do), in a way that opens a canal for a &#8220;reverse&#8221; connection from A to B:</p>
<div class="codeblock">
<i>(In machine_B)</i><br />
% ssh -R 1234:localhost:22 username_in_A@machine_A
</div>
<p>Then we will be able to use port 1234 (or whatever port we specify in the <tt>ssh -R</tt> command above) in machine A to connect to machine B, as long as the original <tt>ssh -R</tt> holds:</p>
<div class="codeblock">
<i>(In machine_A)</i><br />
% ssh username_in_B@localhost -p 1234
</div>
<p>The picture shows it better:</p>
<div align="center">
<img src="http://isilanes.org/pub/blog/pics/ssh-R.png">
</div>
<p>SSHing from A to B (dashed red arrow) is disallowed, but the reverse (in black) is not. The <tt>ssh -R</tt> command line (see code above), opens up the link between ports 22 and 1234 (two-headed black arrow), so that a <tt>ssh -p</tt> to port 1234 in machine A will redirect us to machine B. If we are asked for a password (at the <tt>ssh -p</tt> stage), they are requesting the one for <b>machine B</b>, since we are being redirected to machine B.</p>
<p>Please, recall that the above recipe is no less secure than a regular SSH from A to B (if it were allowed), since anyone SSHing to port 1234 in machine A will be automatically redirected to machine B, but undergoing the same security checks as usual (password, public/private key&#8230;). Note also that I am talking about what is possible, not necessarily desirable or comfortable. It&#8217;s just another tool if you want to use it.</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://handyfloss.net/2007.01/wifi-with-wpa-under-ubuntudebian/" title="WiFi with WPA under Ubuntu/Debian (January 28, 2007)">WiFi with WPA under Ubuntu/Debian</a> (5)</li>
	<li><a href="http://handyfloss.net/2006.10/ssh-connection-without-password/" title="SSH connection without password (October 6, 2006)">SSH connection without password</a> (1)</li>
	<li><a href="http://handyfloss.net/2009.04/my-ubuntu-jaunty-jackalope-upgrade-plan/" title="My Ubuntu Jaunty Jackalope upgrade plan (April 27, 2009)">My Ubuntu Jaunty Jackalope upgrade plan</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://handyfloss.net/2010.01/reverse-ssh-to-twart-over-zealous-firewalls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hardware compatibility is better with Windows&#8230; not</title>
		<link>http://handyfloss.net/2010.01/hardware-compatibility-is-better-with-windows-not/</link>
		<comments>http://handyfloss.net/2010.01/hardware-compatibility-is-better-with-windows-not/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 12:20:28 +0000</pubDate>
		<dc:creator>isilanes</dc:creator>
				<category><![CDATA[Free software and related beasts]]></category>
		<category><![CDATA[about me]]></category>
		<category><![CDATA[eeepc]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[FLOSS]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[opinion]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://handyfloss.net/?p=941</guid>
		<description><![CDATA[One of the (few, but legitimate) reasons given by some Windows users to not switch to Linux is that many pieces of hardware are not recognized by the latter. Sure enough, 99.9%, if not all, of the devices sold in shops are &#8220;Windows compatible&#8221;. The manufacturers of devices make damn sure their device, be it [...]]]></description>
			<content:encoded><![CDATA[<p>One of the (few, but legitimate) reasons given by some Windows users to not switch to Linux is that many pieces of hardware are not recognized by the latter. Sure enough, 99.9%, if not all, of the devices sold in shops are &#8220;Windows compatible&#8221;. The manufacturers of devices make damn sure their device, be it a pendrive or a printer, a computer screen or a keyboard, will work on any PC running Windows. They will even ship a CD with the drivers in the same package, so that installation of the device is as smooth as possible in Microsoft&#8217;s platform. Linux compatibility? Well, they usually just don&#8217;t care. Those hackers will make it work anyway, so why bother? And their market share is too small to take them into account.</p>
<p>Now, let&#8217;s pass to some personal experience with a webcam. I bought a webcam for my girlfriend&#8217;s laptop, which doesn&#8217;t have one integrated. The webcam was a cheap Logitech USB one, with &#8220;Designed for Skype&#8221; and &#8220;Windows compatible&#8221; written all around on the box. It even came with a CD, marked prominently as &#8220;Windows drivers&#8221;. My girlfriend&#8217;s laptop runs Windows Vista, and I decided to give it a chance, and plugged the webcam without further consideration. A message from our beloved OS informed me that a new device had been plugged (brilliant!) but Windows lacked the necessary drivers to make it work (bummer!). OK, no problem. We had the drivers, right? I unplugged the camera, inserted the CD, and followed the instructions to get the drivers installed. Everything went fine, except that the progress bar with the installation percent went on for more than 12 minutes (checked on the watch) before reaching 100%. After installation, Windows informed me that a system reboot was necessary, and so I did. After reboot, the camera would work.</p>
<p>As I had my Asus Eee at hand, I decided to try the webcam on it. I plugged it, and nothing happened. I just saw the green light on the camera turn on. Well, maybe it worked&#8230; I opened Cheese, a Linux program to show the output of webcams. I was a bit wary, because the Eee has an integrated webcam, so maybe there would be some interference or something. Not so. Cheese showed me immediately the output of the webcam I had just plugged, and offered me a menu with two entries (USB webcam and integrated one), so I could choose. That&#8217;s it. No CD with drivers, no 12-minute installation, no reboot, no nothing. Just plug and play.</p>
<p>Perhaps it is worth mentioning that the next time I tried to use the webcam on the Vista laptop, it would ask me for driver installation again! I don&#8217;t know why&#8230; I must have done something wrong in the first installation&#8230; With Windows, who knows?</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://handyfloss.net/2009.03/temperature-and-fan-speed-control-on-the-asus-eee-pc/" title="Temperature and fan speed control on the Asus Eee PC (March 15, 2009)">Temperature and fan speed control on the Asus Eee PC</a> (4)</li>
	<li><a href="http://handyfloss.net/2008.07/making-isight-camera-work-in-ubuntu/" title="Making iSight camera work in Ubuntu (July 4, 2008)">Making iSight camera work in Ubuntu</a> (17)</li>
	<li><a href="http://handyfloss.net/2009.06/ubuntu-error-the-installer-needs-to-remove-operating-system-files/" title="Ubuntu error: the installer needs to remove operating system files (June 18, 2009)">Ubuntu error: the installer needs to remove operating system files</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://handyfloss.net/2010.01/hardware-compatibility-is-better-with-windows-not/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>ChopZip: a parallel implementation of arbitrary compression algorithms</title>
		<link>http://handyfloss.net/2009.12/chopzip-a-parallel-implementation-of-arbitrary-compression-algorithms/</link>
		<comments>http://handyfloss.net/2009.12/chopzip-a-parallel-implementation-of-arbitrary-compression-algorithms/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 16:59:04 +0000</pubDate>
		<dc:creator>isilanes</dc:creator>
				<category><![CDATA[Free software and related beasts]]></category>
		<category><![CDATA[about me]]></category>
		<category><![CDATA[bzip2]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[disk usage]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[FLOSS]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[lzip]]></category>
		<category><![CDATA[lzma]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://handyfloss.net/?p=913</guid>
		<description><![CDATA[Remember plzma.py? I made a wrapper script for running LZMA in parallel. The script could be readily generalized to use any compression algorithm, following the principle of breaking the file in parts (one per CPU), compressing the parts, then tarring them together. In other words, chop the file, zip the parts. Hence the name of [...]]]></description>
			<content:encoded><![CDATA[<p>Remember <a href="http://handyfloss.net/2009.07/plzma-py-a-wrapper-for-parallel-implementation-of-lzma-compression/">plzma.py</a>? I made a wrapper script for running <a href="http://en.wikipedia.org/wiki/LZMA">LZMA</a> in parallel. The script could be readily generalized to use any compression algorithm, following the principle of breaking the file in parts (one per CPU), compressing the parts, then <a href="http://en.wikipedia.org/wiki/tar (file format)">tarring</a> them together. In other words, <b>chop</b> the file, <b>zip</b> the parts. Hence the name of the program that evolved from plzma.py: <a href="http://isilanes.org/soft/chopzip">ChopZip</a>.</p>
<p><b>Introduction</b></p>
<p>Currently ChopZip supports <a href="http://en.wikipedia.org/wiki/LZMA">lzma</a>, <a href="http://en.wikipedia.org/wiki/XZ Utils">xz</a>, <a href="http://en.wikipedia.org/wiki/gzip">gzip</a> and <a href="http://www.nongnu.org/lzip/lzip.html">lzip</a>. Of them, lzip deserves a brief comment. It was brought to my attention by <strike>the</strike> a reader of this blog. It is based on the LZMA algorithm, as are lzma and xz. Apparently unlike them, multiple files compressed with lzip can be concatenated to form a single valid lzip-compressed file. Uncompressing the latter generates a concatenation of the formers. </p>
<p>To illustrate the point, check the following shell action:</p>
<div class="codeblock">
% echo hello > head<br />
% echo bye > tail<br />
% lzip head<br />
% lzip tail<br />
% cat head.lz tail.lz > all.lz<br />
% lzip -d all.lz<br />
% cat all<br />
hello<br />
bye
</div>
<p>However, I just discovered that all gzip, bzip2 and xz do that already! It seems that lzma is advertised as capable of doing it, but it doesn&#8217;t work for me. Sometimes it will uncompress the concatenated file to the original file just fine, others it will decompress it to just the first chunk of the set, yet other times it will complain that the &#8220;data is corrupt&#8221; and refuse to uncompress. For that reason, chopzip will accept two working modes: simple concatenation (gzip, lzip, xz) and tarring (lzma). The relevant mode will be used transparently for the user.</p>
<p>Also, if you use Ubuntu, <a href="https://bugs.launchpad.net/ubuntu/+source/xz-utils/+bug/467803">this bug</a> will apply to you, making it impossible to have xz-utils, lzma and lzip installed at the same time.</p>
<p>The really nice thing about concatenability is that it allows for trivial parallelization of the compression, while maintaining compatibility with the serial compression tool, which can still uncompress the product of a parallel compression. Unfortunatelly, for non-concatenatable compression formats, the output of chopzip will be a tar file of the compressed chunks, making it imposible to uncompress with the original compressor alone (first an untar would be needed, then uncompressing, then concatenation of chunks. Or just use chopzip to decompress).</p>
<p>The rationale behind plzma/chopzip is simple: multi-core computers are commonplace nowadays, but still the most common compression programs do not take advantage of this fact. At least the ones that I know and use don&#8217;t. There are at least two initiatives that tackle the issue, but I still think ChopZip has a niche to exploit. The most consolidated one is <a href="http://compression.ca/pbzip2/">pbzip2</a> (which I mention in my plzma post). pbzip2 is great, if you want to use bzip2. It scales really nicely (almost linearly), and pbzipped files are valid bzip2 files. The main drawback is that it uses bzip2 as compression method. bzip2 has always been the &#8220;extreme&#8221; bother of gzip: compresses more, but it&#8217;s so slow that you would only resort to it if compression size is vital. LZMA-based programs (lzma, xz, lzip) are both faster, and even compress more, so for me bzip2 is out of the equation.</p>
<p>A second contender in parallel compression is <a href="http://jnovy.fedorapeople.org/pxz/">pxz</a>. As its name suggests, it compresses in using xz. Drawbacks? it&#8217;s not in the official repositories yet, and I couldn&#8217;t manage to compile it, even if it comprises a single C file, and a Makefile. It also lacks ability to use different encoders (which is not necessarily bad), and it&#8217;s a compiled program, versus chopzip, which is a much more portable script.</p>
<p><b>Scalability benchmark</b></p>
<p>Anyway, let&#8217;s get into chopzip. I have run a simple test with a moderately large file (a 374MB tar file of the whole <tt>/usr/bin</tt> dir). A table follows with the speedup results for running chopzip on that file, using various numbers of chunks (and consequently, threads). The tests were conducted in a 4GB RAM Intel Core 2 Quad Q8200 computer. Speedups are calculated as how many times faster did  #chunks perform with respect to just 1 chunk. It is noteworthy that in every case running chopzip with a single chunk is virtually identical in performance to running the orginal compressor directly. Also decompression times (not show) were identical, irrespective of number of chunks. ChopZip version vas r18.</p>
<div align="center">
<table cellspacing="15">
<tr>
<td><b> #chunks</b></td>
<td><b>     xz</b></td>
<td><b>   gzip</b></td>
<td><b>   lzma</b></td>
<td><b>   lzip</b></td>
</tr>
<tr>
<td>     1</td>
<td>  1.000</td>
<td>  1.000</td>
<td>  1.000</td>
<td>  1.000</td>
</tr>
</tr>
<tr>
<td>     2</td>
<td>  1.862</td>
<td>  1.771</td>
<td>  1.907</td>
<td>  1.906</td>
</tr>
</tr>
<tr>
<td>     4</td>
<td>  3.265</td>
<td>  1.910</td>
<td>  3.262</td>
<td>  3.430</td>
</tr>
</tr>
<tr>
<td>     8</td>
<td>  3.321</td>
<td>  1.680</td>
<td>  3.247</td>
<td>  3.373</td>
</tr>
</tr>
<tr>
<td>    16</td>
<td>  3.248</td>
<td>  1.764</td>
<td>  3.312</td>
<td>  3.451</td>
</tr>
</table>
</div>
<p>Note how increasing the number of chunks beyond the amount of actual cores (4 in this case) can have a small benefit. This happens because N equal chunks of a file will not be compressed with equal speed, so the more chunks, the smaller overall effect of the slowest-compressing chunks.</p>
<p><b>Conclusion</b></p>
<p>ChopZip speeds up quite noticeably the compression of arbitrary files, and with arbitrary compressors. In the case of concatenatable compressors (see above), the resulting compressed file is an ordinary compressed file, apt to be decompressed with the regular compressor (xz, lzip, gzip), as well as with ChopZip. This makes ChopZip a valid alternative to them, with the parallelization advantage.</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://handyfloss.net/2009.07/plzma-py-a-wrapper-for-parallel-implementation-of-lzma-compression/" title="plzma.py: a wrapper for parallel implementation of LZMA compression (July 23, 2009)">plzma.py: a wrapper for parallel implementation of LZMA compression</a> (3)</li>
	<li><a href="http://handyfloss.net/2010.03/speed-up-pygtk-and-cairo-by-reusing-images/" title="Speed up PyGTK and Cairo by reusing images (March 18, 2010)">Speed up PyGTK and Cairo by reusing images</a> (0)</li>
	<li><a href="http://handyfloss.net/2010.04/please-choose-the-right-format-to-send-me-that-text-thanks/" title="Please, choose the right format to send me that text. Thanks. (April 13, 2010)">Please, choose the right format to send me that text. Thanks.</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://handyfloss.net/2009.12/chopzip-a-parallel-implementation-of-arbitrary-compression-algorithms/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Trivial use of md5sum</title>
		<link>http://handyfloss.net/2009.11/trivial-use-of-md5sum/</link>
		<comments>http://handyfloss.net/2009.11/trivial-use-of-md5sum/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 13:52:50 +0000</pubDate>
		<dc:creator>isilanes</dc:creator>
				<category><![CDATA[Free software and related beasts]]></category>
		<category><![CDATA[about me]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opinion]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://handyfloss.net/?p=886</guid>
		<description><![CDATA[I just made use of the md5sum command in a rather simple situation which could have been more troublesome to handle with other means. The following scenario highlights, IMHO, how command line greatly simplifies some tasks. I have a file file.txt, and a collection of files file.txt.N, where N = 1, 2, 3&#8230; I know [...]]]></description>
			<content:encoded><![CDATA[<p>I just made use of the <a href="http://en.wikipedia.org/wiki/md5sum">md5sum</a> command in a rather simple situation which could have been more troublesome to handle with other means. The following scenario highlights, IMHO, how <a href="http://en.wikipedia.org/wiki/command line">command line</a> greatly simplifies some tasks.</p>
<p>I have a file <tt>file.txt</tt>, and a collection of files <tt>file.txt.N</tt>, where N = 1, 2, 3&#8230; I know that the former is a copy of one of the latter, but I don&#8217;t know which. I could have run <a href="http://en.wikipedia.org/wiki/diff">diff</a> on all the possible matches, but I would have had to run it for every N until a match was found. However, md5sum comes to rescue. I can just run:</p>
<div class="codeblock">
% md5sum file.txt*
</div>
<p>And check which <tt>file.txt.N</tt> has a MD5 signature equal to <tt>file.txt</tt>, so that one would be the match. This solution is still a bit annoying, because I have to visually search matches for a long string. Not to worry! Unix is our friend once again. Recover the above command with a single press to the &#8220;up&#8221; arrow, then extend the command a tiny bit:</p>
<div class=" codeblock">
% md5sum file.txt* | sort
</div>
<p>Now, since the MD5 signatures are sorted, the match for our <tt>file.txt</tt> (if there is any), will appear right after the line for <tt>file.txt</tt>.</p>
<p>I challenge the reader to accomplish the same task as readily, comfortably and successfully in Windows or Mac, or in Linux without the command line.</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://handyfloss.net/2010.01/hardware-compatibility-is-better-with-windows-not/" title="Hardware compatibility is better with Windows&#8230; not (January 3, 2010)">Hardware compatibility is better with Windows&#8230; not</a> (10)</li>
	<li><a href="http://handyfloss.net/2008.10/usable-compiz-fusion-zoom-to-window/" title="Usable Compiz Fusion: zoom to window (October 1, 2008)">Usable Compiz Fusion: zoom to window</a> (0)</li>
	<li><a href="http://handyfloss.net/2009.01/save-hd-space-by-using-compressed-files-directly/" title="Save HD space by using compressed files directly (January 14, 2009)">Save HD space by using compressed files directly</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://handyfloss.net/2009.11/trivial-use-of-md5sum/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>First impressions with Arch Linux</title>
		<link>http://handyfloss.net/2009.10/first-impressions-with-arch-linux/</link>
		<comments>http://handyfloss.net/2009.10/first-impressions-with-arch-linux/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 11:19:29 +0000</pubDate>
		<dc:creator>isilanes</dc:creator>
				<category><![CDATA[Free software and related beasts]]></category>
		<category><![CDATA[64-bits]]></category>
		<category><![CDATA[about me]]></category>
		<category><![CDATA[arch linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[FLOSS]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[x.org]]></category>

		<guid isPermaLink="false">http://handyfloss.net/?p=856</guid>
		<description><![CDATA[I have been considering for some time trying some Linux distro that would be a little faster than Ubuntu. I made the switch from Debian to Ubuntu some time ago, and I must say that I am very pleased with it, despite it being a bit bloated and slow. Ubuntu is really user-friendly. This term [...]]]></description>
			<content:encoded><![CDATA[<p>I have been considering for some time trying some Linux distro that would be a little faster than <a href="http://en.wikipedia.org/wiki/Ubuntu (operating system)">Ubuntu</a>. I made the switch from <a href="http://en.wikipedia.org/wiki/Debian">Debian</a> to Ubuntu some time ago, and I must say that I am very pleased with it, despite it being a bit bloated and slow. Ubuntu is really user-friendly. This term is often despised among geeks, but it does have a huge value. Often times a distro will disguise poor dependency-handling, lack of package tuning and absence of wise defaults as  not having &#8220;fallen&#8221; for user-friendliness and &#8220;allowing the user do whatever she feels like&#8221;.</p>
<p>However comfortable Ubuntu might be, my inner geek wanted to get his hands a little bit dirtier with configurations, and obtain a more responsive OS in return. And that&#8217;s where <a href="http://en.wikipedia.org/wiki/Arch Linux">Arch Linux</a> fits in. Arch Linux is regarded as one of the fastest Linux distros, at least among the ones based on <a href="http://en.wikipedia.org/wiki/executable">binary</a> <a href="http://en.wikipedia.org/wiki/Software package (installation)">packages</a>, not <a href="http://en.wikipedia.org/wiki/source code">source code</a>. Is this fame deserved? Well, in my short experience, it seem to be.</p>
<p>First off, let us clarify what one means with a &#8220;faster&#8221; Linux distro. There are as I see it, broadly speaking, three things that can be faster or slower in the users&#8217; interaction with a computer. The first one, and very often cited one, is the <a href="http://en.wikipedia.org/wiki/booting">boot</a> (and shutdown) time. Any period of time between a user deciding to use the computer and being able to do so is wasted time (from the user&#8217;s point of view). Many computers stay on for long periods of time, but for a home user, short booting times are a must. A second speed-related item would be the startup time of applications. Booting would be a sub-section of this, if we consider the OS/<a href="http://en.wikipedia.org/wiki/kernel (computing)">kernel</a> as an &#8220;app&#8221;, but I refer here to user apps such as an e-mail client or text editor. Granted, most start within seconds at most, many below one second or apparently &#8220;instantly&#8221;, but some others are renowned for their slugginess (<a href="http://en.wikipedia.org/wiki/OpenOffice.org">OpenOffice.org</a>, <a href="http://en.wikipedia.org/wiki/Firefox">Firefox</a> and <a href="http://en.wikipedia.org/wiki/Amarok (software)">Amarok</a> come to mind). Even the not-very-slow apps that take a few seconds can become irritating if used with some frequency. The third speed-related item would be the execution of long-running CPU-intensive software, such as audio/video coding or scientific computation.</p>
<p>Of the three issues mentioned, it should be made clear that the third one (execution of CPU-intensive tasks) is seldom affected at all by the &#8220;speed&#8221; of the OS. Or it shouldn&#8217;t be.  Of course having the latest versions of the libraries used by the CPU-intensive software should make a difference, but I doubt that encoding a video with <a href="http://en.wikipedia.org/wiki/MEncoder">MEncoder</a> is any faster in <a href="http://en.wikipedia.org/wiki/Gentoo Linux">Gentoo</a> than Ubuntu (for the same version of mencoder and libraries). However, the first two (booting and start up of apps) <b>are</b> different from OS to OS.</p>
<p><b>Booting</b></p>
<p>I did some timings in Ubuntu and Arch, both in the same (dual boot) machine. I measured the time from <a href="http://en.wikipedia.org/wiki/GRUB">GRUB</a> to <a href="http://en.wikipedia.org/wiki/GNOME Display Manager">GDM</a>, and then the time from GDM to a working <a href="http://en.wikipedia.org/wiki/desktop environment">desktop environment</a> (<a href="http://en.wikipedia.org/wiki/GNOME">GNOME</a> in both). The exact data might not be that meaningful, as some details could be different from one installation to the other (different choice of firewall, or (minimally) different autostarted apps in the DE). But the big numbers are significant: where Ubuntu takes slightly below 1 minute to GDM, and around half a minute to GNOME, Arch takes below 20 seconds and 10 seconds, respectively.</p>
<p><b>App start up</b></p>
<p>Of the three applications mentioned, OpenOffice.org and Firefox start faster in Arch than in Ubuntu. I wrote down the numbers, but don&#8217;t have them now. Amarok, on the other hand, took equally long to start (some infamous 35 seconds) in both OSs. It is worth mentioning that all of them start up faster the second and successive times, and that the Ubuntu/Arch differences between second starts is correspondingly smaller (because both are fast). Still Arch is a bit faster (except for Amarok).</p>
<p><b>ABS, or custom compilation</b></p>
<p>But the benefits of Arch don&#8217;t end in a faster boot, or a more responsive desktop (which it has). Arch Linux makes it really easy to compile and install any custom package the user wants, and I decided to take advantage of it. With Debian/Ubuntu, you can download the source code of a package quite easily, but the compilation is more or less left to you, and the installation is different from that of a &#8220;official&#8221; package. With Arch, generating a package from the source is quite easy, and then installing it with <a href="http://en.wikipedia.org/wiki/Pacman (package manager)">Pacman</a> is trivial. For more info, refer to the Arch wiki entry for <a href="http://wiki.archlinux.org/index.php/ABS_-_The_Arch_Build_System">ABS</a>.</p>
<p>I first compiled MEncoder (inside the <tt>mplayer</tt> package), and found out that the compiled version made no difference with respect to the stock binary package. I should have known that, because I say so in this very post, don&#8217;t I? However, one always thinks that he can compile a package &#8220;better&#8221;, so I tried it (and failed to get any improvement).</p>
<p>On the other hand, when I recompiled Amarok, I <b>did</b> get a huge boost in speed. A simple custom compilation produced an Amarok that took only 15 seconds to start up, less than half of the vanilla binary distributed with Arch (I measured the 15 seconds even after rebooting, which rules out any &#8220;second time is faster&#8221; effect).</p>
<p><b>Is it hard to use?</b></p>
<p>Leaving the speed issue aside, one of the possible drawbacks of a geekier Linux distro is that it could be harder to use. Arch is, indeed, but not much. A seasoned Linux user should hardly find any difficulty to install and configure Arch. It is certainly not for beginners, but it is not super-hard either.</p>
<p>One of the few gripes I have with it regards the installation of a graphical environment. As it turns out, installing a DE such as GNOME does not trigger the installation of any <a href="http://en.wikipedia.org/wiki/X Window System">X Window System</a>, such as <a href="http://en.wikipedia.org/wiki/X.org Server">X.org Server</a>, as dependencies are set only for really vital things. Well, that&#8217;s not too bad, Arch is not assuming I want something until I tell it I do. Fine. Then, when I do install Xorg, the tools for configuring it are a bit lacking. I am so spoiled by the automagic configurations in Ubuntu, where you are presented a full-fledged desktop with almost no decision on your side, that I miss a magic script that will make X &#8220;just work&#8221;. Anyway, I can live with that. But some thing that made me feel like giving up was that after following all the instruction in the really nice Arch Wiki, I was unable to start X (it would start as a black screen, then freeze, and I could only get out by rebooting the computer). The problem was that I have a <a href="http://en.wikipedia.org/wiki/Nvidia">Nvidia</a> graphics card, and I needed the (proprietary) drivers. OK, of course I need them, but the default <tt>vesa</tt> driver should work as well!! In Ubuntu one can get a lower resolution, non-3D effect, desktop with the default vesa driver. Then the proprietary Nvidia drivers allow for more eye-candy and fanciness. But not in Arch. When I decided to skip the test with vesa, and download the proprietary drivers, the X server started without any problem.</p>
<p><b>Conclusions</b></p>
<p>I am quite happy with Arch so far. Yes, one has to work around some rough edges, but it is a nice experience as well, because one learns more than with other too user-friendly distros. I think Arch Linux is a very nice distro that is worth using, and I recommend it to any Linux user willing to learn and &#8220;get hands dirty&#8221;.</p>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://handyfloss.net/2008.07/making-isight-camera-work-in-ubuntu/" title="Making iSight camera work in Ubuntu (July 4, 2008)">Making iSight camera work in Ubuntu</a> (17)</li>
	<li><a href="http://handyfloss.net/2009.04/poor-intel-graphics-performance-in-ubuntu-jaunty-jackalope-and-a-fix-for-it/" title="Poor Intel graphics performance in Ubuntu Jaunty Jackalope, and a fix for it (April 29, 2009)">Poor Intel graphics performance in Ubuntu Jaunty Jackalope, and a fix for it</a> (7)</li>
	<li><a href="http://handyfloss.net/2008.07/latex-input-in-inkscape-046/" title="LaTeX input in Inkscape 0.46 (July 21, 2008)">LaTeX input in Inkscape 0.46</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://handyfloss.net/2009.10/first-impressions-with-arch-linux/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
