mars 10, 2010

UTF8 with Perl CGI.pm and Ajax

It took me about three hours to figure out something this simple, so I'm posting this here!

If your doing ajax stuff with CGI.pm in perl, you'll want to exchange your data in UTF8, to do so you need only one special line of code*:

my $json = decode utf8=>$q->param('json');

This will make perl work natively in UTF8 with $json.

If you want to put this (or part of it) in a database, you don't need to do anything special because the DBD driver will convert your string from UTF8 to the database encoding (UCS-2 in my case).

*Of course, you'll also need to use Encode;.

Par gfk à 1:55 PM | Commentaires (0) | TrackBack (0)

février 11, 2010

I just ditched Mail.app for Postbox

I finally had enough of enduring Mail.app odd behavior.

I host my own IMAP server at home and I keep every email I ever received since 2002. My INBOX has ~43 000 messages in it and I have almost 200 000 messages from various mailing lists I subscribe to. In total, I have 10GB of email.

Without a doubt, Mail.app isn't able to handle that. I decided to look for something better.

Continue reading "I just ditched Mail.app for Postbox"

Par gfk à 6:48 PM | Commentaires (0) | TrackBack (0)

mai 26, 2009

Idéalisation

Le printemps dernier j'ai vu la fille de mes rêves* courir sur le tapis roulant au gym. Mais bon sens, elle courrait à une vitesse telle, je n'avais jamais vu ça. Le gars sur le tapis roulant à côté d'elle s'est arrêté pour la regarder, l'air incrédule.

Continue reading "Idéalisation"

Par gfk à 9:06 PM | Commentaires (0) | TrackBack (0)

novembre 8, 2008

I had a dream...

J'ai fais un rêve... Je suis sur mon patio à faire de l'ordinateur quand je vois la plus belle serveuse du StarBar qui est en train de cueillir des champignons sur mon terrain. Je la regarde en me disant que je la vois bien souvent s'adonner à cette activité. Elle m'aperçoit la regardant et se tourne vers moi. Gêné, je plonge le nez dans mon écran.

Continue reading "I had a dream..."

Par gfk à 9:23 AM | Commentaires (0) | TrackBack (1)

juillet 24, 2008

Firefox History URL Auto-Completion

Damn, this URL Auto-Completion based on visit history in FireFox makes me look like some sick pervert...

Par gfk à 11:08 AM | Commentaires (0) | TrackBack (0)

mai 15, 2008

I love EC2 and RightScale!

Monday morning, one of our web sites got infected by a javascript virus that spreads through SQL Injection. I don't work on mondays (good life) so I wasn't there to see the chaos but I eared that it was quite bad: customers complaining that our web site infected them for example.

The people working that day took the server offline, restored the infected DB from a clean backup and all was good (temporarily).

I got a couple phone calls, we talked about installing a reverse proxy to catch these kinds of attacks. It would take a few days to set this up.

They looked for the piece of code where the injection occurred, but missed one (or many) because the day after the server got infected again.

Continue reading "I love EC2 and RightScale!"

Par gfk à 3:09 PM | Commentaires (0) | TrackBack (0)

avril 6, 2008

Plainte contre l'émission Découverte du 6 avril 2008

Madame l'ombudsman de Radio-Canada,

Je voudrais porter plainte contre le reportage sur les "effets indésirables des micro-ondes qui nous envahissent" diffusé à l'émission Découverte du 6 avril 2008. J'ai trouvé cette émission alarmiste et biaisée sur plusieurs points, en voici quelques uns:

Continue reading "Plainte contre l'émission Découverte du 6 avril 2008"

Par gfk à 8:11 PM | Commentaires (0) | TrackBack (0)

mars 25, 2008

Bernstein's comment about third-party DNS and the reality with qmail

In a document written a couple years ago, Dan Bernstein describes the costs and benefits of third-party DNS services.

In his document, he states that:

``Third-party DNS means the difference between email being requeued and email bouncing.'' No, it doesn't. Mail transfer agents defer delivery attempts when DNS servers are unreachable, just as they defer delivery attempts when SMTP servers are unreachable.

This is simply not true.

Continue reading "Bernstein's comment about third-party DNS and the reality with qmail"

Par gfk à 11:21 AM | Commentaires (0) | TrackBack (0)

mars 11, 2008

Latency?

Oh my God, I'm installing Debian inside a Virtual PC using VNC inside Windows Remote Desktop from my PowerBook G4. Geez, I wonder why it's so slow...

Par gfk à 9:32 PM | Commentaires (0) | TrackBack (0)

février 5, 2008

Yes we can

Lyrics

It was a creed written into the founding documents
that declared the destiny of a nation.
Yes we can.

It was whispered by slaves and abolitionists
as they blazed a trail toward freedom.
Yes we can.

Continue reading "Yes we can"

Par gfk à 8:31 PM | Commentaires (0) | TrackBack (0)

janvier 23, 2008

msdb is huge!

On our SQL Server 2005 DB, I found out that the msdb.dbo.sysmaintplan_logdetail table was more than 6 GB, so I ran the following SQL code to reduce it to 60 MB. It took about 10 minutes to run the query, so don't panic.

Continue reading "msdb is huge!"

Par gfk à 10:29 AM | Commentaires (0) | TrackBack (0)

octobre 9, 2007

Mon premier Haïku

Voici mon premier Haïku (court poème japonais):

terasse au soleil
les jolies filles du StarBar
délice pour les yeux

Il respecte les règles de base d'un Haïku:

  1. Trois vers de 5-7-5 syllables
  2. Le premier vers contient une référence à la saison
  3. Il décrit un court instant
  4. Et en bonus, il parle des filles du StarBar! (Contrairement à ce que plusieurs croient, ce n'est pas une règle du Haïku traditionnel.)

Par gfk à 9:31 PM | Commentaires (0) | TrackBack (0)

août 26, 2007

MythDora: MythTV that works!

I tried once more to install MythTV on an old PC (P4 1.6 GHz, 512 MB RAM) that has been gattering dust at home for months. I tried using KnoppMyth in the past with ressounding failure. This time, I decided to try mythDora.

Continue reading "MythDora: MythTV that works!"

Par gfk à 4:50 PM | Commentaires (0) | TrackBack (0)

juillet 9, 2007

Raccourcis pour sa demande de passeport

Je viens de faire ma demande de passeport et en parlant avec le personnel j'ai appris quelques trucs pour accélérer sa demande de passeport.

Continue reading "Raccourcis pour sa demande de passeport"

Par gfk à 6:26 PM | Commentaires (0) | TrackBack (0)

juin 19, 2007

Hard drive woes

Yesterday at around 16:30 the secondary hard drive on my decade old linux router passed away. Most of the software continued working, only the DNS server stopped working. Not knowing what was going on, I restarted it, and it's not starting anymore... :-( I don't believe in esotericism, but I guess I had a premonition last week-end when I bought a Soekris net4501 that I should be receiving in a day or two. So for those who are emailing me, it might take me a bit more time to answer, since my mail server was behind that router. You can reach me at gfilion@gmail.com in the meantime. Update 20070619 19:57: I managed to use a Linksys wireless router running DD-WRT as the new router. It's not as good as my old one, but it will do until I can set up the Soekris board. Update 20070622: The Soekris board is now set up with m0n0wall with openvpn support. It's a bit more rigid than I had hoped for, but at least it's really easy to set up.

Par gfk à 10:25 AM | Commentaires (0)

Tous les articles