Archive for October, 2005

Introducing Google AdSense

Monday, October 31st, 2005

But, oh why?

Why do you blog?

I could not put it in better words. Hugh just put those words out of my mouth. We’ll see how it goes.

The funny thing is that I cannot see my own ads, because I’m using Firefox with the AdBlock extension. I have to run Internet Explorer just to see if they are there at all. Chances are some of you, just as me, will not see them at all. I can live with that, I guess.

There’s also some weird flicking problem with Firefox. I suppose it will have to be dealt with sooner or later…

Review: Der Tunnel (2001)

Tuesday, October 25th, 2005

Visit IMDb for more details about Der Tunnel

Some movies are made purely for entertainment purposes. Others are made for us to learn something or to remind us about the past times. Der Tunnel definitely belongs to the latter category. Directed by Roland Suso Richter this German film tells the story about a struggle against the communist government in East Germany.

Although I did live and vaguely remember communist times in Poland, I have certainly not experienced them in the way this movie’s characters did. I was eleven when Solidarity freed Poland from the communist oppression. The only thing that I can remember clearly were the endless queues at the shopping malls. Nowadays they may seem funny, but back at the day they were not quite so. Not to mention, that this was one of the lightest indication of the communism. Der Tunnel shows us much darker side of those times. One thing, which is not that surprising, is the fact that Communist Germany was not much different from Communist Poland.

Most of the action takes place in East Germany, during the early sixties. It was 1961 when The Berlin Wall construction started. As you might have already guessed, the title of the movie is the actual tunnel which was built underneath it. The movie tells a story of East Berliners trying to escape to the West.

At moments Der Tunnel is very touching, other times melodramatic, but almost all the time it is very tense, which is quite surprising for a 167 minutes long feature. There were moments when my adrenaline level jumped like crazy. At other times I cried like a little baby…

I have no words to describe the feelings that shattered my heart while watching Der Tunnel. I can recommend it heartily. The thing that makes watching it even more worthwhile is that it is based on facts. This story (together with many other similar ones) has really happened in Berlin.

Der Tunnel/The Tunnel (2001)

Rating: 1 star gives one point1 star gives one point1 star gives one point1 star gives one point1 star gives one point1 star gives one point1 star gives one point1 star gives one point1 star gives one point1 star gives one point 10/10

Review: Nordkraft (2005)

Tuesday, October 11th, 2005

Visit IMDb for more details about Nordkraft

You could definitely call it the Danish version of Traffic. Only with less cops and more drugs and their affect on people. Mostly bad, as you might have guessed. It presents a rough and very real look into the Danish drug underworld.

Three interconnected stories, that begin as completely separate, while ending mixed up. Maria, small-time pusher delivering drugs, Allan, returning to his hometown after an accident on his boat and Steso, a bright young man, who says that drugs open his mind.

While being mostly dramatic and tragic, it has its funny moments too. One of the most memorable quotes goes like this:

- Did you screw me while I slept?
- Yes.
- You can’t do that!
- I didn’t wake you up, did I?
- You’re sick!
- You always say we don’t fuck enough. And when we fuck, you sleep!
- I hate you. (…) Was it good?
- Better than ever.

It reminded me of Requiem for a Dream. When you think about it, those movies have very much in common. While you may easily accuse it of being Requiem’s rip-off, you may also say that Requiem was a Trainspotting rip-off. Actually it was, but that’s a different story. The point is, that while all of those movies center around drugs, presenting similar problems, the stories themselves are quite different.

All in all, very disturbing movie. Highly recommended.

Nordkraft/Angels in Fast Motion (2005)

Rating: 1 star gives one point1 star gives one point1 star gives one point1 star gives one point1 star gives one point1 star gives one point1 star gives one point1 star gives one point1 star gives one point1 star gives one point 10/10

Custom HTTPS POST queries in Ruby

Wednesday, October 5th, 2005

Complementing both the manual for the Net::HTTP class and Rail’s guide to rendering proxied pages (from the Rails wiki) here is a short script, which makes use of a custom made HTTPS POST query (btw. HTTP POST is basically the same, you just have to remove the ssl declaration and change the destination port).

First, the script makes a GET query to the target host (in the example, it is the login page for Wirtualna Polska webmail). In the next step it reads which cookies the website wants to set. After that, we can make our POST query. We send both filled in POST parameters (and hidden inputs too) and all of the cookies, which would normally be set in the browser. After that the script just prints out response headers and data (if there’s any).

The solution is simple, short and clean, although it took me few hours to find out that POST parameters must be a &-separated string and that the headers is a hash array. After that, it was a piece of cake.

Anyway, here’s the script:

#!/usr/bin/ruby

require 'net/http'
require 'net/https'

http = Net::HTTP.new('profil.wp.pl', 443)
http.use_ssl = true
path = '/login.html'

# GET request -> so the host can set his cookies
resp, data = http.get(path, nil)
cookie = resp.response['set-cookie']

# POST request -> logging in
data = ’serwis=wp.pl&url=profil.html&tryLogin=1&countTest=1&logowaniessl=1&login_username=blah&login_password=blah’
headers = {
  ‘Cookie’ => cookie,
  ‘Referer’ => ‘http://profil.wp.pl/login.html’,
  ‘Content-Type’ => ‘application/x-www-form-urlencoded’
}

resp, data = http.post(path, data, headers)

# Output on the screen -> we should get either a 302 redirect (after a successful login) or an error page
puts ‘Code = ‘ + resp.code
puts ‘Message = ‘ + resp.message
resp.each {|key, val| puts key + ‘ = ‘ + val}
puts data