Wrapped in gaffa

Programming, Art, Music, Philosophy, Politics

Downloading galleries with Zenphoto

with 16 comments

Last weekend I had a Christmas Party or what you call it in english – it is basically a danish tradition where you drink a lot of schnapps, with marinated herring and anything made from pigs on rye bread. A great one also has warm food, but mine didn’t.. I think it all evolves around the schnapps and beer, the rest is just fittings.

Anyway I took a lot of pictures with my quite expensive digital camera before I got too drunk.. and decided to hide it from myself. Digital pictures is no fun unless you can share peoples embarrassing moments online, so I installed Zenphoto on my Dreamhost account. Worked like a charm, but soon people started requesting an archived download of the entire gallery. I did a little search and found out that Zenphoto already had that function printAlbumZip and I just had to add it to the Template which was as easy (even for a PHP virgin like me) as adding <?php if (function_exists(‘printAlbumZip’)) { printAlbumZip(); } ?> somewhere appropiate in the template and turned on persistent archive in Zenphoto, so that the gallery would not be archived more than once. Storage space was not a big issue, but apparently RAM was – I kept getting errors because memory ran out. I took a look at createAlbumZip and found that it was sending the file by using readfile which puts the entire ~500MB into RAM before sending it. I did a small patch to cache and send chunks of 16MB at a time in createAlbumZip, it’s not a pretty patch, but I guess simply using readfile isn’t either.

I replaced this code in zp-core/functions.php:
header('Content-Type: application/zip');
header('Content-Disposition: attachment; filename="' . urlencode($album) . '.zip"');
echo file_get_contents($dest);

With this:
$buf_size = 1024*16;
$file = fopen($dest, "r");
header('Content-Type: application/zip');
header('Content-Disposition: attachment; filename="' . urlencode($album) . '.zip"');
header('Content-Length: ' . filesize($dest));
print fread($file, $buf_size);

Link to gallery


Written by gaffa

2008-12-07 at 17:12

Posted in Programming, Software

Tagged with

Great Apes Get Human Rights – In Spain

leave a comment »

Ape Reading A Newspaper

Great Ape Reading A Newspaper

MADRID (Reuters) – Spain’s parliament voiced its support on Wednesday for the rights of great apes to life and freedom in what will apparently be the first time any national legislature has called for such rights for non-humans.

Parliament’s environmental committee approved resolutions urging Spain to comply with the Great Apes Project, devised by scientists and philosophers who say our closest genetic relatives deserve rights hitherto limited to humans.

Source: Reuters

We have seen human rights get expanded to cover more and more people before (slaves fx.), but this is the first time we see animals gain human rights. Like humans great apes will have the right to freedom and life. If you kill a great ape or take away its freedom you will go to jail.

Although I’m not vegetarian, I can see some reason in this. It is well know that great apes have a cultural and social life which indicates a level of intelligence where I can no longer decide if they are self aware creatures or not.

If you want to know more about great apes and why they should have rights similar to human rights, you should check out The Great Ape Project.

This is just an update a year later to say that, I don’t know if the resolution was ever made in to law. If anyone does, please comment or send me an e-mail. Thank you.

Written by gaffa

2008-08-02 at 23:42

Save Earth! Watch Porn!

with 6 comments

I first heard about this at Roskilde Festival 2008. One of my friends Theis, who had just returned from New Zealand working for Greenpeace, told me about these Norwegian people who started a non-profit porn site to save nature, Fuck For Forest.

Now you can have that nice feeling of helping to save earth while jerking off to porn.

Fuck For Forest

Leona and Tommy from Fuck For Forrest

Visit Fuck For Forest

Sorry guys the link was wrong. Apparently I couldn’t spell forest.

Written by gaffa

2008-08-02 at 17:27

Garfield minus Garfield

leave a comment »

Today I stumpled upon a site called Garfield Minus Garfield. Here is what it says about the Garfield comic strip without Garfield.

Who would have guessed that when you remove Garfield from the Garfield comic strips, the result is an even better comic about schizophrenia, bipolar disorder, and the empty desperation of modern life? Friends, meet Jon Arbuckle. Let’s laugh and learn with him on a journey deep into the tortured mind of an isolated young everyman as he fights a losing battle against loneliness in a quiet American suburb.

What is even cooler is a blog post on what Jim Davis thinks about this remix art.

Instead of reacting over-zealously and hitting me with a Cease & Desist order, Jim is down to earth enough to admit that there’s a laugh to be had from Garfield Minus Garfield and in fact he even thanks me for putting it together!

Garfield Minus Garfield, 2008-08-01

Garfield Minus Garfield, 2008-08-01

Written by gaffa

2008-08-02 at 15:11

Posted in Art, Copyright, Humour

Tagged with , , , , , ,

Free Downloads

leave a comment »

I have a friend who recorded a few tracks 3-4 years ago and only found out about it recently at a party, so I asked if I could distribute them and she said yes – under heavy influence of alcohol.

Here they are:
Blocking The Sun
Thoughts Of Life
Waste Of Time

Written by gaffa

2008-02-03 at 00:31

Posted in Music

Tagged with , , , , ,

Update Anjuta Auto-Complete

leave a comment »

The tags used by the auto-complete feature (Scintilla only) in Anjuta can be updated by running this script:


The script automatically scans your /usr/include folder. It is also running pkg-config to update dependencies for packages.

Maybe there is a way to do this from within Anjuta, but if if there is, it is so unintuitive that it was more obvious for me to open a terminal and write dpkg -L anjuta-common to locate a script ;)

I’m having some issues with the Devhelp extension for Anjuta on Ubuntu 7.10, I’ll post something if I find some time to debug it. I know it crashes on running gtk_moz_embed_realize, but I don’t know why yet ;)

Written by gaffa

2007-12-29 at 02:18

Man tits women’s tits, what’s the difference?

with 13 comments

Aktion for bare bryster i DGI byen

Demonstration for womens right to bathe topless. DGI Byen.

Demonstrations can be violent or peaceful… or beautiful.

Today a group of women decided to demonstrate for equal rights to bathe topless. They have my sympathy… I just can’t help it girls. It has nothing to do with women’s rights that your breasts turn me on. (So does a naked shoulder! Preferably a woman’s).

Something I am strongly against is action against taking sexual photos of women in a nurses costume. JBS, a boxershorts company, pulled their campaign after heavy pressure from the national nurses association.

Luckily I saved the wallpapers. You can get them here:


Written by gaffa

2007-12-20 at 20:43