Suhosin and maximum $_POST variables limit

I had a problem of more than 200 $_POST variables in one of my php scripts. Something was limiting the script not to process more than 200 in the $_POST array.

After unsuccessfully trying to find some info about how to change it in php.ini or apache.conf I found a solution using Suhosin:

You simply add the following to your php.ini file after loading the suhosin module:

[suhosin] = 2000
suhosin.request.max_vars = 2000

That’s easy now :)

Update: remember to restart Apache after making these changes.

Posted in Web | Tagged , , , , , | 2 Comments

Suhosin – customize php security

I was trying to configure my virtualhosts to have different php options regarding shell access. After some research I came up with Suhosin solution, which solved problems with setting disable_functions per virtualhost. Look it up!

Posted in Web | Leave a comment

Formulate and stamp indelibly on your mind a mental picture of yourself as succeeding. Hold this picture tenaciously. Never permit it to fade. Your mind will seek to develop the picture.”

Norman Vincent Peale, Author

Posted in General | Leave a comment

Skiing 2008

I just uploaded some fresh pictures from skiing in Hochsoelden, Tirol, Austria. Also you will find some pictures from Schwangau, Hohenschwangau and Neuschwanstein. Yes I was writing these names from memory ;)

Have a look, they are great.

Posted in General | Leave a comment

Getting the Spanish N.I.E. – social security number for foreigners

Just recently I obtained the Numero de Identidad de Extranjero, which allows me in Spain to get a job, buy a car/house etc. Very important number if you want to live in Spain for a longer time. The number you get is valid forever, you just have to renew the certificate (every 5 years).

For European Union citizens there are 2 steps involved in obtaining it. The first one is to get an appointment. You can try calling the COMISARIA GENERAL DE EXTRANJERIA to get the appointment but in my case it was easier to go to the office at 4am and wait for the registration at 9am. The good thing was that I went there with 3 friends, so we were not that bored as you can see on the pictures. Remember to bring your passport for that meeting. The officer will schedule you for an appointment that will take place after about 8 days. You will get forms needed to be filled out and a form to pay 6.70EUR for the issuance of the number.

Fill out the forms, pay the “tasa” at any bank, bring your passport, 1 photocopy of your passport and to be on the safe side, bring 3 recent photographs of yourself (I didn’t need to give them in but…). You should obtain you N.I.E. number on the same day.

Posted in School | Leave a comment

ATI Radeon XD 2400 XT

UPDATE thanks to Hendrik: Acer has released a new driver pack, which should work for XP.

I got a laptop Acer Travelmate 6592 with ATI Radeon HD 2400 XT. After a few whiles of using Vista I decided to go back to XP and there was a problem with supplied drivers from Acer. There was none that could be used with my XP version…

Therefore after looking for a while and trying different solutions I came up with a one of my own.

Just follow these steps if you have problems:
1. Download and install Driver Pack.
2. It will say it doesn’t recognize the driver, but it will leave its drivers on your hard drive.
3. Go to your device manager.
4. Click on the graphics card not beeing recognised
5. Choose reinstall driver.
6. Click “Install from specific…”.
7. Click “I will choose…”.
8. Choose “Display adapters”.
9. Click “Have a disk”.
10. Point it to the dir where you installed the above file – ending has to be something like “7-9_xp32_dd_ccc_wdm_enu_52443\Driver\Driver\XP_INF” and click OK.
11. Search for your video card driver. Trust me it is there.
12. Click yes to continue and ENJOY!

If you have questions, please post in comments.

Posted in Win | 9 Comments

A php function to return random values

I was looking for a method in php that would return unequal numbers using the rand() function. I found an answer on and all credit goes to alishahnovin at hotmail dot com. The method is as follows:

function randiff($min, $max, $num) {
    if ($min<$max && $max-$min+1 >= $num && $num>0) {
        $random_nums = array();
        while($i<$num) {
            $rand_num = rand($min, $max);
            if (!in_array($rand_num, $random_nums)) {
                $random_nums[] = $rand_num;
        return $random_nums;
    } else {
        return false;


$nums = randiff(0,10,2);
$var1 = $nums[0];
$var2 = $nums[1];
Posted in Web | Tagged , , | 1 Comment


I have just watched a movie called Stardust and I am greatly impressed by it. An unknown actor to me – Charlie Cox shows some great acting skills and makes a firm leading role. Movie was entertaining, full of wit, romantic and simply pleasant to watch. The storyline seemed very unique to me, although I am not a fan of fantasy like movies. Oh, and very important thing – you get seamlessly guided by a narrative voice throughout the movie, so you never get lost :))  Last but not least, Claire Danes is playing the actual star, and always great Robert De Niro is a ship’s captain. Fabulous!

It was definitely worth spending those €6 ;) I might actually watch it again

I highly recommend it!

Posted in Movies | Leave a comment

localhost.customs or localhost:1001

Well, just recently I discovered an error in my Apache2 log file saying: – - [17/Sep/2007:20:10:32 +0200] “GET /” 400 466

Well, that is a SSL log, so I am working to figure out what it really is…

Ok, “tshark -i lo -S -V > dump.shark” command comes in handy to see the packets, and here is what we get:

Internet Protocol, Src: (, Dst: (
Version: 4
Source: (
Destination: (
Transmission Control Protocol, Src Port: 53612 (53612), Dst Port: customs (1001), Seq: 1, Ack: 1, Len: 155
Source port: 53612 (53612)
Destination port: customs (1001)
Sequence number: 1 (relative sequence number)
[Next sequence number: 156 (relative sequence number)]
Acknowledgement number: 1 (relative ack number)
Header length: 32 bytes
Flags: 0×18 (PSH, ACK)
0… …. = Congestion Window Reduced (CWR): Not set
.0.. …. = ECN-Echo: Not set
..0. …. = Urgent: Not set
…1 …. = Acknowledgment: Set
…. 1… = Push: Set
…. .0.. = Reset: Not set
…. ..0. = Syn: Not set
…. …0 = Fin: Not set
Window size: 32800 (scaled)
Checksum: 0xfec3 [incorrect, should be 0x14e9 (maybe caused by checksum offloading?)]
Options: (12 bytes)
Timestamps: TSval 289375346, TSecr 289375346
Data (155 bytes)0000 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 30 0d 0a GET / HTTP/1.0..
0070 28 69 6e 74 (int
0080 65 72 6e 61 6c 20 64 75 6d 6d 79 20 63 6f 6e 6e ernal dummy conn
0090 65 63 74 69 6f 6e 29 0d 0a 0d 0a ection)….

Looks like a known error of dummy connections, but a bit different one, since Apache2 didn’t speak SSL to its SSL server, so no proper “GET” request has been logged – just info about the 400 error.

The way I fixed it was to to increase the number of “MaxSpareServers” to “10″ in my Apache2 configuration file. I don’t need more…

Posted in Linux | Leave a comment

Using wget to download all *.rar over ftp

Today I read a news about releasing a Polish version of Wikipedia on a DVD and providing a download possibility as well. Having a 8Mb line I decided to get it.
Handy came a wget command:

wget -c "*.rar"

DVD version of Wikipedia is definitely a good thing for “laptopers”.

Posted in General | Leave a comment