<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>Tanguy Ortolo - Debian</title>
	<link>http://tanguy.ortolo.eu/blog/categorie2/debian</link>
	<language>en</language>
	<description>a blog about Debian and self-hosting</description>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://tanguy.ortolo.eu/blog/feed.php" />
	<lastBuildDate>Tue, 05 Mar 2013 12:05:00 +0100</lastBuildDate>
	<generator>PluXml</generator>
	<item>
		<title>Suspend your computer from a non-mainstream desktop environment</title> 
		<link>http://tanguy.ortolo.eu/blog/article97/suspend-cli</link>
		<guid>http://tanguy.ortolo.eu/blog/article97/suspend-cli</guid>
		<description>&lt;a href=&quot;http://tango.freedesktop.org/&quot; title=&quot;From the Tango Desktop Project, Public Domain&quot;&gt;&lt;img src=&quot;http://tanguy.ortolo.eu/blog/data/images/icons/tango-battery-128.png&quot; alt=&quot;Battery icon&quot; style=&quot;float: left; margin: 1em 1em 0 0;&quot;/&gt;&lt;/a&gt;

&lt;h2&gt;UPower for regular users&lt;/h2&gt;

&lt;p&gt;Major desktop environments usually provide a user-friendly menu to suspend your
computer. Internally, if seems to use something called
&lt;a href=&quot;http://upower.freedesktop.org/&quot;&gt;UPower&lt;/a&gt;, which uses something
called PolicyKit, which in turn may or may not use another piece called
ConsoleKit (do not ask me what all these pieces are and how they relate to
each other, I do not know and I do not want to know). For the regular user,
the result is the following: when they click on that button, it suspends their
computer.&lt;/p&gt;&lt;h2&gt;UPower for command line users&lt;/h2&gt;

&lt;p&gt;However, if you are using a more unusual desktop environment, for instance
a simple, light window manager, you will not have such a button. And no,
UPower does not provide a simple command line tool to suspend your
computer&lt;a href=&quot;http://tanguy.ortolo.eu/blog/rss/categorie2#note1&quot; id=&quot;call1&quot;&gt;¹&lt;/a&gt; (they probably consider that command line
is out of fashion…). Well, in case you need it, here is a way to suspend your
computer from a command line or whatever: just alias it or bind it to a key shortcut.
It uses some &lt;a href=&quot;http://upower.freedesktop.org/docs/UPower.html&quot;&gt;dark DBus
magic&lt;/a&gt;:&lt;/p&gt;

&lt;pre class=&quot;cli&quot;&gt;$ dbus-send --system --print-reply --dest=&#039;org.freedesktop.UPower&#039; \
    /org/freedesktop/UPower org.freedesktop.UPower.Suspend&lt;/pre&gt;

&lt;p&gt;If you prefer to hibernate your computer, that is, to suspend it, not to RAM but to disk:&lt;/p&gt;

&lt;pre class=&quot;cli&quot;&gt;$ dbus-send --system --print-reply --dest=&#039;org.freedesktop.UPower&#039; \
    /org/freedesktop/UPower org.freedesktop.UPower.Hibernate&lt;/pre&gt;

&lt;p&gt;As you can see, for some reason it requires some duplication of
information: the name “org.freedesktop.UPower” appears three times in that
command line: in the “destination”, “object path” and “interface member”,
whatever that could mean. Again, do not ask me why, I know nothing about that
and I do not want to.&lt;/p&gt;

&lt;h2&gt;Notes&lt;/h2&gt;

&lt;ol&gt;
    &lt;li id=&quot;note1&quot;&gt;Actually, UPower does provide a command line tool called
        &lt;em class=&quot;software cli&quot;&gt;upower&lt;/em&gt;, but the only thing it does
        (monitoring power sources) is not really useful for that matter.
        &lt;a href=&quot;http://tanguy.ortolo.eu/blog/rss/categorie2#call1&quot;&gt;↑&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description>
		<pubDate>Tue, 05 Mar 2013 12:05:00 +0100</pubDate>
		<dc:creator>Tanguy</dc:creator>
	</item>
	<item>
		<title>One archiver to rule them all: bsdtar</title> 
		<link>http://tanguy.ortolo.eu/blog/article96/bsdtar</link>
		<guid>http://tanguy.ortolo.eu/blog/article96/bsdtar</guid>
		<description>&lt;a href=&quot;http://tango.freedesktop.org/&quot; title=&quot;From the Tango Desktop Project, Public Domain&quot;&gt;&lt;img src=&quot;http://tanguy.ortolo.eu/blog/data/images/icons/tango-archive-128.png&quot; alt=&quot;Package icon&quot; style=&quot;float: right; margin-left: 1em;&quot;/&gt;&lt;/a&gt;

