Warning: Cannot modify header information - headers already sent by (output started at /home/jdobbels/www/blog/inc/config.php:40) in /home/jdobbels/www/blog/inc/public/lib.urlhandlers.php on line 503
Warning: Cannot modify header information - headers already sent by (output started at /home/jdobbels/www/blog/inc/config.php:40) in /home/jdobbels/www/blog/inc/clearbricks/common/lib.http.php on line 222
Warning: Cannot modify header information - headers already sent by (output started at /home/jdobbels/www/blog/inc/config.php:40) in /home/jdobbels/www/blog/inc/clearbricks/common/lib.http.php on line 224
Warning: Cannot modify header information - headers already sent by (output started at /home/jdobbels/www/blog/inc/config.php:40) in /home/jdobbels/www/blog/inc/public/lib.urlhandlers.php on line 65
Warning: Cannot modify header information - headers already sent by (output started at /home/jdobbels/www/blog/inc/config.php:40) in /home/jdobbels/www/blog/inc/clearbricks/common/lib.http.php on line 247 JDobbelstein.dev()To infinity, and beyond !2011-01-10T00:04:33+01:00Johanurn:md5:98d5e93307cb5ee6e20feba0dc3f35ebDotclearA custom Vimshurn:md5:d868b6548aec926b62709dfb7cfac5c62011-01-10T01:04:00+01:00JohanThe wonderful world of computer programmingpythonvimvimsh<!-- vim:spell:spelllang=en:
Note that the article title is missing.
It is managed directly by DotClear2.
- - - - - - - - - - - - - - - - -
Insert below a short introduction
=================================
-->
<div style="text-align:center;">
<video controls="true" src="http://www.jdobbelstein.eu/blog/public/999_Vimsh/vimsh.ogg" style="width:33em;">
Your browser does not support the <code>video</code> element.
</video>
</div> <p>The previous video demonstrates a simple hack using a custom version of
the vim plugin vimsh. The new features are:
An option g:vimsh_filetype to customize the syntax coloration in
the prompt buffer;
Another option g:vimsh_split_method to control where the prompt
pops. Cf. the vim functions :below and :above.
Improve g:vimsh_sh_arg parsing using... <em><a href="http://www.jdobbelstein.eu/blog/post/2011/01/10/A-custom-Vimsh">Read</em> A custom Vimsh</a></p>Debugging GObjects in Gliburn:md5:0740042f5893a49e50ed659e5323c8e22010-10-01T00:58:00+02:00JohanThe wonderful world of computer programminggdbglibhaskellmemory leak<!-- vim:spell:spelllang=en:
Note that the article title is missing.
It is managed directly by DotClear2.
- - - - - - - - - - - - - - - - -
Insert below a short introduction
=================================
-->
<p style="width:20em; margin:auto; padding:1em; text-align:center; float:right;">
<object data="http://www.jdobbelstein.eu/blog/public/15_GlibDebug/leak.svg" type="image/svg+xml">
<img alt="leaky memory" src="http://www.jdobbelstein.eu/blog/public/15_GlibDebug/leak.png"/>
<p>can't read SVG ? go
<a href="http://www.jdobbelstein.eu/blog/post/2010/10/01/www.getfirefox.com">www.getfirefox.com</a></p>
</object>
</p>
<p>I'm working (since too long) on a Haskell binding to the XFCE library
"xfconf" because, you know, in order to improve one programming skills,
one should write code. Anyway, after harassing the Haskell mailing-lists
with my newbie questions, I got a not-so-bad working binding to xfconf.</p>
<p>… memory leaks apart.</p>
<p>It took me a <em>lots</em> of efforts to finally solve this memory issue,
mainly because I'm a bad programmer who don't know a damn about software
runtime and also because I don't know what tools to use with Haskell.</p>
<div style="clear:both;">
</div> <p>I. The situation
I.a. Why do I care about memory leaks ?
Because I am poor.
Poor people tend to have old computers. Old computers tend to have a
small amount of RAM. And, sadly, recent GNU/linux distributions tend to
be really bloated.
Practical advantages of hunting memory leak are 1) you get to know more
stuff about software debugging 2) you... <em><a href="http://www.jdobbelstein.eu/blog/post/2010/10/01/Debugging-GObjects-in-Glib">Read</em> Debugging GObjects in Glib</a></p>Unicode in Python and i18n in Fedoraurn:md5:523556271f859ae6173ca52b488da1852010-08-10T13:45:00+02:00JohanNow geeking ...fedorai18npythonrantunicode<!-- vim:spell:spelllang=en:
Note that the article title is missing.
It is managed directly by DotClear2.
- - - - - - - - - - - - - - - - -
Insert below a short introduction
=================================
-->
<p>When I was playing with the ports4dotclear system (see the previous post
about it), I had to fix a number of Unicode handling errors in both
Python and Perl. For those of you who do not know what is <a href="http://www.unicode.org/">Unicode</a>,
it's the technology which allows me to write this kind of stuff:
<em>«æ€¶ŧ←»® or «你好世界»</em>.</p>
<p>I was forced to use Unicode because, well, XML-RPC communications are in
XML and thus require the content to be encoded in UTF-8 (a Unicode
encoding/decoding charset).</p>
<p>All this mess leads me to this conclusion : <em>Unicode sucks in Python 2.x
! (and Fedora i18n has still some strange artifacts)</em></p> <p>I. Python
There is a well known unicode bug in Python 2.x. It's really a shame it
didn't got fix earlier, although I may have read the new python 3k fixed
it. Anyway, this bug pops when you play with POSIX pipes and wide
characters. It's very annoying because you don't understand why a simple
shell redirection (on stdout) should change the python... <em><a href="http://www.jdobbelstein.eu/blog/post/2010/08/10/Unicode-in-Python-and-i18n-in-Fedora">Read</em> Unicode in Python and i18n in Fedora</a></p>A port system for DotClearurn:md5:b91b3fa14412095c364a9b3ab867878d2010-07-26T18:36:00+02:00Johannetworkdotclearhighlightmarkdownports4dotclear<!-- vim:spell:spelllang=en:
Jekyll-like blog management for DotClear2
=========================================
-->
<p style="width:94%; margin:auto; padding:1em; text-align:center;">
<object data="http://www.jdobbelstein.eu/blog/public/13_jekyll/goldberg.svg" type="image/svg+xml">
<p>can't read SVG ? go
<a href="http://www.jdobbelstein.eu/blog/post/2010/07/26/www.getfirefox.com">www.getfirefox.com</a></p>
</object>
<br/>
(<a href="http://www.jdobbelstein.eu/blog/public/13_jekyll/goldberg.svg">SVG source</a>)
</p>
<p>For the ones who favor their command line interface over graphical
terminals, here comes <a href="http://github.com/obbele/ports4dotclear">a bundle of Makefiles and scripts</a> to easily
publish new entries on a DotClear2 blog with XML-RPC enabled.</p>
<p>It is loosely based on *BSD ports and the idea behind static blog
generators like <a href="http://github.com/mojombo/jekyll">jekyll</a>, which in fact I've never used so the
comparison might be more about what I think they are and what I'd like
to use. Nevertheless, the few features I have aimed for are:</p>
<ul>
<li>automation, otherwise I would not waste whole days on the command line</li>
<li>integration with VIM, <em>the</em> text editor</li>
<li>pure text files, a very simple and universal way to store data.
Moreover ones can manage the whole damned thing with <a href="http://git-scm.com">Git</a>.</li>
<li>extensible, as in the Unix philosophy where you combine a myriad of
small programs to achieve your task</li>
</ul>
<p>The project is available on <a href="http://github.com/obbele/ports4dotclear">GitHub</a>.</p> <p>I. Quick demo
Computer science is all about speeding things up. This system doesn't
escape the rule. Using it for posting a new entry on a DotClear2 blog
is as quick as typing:
bash:Goldberg $ make new
Enter directory name: foobar
New directory created: [999_foobar]
bash:Goldberg $ cd 999_foobar
bash:Goldberg/999_foobar $ make edit... <em><a href="http://www.jdobbelstein.eu/blog/post/2010/07/26/A-port-system-for-DotClear">Read</em> A port system for DotClear</a></p>First attempt with SVGurn:md5:4a04de4b510d19fce9c08e53e237fde82010-07-16T19:35:00+02:00Johannetworkdotclearsvg<!--
SVGs
====
-->
<p style="width:14em; margin:auto; padding:1em; text-align:center;">
<object data="http://www.jdobbelstein.eu/blog/public/Media/SVG.svg" type="image/svg+xml">
<p>can't read SVG ? go
<a href="http://www.jdobbelstein.eu/blog/post/2010/07/16/www.getfirefox.com">www.getfirefox.com</a></p>
</object>
<br/>
(<a href="http://www.jdobbelstein.eu/blog/public/Media/SVG.svg">SVG source</a>)
</p>
<p>SVG diagrams are scalable. They should be a perfect fit for this elastic
CSS theme. Let's try.</p> <p>can't read SVG ? go
www.getfirefox.com
(SVG source)
The diagram on the right shows how you can use SVG to display clean and
elegant diagrams. This one was created with Inkscape. On Opera™ and
Mozilla™ browsers, the schema is displayed with a transparent
background. Unfortunately, webkit-based software still... <em><a href="http://www.jdobbelstein.eu/blog/post/2010/07/16/First-attempt-with-SVG">Read</em> First attempt with SVG</a></p>Managing mails the Unix wayurn:md5:539192a7d0f20bd37c6e224c31a5e1e62010-05-10T15:14:00+02:00Johannetworkdovecotemailgetmailmdamramsamtamuapostfixprocmailstunnel<p>I am quite allergic to modern email programs such as Microsoft Outlook,
KMail, Evolution or Thunderbird. After digging the web for a mail program
that "sucks less", I've adopted mutt. In the same time, I've
learned a lot of (not so useful) stuff about the email flow from servers to
servers to servers to my brave old Unix mailbox. I am now using a split set
of software to manage my emails. This could be confusing at first sight,
but eventually I get the so-called do-one-thing-but-do-it-right quality of
Unix systems. To summarize it, my messages go through the following
path:</p>
<pre style="width : 34em; margin : auto;">
.--.
_ -( )- _
.--,( ),--.
_.-( )-._
( INTERNET )
'-._( )_.-'
'__,( ),__'
- ._(__)_. -
^ |
| |
| v
.---------. .-----------.
encryption | stunnel | | getmail | deliver
'---------' '-----------'
^ |
| |
| v
.---------. .----------.
send | postfix | | procmail | filter
'---------' '----------'
^ |
| |
| v
.------. .---------.
read/write | mutt |<============>| dovecot | store
'------' '---------'
</pre>
<p>Getmail, procmail, dovecot, mutt, postfix and stunnel. That's 6 programs
to do what your Microsoft Outlook or Thunderbird do. But I can assure you
that the former 6 programs offer a better experience compared to the latter
ones.</p> <p>I. Some vocabulary
Before going further, let's redefine here some acronyms commonly used
to talk about email systems. The list is based on the mail concept overview from
the mutt wiki.
MRA: Mail Retrieval Agent, the program fetching mails from the
internet (such as fetchmail or getmail)
MDA: Mail Delivery Agent, the program actually... <em><a href="http://www.jdobbelstein.eu/blog/post/2010/05/10/Managing-mails-the-Unix-way">Read</em> Managing mails the Unix way</a></p>A new version for the "Deep Blue" DotClear themeurn:md5:a74ac83d4bab225d4b59a2fb8f4104442010-05-02T23:40:00+02:00Johannetworkcssdotclearwww<p>After three whole nights and more than 30 cups of tea, my blog is
using a new version of my "deep blue" theme. Key new features are:</p>
<ul>
<li>Elastic CSS, this implies no more bitmap pictures :(</li>
<li>Refactoring of DotClear2 template to shift the center of the page
to the left. This leaves a small opening for a side image on the right.
This is a new proof that my poor CSS skills cannot overcome the
xHTML tags and document structure of the original DotClear2
pages.</li>
<li>After many thoughts on the <em>right</em> CSS layout, I choose to use a CSS
width based on <code>em</code>. Layouts based on page percent width are very
tricky when it comes to displaying lines of code because text lines could be
wrapped. CSS <code>em</code> attribute should garantee a similar appearance
among screens and, let's dream, browsers. New pages width should be almost/at
least 80 characters long. This might keep a text layout constant, even if you
are zooming in/out, even if you are using different font sizes. Too wide or too
big screens will be under-used. I don't care, use the space left to play with
tiling window managers. Too small screens will have to go full screen and zoom
out. Anyway if you cannot read 80 characters-long-line text, you should use
another graphical terminal.<em> (note: in fact, and perhaps due to limitation
on the fonts, the length of text lines will never be constant. I've just
tried to assure a minimal quality. See the <a href="http://www.jdobbelstein.eu/blog/post/2010/05/01/A-new-version-for-the-Deep-Blue-DotClear-theme#lengthMyth">next
section</a> for a concrete example)</em></li>
<li>Experimenting the CSS3 property <code>rgba(r,g,b,alpha)</code> to
add some eye candy.</li>
<li>Experimenting another CSS3 property with the
<code>background-size</code> declaration to scale the background image
to full page height. Strangely browsers like Opera zoom both text and
images, this can lead to unesthetic result.</li>
</ul> <p>Fixed line length is a myth
The following paragraphs contain a dummy lorem ipsum text for reference and
two 80 characters long strings. If you zoom or play with your font family/size
you will see that this CSS with cste em block width is far from
perfect.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan
sollicitudin... <em><a href="http://www.jdobbelstein.eu/blog/post/2010/05/01/A-new-version-for-the-Deep-Blue-DotClear-theme">Read</em> A new version for the "Deep Blue" DotClear theme</a></p>Why Debian Lenny ?urn:md5:d3e94ffd9eb70e25101ede45c89d3c842010-04-26T20:38:00+02:00Johannetworkdebianlibxml2php<p>Because it is stable ! It means less trouble between packages and
less time spent hunting incompatibilities between libraries. Here comes yet
another example of dependency hell in the world of F/OSS where our two main
protagonists will be libxml2 and PHP 5.x.</p> <p>Recently I come across a little bug when I was playing with my LAMP server (actually it's
more a LLPP system for I prefer Lighttpd and PostgreSQL). It appears PHP
5.2.x and libxml>2.7 do not play well together when parsing HTML/URI
encoded messages (where characters as '<' or '>' are replaced by
< or >). If you try to use a
$xml_parser = new... <em><a href="http://www.jdobbelstein.eu/blog/post/2010/04/26/Why-Debian-Lenny">Read</em> Why Debian Lenny ?</a></p>XML-RPC on DotClearurn:md5:75999dee537207bd484087c294b722d82010-01-15T23:52:00+01:00JohannetworkdotclearpythonvimXML-RPC<p>XML-RPC is a protocol to remotely control a web application. Here is a
short demo of XML-RPC to create, view and edit entry on the DotClear2 blog
platform from the command line, using a tiny python script.</p> <p>Your browser does not support either the video element or
embedded OGG theora video.
What can we do with dotclear.py ?
Create post entry.
List previous ones.
Modify them
... or delete them.
Locally, on your computer, using your favorite browser/text editor
to preview/edit the blog entry.
But why ???
Because I got bored and... <em><a href="http://www.jdobbelstein.eu/blog/post/2010/01/15/XML-RPC-on-DotClear">Read</em> XML-RPC on DotClear</a></p>Fedora RPM hackingurn:md5:e53ed4f22591be4c3fad9cfc49e056c32010-01-14T03:57:00+01:00JohandesktopFedoraRPM<p>Fedora is a distribution supported by Red Hat® which aims to be
user-friendly. Unfortunately if you like to hack your software or to use
exotic programs, you'll have to go through the RPM pipeline to nicely
integrate your binaries with the rest of your system. </p>
<p>Here is an example on how to modify <a href="http://www.brain-dump.org/projects/dvtm/" style="">DVTM</a> source code. We get
the RPM source package, patch the code and regenerate a binary RPM the fedora-way.</p> <p>Setting up development environment
First, you have to create a directory rpmbuild where you will work.
Simply install the rpmdevtools RPM and use :
su -c 'yum install yum-utils rpmdevtools'
rpmdev-setuptree
Getting the source
We will use yum, the fedora package manager, to download the source, extract
them, and install the require build &... <em><a href="http://www.jdobbelstein.eu/blog/post/2010/01/14/Fedora-RPM-hacking">Read</em> Fedora RPM hacking</a></p>Sondage dcWaveurn:md5:26d2e15848e6156f726321459c46346a2009-12-20T02:51:00+01:00Johannetworkdotclearfrwavewww<p>Petit test pour tester l'usage de cette chose hautement inutile.</p> <p>Bon alors la question est simple : j'ai un p'tit plug-in sous la main qui permet d'inclure plus ou moins sans soucis des Google Waves sous DotClear. Je cherche un logo pour le plug-in (et un occasion de poster sur DotClear / créer une Wave).
Petit rappel, les logos de Wave et DotClear sont les suivants :
Les propositions sont les suivantes :... <em><a href="http://www.jdobbelstein.eu/blog/post/2009/12/20/Sondage-dcWave">Read</em> Sondage dcWave</a></p>The headless caseurn:md5:bb35641d9ddaf45a8a15fb26d74d18a62009-12-19T20:38:00+01:00Johandesktopqemuslitaztoolbox<p>Imagine an old headless computer box and an `aptitude safe-upgrade` which failed. No keyboard nor screen connected to the box. No graphic card inside. The nightmare has begun...
... fortunately, Slitaz was here to help !</p> <p>I came across a small annoying problem when upgrading my Debian headless 'server' one time : dpkg failed to remount read-write enabled my /boot partition or it was out of space and consequently the update of grub/initramfs did not work, letting my old server unable to reboot by itself. (yes I know, I could have confgured /etc/apt/apt.conf to work... <em><a href="http://www.jdobbelstein.eu/blog/post/2009/12/19/The-headless-case">Read</em> The headless case</a></p>Wave plugin 0.2urn:md5:99d0e1396a0268aceb477e344a9a587d2009-12-18T01:01:00+01:00Johannetworkdotclearwavewww<p>The GoogleWave plug-in for DotClear 2.x is updated with improvements and bugfixes.</p> <p>Let's start with a pretty summary :
jDS@toto ~/dev.dcWave $ git diff --stat --summary v0.1..v0.2.0
_admin.php | 97 +++++++++++++++-----
_define.php | 6 +-
_install.php | 23 ++++--
_prepend.php | 3 +
_public.php | 8 +-
inc/class.dcwave.config.php |... <em><a href="http://www.jdobbelstein.eu/blog/post/2009/12/18/Wave-plugin-0.2">Read</em> Wave plugin 0.2</a></p>Wave plugin 0.1urn:md5:394da198976f82f223877d0ca193eeb22009-12-15T01:59:00+01:00Johannetworkdotclearwavewww<p>Dotclear is great. Dotclear is simple (until you try to read and understand the code). Dotclear is W3C compliant.
But ... there is not yet a plug-in to easily include a Google® Wave.
... so let's try to add a wave smoothly.</p> <p>Edit: move from googleWave 0.1 to dcWave 0.2.0. Old div.waves on this pages do not work any more with my new javascript wrapper. To get the latest news, please go on the next entry
No worries, I've looked everywhere on the web to find some clues on how to
do it. The first version of the Dotclear plug-in gives the following result :
Wave v0.1... <em><a href="http://www.jdobbelstein.eu/blog/post/2009/12/15/Wave-plugin-0.1">Read</em> Wave plugin 0.1</a></p>December desktopurn:md5:6c0747b3d16a30b14e77fa0f3ed582dc2009-12-08T23:58:00+01:00JohanDNow geeking ...desktop<p>A small entry to test multimedia content.</p> <p>Winter is coming !
/DS... <em><a href="http://www.jdobbelstein.eu/blog/post/2009/12/08/December-desktop">Read</em> December desktop</a></p>Welcome to Dotclear!urn:md5:99c7523c99bc9e2d497fc72142fde9302009-12-08T22:26:00+01:00JohanDnetworkdebiandotclearpostgresql<p>So, following advice from <a href="http://fr.dotclear.org/documentation/2.0/admin/install#assistant-d-installation">here</a>
I've installed dotclear2 on my beloved private server. To get start with the software, let's test the entry system with this brief text describing how I configured my Debian with php5 and PostgreSQL.</p> <p>Updating the Debian server
aptitude update && aptitude safe-upgrade
... plus some configuration checks, including php5-gd, php5-pgsql, etc.
Configuring Apache2
Simply by adding the configuration file cat /etc/apache2/conf.d/dotclear2.conf:
Alias /dotclear2 /srv/dotclear2
<Directory /srv/dotclear2/>
php_admin_flag safe_mode off
php_admin_flag... <em><a href="http://www.jdobbelstein.eu/blog/post/2009/12/08/Welcome-to-Dotclear%21">Read</em> Welcome to Dotclear!</a></p>