<?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>Patrick&#039;s WebLog</title>
	<atom:link href="http://patrick-nagel.net/blog/feed" rel="self" type="application/rss+xml" />
	<link>https://patrick-nagel.net/blog</link>
	<description>patrick-nagel.net/blog</description>
	<lastBuildDate>Tue, 10 Apr 2012 20:25:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Thoughts on HTML5&#8242;s &lt;time&gt; element and other semantic info on the web</title>
		<link>https://patrick-nagel.net/blog/archives/456</link>
		<comments>https://patrick-nagel.net/blog/archives/456#comments</comments>
		<pubDate>Tue, 10 Apr 2012 14:56:59 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">https://patrick-nagel.net/blog/?p=456</guid>
		<description><![CDATA[I just read about the &#60;time&#62; HTML5 element, and how it was introduced, then removed, and then re-introduced. While I think proper syntax, consistency, etc. are important, I am more concerned with what such new &#8220;semantic&#8221; elements will actually mean for the web and its users. This is not limited to &#60;time&#62;, but here it [...]]]></description>
			<content:encoded><![CDATA[<p>I just read about the &lt;time&gt; HTML5 element, and how it was <a href="http://html5doctor.com/time-and-data-element/" title="html5doctor.com/time-and-data-element" target="_blank">introduced, then removed, and then re-introduced</a>. While I think proper syntax, consistency, etc. are important, I am more concerned with what such new &#8220;semantic&#8221; elements will actually mean for the web and its users. This is not limited to &lt;time&gt;, but here it should be easy to explain my general concern, using an example:</p>
<p><em>It&#8217;s March 2012</em><br />
Joe from the U.S. writes on his blog: &#8220;I&#8217;ll be on vacation in Europe starting 5/4/12, looking forward to meeting you there!&#8221;<br />
Pierre from France reads the blog, and, knowing Joe is from the U.S., he will have the following thoughts: &#8220;Cool, Joe will be around&#8230; what&#8217;s that date&#8230; ah, Americans with their month/day/year format&#8230; ok, I interpret this as 4th of May, i.e. 4/5/12 in proper French format&#8221;</p>
<p><em>It&#8217;s March 2015, HTML5 and &lt;time&gt; are starting to get used</em><br />
Joe from the U.S. writes on his blog: &#8220;I&#8217;ll be on vacation in Europe starting &lt;time&gt;2015-05-04&lt;/time&gt;, looking forward to meeting you there!&#8221;<br />
Pierre from France reads the blog, and having set his browser language to French, it shows &#8220;I&#8217;ll be on vacation in Europe starting 4/5/15, looking forward to meeting you there!&#8221;. Not knowing about is browser being clever, and showing him the date in the format he is used to, he thinks: &#8220;Cool, Joe will be around&#8230; what&#8217;s that date&#8230; ah, Americans with their month/day/year format&#8230; ok, I interpret this to 5th of April, i.e. 5/4/15 in proper French format&#8221;</p>
<p>Of course, with proper highlighting of automatically localised dates this could be mitigated to some extent, but I can imagine lots of cases where our current assumptions, coupled with technology that is trying to help, will cause even more confusion than we have now. When communicating, lots of information is &#8220;out of band&#8221; or just assumed known context. Therefore we need to be very careful when programming our machines to help us communicate, otherwise we achieve the opposite.</p>
]]></content:encoded>
			<wfw:commentRss>https://patrick-nagel.net/blog/archives/456/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transferring large amounts of data over unreliable network connections</title>
		<link>https://patrick-nagel.net/blog/archives/434</link>
		<comments>https://patrick-nagel.net/blog/archives/434#comments</comments>
		<pubDate>Fri, 16 Mar 2012 00:58:43 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">https://patrick-nagel.net/blog/?p=434</guid>
		<description><![CDATA[Ever wanted to transfer a batch of multi-Gigabyte files through a slow DSL link and had trouble? Then this article may help &#8211; it shows how to do this properly, with standard Linux/Unix command line tools and working SSH key-auth between the two hosts. Lets look at what the problems are one may encounter when [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to transfer a batch of multi-Gigabyte files through a slow DSL link and had trouble? Then this article may help &#8211; it shows how to do this properly, with standard Linux/Unix command line tools and <a href="http://www.linuxquestions.org/linux/answers/Networking/Public_key_authentication_with_ssh" title="LinuxQuestions.org article on how to set up SSH key-auth">working SSH key-auth</a> between the two hosts.</p>
<p>Lets look at what the problems are one may encounter when attempting to, say, transfer an 8 GiB video file over the Internet, uploading through a slow link:</p>
<ul>
<li>The connection to the destination host may break at any time, due to any network equipment failure in between, or DSL reconnects by the ISP, or your son pulling the plug of your home router, &#8230;</li>
<li>The data may get corrupted by faulty hardware or software along the way</li>
<li>The uploading may clog up your ADSL connection, essentially making it unusable for anything else</li>
<li>Transferring the data without encryption would allow the maybe sensitive data to be read by others, e.g. someone at your ISP, or nearby the destination host</li>
<li>The transfer may take hours or days, depending on the amount/link speed ratio. Not getting notified when the transfer finishes may be undesirable</li>
</ul>
<p>Here is my solution to all the above problems, in a couple of commands. Once entered, you don&#8217;t need to worry about the transfer &#8211; just wait for a notification e-mail:</p>
<ol><tt></p>
<li>ssh-agent bash</li>
<li>ssh-add</li>
<li>while ! rsync \</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--bwlimit &lt;KB/s value&gt; \</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-rP \</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/path/to/directory_that_contain_the_data_to_be_transferred \</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user@destination.host:/path/to/target_directory ; \</li>
<li>do sleep 60 ; done &#038;&#038; \</li>
<li>&nbsp;echo "File transfer completed successfully at $(date)." | mail -s "File transfer completed" your@e-mail.address</li>
<p></tt></ol>
<p>Quick explanation of the commands:</p>
<ol>
<li>Start a shell that is ssh-agent enabled, i.e. the SSH key passphrase can be cached within that shell</li>
<li>Unlock the SSH key by entering the passphrase (which is then cached for all following commands in this shell session)</li>
<li>Start a loop that will only end when the &#8216;rsync&#8217; command (used as the loop&#8217;s ending condition) completes successfully, i.e. the file transfer is done. <br />rsync is the perfect tool for the job, since it transfers files reliably (through checksums), can resume efficiently, and all traffic is going through an encrypted SSH connection.</li>
<li>The &#8211;bwlimit option of rsync throttles the transfer to &lt;KB/s value&gt; &#8211; with my 512 KBit/s = 64 KB/s ADSL upload that means I would use a value around 35 or 40, to guarantee there is still some upload bandwidth left for other things.</li>
<li>-r stands for recursive (transfer the whole directory, and all sub-directories), and -P keeps partially transferred files for resuming and shows progress information; for details see &#8216;man rsync&#8217;</li>
<li>Should be self-explanatory, if not, see &#8216;man rsync&#8217;</li>
<li>Should be self-explanatory, if not, see &#8216;man rsync&#8217;</li>
<li>The actual content of the while loop is just &#8220;wait for 60 seconds&#8221;. So in case there is a connection problem, the &#8216;rsync&#8217; command will be retried every minute.</li>
<li>Once the whole loop has completed successfully, which equals a successful transfer, send a short e-mail that notifies you about the completed transfer.</li>
</ol>
<p>(By the way, you can of course make one line out of lines 3 to 9, I just split it up to make it easier to read and explain)</p>
]]></content:encoded>
			<wfw:commentRss>https://patrick-nagel.net/blog/archives/434/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sync your Android contacts and calendars with your own server</title>
		<link>https://patrick-nagel.net/blog/archives/389</link>
		<comments>https://patrick-nagel.net/blog/archives/389#comments</comments>
		<pubDate>Wed, 25 Jan 2012 13:02:27 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Linux (general)]]></category>

		<guid isPermaLink="false">https://patrick-nagel.net/blog/?p=389</guid>
		<description><![CDATA[It&#8217;s 2012, and there are still people who don&#8217;t put all their information onto Google/Facebook/&#8230; servers. Call them paranoid control freaks, if you want. Some of them even run their own e-mail server. Those people would probably prefer to have their address book(s) and calendar(s) stored on their own server as well, which Android cannot [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s 2012, and there are still people who don&#8217;t put all their information onto Google/Facebook/&#8230; servers. Call them paranoid control freaks, if you want. <img src='https://patrick-nagel.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Some of them even run their own e-mail server. Those people would probably prefer to have their address book(s) and calendar(s) stored on their own server as well, which Android cannot do out of the box.</p>
<p>This blog post aims to give a brief overview over my current solution to this problem. It&#8217;s not 100% perfect yet, but I am quite satisfied with it already. I have been using this setup for a couple of months now, and did not encounter any problems of relevance. (*)</p>
<h4>Software components involved</h4>
<p><strong>On the server:</strong></p>
<ul>
<li><a href="http://www.davical.org/" title="DAViCal">DAViCal</a> &#8211; a free (GPL licensed) CalDAV/CardDAV server written in <a href="http://www.php.net/" title="PHP">PHP</a>; needs <a href="http://www.postgresql.org/" title="PostgreSQL">PostgreSQL</a> as database server<br/><a href="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/davical_screenshot.png"><img src="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/davical_screenshot-150x150.png" alt="" title="davical_screenshot" width="150" height="150" class="size-thumbnail wp-image-408" /></a>
	</li>
<li><a href="http://roundcube.net/" title="Roundcube Webmail">Roundcube Webmail</a> with the <a href="http://www.crash-override.net/carddav.html" title="CardDAV plugin">CardDAV plugin</a> &#8211; to manage your contacts from within any web browser (Roundcube is of course also a decent mail client)<br/><a href="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/roundcube_carddav_screenshot.png"><img src="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/roundcube_carddav_screenshot-150x150.png" alt="" title="roundcube_carddav_screenshot" width="150" height="150" class="alignnone size-thumbnail wp-image-409" /></a>
</li>
</ul>
<p><strong>On the desktop / laptop computer:</strong></p>
<ul>
<li><a href="http://www.mozilla.org/en-US/thunderbird/" title="Mozilla Thunderbird">Mozilla Thunderbird</a> with
<ul>
<li><a href="http://www.mozilla.org/projects/calendar/lightning/" title="Lightning">Lightning extension</a> &#8211; to manage your calendar(s) from your Linux/Windows/Mac computer<br/><a href="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/thunderbird_caldav_screenshot.png"><img src="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/thunderbird_caldav_screenshot-150x150.png" alt="" title="thunderbird_caldav_screenshot" width="150" height="150" class="alignnone size-thumbnail wp-image-410" /></a>
    </li>
<li><a href="http://inverse.ca/downloads/extensions/nightly/" title="SOGo connector extension (nightly)">SOGo connector extension</a> (this link brings you to a file listing where you can download a nightly snapshot, there is no officially released version for current Thunderbird versions on the <a href="http://www.sogo.nu/english/downloads/frontends.html" title="SOGo download page">SOGo download page</a>, yet) &#8211; to manage / lookup your contacts from your Linux/Windows/Mac computer<br/><a href="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/thunderbird_sogo_connector_screenshot.png"><img src="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/thunderbird_sogo_connector_screenshot-150x150.png" alt="" title="thunderbird_sogo_connector_screenshot" width="150" height="150" class="alignnone size-thumbnail wp-image-424" /></a><br /><small>A few words on how to get the SOGo connector working (it&#8217;s not really straight-forward, in my opinion): After installing the extension by dragging the downloaded .xpi file onto Thunderbird, open the Address book and choose Menu File / New / Remote Address Book. Enter the URL of your DAViCal CardDAV collection, i.e. https://your.server/davical/caldav.php/YOUR_USER/YOUR_COLLECTION. Then right-click on the new address book and choose Synchronize.</small>
    </li>
</ul>
</ul>
<p><strong>On the Android device:</strong></p>
<ul>
<li><a href="http://dmfs.org/caldav/" title="CalDAV-Sync">CalDAV-Sync</a> app from Market or AndroidPIT for a bit more than 2€<br/><a href="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/Android_calendar_CalDAV.png"><img src="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/Android_calendar_CalDAV-150x150.png" alt="" title="Android_calendar_CalDAV" width="150" height="150" class="alignnone size-thumbnail wp-image-411" /></a><br/><small>(Since CalDAV-Sync is just a backend app that facilitates syncing, this is a screenshot of the Android calendar, with the event that can be seen in the Thunderbird-Lightning screenshot above)</small></li>
<li><a href="http://dmfs.org/carddav/" title="CardDAV-Sync">CardDAV-Sync</a> app from Market or AndroidPIT for a bit less than 1.50€ or free<br/><a href="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/Android_contact_CardDAV.png"><img src="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/Android_contact_CardDAV-150x150.png" alt="" title="Android_contact_CardDAV" width="150" height="150" class="alignnone size-thumbnail wp-image-412" /></a><br/><small>(Since CardDAV-Sync is just a backend app that facilitates syncing, this is a screenshot of the Android contact viewer, with the contact that can be seen in the Roundcube CardDAV screenshot above)</small></li>
<li><a href="http://dmfs.org/editor/" title="Contact Editor">Contact Editor or Contact Editor Pro</a> app from Market or AndroidPIT (Pro costs a bit more than 2€, the free version lacks a few features)<br/><a href="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/Android_Contact_Editor_Pro11.png"><img src="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/Android_Contact_Editor_Pro11-150x150.png" alt="" title="Android_Contact_Editor_Pro1" width="150" height="150" class="alignnone size-thumbnail wp-image-414" /></a> <a href="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/Android_Contact_Editor_Pro2.png"><img src="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/Android_Contact_Editor_Pro2-150x150.png" alt="" title="Android_Contact_Editor_Pro2" width="150" height="150" class="alignnone size-thumbnail wp-image-415" /></a> <a href="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/Android_Contact_Editor_Pro3.png"><img src="https://patrick-nagel.net/blog/wp-content/uploads/2012/01/Android_Contact_Editor_Pro3-150x150.png" alt="" title="Android_Contact_Editor_Pro3" width="150" height="150" class="alignnone size-thumbnail wp-image-416" /></a></li>
</ul>
<h4>A few notes regarding the components:</h4>
<ul>
<li>Contact Editor is necessary because the default Android contact editor somehow does not work with custom contact sources. It integrates seamlessly once you have set it as default action upon adding/editing a contact for the first time after installation.</li>
<li>The SOGo connector extension for Thunderbird is a good start, but in the long run I really hope Thunderbird&#8217;s contact handling can be brought to a level that matches the rest of the application. <a href="https://wiki.mozilla.org/Features/Thunderbird/Modern_Address_Book" title="Mozilla Wiki - Modern Address Book feature page">There is hope</a>.</li>
<li>There seems to be a calendar plugin for Roundcube as well (<a href="https://code.google.com/p/myroundcube/" title="MyRoundcube">as part of the MyRoundcube plugin collection</a>), and it seems to support CalDAV, but I couldn&#8217;t get it to work so far (and did not try hard, since I always have a Thunderbird with Lightning around, which is great for calendaring).</li>
</ul>
<p>I&#8217;m planning to write more on how to get everything set up, but I currently don&#8217;t have time for that. The hardest part is getting DAViCal and PostgreSQL to work, in my opinion, all the other components basically just need a URL (to the previously set up DAViCal collection &#8211; e.g. https://your.server/davical/caldav.php/YOUR_USER/YOUR_COLLECTION), username and password to work.</p>
<p><strong>Update (2012-01-28): </strong>Added some screenshots.<br /><small>By the way, what must be a very recent change in Gentoo&#8217;s packaging of PHP causes CalDAV-Sync to fail syncing, and the apache error log contains &#8220;[Sat Jan 28 08:30:48 2012] [error] [client x.x.x.x] PHP Fatal error:  Call to undefined function cal_days_in_month() in /&#8230;/davical/inc/RRule-v2.php on line 906&#8243; if you do not enable the &#8216;calendar&#8217; USE flag for dev-lang/php (which is disabled by default).</small><br />
<strong>Update (2012-01-29): </strong>(*) Typical, I write about something, and then it breaks. It seems there is an incompatibility between the newly released DAViCal 1.0.2 and CalDAV-Sync. The CalDAV-Sync developer has confirmed the issue and is working on it.<br />
<strong>Update (2012-01-30): </strong>The incompatibility &#8211; resulting in logged error messages &#8211; does not affect functionality (it was just me having set the account to &#8220;One-Way-Sync&#8221;)<br />
<strong>Update (2012-02-09): </strong>Great news: There are nightly builds of the SOGo connector Thunderbird extension that provides CardDAV integration for Thunderbird 10 now &#8211; I knew that extension before, but development seemed to have stopped at Thunderbird 3.5 or so. I added links and a bit of info above.<br />
<strong>Update (2012-02-09/2): </strong>I found the first bug with SOGo connector &#8211; when saving a contact that has an image, the image gets lost. This doesn&#8217;t really matter to me, because I don&#8217;t use images in contacts usually, but for people who use images, this could be annoying. Hope they fix it.</p>
]]></content:encoded>
			<wfw:commentRss>https://patrick-nagel.net/blog/archives/389/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>SOPA protest &#8211; Wikipedia blackout</title>
		<link>https://patrick-nagel.net/blog/archives/377</link>
		<comments>https://patrick-nagel.net/blog/archives/377#comments</comments>
		<pubDate>Tue, 17 Jan 2012 04:44:47 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Internet development]]></category>

		<guid isPermaLink="false">https://patrick-nagel.net/blog/?p=377</guid>
		<description><![CDATA[Since I consider this some kind of historical Internet event, I&#8217;ll dedicate a short blog post: The English Wikipedia will be taken offline for as long as 24 hours as a form of protest against the U.S. &#8220;SOPA&#8221; law, which is considered a threat for Internet Free Speech by the Wikipedia community and many others. [...]]]></description>
			<content:encoded><![CDATA[<p>Since I consider this some kind of historical Internet event, I&#8217;ll dedicate a short blog post:</p>
<p>The <a href="http://en.wikipedia.org/" title="Wikipedia">English Wikipedia</a> will be taken offline for as long as 24 hours as a form of protest against the U.S. &#8220;SOPA&#8221; law, which is considered a threat for Internet Free Speech by the Wikipedia community and many others.</p>
<p>So&#8230; no &#8216;lemme look that up on Wikipedia&#8217; from <a href="http://myworldtime.net/2012-01-18_05:00_UTC" title="Wednesday 5:00 UTC">Wednesday 5:00 UTC</a> to <a href="http://myworldtime.net/2012-01-19_05:00_UTC" title="Thursday 5:00 UTC">Thursday 5:00 UTC</a>.</p>
<p>In this context I&#8217;d like to recommend watching <a href="http://craphound.com/?p=3848" title="Cory Doctorow - The Coming War on General Purpose Computation">Cory Doctorow&#8217;s speech on what he calls The Coming War on General Purpose Computation</a> &#8211; the content mafia trying to shape the Internet may just be the beginning&#8230; For those who have a preview of what&#8217;s to come already (i.e. those living in China, for example): <a href="http://mirror.fem-net.de/CCC/28C3/mp4-h264-HQ/28c3-4848-en-the_coming_war_on_general_computation_h264.mp4">here is a direct link to download the video in MP4</a>, and <a href="http://mirror.fem-net.de/CCC/28C3/mp4-h264-HQ/28c3-4848-en-the_coming_war_on_general_computation_h264.mp4.torrent">here is a torrent through which you can get the same MP4</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://patrick-nagel.net/blog/archives/377/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://mirror.fem-net.de/CCC/28C3/mp4-h264-HQ/28c3-4848-en-the_coming_war_on_general_computation_h264.mp4" length="425690525" type="video/mp4" />
		</item>
		<item>
		<title>Cool timestamp</title>
		<link>https://patrick-nagel.net/blog/archives/366</link>
		<comments>https://patrick-nagel.net/blog/archives/366#comments</comments>
		<pubDate>Fri, 11 Nov 2011 10:58:38 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">https://patrick-nagel.net/blog/?p=366</guid>
		<description><![CDATA[11 hours, 11 minutes and 11 seconds until a really cool timestamp myworldtime.net/cool_timestamp/11-11-11_11:11:11_-11]]></description>
			<content:encoded><![CDATA[<p>11 hours, 11 minutes and 11 seconds until a really cool timestamp <img src='https://patrick-nagel.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://myworldtime.net/cool_timestamp/11-11-11_11:11:11_-11" title="http://myworldtime.net/cool_timestamp/11-11-11_11:11:11_-11">myworldtime.net/cool_timestamp/11-11-11_11:11:11_-11</a></p>
]]></content:encoded>
			<wfw:commentRss>https://patrick-nagel.net/blog/archives/366/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TT-RSS 1.5.5 in Portage</title>
		<link>https://patrick-nagel.net/blog/archives/355</link>
		<comments>https://patrick-nagel.net/blog/archives/355#comments</comments>
		<pubDate>Tue, 19 Jul 2011 13:40:56 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[Web applications]]></category>

		<guid isPermaLink="false">https://patrick-nagel.net/blog/?p=355</guid>
		<description><![CDATA[I have blogged about TT-RSS just recently. And when Andrew Dolgov, TT-RSS&#8217;s initiator and main contributor released version 1.5.5, I thought I&#8217;d try to improve the ebuild a bit, given that it is in Portage now. So I added a &#8216;daemon&#8217; USE flag, which makes it easy for Gentoo users to get TT-RSS to update [...]]]></description>
			<content:encoded><![CDATA[<p>I have <a href="/blog/archives/313" title="Reading news the way I like it">blogged about TT-RSS</a> just recently. And when <a href="http://twitter.com/#!/gothfox" title="gothfox on Twitter">Andrew Dolgov</a>, TT-RSS&#8217;s initiator and main contributor released version 1.5.5, I thought I&#8217;d try to improve the ebuild a bit, given that it is <a href="http://packages.gentoo.org/package/www-apps/tt-rss" title="www-apps/tt-rss in Gentoo Portage">in Portage</a> now.</p>
<p>So I added a &#8216;daemon&#8217; USE flag, which makes it easy for Gentoo users to get TT-RSS to update the RSS feeds. When you emerge www-apps/tt-rss with USE=daemon, it will now install an init script to start the &#8216;ttrssd&#8217; daemon (or multiple, if you have multiple TT-RSS instances on your host). This is the preferred way to keep the feeds updated, according to <a href="http://tt-rss.org/redmine/wiki/tt-rss/UpdatingFeeds" title="TT-RSS's documentation">TT-RSS&#8217;s documentation</a>.</p>
<p>So, if you need a great, centralised (i.e. synchronised state amongst your computers, phones, etc.) news aggregator that runs on your own server / web host, give tt-rss a try! And if you&#8217;re a Gentoo user, I&#8217;d appreciate if you could test the new ebuild&#8217;s features (USE=daemon), and give feedback here or open a bug report if there is anything that could be improved further.</p>
]]></content:encoded>
			<wfw:commentRss>https://patrick-nagel.net/blog/archives/355/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Impact of ext4&#8242;s discard option on my SSD</title>
		<link>https://patrick-nagel.net/blog/archives/337</link>
		<comments>https://patrick-nagel.net/blog/archives/337#comments</comments>
		<pubDate>Fri, 08 Jul 2011 08:19:32 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Linux (general)]]></category>
		<category><![CDATA[SSD]]></category>

		<guid isPermaLink="false">https://patrick-nagel.net/blog/?p=337</guid>
		<description><![CDATA[Solid-state drives (SSDs) are seen as the future of mass storage by many. They are famous for their high performance: extremely low seek times, since there is no head that needs move to a position and then wait for the spinning disk to come around to where it needs to read/write; but also higher throughput [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Solid-state_drive" title="Solid-state drive">Solid-state drives</a> (SSDs) are seen as the future of mass storage by many. They are famous for their high performance: extremely low seek times, since there is no head that needs move to a position and then wait for the spinning disk to come around to where it needs to read/write; but also higher throughput of sequential data: My 2,5&#8243; OCZ Vertex LE (100 GB) is rated at 235 MB/s sustained write speed, and read speeds up to 270 MB/s, for example.</p>
<p>There is a caveat though &#8211; quoting <a href="http://en.wikipedia.org/w/index.php?title=TRIM&#038;oldid=436591474#Flash_drive_specific_issues" title="Wikipedia" target="_blank">Wikipedia</a>:</p>
<blockquote><p>In SSDs, a write operation can be done on the page-level, but due to hardware limitations, erase commands always affect entire blocks. As a result, writing data to SSD media is very fast as long as empty pages can be used, but slows down considerably once previously written pages need to be overwritten. Since an erase of the cells in the page is needed before it can be written again, but only entire blocks can be erased, an overwrite will initiate a read-erase-modify-write cycle: the contents of the entire block have to be stored in cache before it is effectively erased on the flash medium, then the overwritten page is modified in the cache so the cached block is up to date, and only then is the entire block (with updated page) written to the flash medium. This phenomenon is known as write amplification.</p></blockquote>
<p>So, SSDs are fast at writing, but only when their free space is neatly trimmed. The only component in your software stack that knows which parts of your SSD should be trimmed, is your file system. That is why there is a file system option in ext4 (my current file system of choice), called &#8220;discard&#8221;. When this option is active, space that is freed up in the file system is reported to the SSD immediately, and then the SSD does the trimming right away. This will make the next write to that part of the SSD as fast as expected. Obviously, trimming takes time &#8211; but how much time exactly? I wanted to find out, and did the following: I measured the time to unpack and then delete the kernel sources (36706 files amounting to 493 MB, which is what I call a big bunch of small files). I did it three times with and three times without the &#8220;discard&#8221; option, and then took the average of those three tries:</p>
<p><strong>Without &#8220;discard&#8221; option:</strong></p>
<ul>
<li>Unpack: 1.21s</li>
<li>Sync: 1.66s (= 172 MB/s)</li>
<li>Delete: 0.47s</li>
<li>Sync: 0.17s</li>
</ul>
<p><strong>With &#8220;discard&#8221; option:</strong></p>
<ul>
<li>Unpack: 1.18s</li>
<li>Sync: 1.62s (= 176 MB/s)</li>
<li>Delete: 0.48s</li>
<li>Sync: <strong>40.41s</strong></li>
</ul>
<p>So, with &#8220;discard&#8221; on, deleting a big bunch of small files is 64 times slower on my SSD. For those ~40 seconds any I/O is really slow, so that&#8217;s pretty much the time when you get a fresh cup of coffee, or waste time watching the mass storage activity LED.</p>
<p><strong>Conclusion</strong><br />
Don&#8217;t enable the &#8220;discard&#8221; option if you have a similar SSD. A much better way to keep your free space neatly trimmed for good write speeds is, to trigger a complete walk over the file system&#8217;s free space, and tell the SSD to trim that all at once. And of course you would do that at times when you don&#8217;t actually want to use the system (e.g. in a nightly cron job, or with a script that gets launched during system shutdown). This can be done with the &#8216;fstrim&#8217; command (that comes with util-linux), which takes around six minutes for my currently 60% filled 95 GB file system.</p>
<p>Update (2011-07-08): I forgot some details that may be interesting:</p>
<ul>
<li>Kernel version: 2.6.39.2</li>
<li>SSD firmware version: 1.32</li>
<li>CPU: AMD Phenom II X4 965</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>https://patrick-nagel.net/blog/archives/337/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Reading news the way I like it</title>
		<link>https://patrick-nagel.net/blog/archives/313</link>
		<comments>https://patrick-nagel.net/blog/archives/313#comments</comments>
		<pubDate>Sat, 02 Jul 2011 06:13:35 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[Web applications]]></category>

		<guid isPermaLink="false">https://patrick-nagel.net/blog/?p=313</guid>
		<description><![CDATA[I have been using Tiny Tiny RSS (or TT-RSS) (www-apps/tt-rss in Gentoo) as my news aggregator since the end of 2008. It is a web application (written in PHP) that provides a great news aggregator UI. Since it&#8217;s a web application, you can use it from anywhere with just a browser, and thus have all [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using <a href="http://tt-rss.org">Tiny Tiny RSS</a> (or TT-RSS) (<a href="http://packages.gentoo.org/package/www-apps/tt-rss">www-apps/tt-rss in Gentoo</a>) as my news aggregator since the end of 2008. It is a web application (written in PHP) that provides a great news aggregator UI. Since it&#8217;s a web application, you can use it from anywhere with just a browser, and thus have all your feeds in the same state (read/starred/&#8230;), anywhere you are. Think of it as Google Reader, but without Google knowing exactly what news articles you&#8217;re interested in, since you can run TT-RSS on your own server / web host.<br />
So, TT-RSS alone was great already, but the UI is more suitable for when you have a mouse and a big browser window, than for using it from your phone.</p>
<p>Recently I discovered the Android App <a href="http://code.google.com/p/ttrss-reader-fork/">TT-RSS Reader</a> which solves exactly that problem. It connects to your TT-RSS instance via an API, and brings all your feeds, with all their states just as on the web interface, to your Android device. The interface is specifically designed for touch screens, so it&#8217;s much easier to navigate through your feeds and articles than via the web interface. Furthermore, it can cache articles and images, which you can trigger while on WiFi before leaving the house, and then read everything on the way in Offline mode, to save mobile traffic, which is expensive and/or slow for some. When you&#8217;re back on WiFi, you switch back to Online mode, and TT-RSS Reader synchronises your state to your TT-RSS instance. Absolutely awesome <img src='https://patrick-nagel.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>A couple of quick screenshots from the web interface (TT-RSS):</p>
<p><a href="https://patrick-nagel.net/blog/wp-content/uploads/2011/07/tt-rss.png"><img src="https://patrick-nagel.net/blog/wp-content/uploads/2011/07/tt-rss-300x203.png" alt="" title="TT-RSS" width="300" height="203" class="aligncenter size-medium wp-image-316" /></a><br />
<a href="https://patrick-nagel.net/blog/wp-content/uploads/2011/07/tt-rss2.png"><img src="https://patrick-nagel.net/blog/wp-content/uploads/2011/07/tt-rss2-300x251.png" alt="" title="TT-RSS 2" width="300" height="251" class="aligncenter size-medium wp-image-334" /></a></p>
<p>&#8230;  and the Android App (TT-RSS Reader):</p>
<p><span class="aligncenter"><a href="https://patrick-nagel.net/blog/wp-content/uploads/2011/07/tt-rss-reader1.png"><img src="https://patrick-nagel.net/blog/wp-content/uploads/2011/07/tt-rss-reader1-180x300.png" alt="" title="TT-RSS-Reader 1" width="90" height="150" class="size-medium wp-image-317" /></a> <a href="https://patrick-nagel.net/blog/wp-content/uploads/2011/07/tt-rss-reader2.png"><img src="https://patrick-nagel.net/blog/wp-content/uploads/2011/07/tt-rss-reader2-180x300.png" alt="" title="TT-RSS-Reader 2" width="90" height="150" class="size-medium wp-image-318" /></a> <a href="https://patrick-nagel.net/blog/wp-content/uploads/2011/07/tt-rss-reader3.png"><img src="https://patrick-nagel.net/blog/wp-content/uploads/2011/07/tt-rss-reader3-180x300.png" alt="" title="TT-RSS-Reader 3" width="90" height="150" class="size-medium wp-image-319" /></a></span><br />
<a href="https://patrick-nagel.net/blog/wp-content/uploads/2011/07/tt-rss-reader4.png"><img src="https://patrick-nagel.net/blog/wp-content/uploads/2011/07/tt-rss-reader4-180x300.png" alt="" title="tt-rss-reader4" width="180" height="300" class="aligncenter size-medium wp-image-331" /></a></p>
<p>Update (2011-07-03): Shortly after posting this, hwoarang offered to take TT-RSS from the Sunrise Overlay into Gentoo&#8217;s main repository (Portage), with me proxy-maintaining it. So now it&#8217;s even easier to get TT-RSS onto your Gentoo-powered server.</p>
]]></content:encoded>
			<wfw:commentRss>https://patrick-nagel.net/blog/archives/313/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My phone&#8217;s bash.profile</title>
		<link>https://patrick-nagel.net/blog/archives/298</link>
		<comments>https://patrick-nagel.net/blog/archives/298#comments</comments>
		<pubDate>Thu, 26 May 2011 09:45:20 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Linux (general)]]></category>

		<guid isPermaLink="false">https://patrick-nagel.net/blog/?p=298</guid>
		<description><![CDATA[Here is some automation that I put into my bash.profile. It&#8217;s all done with aliases, since with regular shell scripts, I would first have to remount /mnt/sdcard without &#8216;noexec&#8217;. Like this, I just need to open a ConnectBot &#8220;Local&#8221; connection, type the alias, and press enter(*). (*) For this to work, the &#8216;post login automation&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>Here is some automation that I put into my bash.profile. It&#8217;s all done with aliases, since with regular shell scripts, I would first have to remount /mnt/sdcard without &#8216;noexec&#8217;. Like this, I just need to open a ConnectBot &#8220;Local&#8221; connection, type the alias, and press enter(*). </p>
<p>(*) For this to work, the &#8216;post login automation&#8217; entry of the ConnectBot &#8220;Local&#8221; profile needs to have<br />
<code>bash --rcfile /sdcard/bash.profile</code><br />
in it.</p>
<p>Here is what I have in there:</p>
<p><code>alias bb="busybox"<br />
alias top="bb top"<br />
alias df="bb df"</p>
<p>alias ll="ls -l"<br />
alias n="su -c \"netstat -ntupl\""</p>
<p>alias backupdata="su -c \"rsync -rP --delete --numeric-ids --chmod=u+rwX --exclude Music /sdcard/ pat@192.168.0.2:/data/pat/g2sd/\""</p>
<p>alias postflash="echo \"Mounting /system read-write\" &#038;&#038; su -c \"mount -o rw,remount /system\" &#038;&#038; echo \"Copying modified keyboard layout files...\" &#038;&#038; su -c \"cp /sdcard/vision-keypad-wwe.kcm.bin /system/usr/keychars/\" &#038;&#038; su -c \"cp /sdcard/vision-keypad-wwe.kl /system/usr/keylayout/\" &#038;&#038; echo \"Deleting awful camera click sound...\" &#038;&#038; su -c \"rm /system/media/audio/ui/camera_click.ogg\" &#038;&#038; sync &#038;&#038; echo \"All done. Please reboot now.\""</p>
<p>clear<br />
uptime<br />
echo</code></p>
<p>The first couple of aliases should be self-explanatory.<br />
<tt><strong>backupdata</strong></tt> is, as the name suggests, to get my SD card&#8217;s content to my home server.<br />
<tt><strong>postflash</strong></tt> is for after flashing a new ROM (usually a <a href="http://www.cyanogenmod.com/">CyanogenMod</a> nightly build). It gets my modified keyboard layout into place, and deletes the <em>terrible</em> sound file that gets played when I take a photo with the phone&#8217;s camera.</p>
]]></content:encoded>
			<wfw:commentRss>https://patrick-nagel.net/blog/archives/298/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>emerge output ends up as attachment.bin when sent with nail / Heirloom mailx</title>
		<link>https://patrick-nagel.net/blog/archives/286</link>
		<comments>https://patrick-nagel.net/blog/archives/286#comments</comments>
		<pubDate>Fri, 25 Feb 2011 04:55:43 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Gentoo Linux]]></category>
		<category><![CDATA[Linux (general)]]></category>
		<category><![CDATA[This machine]]></category>

		<guid isPermaLink="false">https://patrick-nagel.net/blog/?p=286</guid>
		<description><![CDATA[I really like the command line mailer Heirloom mailx (formerly nail), and now there is even a current version in portage again (still under the name mail-client/nail, but that doesn&#8217;t matter), so that&#8217;s even better. I use it on all servers, since it&#8217;s just convenient &#8211; it can handle attached files, UTF-8 etc. without any [...]]]></description>
			<content:encoded><![CDATA[<p>I really like the command line mailer <a href="http://heirloom.sourceforge.net/mailx.html">Heirloom mailx (formerly nail)</a>, and now there is even a current version in portage again (still under the name mail-client/nail, but that doesn&#8217;t matter), so that&#8217;s even better. I use it on all servers, since it&#8217;s just convenient &#8211; it can handle attached files, UTF-8 etc. without any problems.</p>
<p>But there was one problem that bothered me for months already: It involved my check_updates.sh script, which basically just calls <code>/usr/bin/emerge -upvDN --nospinner world</code> for the host and all virtual servers, and then sends the output to me.</p>
<p>The problem: emerge&#8217;s output always ended up as &#8216;attachment.bin&#8217;, attached to the (otherwise empty) mail, although I piped it into <code>mail -s "Updates for $DATE" root</code> where it should come out as the mail body. I knew that Heirloom mailx does that, as soon as it doesn&#8217;t &#8220;like&#8221; one of the characters in the input, but I couldn&#8217;t think of a reason why it would do that with emerge&#8217;s supposedly plain-ASCII output.</p>
<p>Today I had enough of it, and fired up hexdump to investigate said &#8216;attachment.bin&#8217;, using the following command:<br />
<code>hexdump -e '1/1 "%03d \n"' attachment.bin | sort -u</code><br />
It outputs the unique decimal values of any byte occurring in &#8216;attachment.bin&#8217; as a sorted list. I expected to find something above 127 &#8211; but the highest occurring value was 122 (&#8220;z&#8221;). I then checked the top part of the list, and to my surprise, found 008 (backspace) there. After removing those by piping the output through <code>tr -d '\010'</code> (8<sub>dec</sub> = 10<sub>oct</sub>, and tr needs octal values), Heirloom mailx no longer put the text into &#8216;attachment.bin&#8217;. It now appears in the mail&#8217;s body, where it belongs.</p>
<p>By the way, those backspaces (when interpreted) change<br />
<tt>Calculating dependencies  ... done!</tt><br />
to<br />
<tt>Calculating dependencies... done!</tt><br />
&#8230; so removing them is not a big loss. I&#8217;d like to know though, why they are there in the first place, even though the output doesn&#8217;t go to a TTY.</p>
]]></content:encoded>
			<wfw:commentRss>https://patrick-nagel.net/blog/archives/286/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