&lt;p&gt;Sometimes, you have to use ZIP archives, or worse, RAR archives (curse
them!), with one significant annoyance: &lt;em class=&quot;software
cli&quot;&gt;zip&lt;/em&gt;, &lt;em class=&quot;software cli&quot;&gt;unzip&lt;/em&gt;, &lt;em
    class=&quot;software cli&quot;&gt;rar&lt;/em&gt; and &lt;em class=&quot;software
cli&quot;&gt;unrar&lt;/em&gt; use a rather uncommon command line convention,
compared to the usual &lt;em class=&quot;software cli&quot;&gt;tar&lt;/em&gt;, &lt;em
    class=&quot;software cli&quot;&gt;cpio&lt;/em&gt; and &lt;em class=&quot;software
cli&quot;&gt;pax&lt;/em&gt;.&lt;/p&gt;&lt;p&gt;This is where &lt;em class=&quot;software cli package&quot;&gt;bsdtar&lt;/em&gt; and
&lt;em
    class=&quot;software cli package&quot;&gt;bsdcpio&lt;/em&gt; come handy: these
two equivalent tools from FreeBSD do not directly implement any archive
format, relying on &lt;em class=&quot;software library&quot;&gt;libarchive&lt;/em&gt; to do that
instead. That allows you to do thinks like:&lt;/p&gt;

&lt;pre class=&quot;cli&quot;&gt;
% bsdtar -tf crap.rar
% bsdtar -xf crap.rar
% bsdtar --format zip -cf stuff.zip stuff
&lt;/pre&gt;

&lt;p&gt;Too bad it does not have a &lt;code class=&quot;cli option&quot;&gt;-a&lt;/code&gt; option to
automatically select the archive format as &lt;em class=&quot;software&quot;&gt;GNU tar&lt;/em&gt;
does.&lt;/p&gt;</description>
		<pubDate>Thu, 21 Feb 2013 12:21:00 +0100</pubDate>
		<dc:creator>Tanguy</dc:creator>
	</item>
	<item>
		<title>.diff or .patch?</title> 
		<link>http://tanguy.ortolo.eu/blog/article95/diff-or-patch</link>
		<guid>http://tanguy.ortolo.eu/blog/article95/diff-or-patch</guid>
		<description>&lt;p&gt;Silly question: when you use &lt;em class=&quot;software cli
    manpage&quot;&gt;diff(1)&lt;/em&gt; to produce a file to be applied with &lt;em
    class=&quot;software cli manpage&quot;&gt;patch(1)&lt;/em&gt;, do you call the result a
&lt;em&gt;diff&lt;/em&gt; or a &lt;em&gt;patch&lt;/em&gt;? Do you name it &lt;code
    class=&quot;filename&quot;&gt;foo.diff&lt;/code&gt; or &lt;code
    class=&quot;filename&quot;&gt;foo.patch&lt;/code&gt;?&lt;/p&gt;</description>
		<pubDate>Fri, 15 Feb 2013 19:35:00 +0100</pubDate>
		<dc:creator>Tanguy</dc:creator>
	</item>
	<item>
		<title>Using the UDF as a successor of FAT for USB sticks</title> 
		<link>http://tanguy.ortolo.eu/blog/article93/usb-udf</link>
		<guid>http://tanguy.ortolo.eu/blog/article93/usb-udf</guid>
		<description>&lt;a href=&quot;https://commons.wikimedia.org/wiki/File:Media-verbatim-store-n-go-1gb.svg&quot; title=&quot;By Frédéric Bellaiche, GPLv2+&quot;&gt;&lt;img src=&quot;http://tanguy.ortolo.eu/blog/data/images/icons/usb-stick-128.png&quot; alt=&quot;USB Stick&quot; style=&quot;float: left; margin: 1em 1em .5em .5em;&quot;/&gt;&lt;/a&gt;

&lt;h2&gt;FAT&lt;/h2&gt;

&lt;p&gt;USB sticks are traditionally formatted with FAT 32, because this file system
is implemented by almost every operating system and device. Unfortunately, it
sucks, as it cannot use more than 2 TiB, store files larger than 2 GiB or store
symbolic links for instance. In a word, it is an &lt;em&gt;obsolete and deficient&lt;/em&gt;
file system.&lt;/p&gt;

&lt;h2 style=&quot;clear: both;&quot;&gt;exFAT&lt;/h2&gt;

