Wrapped in gaffa

Programming, Art, Music, Philosophy, Politics

Local DNS to work around censorship

leave a comment »

I live in Denmark and unfortunately that’s a country where courts don’t know the laws they judge by. Which means IFPI got through with a nationwide block of the site thepiratebay.org. The Pirate Bay is basically just a huge public torrent tracker, which means many Open Source projects are using it to distribute files (fx. the game Urban Terror) and even the Danish national television were distributing some files through it. I personally used it to distribute the Creative-Commons BBC documentary The Codebreakers for IOSN (a UN Development Programme).

At first I used /etc/hosts and manually entered the IPs, because I didn’t want to use an external DNS service. I don’t trust any outsiders with all my DNS lookups, I want all lookups except the blocked domains to go to my ISP. Unfortunately a static hosts file is just not the same as doing a DNS lookup for this kind of site. Fx. tracker.thepiratebay.org does not point to one single IP, but 8 different IPs. CNAME records like vip.tracker.thepiratebay.org points to tracker.thepiratebay.org. Another problem is when TPB decides to start a new site like trial.thepiratebay.org, then I have to manually add that domain to /etc/hosts after looking it up at TPBs own nameservers.

Today I decided to try a different approach than the static hosts file. I wanted to set up at DNS proxy. I went with pdnsd, which was very easy to set up. All I had to do was to install the packages pdnsd and resolvconf (on Ubuntu 8.04) and add the two entries below to the pdnsd.conf file. The router entry redirects any lookup not pointing at thepiratebay.org and its subdomains to my router. If you’re not using a router you could enter the IPs of your ISPs DNS servers instead of the IP of your router. The tpb entry is simply an entry that looks up any request for thepiratebay.org and its subdomains and nothing else. The servers used are TPBs own name servers.

server {
    label = "router";
    ip = 192.168.1.1;
    exclude = ".thepiratebay.org";
    policy = included;
}
 
server {
    label = "tpb";
    ip = 83.140.176.159
    ,    194.71.107.1
    ,    85.17.40.33
    ,    217.75.120.120
    ;
    include = ".thepiratebay.org";
    policy = excluded;
}

Written by gaffa

2009-02-15 at 19:41

Downloading galleries with Zenphoto

leave a comment »

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));
flush();
 
while(!feof($file))
{
print fread($file, $buf_size);
flush();
}
fclose($file);

Link to gallery

Written by gaffa

2008-12-07 at 17:12

Posted in Programming, Software

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.

Written by gaffa

2008-08-02 at 23:42

Save Earth! Watch Porn!

with one comment

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

Update:
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 , , , ,

See you soon!

leave a comment »

Samuel and Martin at The Beach, Slagelse.

Samuel and Martin at The Beach, Slagelse.

A good friend of mine are going away for a while (to the slammer). Locked up for four months for a ridiculously small crime. No reason to talk about what he did while he had a drunken blackout, he didn’t hurt other people, but that’s it – four months.

I think it’s one month before he can go on leave in weekends (with probable cause). Drinking with me should be reason enough, don’t you think? Probation after three months, I think.

Written by gaffa

2008-07-31 at 22:16

Posted in Personal

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:

/usr/share/anjuta/scripts/create_global_tags.sh

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 3 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:

http://linuxklubben.dk/gaffa/jbs/

Written by gaffa

2007-12-20 at 20:43

Statistics for what they are

leave a comment »

Statistics is a mathematical tool for measuring probability in clean room experiments. We see a lot of statistic surveys in the news all the time, which most often influences the politics of our country. That is fine if they were taken for what they are. These statistical surveys are rarely done in clean room environments, but are being treated as if they were. Take for example something which is very controversial to opponent against – statistics of smoke induced diseases.

Monitoring smokers and determining the probability of that group getting cancer is not done in a clean room environment. If it was to be done in a clean room environment we would need 200 human clones, eating the exact same, breathing the exact same air and so on where 100 of those would be smokers and 100 of them non-smokers. We need the only difference to be the subject we are doing statistics on. If not then I could claim that smokers tend to live their lives less healthy than non-smokers and blame the general lifestyle of smokers or that smokers had an actual gene that would make them both smoke, and die younger. I would not be able to blame the chemical substances of tobacco. What the survey would tell you is that if you are the group of people who smoke you will have a higher probability of getting cancer, but it would not be able to say if tobacco was to blame.

Don’t believe statistics. Understand them.

I’m a smoker and I’m not blind to the risks of an unhealthy lifestyle. I accept them as a side effect of enjoying my life.

Written by gaffa

2007-11-24 at 14:35

Posted in Politics

Tagged with , ,