<?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>iXce's blog &#187; Linux</title>
	<atom:link href="http://guillaume.segu.in/blog/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://guillaume.segu.in/blog</link>
	<description>Stuff that doesn’t matter</description>
	<lastBuildDate>Mon, 28 Feb 2011 22:28:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Getting your EOS 450D shutter actuation count</title>
		<link>http://guillaume.segu.in/blog/linux/329/getting-your-eos-450d-shutter-actuation-count/</link>
		<comments>http://guillaume.segu.in/blog/linux/329/getting-your-eos-450d-shutter-actuation-count/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 04:51:47 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Photo]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[canon]]></category>
		<category><![CDATA[dslr]]></category>
		<category><![CDATA[eos 450D]]></category>
		<category><![CDATA[gphoto2]]></category>
		<category><![CDATA[shutter]]></category>
		<category><![CDATA[shutter actuation]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/?p=329</guid>
		<description><![CDATA[While sorting my pictures this evening, I was wondering how much pictures I captured with my EOS 450D camera since I got it. I knew (thanks to a doc about flashes I read a few days ago) that was I was looking for was the shutter actuation count of the camera. Googling pointed me to [...]]]></description>
			<content:encoded><![CDATA[<p>While sorting my pictures this evening, I was wondering how much pictures I captured with my EOS 450D camera since I got it. I knew (thanks to a doc about flashes I read a few days ago) that was I was looking for was the shutter actuation count of the camera.<br />
Googling pointed me to a bunch of Windows or OSX related links, such as the nontheless nice <a href="http://astrojargon.net/40DShutterCount.aspx?AspxAutoDetectCookieSupport=1">40D Shutter Count</a> software, or <a href="http://dptnt.com/2007/06/how-to-find-out-the-total-shutter-actuations-of-your-dslr/">pointers to exiftool</a>, which did not work with the pictures taken on my 450D.<br />
I then remembered the greatness of gphoto2 and gave it a shot.</p>
<ul>
<li>Plugged the camera through USB, restarted it</li>
<li>Checked that it was detected with <tt>gphoto2 --auto-detect</tt></li>
<li>Checked the capabilities with <tt>gphoto2 -a</tt></li>
<li>Looked at the config options with <tt>gphoto2 --list-options</tt></li>
<li>Found the <tt>/main/status/shuttercounter</tt> option</li>
<li>Ran <span style="font-size:1.5em;"><b><tt>gphoto2 --get-config=/main/status/shuttercounter</tt></b></span></li>
<li>And here it is : 27781 shutter actuations</li>
</ul>
<p>That number seems quite reliable, since I can have about 15000 of those pictures on my hard drive disks and I used to drop about 2 pics on 3 in my early days (I&#8217;m a lot softer on the shutter now, after experiencing the joys of picture sorting <img src='http://guillaume.segu.in/blog/wp-includes/images/smilies/tongue.png' alt=':p' class='wp-smiley' /> ).</p>
<p>Good to know I&#8217;m still far from the <a href="http://photocamel.com/forum/canon-forum/79862-canon-discloses-camera-shutter-life-expectancy.html">100.000 actuations expected shutter life for 450D&#8217;s</a>.</p>
<p>Well, thanks <tt>gphoto2</tt> for your simplicity !</p>
]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/linux/329/getting-your-eos-450d-shutter-actuation-count/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use git as your blog data storage backend</title>
		<link>http://guillaume.segu.in/blog/code/298/use-git-as-your-blog-data-storage-backend/</link>
		<comments>http://guillaume.segu.in/blog/code/298/use-git-as-your-blog-data-storage-backend/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 00:18:37 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/?p=298</guid>
		<description><![CDATA[A school friend, namely p4bl0, mentioned the idea of maintaining blog posts with git and a set of hooks which would produce the blog html from the contents of the repo. I loved the idea, but thought I could push it a little further&#160;: a blog engine which would use no other storage than git, [...]]]></description>
			<content:encoded><![CDATA[<p>A school friend, namely <a href="http://pablo.rauzy.name/">p4bl0</a>, mentioned the idea of maintaining blog posts with <tt>git</tt> and a set of hooks which would produce the blog html from the contents of the repo. I loved the idea, but thought I could push it a little further&nbsp;: a blog engine which would use no other storage than <tt>git</tt>, with the post subject and contents being the commit message subject and contents. A post-commit or post-receive hook then produces the html. As simple as that&nbsp;!</p>
<p>You can find the source in <a href="http://guillaume.segu.in/cgit/blogit.git/">BloGit git repo</a>, and see an example at <a href="http://aulo.in/blogit.html">BloGit example</a>. To use the source, you first have to pack it (using the <tt>pack</tt> script), which will merge the <tt>raw_post</tt> and <tt>raw_produce</tt>, producing a single <tt>post</tt> script (which I also included at the end of this post), which you can simply put in an empty directory and run it. It will unpack the other script (<tt>produce</tt>), initialize the git repo, and set the hooks. It&#8217;ll then prompt you for your post title and then open an editor for you to set your post contents. Save the file, and you&#8217;re done with your first post&nbsp;: check the index.html file which has been produced in the same directory. You can write your own stylesheet in the <a href="http://aulo.in/blogit-style.css">blogit-style.css</a> file. Further posts can be done with the same <tt>post</tt> script.</p>
<p>Yet, the best way is probably just to use the usual git workflow. To initialize the repo and all, run <tt>post --unpack</tt>, and to post <tt>post --raw</tt> or <tt>git commit --allow-empty</tt> (when using <tt>git commit</tt>, leave a blank line between the subject line and the rest of the post). You can also amend existing commits (using <tt>git commit --amend</tt>), use the GIT_AUTHOR_* environment variables to change the author, and so on. Since merge commits are skipped by the html generator, it should work just great for multi author blogging !</p>
<p>PS&nbsp;: I know this is JUST a git log pretty printer, and that the whole thing is pretty much trivial. I also know that using versionned files to store the posts would allow a lot of extra bonuses (such as automatically adding &#8220;Updated on &#8230;&#8221; mentions based on the commit log of each single file). I just thought the idea was fun <img src='http://guillaume.segu.in/blog/wp-includes/images/smilies/tongue.png' alt=':p' class='wp-smiley' />  There are probably a lot of things to improve, or a lot of smart git features to use there that I overlooked. Feel free to leave a line <img src='http://guillaume.segu.in/blog/wp-includes/images/smilies/smile.png' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-298"></span></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
<span style="color: #483d8b;">&quot;&quot;&quot;
 bloggit
 Author : Guillaume &quot;iXce&quot; Seguin
 Email  : guillaume@segu.in (or guillaume.seguin@ens.fr)
 Copyright (C) 2010 Guillaume Seguin
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor,
 Boston, MA  02110-1301, USA.
&quot;&quot;&quot;</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">subprocess</span>, <span style="color: #dc143c;">os</span>, <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">base64</span>, <span style="color: #dc143c;">bz2</span>
CONTENTS_FILE = <span style="color: #483d8b;">&quot;POST_CONTENTS&quot;</span>
repo = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">dirname</span> <span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">abspath</span> <span style="color: black;">&#40;</span>__file__<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #dc143c;">os</span>.<span style="color: black;">chdir</span> <span style="color: black;">&#40;</span>repo<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">exists</span> <span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span> <span style="color: black;">&#40;</span>repo, <span style="color: #483d8b;">&quot;.git&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>:
    <span style="color: #dc143c;">subprocess</span>.<span style="color: black;">call</span> <span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;git&quot;</span>, <span style="color: #483d8b;">&quot;init&quot;</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
produce_path = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span> <span style="color: black;">&#40;</span>repo, <span style="color: #483d8b;">&quot;produce&quot;</span><span style="color: black;">&#41;</span>
produce_script = <span style="color: #dc143c;">bz2</span>.<span style="color: black;">decompress</span> <span style="color: black;">&#40;</span><span style="color: #dc143c;">base64</span>.<span style="color: black;">b64decode</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;&quot;
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
6MrbOTHwIixlYyW5xO7y/+LuSKcKEgD+5O2A==
&quot;&quot;&quot;</span>.<span style="color: black;">strip</span> <span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">replace</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">exists</span> <span style="color: black;">&#40;</span>produce_path<span style="color: black;">&#41;</span>:
    <span style="color: #008000;">open</span> <span style="color: black;">&#40;</span>produce_path, <span style="color: #483d8b;">&quot;w&quot;</span><span style="color: black;">&#41;</span>.<span style="color: black;">write</span> <span style="color: black;">&#40;</span>produce_script<span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">os</span>.<span style="color: black;">chmod</span> <span style="color: black;">&#40;</span>produce_path, 0755<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">for</span> hook <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;post-receive&quot;</span>, <span style="color: #483d8b;">&quot;post-commit&quot;</span><span style="color: black;">&#41;</span>:
    hook_path = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span> <span style="color: black;">&#40;</span>repo, <span style="color: #483d8b;">&quot;.git&quot;</span>, <span style="color: #483d8b;">&quot;hooks&quot;</span>, hook<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">exists</span> <span style="color: black;">&#40;</span>hook_path<span style="color: black;">&#41;</span> \
     <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">realpath</span> <span style="color: black;">&#40;</span>hook_path<span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= produce_path:
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">lexists</span> <span style="color: black;">&#40;</span>hook_path<span style="color: black;">&#41;</span>: <span style="color: #dc143c;">os</span>.<span style="color: black;">remove</span> <span style="color: black;">&#40;</span>hook_path<span style="color: black;">&#41;</span>
        <span style="color: #dc143c;">os</span>.<span style="color: black;">symlink</span> <span style="color: black;">&#40;</span>produce_path, hook_path<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">&quot;--unpack&quot;</span> <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Unpack only&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">raise</span> <span style="color: #008000;">SystemExit</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">&quot;--raw&quot;</span> <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span>:
    p = <span style="color: #dc143c;">subprocess</span>.<span style="color: black;">Popen</span> <span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;git&quot;</span>, <span style="color: #483d8b;">&quot;commit&quot;</span>, <span style="color: #483d8b;">&quot;--allow-empty&quot;</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
    p.<span style="color: black;">communicate</span> <span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">else</span>:
    title = <span style="color: #008000;">raw_input</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Post title ? &quot;</span><span style="color: black;">&#41;</span>
    editor = <span style="color: #483d8b;">&quot;vi&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">&quot;VISUAL&quot;</span> <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">environ</span>:
        editor = <span style="color: #dc143c;">os</span>.<span style="color: black;">environ</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;VISUAL&quot;</span><span style="color: black;">&#93;</span>
    <span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #483d8b;">&quot;EDITOR&quot;</span> <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">environ</span>:
        editor = <span style="color: #dc143c;">os</span>.<span style="color: black;">environ</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;EDITOR&quot;</span><span style="color: black;">&#93;</span>
    contents_path = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span> <span style="color: black;">&#40;</span>repo, CONTENTS_FILE<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">exists</span> <span style="color: black;">&#40;</span>contents_path<span style="color: black;">&#41;</span>:
        <span style="color: #dc143c;">os</span>.<span style="color: black;">remove</span> <span style="color: black;">&#40;</span>contents_path<span style="color: black;">&#41;</span>
    ret = <span style="color: #dc143c;">subprocess</span>.<span style="color: black;">call</span> <span style="color: black;">&#40;</span><span style="color: black;">&#91;</span>editor, contents_path<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> ret == <span style="color: #ff4500;">0</span> <span style="color: #ff7700;font-weight:bold;">and</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">exists</span> <span style="color: black;">&#40;</span>contents_path<span style="color: black;">&#41;</span>:
        contents = <span style="color: #008000;">open</span> <span style="color: black;">&#40;</span>contents_path<span style="color: black;">&#41;</span>.<span style="color: black;">read</span> <span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #dc143c;">os</span>.<span style="color: black;">remove</span> <span style="color: black;">&#40;</span>contents_path<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;A problem occured while editing the contents file&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">raise</span> <span style="color: #008000;">SystemExit</span>
    p = <span style="color: #dc143c;">subprocess</span>.<span style="color: black;">Popen</span> <span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;git&quot;</span>, <span style="color: #483d8b;">&quot;commit&quot;</span>, <span style="color: #483d8b;">&quot;--allow-empty&quot;</span>, <span style="color: #483d8b;">&quot;-F&quot;</span>, <span style="color: #483d8b;">&quot;-&quot;</span><span style="color: black;">&#93;</span>,
                          stdin = <span style="color: #dc143c;">subprocess</span>.<span style="color: black;">PIPE</span><span style="color: black;">&#41;</span>
    p.<span style="color: black;">communicate</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%s<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>%s&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>title, contents<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">if</span> p.<span style="color: black;">returncode</span> == <span style="color: #ff4500;">0</span>: <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;New post successfully added&quot;</span>
<span style="color: #ff7700;font-weight:bold;">else</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Couldn't add new post&quot;</span>
    <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span> <span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/code/298/use-git-as-your-blog-data-storage-backend/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Accepting invalid SSL certs in Thunderbird</title>
		<link>http://guillaume.segu.in/blog/tips/265/accepting-invalid-ssl-certs-in-thunderbird/</link>
		<comments>http://guillaume.segu.in/blog/tips/265/accepting-invalid-ssl-certs-in-thunderbird/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 04:46:09 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/?p=265</guid>
		<description><![CDATA[Since Thunderbird 3 (or maybe before that), when you encounter an invalid SSL certificate, the GUI doesn&#8217;t even offer you to add an exception as in Firefox. Counter-intuitively, the same GUI than in Firefox is actually, available you just have to dig it through the menus. Here is a step-by-step tutorial with screenshots (had to [...]]]></description>
			<content:encoded><![CDATA[<p>Since Thunderbird 3 (or maybe before that), when you encounter an invalid SSL certificate, the GUI doesn&#8217;t even offer you to add an exception as in Firefox. Counter-intuitively, the same GUI than in Firefox is actually, available you just have to dig it through the menus. Here is a step-by-step tutorial with screenshots (had to do them for a doc, thought I&#8217;d share).</p>
<div id="attachment_266" class="wp-caption aligncenter" style="width: 440px"><a href="http://guillaume.segu.in/blog/wp-content/uploads/2010/07/thunderbird-cert-1.png"><img src="http://guillaume.segu.in/blog/wp-content/uploads/2010/07/thunderbird-cert-1.png" alt="" title="Go to Account Settings" width="430" height="424" class="size-full wp-image-266" /></a><p class="wp-caption-text">Go to Account Settings</p></div>
<div id="attachment_267" class="wp-caption aligncenter" style="width: 857px"><a href="http://guillaume.segu.in/blog/wp-content/uploads/2010/07/thunderbird-cert-2.png"><img src="http://guillaume.segu.in/blog/wp-content/uploads/2010/07/thunderbird-cert-2.png" alt="" title="In Security menu select View Certificates (alternatively, you can get there through Edit, Preferences, Advanced, Certificates, View Certificates if you have no Security menu here)" width="847" height="682" class="size-full wp-image-267" /></a><p class="wp-caption-text">In Security menu select View Certificates (alternatively, you can get there through Edit, Preferences, Advanced, Certificates, View Certificates if you have no Security menu here)</p></div>
<div id="attachment_268" class="wp-caption aligncenter" style="width: 618px"><a href="http://guillaume.segu.in/blog/wp-content/uploads/2010/07/thunderbird-cert-3.png"><img src="http://guillaume.segu.in/blog/wp-content/uploads/2010/07/thunderbird-cert-3.png" alt="" title="In Servers tab, hit Add Exception" width="608" height="428" class="size-full wp-image-268" /></a><p class="wp-caption-text">In Servers tab, hit Add Exception</p></div>
<div id="attachment_269" class="wp-caption aligncenter" style="width: 515px"><a href="http://guillaume.segu.in/blog/wp-content/uploads/2010/07/thunderbird-cert-4.png"><img src="http://guillaume.segu.in/blog/wp-content/uploads/2010/07/thunderbird-cert-4.png" alt="" title="Enter the address:port of the service you are using (without any protocol://) and hit Get Certificate" width="505" height="508" class="size-full wp-image-269" /></a><p class="wp-caption-text">Enter the address:port of the service you are using (without any protocol://) and hit Get Certificate</p></div>
<div id="attachment_270" class="wp-caption aligncenter" style="width: 521px"><a href="http://guillaume.segu.in/blog/wp-content/uploads/2010/07/thunderbird-cert-5.png"><img src="http://guillaume.segu.in/blog/wp-content/uploads/2010/07/thunderbird-cert-5.png" alt="" title="Hit Confirm Security Exception, and you&#039;re done !" width="511" height="510" class="size-full wp-image-270" /></a><p class="wp-caption-text">Hit Confirm Security Exception, and you're done !</p></div>
]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/tips/265/accepting-invalid-ssl-certs-in-thunderbird/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Ghost TV problem</title>
		<link>http://guillaume.segu.in/blog/linux/238/the-ghost-tv-problem/</link>
		<comments>http://guillaume.segu.in/blog/linux/238/the-ghost-tv-problem/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 19:14:55 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[drm]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[freeze]]></category>
		<category><![CDATA[intel]]></category>
		<category><![CDATA[x.org]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/?p=238</guid>
		<description><![CDATA[For months I have been having (temporary) freezes upon X/gdm login, sometimes even before that, lasting anywhere between 1 and 5 minutes (that&#8217;s on my Dell Latitude E4200). Actually, I could still move the cursor, and at times a panel widget would refresh, but nothing else. Logging on a tty and running top would show [...]]]></description>
			<content:encoded><![CDATA[<p>For <a href="http://identi.ca/notice/19670654">months</a> I have been having (temporary) freezes upon X/gdm login, sometimes even before that, lasting anywhere between 1 and 5 minutes (that&#8217;s on my Dell Latitude E4200). Actually, I could still move the cursor, and at times a panel widget would refresh, but nothing else. Logging on a tty and running top would show X.org eating 100% CPU (pretty much expected actually). Investigations of /var/log/Xorg.0.log revealed that X was continuously doing EDID probing because of an unknown TV1 monitor, while dmesg confirmed that something was going on with that mysterious TV1 output&nbsp;:<br />
<code>[    12.924] (II) intel(0): Printing probed modes for output TV1<br />
[    15.065] (II) intel(0): Printing probed modes for output TV1<br />
[    15.477] (II) intel(0): Printing probed modes for output TV1<br />
[    15.892] (II) intel(0): Printing probed modes for output TV1<br />
...<br />
</code><br />
<code>[drm] TV-1: set mode NTSC 480i 0<br />
[drm] TV-1: set mode NTSC 480i 0<br />
[drm] TV-1: set mode NTSC 480i 0<br />
...</code></p>
<p>After spending quite a bunch of time trying to tell X to just ignore, I took the easy way and&#8230; switched to Ubuntu. But yesterday, I asked drago01 (maintainer of Compiz packages in Fedora) about the issue, and he immediately recognised the problem, calling it the &#8220;Ghost TV problem&#8221;. According to him and Adam Jackson (ajax), this is a screw up from hardware vendors. The graphics chipset thinks there is that TV plugged while there is definitely none.</p>
<p>Anyway, he also pointed me to the fix. 4 lines in xorg.conf and you&#8217;re done (this is actually my whole xorg.conf <img src='http://guillaume.segu.in/blog/wp-includes/images/smilies/tongue.png' alt=':p' class='wp-smiley' /> )</p>
<p><code>Section "Monitor"<br />
  Identifier "TV1"<br />
  Option "Ignore" "1"<br />
EndSection</code></p>
]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/linux/238/the-ghost-tv-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doing changes for usability sake based on broken assumptions</title>
		<link>http://guillaume.segu.in/blog/code/173/doing-changes-for-usability-sake-based-on-broken-assumptions/</link>
		<comments>http://guillaume.segu.in/blog/code/173/doing-changes-for-usability-sake-based-on-broken-assumptions/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 19:01:43 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[azerty]]></category>
		<category><![CDATA[dumb]]></category>
		<category><![CDATA[keybinding]]></category>
		<category><![CDATA[metacity]]></category>
		<category><![CDATA[qwerty]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/?p=173</guid>
		<description><![CDATA[Keyboard shortcuts are always a great matter of debate, and the whole problem is that most often they are chosen based on assumptions of the end user layout. For instance, take this metacity commit : Change default cycle_group keybinding to Alt-grave. This change looks perfectly harmless, right ? Well not quite. It&#8217;s most likely based [...]]]></description>
			<content:encoded><![CDATA[<p>Keyboard shortcuts are always a great matter of debate, and the whole problem is that most often they are chosen based on assumptions of the end user layout.</p>
<p>For instance, take this <a href="http://git.gnome.org/browse/metacity/commit/?id=0f805bfdfb46e6739912df042f628ca9913b433c">metacity commit : Change default cycle_group keybinding to Alt-grave</a>. This change looks perfectly harmless, right ? Well not quite. It&#8217;s most likely based on the assumption that the end users has a qwerty keyboard layout (and it makes perfectly sense there). But let&#8217;s take an azerty layout. Grave is on the é/7 key, which is even farther from alt or tab than F6 is (well, not much I agree, but it might be even worse on other layouts). Is it really worth doing such a change then ?</p>
<p>Let&#8217;s also note that this also triggers a bad bug which gets alt+7 and alt+shift+7 to trigger the binding as well, while alt+grave is actually alt+altgr+7. This has been keeping me from nicely switching to my window n°7 in irssi for months (great thing that this window holds a really low traffic channel&#8230;).</p>
<p>All in all, I guess that the real problem is not that this change was made, but rather than we might need a system to have layout-dependant keybindings, or maybe hardware-location-based keybindings (<em>i.e.</em> that the key above the Tab key would trigger this keybinding independently of the layout).</p>
<p><em>Initially published on Mar 24, 2010 @ 8:22</em></p>
<p><strong>Update :</strong> this change has been <a href="http://git.gnome.org/browse/metacity/commit/?id=7d8972f20d4a41bb9c8afbc45a2eb6a9bbf08b09">reverted for the GNOME 2.30 release</a>. Even though I&#8217;m happy that the problem is &#8220;fixed&#8221;, it&#8217;s sad that the underlying problem (Alt+Shift+7 triggering Alt+`) is still there.</p>
]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/code/173/doing-changes-for-usability-sake-based-on-broken-assumptions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doing basic UML-like diagrams for Python code</title>
		<link>http://guillaume.segu.in/blog/code/160/doing-basic-uml-like-diagrams-for-python-code/</link>
		<comments>http://guillaume.segu.in/blog/code/160/doing-basic-uml-like-diagrams-for-python-code/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 00:56:15 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[diagram]]></category>
		<category><![CDATA[uml]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/?p=160</guid>
		<description><![CDATA[For a project midterm presentation, we were asked to produce a bunch of slides explaining our project architecture and implementation choices. Apart of the obvious things (libraries in use, network protocol&#8230;), I had no real clue on what I could put in, so I thought I&#8217;d just throw some UML-like diagrams and that it would [...]]]></description>
			<content:encoded><![CDATA[<p>For a project midterm presentation, we were asked to produce a bunch of slides explaining our project architecture and implementation choices. Apart of the obvious things (libraries in use, network protocol&#8230;), I had no real clue on what I could put in, so I thought I&#8217;d just throw some UML-like diagrams and that it would be fine. The only detail was&nbsp;: how to produce these diagrams&nbsp;?</p>
<p>Since the project code was written in Python, all the inheritance relations were already held by the code and could be introspected, so that it was theoretically possible to automatically produce the inheritance diagram. And it actually is, and is implemented by things like the <a href="http://epydoc.sourceforge.net/">Epydoc</a> (a documentation generator for Python code) parser, as well as the diagram generation, which Epydoc also implements. The only thing is that I wasn&#8217;t satisfied by the Epydoc diagrams since they were limited to the inheritance relationships, while I was also willing to include usage relationships and display only the main methods and variables of my objects.</p>
<p>I thus wrote <a href="http://guillaume.segu.in/cgit/umlpy.git/">Umlpy</a>, a UML-like class diagram generator for Python code, which depends on Epydoc (for the parser) and python-graphviz (for the graph generation, it produces nicely spaced graphs and can output jpg, png or pdf files, and probably more). It handles the aforementioned requirements through docstrings parsing and introspection. Check the <a href="http://guillaume.segu.in/cgit/umlpy.git/tree/README">Umlpy README file</a> for more documentation on how to use it. It took me about 10 minutes to get to the result I was expecting (it&#8217;s basically about adding a little docstring for usage relationship, and copy-pasting a docstring on methods or variables you want to see on the diagram.</p>
<p>This wouldn&#8217;t be complete without the mandatory screenshot, and <a href="http://guillaume.segu.in/cgit/umlpy.git/tree/example.py?id=16c34deeb3340aeb470958e2b2278c6c703fc5d5">this example code</a> results into this diagram&nbsp;:<br />
<img src="http://guillaume.segu.in/blog/wp-content/uploads/2010/03/example.png" alt="Umlpy result example" title="Umlpy result example" width="384" height="320" class="aligncenter size-full wp-image-161" /></p>
]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/code/160/doing-basic-uml-like-diagrams-for-python-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote controlling your DSLR</title>
		<link>http://guillaume.segu.in/blog/home/147/remote-controlling-your-dslr/</link>
		<comments>http://guillaume.segu.in/blog/home/147/remote-controlling-your-dslr/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 23:13:03 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Photo]]></category>
		<category><![CDATA[~home]]></category>
		<category><![CDATA[canon]]></category>
		<category><![CDATA[dslr]]></category>
		<category><![CDATA[eos 450D]]></category>
		<category><![CDATA[gphoto2]]></category>
		<category><![CDATA[remote]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/?p=147</guid>
		<description><![CDATA[A few days ago, I discovered I had a miniUSB-A (or something along the line) plug on my beloved EOS 450D camera. Fun stuff, I could read pictures directly from the camera without having to swapping my SDHC card back and forth, at a pretty decent transfer rate (yet quite slower than through the cardreaded [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago, I discovered I had a miniUSB-A (or something along the line) plug on my beloved EOS 450D camera. Fun stuff, I could read pictures directly from the camera without having to swapping my SDHC card back and forth, at a pretty decent transfer rate (yet quite slower than through the cardreaded of my laptop).</p>
<p>I then discovered <a href="http://www.gphoto.org/">libghoto2</a>, which is the library behind the Linux support of this feature. After a little bit of googling, I stumbled upon the gphoto2 website, where they mentionned that it was possible to command shooting from the computer and directly get the resulting image on the computer. Immediately tried and&#8230; it works great ! (though I haven&#8217;t figured yet how to get the picture on the sdcard instead of directly on the computer).</p>
<p>Not sure what I&#8217;m going to do with this, but I&#8217;m confident there is a bunch of hacking possibilities here. Maybe should I write a simple GUI on top of it someday to begin with. Or I could try building a motorized base and remote control the whole thing from my n900 (and attempt to do things like <a href="http://www.paris-26-gigapixels.com/">Paris 26 Gigapixels</a>). Hmmmmm&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/home/147/remote-controlling-your-dslr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>molly-guard: prevent accidental shutdowns/reboots</title>
		<link>http://guillaume.segu.in/blog/home/118/molly-guard-prevent-accidental-shutdownsreboots/</link>
		<comments>http://guillaume.segu.in/blog/home/118/molly-guard-prevent-accidental-shutdownsreboots/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 17:07:46 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[~home]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/?p=118</guid>
		<description><![CDATA[Have you ever mistakenly shut down or rebooted your operation-critical server while you were willing to halt your desktop computer through ssh before going to bed, or anything like this? If so, and if you are on Debian/Ubuntu, molly-guard is designed for you: this nifty bash script gets between you and the shutdown/reboot/halt tools, checking [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever mistakenly shut down or rebooted your operation-critical server while you were willing to halt your desktop computer through ssh before going to bed, or anything like this? If so, and if you are on Debian/Ubuntu, <a href="http://packages.debian.org/unstable/admin/molly-guard">molly-guard</a> is designed for you: this nifty bash script gets between you and the shutdown/reboot/halt tools, checking if you are connecting through ssh and if so asking for the hostname of the machine before proceeding.</p>
<p>Wondering how it looks? Here is the output of a little test:</p>
<pre><code>ixce@timmy:~$ sudo shutdown -r
W: molly-guard: SSH session detected!
Please type in hostname of the machine to shutdown:
Good thing I asked; I won't shutdown timmy ...</code></pre>
<p>Since it doesn&#8217;t correctly handle sudo yet (actually sudo is at fault here, since it drops SSH_CONNECTION environment variable when doing its stuff), you might want to add PRETEND_SSH around the beginning of /usr/sbin/shutdown <a href="http://nion.modprobe.de/blog/archives/570-Installing-molly-guard.html">as specified on Nico &#8220;nion&#8221; Golde&#8217;s blog</a>.</p>
<p>You might also want to grab the <a href="http://guillaume.segu.in/packages/molly-guard/molly-guard_0.3.2-1_all.deb">molly-guard 0.3.2 etch package</a> I backported from sid (all I changed is downgrade debhelper build-dep version and debhelper compatibility level in debian/compat since etch only has debhelper 5 and the sid package required debhelper 6 ; this shouldn&#8217;t break anything since the newer debhelper just seems to be needed to recognize a few fields in debian/control about where the package is maintained). <a href="http://guillaume.segu.in/packages/molly-guard/">Sources are also available</a>, anyway.</p>
<p>Thanks <a href="http://www.bonz.org/tech/">hr</a> for the tip <img src='http://guillaume.segu.in/blog/wp-includes/images/smilies/smile.png' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/home/118/molly-guard-prevent-accidental-shutdownsreboots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenSuse T-Shirt</title>
		<link>http://guillaume.segu.in/blog/home/105/opensuse-t-shirt/</link>
		<comments>http://guillaume.segu.in/blog/home/105/opensuse-t-shirt/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 19:11:54 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[Compiz/Fusion]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[~home]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/home/105/opensuse-t-shirt/</guid>
		<description><![CDATA[Huge thanks to Novell, OpenSuse and jpr for this awesome T-Shirt I love it! Sorry, I look completely tired and I&#8217;ve got too much hair these days]]></description>
			<content:encoded><![CDATA[<p>Huge thanks to Novell, OpenSuse and <a href="http://jprosevear.org/blog/index.php">jpr</a> for this awesome T-Shirt <img src='http://guillaume.segu.in/blog/wp-includes/images/smilies/smile.png' alt=':)' class='wp-smiley' />  I love it!<br />
<a href='http://guillaume.segu.in/blog/wp-content/uploads/2008/03/dsc02480.JPG' title='OpenSuse T-Shirt'><img src='http://guillaume.segu.in/blog/wp-content/uploads/2008/03/dsc02480.thumbnail.JPG' alt='OpenSuse T-Shirt' /></a></p>
<p><em>Sorry, I look completely tired and I&#8217;ve got too much hair these days <img src='http://guillaume.segu.in/blog/wp-includes/images/smilies/tongue.png' alt=':p' class='wp-smiley' /> </em></p>
]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/home/105/opensuse-t-shirt/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>pamusb</title>
		<link>http://guillaume.segu.in/blog/home/91/pamusb/</link>
		<comments>http://guillaume.segu.in/blog/home/91/pamusb/#comments</comments>
		<pubDate>Sat, 05 Jan 2008 08:40:50 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[~home]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/home/91/pamusb/</guid>
		<description><![CDATA[I discovered pamusb a few days ago (actually, I had already heard about it, but never puzzled to try it), and WOW it&#8217;s great! In case you wouldn&#8217;t have guessed it yet, it lets you use an USB drive or a removable media (SD cars or so), as a mean of authentication for any pam-based [...]]]></description>
			<content:encoded><![CDATA[<p>I discovered pamusb a few days ago (actually, I had already heard about it, but never puzzled to try it), and WOW it&#8217;s great! In case you wouldn&#8217;t have guessed it yet, it lets you use an USB drive or a removable media (SD cars or so), as a mean of authentication for any pam-based application (su/sudo, keyrings, screensaver&#8230;). The setup is damn easy (it&#8217;s all about adding one line to a file in /etc/pam.d, typing two commands and adding an agent run on every session), and the whole thing works damn well.<br />
It&#8217;s just really cool to just have to unplug an usb key to lock my laptop and replug it to unlock it, or to insert it upon login or&#8230; It&#8217;s just greatly useful. I&#8217;m still a bit reluctant to make it &#8220;required&#8221; and not just &#8220;sufficient&#8221;. It&#8217;d just be awful to be unable to login because I lose it or so&#8230;</p>
<p>Oh, just a little tip, to avoid &#8220;Unsafe disk removal&#8221;, just add the drive to /etc/fstab (you can reference it by label) and make it readonly and mountable by user.<br />
<code>LABEL=MY-KEY        /media/auth             vfat     ro,defaults,user,noauto 0      0</code>If you want to rename *your key, just head to the <a href="https://help.ubuntu.com/community/RenameUSBDrive">RenameUSBDrive article</a> in Ubuntu Documentation</p>
<p>Here are 0.4.2 debs for hardy (which currently only has 0.4.0):</p>
<ul>
<li><a href='http://guillaume.segu.in/blog/wp-content/uploads/2008/01/libpam-usb_042-1ubuntu1_i386.deb' title='libpamusb 0.4.2 deb for hardy'>libpamusb 0.4.2 deb for hardy</a></li>
<li><a href='http://guillaume.segu.in/blog/wp-content/uploads/2008/01/pamusb-tools_042-1ubuntu1_i386.deb' title='pamusb-tools deb for hardy'>pamusb-tools deb for hardy</a></li>
</ul>
<p>And a few handy links:</p>
<ul>
<li><a href="http://www.progbox.co.uk/wordpress/?p=348">Neat howto for debian based distros</a></li>
<li><a href="http://www.pamusb.org/">pamusb homepage</a></li>
<li><a href="http://scox.info/">Andrea Luzzardi&#8217;s blog (pamusb author)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/home/91/pamusb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