&lt;p&gt;Good news: someone addressed that problem. Bad new: that someone is &lt;em&gt;Microsoft.&lt;/em&gt;
So as you could expect, exFAT, the &lt;em&gt;extended FAT&lt;/em&gt;, is a stinking
proprietary, secret and patented file system. There are free implementations of
that shit, but it is safer to stay away from it.&lt;/p&gt;&lt;h2&gt;UDF to the rescue!&lt;/h2&gt;

&lt;p&gt;Good news: there is one file system that is implemented almost everywhere as
well, and which does not suffer from such limitations. UDF, the &lt;em&gt;Universal Disk
Format&lt;/em&gt;, is an ISO standard originally designed for DVDs, but it is perfectly
usable for USB sticks. It also supports POSIX permissions, with one killer
feature for removable media: a file can belong to &lt;em&gt;no specific person or
group&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;So, to use it, assuming you USB stick is &lt;code class=&quot;filename
    device&quot;&gt;/dev/sdc&lt;/code&gt;:&lt;/p&gt;

&lt;pre class=&quot;cli&quot;&gt;
$ dd if=/dev/zero of=/dev/sdc bs=1M count=1
$ mkudffs -b 512 --media-type=hd /dev/sdc
&lt;/pre&gt;

&lt;p&gt;The initial &lt;em class=&quot;software command&quot;&gt;dd&lt;/em&gt; is to erase the existing
partition table or file system information, to prevent you USB stick from being
detected as a FAT after it has been formatted with UDF.&lt;/p&gt;

&lt;p&gt;The &lt;code class=&quot;command option&quot;&gt;-b 512&lt;/code&gt; is to force a file system
block size equal to the USB stick&#039;s physical block size, as required by the UDF
specification. Adapt it if you have the luck of having a USB stick with an more
appropriate block size.&lt;/p&gt;

&lt;p&gt;After that, you USB stick will be usable for reading and writing with
GNU/Linux and the other free operating systems of course, but also with
current versions of Windows (read-only with the outdated version XP) and
with MacOS.&lt;/p&gt;</description>
		<pubDate>Wed, 30 Jan 2013 13:09:00 +0100</pubDate>
		<dc:creator>Tanguy</dc:creator>
	</item>
	<item>
		<title>Do not reCAPTCHA!</title> 
		<link>http://tanguy.ortolo.eu/blog/article92/dont-recaptcha</link>
		<guid>http://tanguy.ortolo.eu/blog/article92/dont-recaptcha</guid>
		<description>&lt;a href=&quot;http://tango.freedesktop.org/&quot; title=&quot;Adapted from the Tango Desktop Project, Public Domain&quot;&gt;&lt;img src=&quot;http://tanguy.ortolo.eu/blog/data/images/icons/tango-book-128.png&quot; alt=&quot;A book&quot; style=&quot;float: right; margin-top: 1em;&quot;/&gt;&lt;/a&gt;

&lt;p style=&quot;margin-top: 30px;&quot;&gt;You probably know reCAPTCHA already: for the webmasters and the end user, it
is an antispam system which asks you to read distorted words in order to prove
that you are a human and not a spamming bot. This service has another end:
instead of generating its distorted texts, it takes them from printed books to
help digitalizing them.&lt;/p&gt;&lt;h2&gt;The problem&lt;/h2&gt;

&lt;p&gt;In theory, this is an excellent idea, which should help preserving and
distributing parts of the human culture. And, in the beginning, it was used in
such a way, with reCAPTCHA participating in the Gutenberg project which
digitalizes books from the public domain to offer them freely (as in free
speech) to everyone. In 2009 however, reCAPTCHA was bought by Google. Now they
do not participate in the Gutenberg project any more, instead they are
digitalizing stuff from the New York Times and from Google Books. They do not
provide much detail about that, but it does not seem that they distribute them
in a free way afterwards&lt;a href=&quot;http://tanguy.ortolo.eu/blog/rss/categorie2#note1&quot; id=&quot;call1&quot;&gt;¹&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To put it boldly: they use people&#039;s brain power to digitalize books for their
own exploitation monopoly, which is &lt;em&gt;wrong.&lt;/em&gt; These books should be made
available &lt;em&gt;under a free license.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;Suggestion&lt;/h2&gt;

&lt;p&gt;Do not help reCAPTCHA. If you are a webmaster, try to use another more
ethical system. If you are an end user, and you are facing a reCAPTCHA
test, avoid putting the exact answer but try inserting small mistakes (not big
ones, which get detected and make you fail the test). And ask Google to free the
books they digitalized using &lt;em&gt;your brain.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;Notes&lt;/h2&gt;

