Building simplicidade.org: notes, projects, and occasional rants

Notes

last update:

Lighttpd, file uploads and Safari

On one of the web applications I have, the setup is more or less like this: a lighttpd 1.4.x front-end to serve static files, both public and protected (using mod_secdownload);a fat Apache2 with mod_perl2 running a Catalyst application.In this case, lighttpd is used as a reverse HTTP proxy to Apache, using mod_proxy. I was trying to get file uploads to work on this setup. Uploading directly to Apache works flawlessly, but via mod_proxy, Safari would hang at the end, never terminating the request.

Module of the day: File::Inplace

The task was simple enough: edit a already existing file, to change something, keeping the name intact, and if possible doing a backup of the original version. We could start dealing with all sorts of errors in open, rename and friends, dealing with temporary files and all that stuff. Or we could just jump to CPAN: cpan File::Inplace perldoc File::Inplace In my case, I wanted to remove a line from a file.

Unrelated fun

Two written pieces of pure fun: Linus and Gnome;Gruber and Mocrovision.

Best $30 you'll ever spend :)

Gruber rocks: My guess is that a very simple explanation suffices, which is that Thurrott is starting with a significant but utterly broken assumption: That Microsoft matters in this debate. Excellent article, as always.

Earthquake

I'm not in Lisbon, so I didn't feel the Earth move. At least not at that time of the day. The question I have for those in Lisbon is very simple: did you knew where you towel was? Just in case?

A pergunta

Usually you'll only find articles written in english here, but next weekend there will be a referendum about abortion here in Portugal, so this post will be in portuguese. Por várias razões vou votar sim. Nunca pensei muito nisso, mas nenhum dos argumentos pelo não me parece ter peso suficiente para justificar a actual situação legal relativamente ao aborto. Infelizmente não herdei da minha mãe o dom da palavra, pelo que em vez de fazer figura triste a tentar escrever algo decente, deixo-vos um pdf com o texto que ela escreveu para uma intervenção ontem.

Shove it!

Here is how Jobs says shove it! to the Nordic, French and German consumer groups that where complaining about Fairplay. No comment from me, just providing the link. I'll watch this one from the sidelines. I couldn't care less about DRM. It's broken, it will always be and it does not prevent me from doing anything that I want to do. BTW, at last count, I have 1311 tracks purchased from iTMS and I never ever bough a CD again since iTMS Portugal open up.

In Perl, sometimes you have a coderef, normally a callback, and you need to know where is that code located in your source. This will do the trick: sub _dude_wheres_my_coderef { use Devel::Peek; $code = \&$code; # guarantee a hard reference my $gv = Devel::Peek::CvGV ($code) or return; return *$gv{PACKAGE} . '::' . *$gv{NAME}; } Taken from dump_vars.pl. BTW, $name also includes filename and line number.

Defense of Marriage Initiative

If this gets approved, Washington state will be know as the Rabbit State, because all of them will try to stay married... It's an absurd measure of course, and the proponents only want to promote discussing of same-sex marriage, but I find it disturbing nonetheless. update: a bit of history behind all this. (via Pedro Timoteo), and I still find the idea disturbing. I don't know why really...

XMPP servers

ejabberd just reached 1.1.3, and you can download new fresh installers from the download page. Of particular interest to me is the new Mac OS X Intel installer that allows me to have a ejabberd running on my Macbook. With this, that makes three different XMPP servers now, that I run on a regular basis: ejabberd, Wildfire, and DJabberd. Each one has good and bad points. Lets see a couple of them.