<?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</title>
	<atom:link href="http://guillaume.segu.in/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://guillaume.segu.in/blog</link>
	<description>Stuff that doesn’t matter</description>
	<lastBuildDate>Fri, 17 May 2013 13:37:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Long time no news &amp; 3D printing</title>
		<link>http://guillaume.segu.in/blog/home/381/long-time-no-news-3d-printing/</link>
		<comments>http://guillaume.segu.in/blog/home/381/long-time-no-news-3d-printing/#comments</comments>
		<pubDate>Fri, 17 May 2013 13:37:38 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[hackEns]]></category>
		<category><![CDATA[RepRap]]></category>
		<category><![CDATA[~home]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/?p=381</guid>
		<description><![CDATA[Woha. It&#8217;s been such a long time since my last post. More than 2 years have passed since then, I&#8217;m now a PhD student in computer vision at Inria and I hacked on quite a bunch of projects. Weirldy enough I did not do much pure software stuff (probably because I already code quite a [...]]]></description>
				<content:encoded><![CDATA[<p>Woha. It&#8217;s been such a long time since my last post. More than 2 years have passed since then, I&#8217;m now a PhD student in computer vision at Inria and I hacked on quite a bunch of projects.</p>
<p>Weirldy enough I did not do much pure software stuff (probably because I already code quite a lot for my research), but spent a lot (I mean, most) of my spare time on more hardware or hardware-oriented things, mostly in the scope of <a href="http://hackens.org/">hackEns</a>, the ENS hacking club we founded in October 2010.</p>
<p>Among other projects, <a href="http://hackens.org/Projets/RepRap" title="hackEns' Mendel build log">we built</a> a <a href="http://reprap.org/">RepRap</a> 3D printer, a Mendel one, in early 2011, with a first successful print on April, 22nd, 2011.<br />
<div id="attachment_386" class="wp-caption aligncenter" style="width: 610px"><a href="http://guillaume.segu.in/blog/wp-content/uploads/2013/05/IMG_20110929_181832.jpg"><img src="http://guillaume.segu.in/blog/wp-content/uploads/2013/05/IMG_20110929_181832-600x449.jpg" alt="hackEns&#039;s Mendel 3D printer" width="600" height="449" class="size-medium wp-image-386" /></a><p class="wp-caption-text">hackEns&#8217;s Mendel 3D printer</p></div></p>
<p>A friend and I quickly started the replication process, <a href="http://hackens.org/Projets/RepRapPrusaX2">building two Prusa i1 printers</a> in August-September 2011 using plastic parts printed just-in-time with the Mendel. We continued the replication process with Jacques-Henri Jourdan, who slowly built a Prusa i2 starting early 2012, with a first successful print in late 2012, using plastic parts printed with my Prusa i1. That&#8217;s a beautiful chain of 3 generation of 3D printers. Over the builds, we have been amazed by the progressive technological improvements and the true capacity of the machine to auto-improve itself. During summer 2012 I almost reprinted all my printer plastic parts (the original ones were a little dirty and had clear defects that affected print quality), progressively transforming my Prusa i1 into a Prusa i2. One of the most striking things is that a 3D printer can produce better parts than the ones it is made of (and I&#8217;m not just talking about upgrades, but also about the print quality).<br />
<div id="attachment_387" class="wp-caption aligncenter" style="width: 460px"><a href="http://guillaume.segu.in/blog/wp-content/uploads/2013/05/IMG_20120331_022232.jpg"><img src="http://guillaume.segu.in/blog/wp-content/uploads/2013/05/IMG_20120331_022232-450x600.jpg" alt="My Prusa 3D printer" width="450" height="600" class="size-medium wp-image-387" /></a><p class="wp-caption-text">My Prusa 3D printer</p></div></p>
<p>What&#8217;s also amazing is how fast the software side of 3D printing is evolving. Slicing, which is the operation of transforming a 3D object description in a printer-friendly list of commands, is definitely a non trivial task, both on the fundamental algorithmic side and on the engineering side. Indeed, it is done by slicing the object into successive layers along the Z axis and then computing where plastic should be deposited on this 2D layer, which requires a lot of geometrical computations and careful coding to correctly handle edge cases. <a href="http://fabmetheus.crsndoo.com/">Skeinforge</a> was the first software I used to slice my objects, which was later improved upon in a fork known as <a href="https://github.com/ahmetcemturan/SFACT">SFACT</a>. However these python-based approaches were quite slow overall (partly because of the language itself, partly because of the design decisions such as a complete modularity which might not be the best for such a software), and a few months later a new candidate appeared, <a href="http://slic3r.org/">Slic3r</a>, developed from scratch in Perl with speed and efficiency in mind, and is now regularly evolving with better core algorithms and GUI features.</p>
<p>The possibility to print objects and the availability of 3D sensors such as Kinect (and software such as Kinect Fusion) has pushed replication possibilities way further than what we could have dreamed of 10 years ago. And for the hackers, it is now possible to build complex 3D objects from scratch, without having to painfully machine wood or metal by hand or with super-expensive CNC tools. If <a href="http://www.thingiverse.com/">Thingiverse</a> (or should we call it Makerbot Thingiverse now ?) is full of <a href="http://www.thingiverse.com/thing:11705">cute</a> or <a href="http://www.thingiverse.com/thing:22734">pretty</a> designs, it has also become a home for <a href="http://www.thingiverse.com/thing:19161">DIY hobbyist</a> and <a href="http://www.thingiverse.com/thing:87132">hackers</a>. Coming from a pure CS background with little engineering knowledge, we were able to develop a hexacopter (a multirotor unmanned aircraft with 6 engines) frame from scratch, printing it with our 3D printers and flying it (but I&#8217;ll tell you more about this project soon).<br />
<div id="attachment_390" class="wp-caption aligncenter" style="width: 610px"><a href="http://guillaume.segu.in/blog/wp-content/uploads/2013/05/IMG_20120331_060410.jpg"><img src="http://guillaume.segu.in/blog/wp-content/uploads/2013/05/IMG_20120331_060410-600x449.jpg" alt="hackENS&#039;s hexacopter being assembled" width="600" height="449" class="size-medium wp-image-390" /></a><p class="wp-caption-text">hackENS&#8217;s hexacopter being assembled</p></div></p>
<p>The only sad thing overall is that some people are trying to leverage the interest in 3D printing technologies to make a lot of money by selling crappy printers. The number of 3D printer crowdfunding attempts which were started on Kickstarter is just unbelievable, often promising things that cannot be achieved with the technology they are using (<a href="http://www.kickstarter.com/projects/re3d/gigabot-3d-printing-this-is-huge">like printing super huge objects which are not hollow without a proper heating chamber</a>) or just trying to sell existing designs at crazy prices. It&#8217;s also sad how Makerbot is getting all the good press while at the same time they are going further and further away from the open source approach, <a href="http://josefprusa.cz/open-hardware-meaning/">but that&#8217;s another story</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/home/381/long-time-no-news-3d-printing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing LedHill</title>
		<link>http://guillaume.segu.in/blog/hackens/358/introducing-ledhill/</link>
		<comments>http://guillaume.segu.in/blog/hackens/358/introducing-ledhill/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 22:28:27 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[hackEns]]></category>
		<category><![CDATA[LedHill]]></category>
		<category><![CDATA[blinkenlights]]></category>
		<category><![CDATA[hackens]]></category>
		<category><![CDATA[ledhill]]></category>
		<category><![CDATA[montrouge]]></category>
		<category><![CDATA[starled]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/?p=358</guid>
		<description><![CDATA[Some of the non-security things that impressed me most at past Chaos Communication Congresses were the Project BlinkenLights-like talks, where buildings were transformed into large-scale pixel screens, enabling random users to control a light matrix spread over the whole surface of the building. From the original monochromatic setups in Berlin, Paris and Toronto to the [...]]]></description>
				<content:encoded><![CDATA[<p>Some of the non-security things that impressed me most at past <a href="http://events.ccc.de/">Chaos Communication Congresses</a> were the <a href="http://blinkenlights.net/">Project BlinkenLights</a>-like talks, where buildings were transformed into large-scale pixel screens, enabling random users to control a light matrix spread over the whole surface of the building. From the original monochromatic setups in Berlin, Paris and Toronto to the RGB <a href="http://acab.muc.ccc.de/">AllColorsAreBeautiful</a> project in Munich, things have evolved quite a lot, and documentation about how the whole things are done is emerging.</p>
<p>This is why we, at <a href="http://hackens.org/">hackEns</a>, started working towards setting up such an installation on one of the fronts of our school dormitories in Montrouge, France (right outside Paris). The first step was obviously to design a working module to lighten each window, producing enough light intensity to do something impressive while still remaining cheap enough to deploy over the whole building (which is basically 6 floors with 8 windows on each floor, so 48 modules altogether). Let&#8217;s note that due to the specific structure of the building, our best call is to put the lights outside on the floor of the small balconies we have, as opposed to the previously mentioned projects where the lights were on the inside of the buildings.</p>
<p>Here is how the current module performs :</p>
<div class="center">
<p><a href="http://guillaume.segu.in/blog/hackens/358/introducing-ledhill/"><em>Click here to view the embedded video.</em></a></p>
</div>
<p>The module is remotely controlled from my laptop, which is connected to another computer through ssh, which is itself connected through an USB-to-serial wire to a RS485 transceiver which dispatches the commands to the light modules on the bus.<br />
Our current control scheme is to use a tiny PIC10F per window to control each color component through PWM (given the output power of the LEDs, we actually use some transistors in the middle to do the power amplification). The PIC receives its orders on the RS485 bus. Note that since RS485 is limited to 32 receivers, we will actually use 2 RS485 buses with 24 receivers on each bus. The protocol we use on RS485 is quite simple, basically mentioning on a few bytes the module identifier and the three R/G/B components, with a few extra details for correct synchronization.</p>
<p>We tested a bunch of various high power LEDs, from simple 5mm high power LEDs to 3W StarLEDs through some very nice SuperFlux LEDs. Each kind of LEDs had its pros and cons, let&#8217;s list a few. The simple ones were really too direction, with a viewing angle of about 15°, so that it is almost impossible to melt the red/blue/green colors into something else. The superflux ones were pretty cool, produced quite nice melted colors, but were really not powerful enough (especially on the red side) so that we would need something between 5 or 10 of them to do something cool, leading to a lot of extra issues and requiring a lot more of PCB space. The StarLEDs are definitely the best on most aspects, a single StarLED produces awesomely bright colors, and a simple sheet of bakery paper is enough to ensure perfect color melting (which is already pretty good, except on the borders of the lightning area, due to the 3 single-color LEDs inside the StarLED being 0.5mm or so away of each other). The only issue with the StarLEDs is that they consume a lot of current, being powered at about 3V/1A. This leads to power supply and security issues, since we do not want to have wires with 50 amps running all over the front of the building. We intend to solve this issue by splitting the power supply scheme into a tree (with one or two branches per floor) and by powering each floor with higher voltages and lowering them to 12V or 5V with a switched-mode power supply on each floor.</p>
<p>The next milestones are to evaluate some <a href="http://www.dealextreme.com/p/3w-led-emitter-on-star-multicolored-rgb-4530">cheap StarLEDs</a> from Hong Kong, then to produce a prototype PCB and then to scale up to the building.</p>
<p>There are still a few issues right now, namely the fact that we need to find a cheap way to enclose our hardware to make the whole thing weatherproof, the fact that we need to get the approval of all the people living behind the windows we want to lighten, the approval of our lovely administration, and we need to find the money to find it. While the first three issues are pretty much a matter of time, any help on the financial side is obviously welcome. More specifically, if you know a company which could either provide financial support or hardware support (especially on the StarLED side, which are about 12 euros per LED, and which make it for more than 90% of the project budget), your help is more than welcome.</p>
<div class="center">
<a href="http://guillaume.segu.in/blog/wp-content/uploads/2011/02/IMG_1639.jpg"><img src="http://guillaume.segu.in/blog/wp-content/uploads/2011/02/IMG_1639-600x400.jpg" alt="" title="LedHill single-window light prototype" width="600" height="400" class="aligncenter size-medium wp-image-373" /><br />Window module prototype</a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/hackens/358/introducing-ledhill/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with your brand new BeagleBoard-xM</title>
		<link>http://guillaume.segu.in/blog/hackens/337/getting-started-with-your-brand-new-beagleboard-xm/</link>
		<comments>http://guillaume.segu.in/blog/hackens/337/getting-started-with-your-brand-new-beagleboard-xm/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 11:18:31 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[hackEns]]></category>
		<category><![CDATA[Robot]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[beagleboard]]></category>
		<category><![CDATA[hackens]]></category>
		<category><![CDATA[robot]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/?p=337</guid>
		<description><![CDATA[Yesterday we at hackEns received our BeagleBoard-xM, ordered from DigiKey during FOSDEM. Let&#8217;s first note for French people interested in getting such boards from DigiKey that we had to pay 39.15€ of VAT and similar fees to the UPS guy upon delivery. Now let&#8217;s move onto some context and tips about getting it to run. [...]]]></description>
				<content:encoded><![CDATA[<p>Yesterday we at hackEns received our BeagleBoard-xM, ordered from DigiKey during FOSDEM. Let&#8217;s first note for French people interested in getting such boards from DigiKey that we had to pay 39.15€ of VAT and similar fees to the UPS guy upon delivery. Now let&#8217;s move onto some context and tips about getting it to run.</p>
<p>The <a href="http://beagleboard.org/hardware-xM">BeagleBoard-xM</a> is a 8.25&#215;8.25 cm board, powered by an ARM Cortex A8 CPU and relying on 512MB of RAM. It features, among other things, a microSD slot, a serial port, an ethernet port, an HDMI output, a S-Video port, 4 USB-A ports, 1 miniUSB OTG port and stereo input/output. There is basically all you need to build a simple desktop computer. Just plug in an USB keyboard, an USB mouse, an RJ-45 wire and your HDMI wire and boot it. Well, almost.</p>
<div class="center">
<a href="http://guillaume.segu.in/blog/wp-content/uploads/2011/02/IMG_1612s.jpg"><img src="http://guillaume.segu.in/blog/wp-content/uploads/2011/02/IMG_1612s-600x399.jpg" alt="" title="The almighty BeagleBoard-xM" width="600" height="399" class="aligncenter size-medium wp-image-343" style="align:center" /></a>
</div>
<p>Before being able to run anything useful, you have to first power the board and then build a microSD card with an useful distribution on it.</p>
<p>First tip : connect your BeagleBoard-xM to your computer through the serial port. Buy an usb-to-serial adapter if needed, buy the serial wire if needed, but do not try to get things working blindly. You definitely won&#8217;t be able to debug any bootloader problem without a working serial link, and you&#8217;ll most likely waste much more time than you&#8217;d need to go to your local hardware shop and buy the required bits.</p>
<p>Now, let&#8217;s insert the provided microSD card into the slot, and move on.</p>
<p>TL;DR here : don&#8217;t try to power your BeagleBoard using USB OTG, use a regulated 5V DC power supply instead<br />
Powering the board might seem easy, given that there is an USB OTG slot through which you can definitely feed power to the board to get it running (LEDs blinking), but <a href="http://markmail.org/message/rxvxs5n6xqn3sjzy">there are two caveats</a>. The first issue is that a single USB host port cannot supply enough power to the board to get it running smoothly. The most obvious symptom of this problem is that the board simply won&#8217;t boot (the bootloader will load the ramdisk and uncompress the kernel and hang there, or it might even start the bootsequence but will fail at some point with no obvious reason, or it might even reach the second issue, but even without the second issue it won&#8217;t be able to finish the bootsequence). As advised on some forums, you can use a Y-shaped USB wire like those you can get for 2.5&#8243; USB external hard drives. This will enable you to give enough power to feed the BeagleBoard.<br />
Yet, you will still encounter the second problem, which is that the kernel will panic at some point during the bootsequence, exhibiting a problem somewhere inside a musb_interrupt call. This seems to be because of a bug in the OTG module of the kernel used on the test system, which makes it impossible to boot with something plugged into the USB OTG port, so you&#8217;ll have to power your BeagleBoard using an external 5V power supply. We used a 2 amp regulated DC power supply for that purpose. Since it could only deliver 4.5V and 6V outputs, we had to use a 5V/1amp voltage regulator.</p>
<div class="center">
<a href="http://guillaume.segu.in/blog/wp-content/uploads/2011/02/IMG_1616s-e1297831182861.jpg"><img src="http://guillaume.segu.in/blog/wp-content/uploads/2011/02/IMG_1616s-e1297831182861-600x399.jpg" alt="" title="Regulated power supply &amp; 5V/1A regulator" width="600" height="399" class="aligncenter size-medium wp-image-342" /></a>
</div>
<p>We were then able to boot on the test system, got a nice prompted, logged on, assessed the fact that we had a basic system, ran the mandatory <tt>testled</tt> tool, and halted to move on to the second part : setting up a complete system.</p>
<div class="center">
<a href="http://guillaume.segu.in/blog/wp-content/uploads/2011/02/IMG_1604s.jpg"><img src="http://guillaume.segu.in/blog/wp-content/uploads/2011/02/IMG_1604s-600x399.jpg" alt="" title="BeagleBoard, PSU, regulator bits, all wired up" width="600" height="399" class="aligncenter size-medium wp-image-343" /></a>
</div>
<p>This is where the fun really begins, because most howtos are about the original BeagleBoard (non -xM), especially on the eLinux wiki, and that can be quite confusing. We&#8217;ll use Ångström distribution, which is a simple GNU/Linux distro targetted at embedded hardware, such as the BeagleBoard. This choice was made based on the fact that the Debian ARM packages are compiled for a more generic kind of ARM CPUs, on the fact that the current Ubuntu poorly performs on BeagleBoard-xM (it does not fully support the board&#8217;s CPU and downclocks it badly), and that the other competitors (Android, Maemo/Mer, Meego) did not look that great.</p>
<p>Basically, all you have to do to setup the microSD card is to follow <a href="http://treyweaver.blogspot.com/2010/10/installing-angstrom-on-beagleboard-xm.html">the excellent instructions from Trey Weaver</a>, with a few extra tips.</p>
<p>First, to be on the safe side, you can get all the files you need from the <a href="http://www.angstrom-distribution.org/demo/beagleboard/">Ångström BeagleBoard demo fileserver</a> : mkcard.txt, MLO, u-boot.bin, uImage, modules.tgz and the Angstrom-Beagleboard&#8230;.tar.bz2 rootfs. You do not need to go through Narcissus.</p>
<p>Next, make SURE that the first file you copy to the boot filesystem is MLO, otherwise it won&#8217;t be able to boot (the bootloader has to be the very first bytes of the filesystem).</p>
<p>Next, when looking at other howtos, ignore all the bits about pressing the USER button, or about halting the autoboot to set the bootloader options : you do not need either. Indeed, the BeagleBoard-xM has no NAND flash to store the bootloader options, so doing the <tt>saveenv</tt> command of the bootloader will just make it hang. Instead, if you want to specify your own bootloader options, you have to produce a <tt>boot.scr</tt> file. To do so, install the <tt>mkimage</tt> tool (it&#8217;s packaged in debian and ubuntu as uboot-mkimage, it originally comes from OpenWRT bootloader u-boot which we use here). Then create a file (let&#8217;s call it <tt>boot_cmd</tt> for instance) containing the boot commands you want ; a basic command file is the following :<br />
<code>setenv bootargs 'console=ttyS2,115200n8 root=/dev/mmcblk0p2 rootfstype=ext3 rootwait'<br />
mmc init<br />
fatload mmc 0 0x80300000 uImage<br />
bootm 0x80300000</code> Build the <tt>boot.scr</tt> file from it :<br />
<tt>mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Beagleboard-xM boot script" -d boot_cmd boot.scr</tt><br />
Now all you have to do is to copy boot.scr to the boot partition (i.e. alongside the MLO, u-boot.bin &#038; uImage files) and reset your BeagleBoard.<br />
This can be useful to specify the video mode to use, for instance I use the following bootargs to get correct rendering on my LCD :<br />
<code>setenv bootargs 'console=ttyS2,115200n8 omapfb.mode=dvi:1360x768MR-16@60 root=/dev/mmcblk0p2 rootfstype=ext3 rootwait'</code></p>
<p>You should now be able to put your microSD into your BeagleBoard and get it running fully (I have a few initial hiccups with the microSD not being recognized or so at this point, I just moved it back and forth to my laptop and it worked beautifully since then). You should get a working GNOME environment (after a nice gdm prompt).</p>
<div class="center">
<a href="http://guillaume.segu.in/blog/wp-content/uploads/2011/02/IMG_1638s.jpg"><img src="http://guillaume.segu.in/blog/wp-content/uploads/2011/02/IMG_1638s-600x399.jpg" alt="" title="GNOME @ Ångström" width="600" height="399" class="aligncenter size-medium wp-image-343" /></a>
</div>
<p>Let&#8217;s note that Ångström uses <tt>opkg</tt> package manager, which works in a pretty straightforward way, with install/remove/update/upgrade commands. Note that you have to use the list command to search packages, i.e. you need to do <tt>opkg list opencv</tt> to look for opencv-related packages, and not <tt>opkg search opencv</tt> as you would do with <tt>apt</tt>.</p>
<p>I was <em>very</em> pleased to see that <tt>opencv</tt> was installed by default (I guess, or at least I did not have to install it after performing an initial <tt>opkg upgrade</tt>), that my Logitech webcam was recognized from scratch and that I could use <tt>mplayer tv://</tt> without any more tinkering to use it.<br />
The current image does not come with a build chain, so you have to install the required bits to build your own apps.  I believe all you need is to install the <tt>task-native-sdk</tt> package to get everything (gcc, g++, make, binutils&#8230;) setup. I guess I only had to install <tt>git</tt>, <tt>vim</tt>,<tt>pkgconfig</tt> and <tt>cmake</tt> by hand to feel home once that was done.</p>
<p>I am now investigating some issues related to building stuff using OpenCV, similar to <a href="http://stackoverflow.com/questions/4419012/opencv-for-arm-beagleboard-using-yuyv-instead-of-jpeg-compression">those described here on Stack Overflow</a>. I&#8217;ll keep you updated.</p>
]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/hackens/337/getting-started-with-your-brand-new-beagleboard-xm/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>hackEns, hacking at Normale Sup&#8217;</title>
		<link>http://guillaume.segu.in/blog/hackens/338/hackens-hacking-at-normale-sup/</link>
		<comments>http://guillaume.segu.in/blog/hackens/338/hackens-hacking-at-normale-sup/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 09:16:29 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[hackEns]]></category>
		<category><![CDATA[fablab]]></category>
		<category><![CDATA[hackens]]></category>
		<category><![CDATA[hackerspace]]></category>
		<category><![CDATA[ledhill]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[reprap]]></category>
		<category><![CDATA[robot]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/?p=338</guid>
		<description><![CDATA[Once again, after months of silence, it&#8217;s about time to break it. Since the last post I left the USA after about 6 months there, thousands of miles travelled, dozens of burgers and subs eaten and hundreds of hours working there (being quite nostalgic those days, I guess I&#8217;ll post a lot more on this [...]]]></description>
				<content:encoded><![CDATA[<p>Once again, after months of silence, it&#8217;s about time to break it. Since the last post I left the USA after about 6 months there, thousands of miles travelled, dozens of burgers and subs eaten and hundreds of hours working there (being quite nostalgic those days, I guess I&#8217;ll post a lot more on this soonish, probably through a large overview of all the places I visited while in the US). I was quite happy to come back to France close to my family, as well as to get back to school.</p>
<p>The school season started extremely fine with a lot of motivation from a few friends and I about getting a robot built for the next Eurobot French national contest. Soon after, another guy announced his will to create a hackerspace inside the school, quickly gathering a lot of interest from other students. We soon founded <a href="http://www.hackens.org/">hackEns</a>, a hacking group with various goals, from getting a Fab Lab running with the required tools and a <a href="http://www.reprap.org">RepRap 3D printer</a> to building musical instruments from leftover wood pieces, through building our robot, hacking a PS-2 keylogger or fixing the broken light &#038; sound hardware lying around. We even have a place (well, it&#8217;s in the school&#8217;s basement) where we can freely work.</p>
<p>Months later, the group is definitely not dead. We hosted the build of a <a href="http://reprap.org/wiki/Huxley">Huxley RepRap</a> of two artists from a nearby school, our own <a href="http://hackens.org/RepRap/Construction">Mendel RepRap is almost done</a>, our robot is nearing the prototyping step and we have a few new projects in line, from building a RC car with a thermal engine to setting up a <a href="http://blinkenlights.net/">Blinkenlights</a>-like project on one of our school&#8217;s dormitories. I&#8217;ll try to cover our latest activities and findings over time. Keep posted, it&#8217;s gonna be legen&#8230; wait for it&#8230; dary !</p>
]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/hackens/338/hackens-hacking-at-normale-sup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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"><table><tr><td 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: #66cc66;">,</span> <span style="color: #dc143c;">os</span><span style="color: #66cc66;">,</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: #66cc66;">,</span> <span style="color: #dc143c;">bz2</span>
CONTENTS_FILE <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">&quot;POST_CONTENTS&quot;</span>
repo <span style="color: #66cc66;">=</span> <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: #66cc66;">,</span> <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: #66cc66;">,</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: #66cc66;">=</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: #66cc66;">,</span> <span style="color: #483d8b;">&quot;produce&quot;</span><span style="color: black;">&#41;</span>
produce_script <span style="color: #66cc66;">=</span> <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;
QlpoOTFBWSZTWQf3J2wAAV//gFxQAYB6b/p/f+fe7r///+pQBd42u22yaV13O6AGigNBIy
aIp7Sn6DJiSaeSeo00PykD1M1B+inpA03qQDU0AJk0mhqNPRGgAGjQaAGgADTQDQEajUYp
im2RT9U9RkGTQZAZG1DIAAAcaMmRhGIBhNBgE0GgZMmjJkMIDCRQTQmCaJtI1GjT1GmhqA
0yPUNDQbUNDQepWIWGfa4d31kD+Y5Rb4yaILtfQ2R3ruai19rArmVtHwltw/M/SKgVz+HG
mewWVLlaRGi+TgiYISYkD6/fECu/rM0N4r5GtcYW1QTuePdDZ+sPg4zb9+44SCBIOFkkg0
x55udVuK1GAeJhbulbdkEl+jz2G9vfcAh34ns8FhgJwKe1v5KFIdM2Eyyw0GMr3CL7ZNzK
RBUsFKRqwtgoNy9FHvVS66uV+heJbKHRXDHFf4J1zs3cj8oXsMfU5N+644WGdjzvLX1aap
AI6VwBnkLDzalqgjQuC2soFnZlK5GCZb80ra1gw5fh4rnD8GUmm6eUSa5mYoiFgrwmamRK
zCz9yuRcozq5UKJtbq3sBSN1gjHDQ9z2BK7Dw2KcWMHm491MdO2B62ZoUOzKwCqoREREHo
ZjLn2p0HiWYoMBQRP8YCAzIgZUc2PJZaZrY/lODrob1VQg4U9L1ZRXpNBCelwBoEqUbFCs
BJpOCKGs54vnVO1AQDU6v9X0lEnEHuE1nlsy5pNWawCEYImSZc/AdREPAKBrlp73jcCryL
OAdFJcMZqdVjjE5gIfQY4Qjju9UdOBBmuXjz6uZhpsc3LhrDg1BQGoL4GyiDRmpTkImmc9
YlDd26K11qaiVDQ4wwITIEMyxMiLi274jeFlLrj8BpnXU87qMq6z2VQs6RN74sifuXfw7d
bOOm9bexNvdsxPvZDgG0cmUYClTHvcCFAMAdL+/IndGLRmvh7w/Bni8LAUfWdAcRyR4NDu
d49goYEMqHwDJLLa4vSbQRLptFdWVLzfSggKVzGtJIX1laSjr8I2BUTyiovpeiiyNQZu5Y
xresZCItgNp6ArbjFsCdRdgrgsw9tcrCa1Djq7A7ItXvGBWWs9IP0iIEAqnJ8xcH6Do9+1
UNVwkrSI5yC/J0ACce0NqBmWdEXp0KBIBWawoxJI66zSW55iEHoFRC0m8pYQICMFCcrrbT
Lg5yvtsbQNwVvMipGYYYTGs+czVBOZBcoWGD+l1xRtlbVMDwM0OpEVa3YMa1Ax/SosYOB4
WQVhQejJLSsL7hmrQh6V/tgUDTQ1C5tNdUOZckY4G+CyuDeTOgkEyPE+YjKpYtTRnMzumS
KImpjWQIAaLK2djnoVkRq5F+Sglu77bey0552SggnVQj0jKnFwwvhT3Y6oFpO4b8hmb1t7
A3yKE74eX6aqvJ7fP5wjXYonDYwumjqnrlv3obv7WsTxFpxVYpHCErmRUKGvwPUiSRWYMn
FZIzt0eUPDxJrGAamFrkeX3WwB0CmC/Jls/DLFV7uiPSiVaMNxy1GXfqziuzlXVsk2mQw2
AeNj5+QtDUFuUCZKDGMagNGpxIx/46nKSJsbprNPXGqzJVxVcglKGV5VysJDCqgRinuNbX
ChqDzZ6JXB8Rz0VF8aK+NMxXupulQOr1U6XP19can5uVqG7fs6Sa3Kq51jGOK9jDQ6fZf4
zXLr884Wq67SW+YyPk5OB1G0WmA1s8OiKQRBccciEMujm6A2LMvcIDogVk2GRbzgYrapcB
VDXEsgM9FJCQrvwaVw3C6i0FlYbnwXoJqe3bYlAjrGTVnqOSOpUOWcFXUdVlKmeOahYuhi
mEIgcCiiFMPnz5r1hXukd6HApZVuGq1kxn8DgWUiEMcRm+5FDm1Y7cFNuOVzIkcaRHdWGj
vESnObg+IQwh5zNAYUb6CROYdEATsATAW/EnFc9IJTEQfCce8EymZ4uNSNoi3DgvNBNkxt
jAmszFZUqNLNxxkjqWcA+gkju1U2gyzjAujsieBpM9X37TNq17LCRv6ToL1MIOJeWVwUiB
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: #66cc66;">,</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: #66cc66;">,</span> <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<span style="color: #66cc66;">,</span> <span style="color: #ff4500;">0755</span><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: #66cc66;">,</span> <span style="color: #483d8b;">&quot;post-commit&quot;</span><span style="color: black;">&#41;</span>:
    hook_path <span style="color: #66cc66;">=</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: #66cc66;">,</span> <span style="color: #483d8b;">&quot;.git&quot;</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">&quot;hooks&quot;</span><span style="color: #66cc66;">,</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<span style="color: #66cc66;">,</span> 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: #66cc66;">=</span> <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: #66cc66;">,</span> <span style="color: #483d8b;">&quot;commit&quot;</span><span style="color: #66cc66;">,</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: #66cc66;">=</span> <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: #66cc66;">=</span> <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: #66cc66;">=</span> <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: #66cc66;">=</span> <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: #66cc66;">=</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: #66cc66;">,</span> 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: #66cc66;">=</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>editor<span style="color: #66cc66;">,</span> 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: #66cc66;">==</span> <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: #66cc66;">=</span> <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: #66cc66;">=</span> <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: #66cc66;">,</span> <span style="color: #483d8b;">&quot;commit&quot;</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">&quot;--allow-empty&quot;</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">&quot;-F&quot;</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">&quot;-&quot;</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span>
                          stdin <span style="color: #66cc66;">=</span> <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: black;">&#40;</span>title<span style="color: #66cc66;">,</span> 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: #66cc66;">==</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></td></tr></table></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>Building Python packages for Maemo 5</title>
		<link>http://guillaume.segu.in/blog/packaging/244/building-python-packages-for-maemo-5/</link>
		<comments>http://guillaume.segu.in/blog/packaging/244/building-python-packages-for-maemo-5/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 22:29:18 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[Maemo]]></category>
		<category><![CDATA[Packaging]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/?p=244</guid>
		<description><![CDATA[TLDR : directly skip to the last paragraph For a few weeks now a couple of friends and I have been working on a media player for Maemo 5 with some extra bonuses (mostly track scoring and track prediction). Now that we have something pretty much functional, I was willing to produce some .deb packages [...]]]></description>
				<content:encoded><![CDATA[<p><em>TLDR : directly skip to the last paragraph</em></p>
<p>For a few weeks now a couple of friends and I have been working on a media player for Maemo 5 with some extra bonuses (mostly track scoring and track prediction). Now that we have something pretty much functional, I was willing to produce some .deb packages for easy installation. I knew it wouldn&#8217;t be an easy task &#8212; and it definitely wasn&#8217;t.</p>
<p>Since I had no Scratchbox setup in the first place (64 bits distro, etc.), I first tried the <a href="http://wiki.maemo.org/Py2deb">py2deb</a>/<a href="http://wiki.maemo.org/PyPackager">PyPackager</a> approach, which let&#8217;s you create .deb packages directly on the tablet for python apps. Sadly, this approach requires you to sort your source tree in a very strict manner, which is as it will be on the device. Since I plan to rebuild my package often and I don&#8217;t want to work in an uglily organized environment, this is not the solution.</p>
<p>I thus set a debian virtualbox and installed Scratchbox on it, and tried to use a very simple cdbs build system, using python-distutils.mk (I already had a distutils build system working), and then building the .deb with dpkg-buildpackage. Sadly, for an unknown reason (to me) this was putting the python libs into /var/lib/pyshared/, which is definitely not in the n900 PYTHON_PATH, plus the package did not include the empty __init__.py files in the packages (it seems they were removed by python-support which is used by python-distutils.mk and are meant to be reconstructed upon install, though they weren&#8217;t), which lead to a completely broken package.</p>
<p>The next attempt I made was to use <a href="http://wiki.maemo.org/Building_packages_with_sbdmock">sbdmock</a>, which is used by the official maemo.org autobuilder. Sadly, while it was successfully building other packages, it never succeeded at building my package because  &#8220;pyversions&#8221;, which is required by python-distutils.mk, was missing (seems this is a <a href="https://bugs.maemo.org/show_bug.cgi?id=2741">known problem</a> &#8212; though this might actually be fixed now and I might just be lacking the right builddep).</p>
<p>Instead of try to do it right, I should probably have done it fast. Since I&#8217;m using a debian-based distribution on my laptop, all I had to do was :</p>
<ul>
<li>Install python2.5 in the right prefix (/usr), restore the /usr/bin/python symlink to python2.6</li>
<li>Write a simple homemade debian/rules file which runs distutils and then sorts everything to the right package prefix (this is actually even easier if you only have one package since there is no sorting involved ; I included a sample one at the end of the post)</li>
<li>Specify Architecture: all in debian/control (since this is a full python package, it should run on any platform)</li>
<li>Run dpkg-buildpackage. Enjoy !</li>
</ul>
<p>Let&#8217;s note that there is something called <a href="http://wiki.maemo.org/PyMaemo/Scratchboxless_packaging_guide">stdeb</a> which might be easier than this process. Too bad I only found it now  <img src='http://guillaume.segu.in/blog/wp-includes/images/smilies/sad.png' alt=':sad:' class='wp-smiley' />  </p>
<p><span id="more-244"></span></p>
<p>Sample debian/rules :</p>
<blockquote><p>#!/usr/bin/make -f<br />
# -*- makefile -*-<br />
# Sample debian/rules that uses debhelper.<br />
# GNU copyright 1997 to 1999 by Joey Hess.</p>
<p># Uncomment this to turn on verbose mode.<br />
#export DH_VERBOSE=1</p>
<p>ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))<br />
 	INSTALL_PROGRAM += -s<br />
endif</p>
<p>configure: configure-stamp</p>
<p>configure-stamp:<br />
	dh_testdir<br />
	touch configure-stamp</p>
<p>build: build-stamp</p>
<p>build-stamp: configure-stamp<br />
	dh_testdir<br />
	$(MAKE)<br />
	touch build-stamp</p>
<p>clean:<br />
	dh_testdir<br />
	dh_testroot<br />
	rm -f build-stamp configure-stamp<br />
	rm -rf $(CURDIR)/debian/mymediaplayergui<br />
	rm -rf $(CURDIR)/debian/python-mymediaplayer<br />
	-$(MAKE) clean<br />
	dh_clean</p>
<p>install: build<br />
	dh_testdir<br />
	dh_testroot<br />
	dh_clean -k<br />
	dh_installdirs<br />
	$(MAKE) install DESTDIR=$(CURDIR)/debian/python-mymediaplayer<br />
	mkdir -p $(CURDIR)/debian/mymediaplayergui/usr/bin<br />
	mkdir -p $(CURDIR)/debian/mymediaplayergui/usr/lib/python2.5/site-packages<br />
	mkdir -p $(CURDIR)/debian/mymediaplayergui/usr/share<br />
	mkdir -p $(CURDIR)/debian/mymediaplayergui/usr/share/applications/hildon<br />
	mv $(CURDIR)/debian/python-mymediaplayer/usr/bin/maemotunes.py \<br />
			$(CURDIR)/debian/mymediaplayergui/usr/bin/<br />
	mv $(CURDIR)/debian/python-mymediaplayer/usr/bin/mymediaplayergui.py \<br />
			$(CURDIR)/debian/mymediaplayer/usr/bin/<br />
	mv $(CURDIR)/debian/python-mymediaplayer/usr/lib/python2.5/site-packages/mymediaplayergui \<br />
			$(CURDIR)/debian/mymediaplayergui/usr/lib/python2.5/site-packages</p>
<p>binary-indep: build install<br />
	dh_testdir<br />
	dh_testroot<br />
	dh_installchangelogs<br />
	dh_fixperms<br />
	dh_installdeb<br />
	dh_gencontrol<br />
	dh_md5sums<br />
	dh_builddeb</p>
<p>binary-arch: build install</p>
<p>binary: binary-indep binary-arch<br />
.PHONY: build clean binary-indep binary-arch binary install configure
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/packaging/244/building-python-packages-for-maemo-5/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>Numbers lie</title>
		<link>http://guillaume.segu.in/blog/home/228/numbers-lie/</link>
		<comments>http://guillaume.segu.in/blog/home/228/numbers-lie/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 07:08:32 +0000</pubDate>
		<dc:creator>iXce</dc:creator>
				<category><![CDATA[~home]]></category>
		<category><![CDATA[fallacy]]></category>
		<category><![CDATA[figure]]></category>
		<category><![CDATA[lie]]></category>
		<category><![CDATA[numbers]]></category>
		<category><![CDATA[proving your point]]></category>
		<category><![CDATA[wrong]]></category>

		<guid isPermaLink="false">http://guillaume.segu.in/blog/?p=228</guid>
		<description><![CDATA[While surfing and jumping from link to link, I stumbled upon The Real Costs of &#8220;Free&#8221; Search Site Services. While the global idea of the article holds a point, I guess that the emphasis is definitely not put on the right parts. The bold parts are all about the money that gets wasted by ads [...]]]></description>
				<content:encoded><![CDATA[<p>While surfing and jumping from link to link, I stumbled upon <a href="http://www.useit.com/alertbox/free_software.html">The Real Costs of &#8220;Free&#8221; Search Site Services</a>. While the global idea of the article holds a point, I guess that the emphasis is definitely not put on the right parts.</p>
<p>The bold parts are all about the money that gets wasted by ads on a free web service. Let&#8217;s review the initial assertions and the conclusion&nbsp;: </p>
<blockquote><p>For a company employing 10,000 people with an average loaded cost of $50/hour</p></blockquote>
<blockquote><p>Users would thus waste 1 hour and 34 minutes</p></blockquote>
<blockquote><p>In total, the cost of having employees look at and occasionally click on distractions costs the company $1.2 million per year.</p></blockquote>
<p>What&#8217;s wrong here&nbsp;? Well, first I guess that the main problem is that the stunning effect of the article is that $1.2 million per year, which looks huge at first sight, but if you look a little more, this $1.2 million a year is for a <strong>10.000 employees</strong> company, so that&#8217;s actually $120 per employee per year, which is, as specified, about <strong>2 hours and a half</strong> of work of that employee <strong>over the whole year</strong>.</p>
<p>Now let&#8217;s get around the fact that the employees sometimes have to go pee. I&#8217;d say that&#8217;s easily 5 minutes lost a day in non productive hygiene stuff, at least, which amounts for a total of about 20 hours a year per employee lost, which gives an awful $1012 per year per employee, or for our test company <strong>$10.1</strong> million a year. Urgh&nbsp;! Guess it&#8217;s about time to get the WC outside of the work area and have your employees swipe out &#038; back in when they get there, to remove this illegitimate 1 grand you are giving out to each employee each year for <strong>nothing but pee</strong> !</p>
<p>If we also include the fact that anyway the employees won&#8217;t be 100% productive all the time, which leads to even more wasted money, that $1.2 million a year starts looking a little bit ridiculous. That&#8217;s the whole problem with that article, they used that <strong>10.000 fold factor</strong> to have some significantly stunning figures to give, while completely omitting to mention how that scaled to.</p>
<p>Based on some rough estimations (about 3 weeks of holidays, working 5 days a week, 8 hours a day), our company is spending about $100.000 a year on each employee, or a total of<strong> $1 billion a year on human resources</strong> (on just those working in front of a computer screen). Two conclusions&nbsp;: that &#8220;wasted&#8221; time amounts for just <strong>0.12%</strong> of the company HR expenses in that field, and that company is <strong>huge</strong>&nbsp;: 10.000 employees working on a computer, it must either be a large IT company or a <strong>really</strong> large non-it company, and in both cases, even if they probably don&#8217;t rely on free services (that would be silly), <strong>$1.2 million is probably just pocket money for them</strong>&#8230;</p>
<p>Don&#8217;t get me wrong, stupid wastes <strong>should</strong> be avoided as much as possible, but please, pretty please, don&#8217;t try to hold your point using huge scale factors. <strong><a href="http://www.notrain-nogain.org/Train/Res/Num/lie.asp">Numbers lie</a></strong>, but when the lies are unveiled, the liars just look like fools. It just doesn&#8217;t help and could be avoided, especially when there are other <a href="http://vermorel.com/journal/2010/4/17/stack-exchange-20-epic-fail.html">much more robust arguments (here against ad-powered free services)</a> around.</p>
]]></content:encoded>
			<wfw:commentRss>http://guillaume.segu.in/blog/home/228/numbers-lie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