&lt;ol&gt;
    &lt;li id=&quot;note1&quot;&gt;I may be wrong but I learnt to be suspicious in the context of digital
    culture. Please Google, if you &lt;em&gt;do&lt;/em&gt; publish your books digitalized
    with reCAPTCHA under a free license, tell me, or rather, tell it to everyone
    and display it proudly in the reCAPTCHA website. &lt;a href=&quot;http://tanguy.ortolo.eu/blog/rss/categorie2#call1&quot;&gt;↑&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description>
		<pubDate>Fri, 25 Jan 2013 20:26:00 +0100</pubDate>
		<dc:creator>Tanguy</dc:creator>
	</item>
	<item>
		<title>The drawback with tiling window managers…</title> 
		<link>http://tanguy.ortolo.eu/blog/article91/tiling-drawback</link>
		<guid>http://tanguy.ortolo.eu/blog/article91/tiling-drawback</guid>
		<description>&lt;p&gt;… is that you cannot use funny desktop programs such as &lt;a
    href=&quot;http://dropmix.xs4all.nl/rick/Xsnow/&quot;&gt;Xsnow&lt;/a&gt; or &lt;a
    href=&quot;http://xpenguins.seul.org/&quot;&gt;XPenguins&lt;/a&gt;. :-(&lt;/p&gt;&lt;hr/&gt;

&lt;p&gt;That is, you can run them, of course, but since you almost never
see your desktop because it is by design entirely covered with windows,
they are just useless, which is too bad because they rock otherwise.&lt;/p&gt;</description>
		<pubDate>Tue, 22 Jan 2013 13:47:00 +0100</pubDate>
		<dc:creator>Tanguy</dc:creator>
	</item>
	<item>
		<title>rlwrap: give readline super powers to any command line tool</title> 
		<link>http://tanguy.ortolo.eu/blog/article88/rlwrap</link>
		<guid>http://tanguy.ortolo.eu/blog/article88/rlwrap</guid>
		<description>&lt;p&gt;Did you ever use a tool such as &lt;em class=&quot;software
    command&quot;&gt;netcat&lt;/em&gt;, which has no history and does not allow you
to edit the line you are typing?&lt;/p&gt;

