white noise | tag/perl /blog//tag/perl.html white noise archmbox 4.10.0 /blog//post/archmbox_4.10.0.html /blog//post/archmbox_4.10.0.html devel perl Thu, 06 Nov 2008 22:07:18 +0100 devel Archmbox 4.10.0 was released.

Archmbox a is perl based email archiver which can perform different and specific actions on one or more mailboxes.

It's been more than three years from the last release of archmbox, and now here we are again. I'd like to than all contributors for their enthusiasm that pushed me to start working again on this piece of software.

This release is not a milestone, and won't probably change the way you archive emails; by the way, there are some nice features that worth a try; option to customize the archive mailbox name was added and support for logical and in regular expressions based archiving was added as well.

The usual code cleanups and revisions were performed as always.

Archmbox home page can be reached at the following url:

http://adc-archmbox.sourceforge.net/

]]>
archmbox is back /blog//post/archmbox_is_back.html /blog//post/archmbox_is_back.html devel perl Sun, 05 Oct 2008 17:15:18 +0200 devel Its been three years of silence. The TODO and CLEAN list had some elements in, but since things were smooth and I didn't received a single report about bugs, the development of archmbox kept on being delayed.

A couple of weeks ago I suddenly received a lot of good code contributions from Juergen Descher, a nice guy I've never heard about before, who awakened me from my sleep and put me back to development. So archmbox 4.5.0 is on it's way; I have little spare time to devote to it, but hopefully the wait for the new release won't be long.

I'm pretty amazed that this small little tool I developed back in 2002 is still used and captures interest. It's nice :D

]]>
tt2 and markdown /blog//post/tt2_and_markdown.html /blog//post/tt2_and_markdown.html devel perl tools web Fri, 21 Mar 2008 22:44:17 +0100 web I definitely love Markdown; it just makes web pages editing painless, quick and funny. I was aware of a markdown plugin for Template Toolkit, so i decided to dig a little deeper.

All I needed was the Template::Plugin::Markdown perl module. After installing it I was able to use markdown syntax in my TT driven web pages:

[% USE Makdown %]
[% FILTER markdown %]
.
.
. (markdown formatted page content)
.
.
[% END %]
]]>
back to tt2 /blog//post/back_to_tt2.html /blog//post/back_to_tt2.html devel perl tools web Sun, 16 Mar 2008 22:38:48 +0100 web I am pretty excited. Soon I will be back on web design and development, so I took the occasion to tidy a bit some stuff about Template Toolkit.

From the TT2 website:

The Template Toolkit is a fast, flexible and highly extensible template processing
system. It is free (in both senses: beer and speech) open source software and runs
on virtually every modern operating system known to man. It is written in the Perl
programming language with certain key elements coded in C for maximum speed.
However you don't need to know any Perl (or C) to be able to use it.

It is ideally suited, but not limited to, the creation of static and dynamic web
content and incorporates various modules and tools to simplify this process. It is
mature, robust, reliable and well documented.

I haven't use it for quite a bit, so It will be very funny to explore all the features added since then.

]]>
the lazier I get /blog//post/the_lazier_I_get.html /blog//post/the_lazier_I_get.html devel geek perl Fri, 01 Feb 2008 17:22:36 +0100 geek I use ikiwiki to maintain this blog; I use it in non-cgi mode, which means that I edit the posts with vim off line, then I upload them to my web site. After more than two years of posting, I got a little bored of adding the tag statement at the top of each post and the html code to display the nice icon you see on the right.

Having some unexpected spare time, I decided to write a little helper to save me some key strokes. I don't know if it can be useful for anyone but me, by the way, you can download it here.

]]>
another little app for a gtd system /blog//post/another_little_app_for_a_gtd_system.html /blog//post/another_little_app_for_a_gtd_system.html devel gtd perl unix Sun, 18 Nov 2007 14:00:51 +0100 Gtd

Feeling really comfortable with my outline based gtd system, I decided to go one step further. I have a bunch of cards, one for each project I'm working on, so I looked for a nice way to managed them. Some kind of interface that helps me browse, filter and edit the cards.

I haven't found anything suitable on the net, so I decided to go my way and code a little helper from scratch. The result is a cards browser with some filtering capabilities; it is project oriented rather than action oriented, simply because that's how I feel comfortable in managing my tasks.

Information, a screenshot and download links can be found on my personal web site.

]]>
curses e perl /blog//post/curses_e_perl.html /blog//post/curses_e_perl.html devel geek perl Tue, 07 Nov 2006 23:11:28 +0100 Dopo aver lavorato, con una certa soddisfazione, con il binding per perl di GTK2, ho provato ad avventurarmi nella selva delle interfacce terminale. Sono incappato nel modulo Curses::UI, che fornisce una semplice interfaccia ad oggetti per creare un certo numero di widget di uso comune. La libreria è ben documentata, ed il codice di esempio fornito molto utile per realizzare in breve tempo qualcosa di funzionante.