&lt;pre class=&quot;cli&quot;&gt;% nc localhost smtp
220 cocorico.example.com ESMTP Postfix
HELO localhost
250 cocorico.example.com
MAIL FROM: &amp;lt;tanguy@localhost&amp;gt;
250 2.1.0 Ok
RCTP TO: &amp;lt;tanguy@localhost&amp;gt;
502 5.5.2 Error: command not recognized
&lt;strong&gt;^[[A&lt;/strong&gt; Sh*t, line recall does not work!
502 5.5.2 Error: command not recognized&lt;/pre&gt;&lt;p&gt;Here comes &lt;em class=&quot;software command&quot;&gt;rlwrap&lt;/em&gt;: it is a small
and useful tool that wraps any command line-oriented tool using readline to
provide you a history allow you to edit each line before you send it:&lt;/p&gt;

&lt;pre class=&quot;cli&quot;&gt;% rlwrap nc localhost smtp
220 cocorico.example.com ESMTP Postfix
HELO localhost
250 cocorico.example.com
MAIL FROM: &amp;lt;tanguy@localhost&amp;gt;
250 2.1.0 Ok
RCTP TO: &amp;lt;tanguy@localhost&amp;gt;
502 5.5.2 Error: command not recognized
&lt;strong&gt;↑&lt;/strong&gt; RCTP TO: &amp;lt;tanguy@localhost&amp;gt; &lt;strong&gt;⇱…&lt;/strong&gt;&lt;/pre&gt;

&lt;p&gt;&lt;em class=&quot;software
    command&quot;&gt;rlwrap&lt;/em&gt;&#039;s effect is hard to describe with a transcript, so here
are two screencasts, with and without it. If you often use tools such as
&lt;em class=&quot;software command&quot;&gt;netcat&lt;/em&gt;, try it!&lt;/p&gt;

&lt;div class=&quot;figures&quot; style=&quot;text-align: center;&quot;&gt;
    &lt;div class=&quot;figure&quot; style=&quot;display: inline-block;&quot;&gt;
        &lt;video src=&quot;http://tanguy.ortolo.eu/blog/data/images/screenshots/smtp-session.webm&quot; alt=&quot;SMTP session with netcat&quot; controls=&quot;controls&quot;&gt;Sorry your browser does not support videos, you may want to try another one.&lt;/video&gt;
        &lt;p class=&quot;caption&quot; style=&quot;text-align: center;&quot;&gt;SMTP session without rlwrap&lt;/p&gt;
    &lt;/div&gt;
    &lt;div class=&quot;figure&quot; style=&quot;display: inline-block;&quot;&gt;
        &lt;video src=&quot;http://tanguy.ortolo.eu/blog/data/images/screenshots/smtp-session-rlwrap.webm&quot; alt=&quot;SMTP session with netcat and rlwrap&quot; controls=&quot;controls&quot;&gt;Sorry your browser does not support videos, you may want to try another one.&lt;/video&gt;
        &lt;p class=&quot;caption&quot; style=&quot;text-align: center;&quot;&gt;SMTP session with rlwrap&lt;/p&gt;
    &lt;/div&gt;
&lt;/div&gt;</description>
		<pubDate>Sat, 05 Jan 2013 17:15:00 +0100</pubDate>
		<dc:creator>Tanguy</dc:creator>
	</item>
	<item>
		<title>A desktop file managers failure: writing an USB stick image</title> 
		<link>http://tanguy.ortolo.eu/blog/article86/burning-usb-image</link>
		<guid>http://tanguy.ortolo.eu/blog/article86/burning-usb-image</guid>
		<description>&lt;h2&gt;Installing an operating system&lt;/h2&gt;

&lt;p&gt;When you want to install a new operating system, the first thing to do is to
get an installer medium, which usually involves two steps: downloading an
image, and writing it to a medium. There are two major types of media usable
for that purpose: optical discs and USB sticks. There used to be a third one,
floppy disks, but it is no longer used, and it was conceptually very similar to
USB sticks.&lt;/p&gt;&lt;h2&gt;Power-user&lt;/h2&gt;

&lt;p&gt;If you are a power-user, you probably use USB stick, to be able to reuse
them and because they are easier to carry. For you, writing an optical disc or
an USB drive is almost the same:&lt;/p&gt;

&lt;pre class=&quot;cli&quot;&gt;
$ wodim image.iso
$ dd if=image.img of=/dev/sdc
&lt;/pre&gt;

&lt;h2&gt;Regular user&lt;/h2&gt;

&lt;p&gt;But what would you suggest to a normal user? USB stick? You should not:
while it is technically much easier to write an USB stick (just copy blocks
from the image to the peripheral file, without any need to use any specific
function), desktop file manager make it much harder. Indeed, for a desktop
user, burning an ISO image to an optical disk is quite simple: right-click on
the image file and choose the “burn” option. But writing an image to an USB
stick? There is no similar option, so that will involve calling a power-user
friend, which will tell you to open a terminal and type “dd if=…”.&lt;/p&gt;

&lt;div class=&quot;figure&quot; style=&quot;text-align: center; margin: 1em;&quot;&gt;
&lt;img src=&quot;http://tanguy.ortolo.eu/blog/data/images/screenshots/nautilus-burn.png&quot; alt=&quot;Nautilus file manager context menu, with a “burn” option&quot; style=&quot;border: 1px solid;&quot; /&gt;
&lt;p class=&quot;caption&quot; style=&quot;text-align: center;&quot;&gt;Nautilus&#039;s context menu: write to &lt;em&gt;optical&lt;/em&gt; disc…&lt;/p&gt;
&lt;/div&gt;

&lt;h2&gt;Moral&lt;/h2&gt;

&lt;dl&gt;
    &lt;dt&gt;Power-users&lt;/dt&gt;
    &lt;dd&gt;Continue using USB sticks as installation media, but tell regular users
    to use optical discs until desktop file managers adapt.&lt;/dd&gt;
    &lt;dt&gt;Regular users&lt;/dt&gt;
    &lt;dd&gt;Use optical discs. If your computer does not have an optical reader,
    either invite a power user friend, or buy an USB optical reader.&lt;/dd&gt;
    &lt;dt&gt;Desktop developers&lt;/dt&gt;
    &lt;dd&gt;Please, fix that! Writing an image to an USB stick should &lt;em&gt;not&lt;/em&gt;
    be harder than burning it to an optical disc! People are using more and
    more computers without an optical reader, and that situation is certainly
    not new, as it is only similar to that of the time when we were using
    floppy disks.&lt;/dd&gt;
&lt;/dl&gt;</description>
		<pubDate>Sun, 30 Dec 2012 23:49:00 +0100</pubDate>
		<dc:creator>Tanguy</dc:creator>
	</item>
</channel>
</rss>