Purtroppo la gestione keyboard driven è leggermente meno intuitiva di quella basata su mouse, per cui ho riscontrato tutta una serie di comportamenti buffi a cui non ero preparato (specie nella gestione del focus dei vari oggetti).

Altra cosa che mi ha spiazzato non poco sono state le difficoltà in fase di debugging. Per come viene gestito l'output, il debugger perl è praticamente inservibile. Per fortuna è possibile ridirigere lo standard error su un file e, attivando l'opzione di debug della libreria, si riesce a creare un file di trace tutto sommato utile.

Al di la di questi piccoli inconvenienti, sicuramente superabili con una lettura più approfondita della documentazione ed una maggior pratica nell'utilizzo, Curses::UI mi sembra un buono strumento per realizzare qualcosa che consenta un minimo di interazione con l'utente. Magari non adattissimo per cose particolarmente complesse, ma comodo da avere a portata di mano.

]]>
maneggiare vcard /blog//post/maneggiare_vcard.html /blog//post/maneggiare_vcard.html devel geek perl Thu, 21 Sep 2006 21:18:30 +0200 vCard è un formato di scambio di dati personali abbastanza diffuso e supportato da una certa varietà di dispositivi. Risulta quindi molto comodo per gestire il proprio archivio di contatti e mantenerlo sincronizzato, ad esempio, con il proprio telefono cellulare.

Se siete interessati a dare un'occhiata approfondita al formato utilizzato dalle vCard potete fare riferimento alla RFC2426, che ne descrive in modo esaustivo tutti gli aspetti.

Ho passato un paio di giorni fa un'oretta a giocare un po' con alcune delle vCard che, nel tempo, mi sono state inviate per posta elettronica da amici e corrispondenti vari. In particolare, ero interessate a costruire un qualcosa che mi permettesse di visualizzare una card in modo più agevole rispetto al formato nativo (testuale e comunque leggibile).

Avendo voglia di scrivere un po' di codice perl, ho utilizzato il modulo Text::vCard - facilmente reperibile su CPAN. La libreria in questione è ben fatta e, per quanto non ancora completa, molto semplice da usare. Non è ancora possibile gestire le informazioni di tipo binario (foto, sample sonori etc.), e l'export nel formato vCard non gestisce (ancora) correttamente l'escape dei caratteri, ma se il vostro obiettivo è la sola visualizzazione, questo modulo semplifica di molto il lavoro.

Se avete voglia di vedere un po' di codice reale, scaricate vcfreader.pl e giocateci liberamente. Penso che possa essere un buon punto di partenza.

]]>
conversioni in utf-8 /blog//post/conversioni_in_utf-8.html /blog//post/conversioni_in_utf-8.html geek perl tools web Sun, 20 Aug 2006 13:36:20 +0200 L'altro giorno mi sono trovato nella situazione di inserire del vecchio materiale che avevo scritto nel mio sito web. Nel far il rendering delle pagine, ikiwiki mi ha segnalato numerosi errori relativi alla codifica utf-8. Al termine del processo le pagine generate erano orrendamente prive di contenuto.

Indagando un po', mi sono reso conto che il problema era originato dalla presenza dei lettere accentate italiane; andavano rimosse e sostituite con le relative codifiche html.

Ho buttato giù due righe in perl per automatizzare il lavoro:

#!/usr/bin/perl
#
# Replace italian accents with html alternates

open STDIN, '-';

while (<STDIN>) {
        s/&agrave;/\&agrave\;/g;
        s/&egrave;/\&egrave\;/g;
        s/&igrave;/\&igrave\;/g;
        s/&ograve;/\&ograve\;/g;
        s/&ugrave;/\&ugrave\;/g;
        print;
}

Notate che non sono presenti accenti acuti... so di essere un barbaro ma per semplicità non li uso.

Con il seguente comando:

for i in *.mdwn; do cat $i | htmlize.pl > $1; done

sono riuscito a sistemare il contenuto dei file in meno di un minuto (htmlize.pl è il nome che ho dato allo script di cui sopra).

Per chi invece avesse necessità di fare conversioni da diverse codifiche in utf-8 - ma non solo - suggerisco l'utility tcs. Semplice quanto comoda... (attenzione che non supporta la codifica iso-8859-15; ovvero niente simbolo dell'euro).

]]>
grafi con perl /blog//post/grafi_con_perl.html /blog//post/grafi_con_perl.html devel perl tools Sat, 05 Aug 2006 15:57:43 +0200 Ho dedicato un po' di tempo a giocare con graphviz, oggetto alquanto simpatico per la realizzazione di grafi di vario genere. Ho anche scoperto che esiste un modulo perl che permette di utilizzare graphviz direttamente da script, in modo assolutamente facile.

graphdir.pl è una minuscola demo che ho realizzato per provare le funzionalità di suddetto modulo; genera un grafo a partire da una directory specificata come parametro.

Ecco il risultato:

graph

]]>