Categories
PHP

A lesson in PHP stupidity

1:  post_max_size >= 2GB makes PHP overflow, resulting in a negative post_max_size:
“POST Content-Length of 0 bytes exceeds the limit of -2147483648 bytes”

2: defining post_max_size (etc) with MB instead of M causes PHP to only read the last character, in other words 10MB becomes 10 bytes . How hard can it be to either use the first character or even better, both?

(note 1: this can be avoided by actually reading the manual, but this should have been handled better from PHP`s side IMO)

(Note 2: This experience come from the latest stable PHP version in SLES 10SP2, hopefully this has been fixed in later releases.)

Categories
Software

Want Spotify invites?

I have started getting a big bunch of Spotify invites, and i have decicded to give them all out!

So if you want an invite, you can get one here: http://h3x.no/spotify.php

(New invites will be added when needed, still got a small bunch left)

Btw: Got any problems, then please comment about it in this entry 🙂

Categories
Twitter

List of people twittering from/about Haiti and other useful links

Blog post last updated19:57 GMT, 15.jan 2010

Twitter accounts updated within the last hour:
troylivesay – Troy Livesay, is in Port Au Prince, Haiti
Wyclef – Wyclef Jean
InternetHaiti – Multilink Haiti, Twitters from Haiti
marvinady – Marvin Rady Twittering about Haiti
redcrossmom – Appears to be twittering from Haiti
LisandroSuero – Lisandro Suero, publishes pictures from Haiti
andersoncooper – Anderson Cooper, CNN Reporter in Haiti
Leecohen – Lee Cohen Twitters from Haiti
Alyssa_Milano – Alyssa Milano, twitters about Haiti

Twitter accounts updated within the last two hours:

n/a

Twitter accounts updated within the last 12 hours:

fredodupoux – Frederic Dupoux, active from Haiti
RAMhaiti – Richard Morse, CNN Reporter in Haiti

Twitter accounts updated > 12 hours:

IvanCNN – Ivan Watson, CNN Reporter in Haiti
DanielleCNN – Danielle Dellorto, CNN Reporter in Haiti
jason_carroll – Jason Carroll, CNN Reporter in Haiti

You can also get live updates regarind Haiti on Twitter.

Want to donate to help Haiti? Then visit Redcross.org!

Have any Twitterers that miss in the list? Please post a comment with a link here.

Categories
Linux Ubuntu

Locate duplicate files under Ubuntu (And some ranting)

Edit: Post updated due to obvious user error 🙂

Looking for a program to find dublicate files? Then fdupe saves the day!

root@bais:/home/samba/raid0# apt-cache search fdupe
fdupes – identifies duplicate files within given directories

By the way, how come the apt search gives to random results?

torhenning@bais:~$ sudo apt-cache search duplicate
….
mirror – keeps FTP archives up-to-date
vlc – multimedia player and streamer
(and a lot of other irrelevant crap)

Can`t exactly say that having to grep in a search results is a good “feature”..

Categories
Linux

How to get your mdadm RAID`s back after OS crash or a reinstall

If all your disks are connected, simply try a:

mdadm –assemble –scan

This should find and activate all your RAID systems 🙂

Categories
PHP

Display clock each 10 minutes x times forward in PHP

Here is a simple code PHP snippet to display the clock each 10 minutes x times in the format of:

php5 test.php
20:40
20:50
21:00
21:10
21:20
21:30
21:40

Etc.

<?php

$j = 0;
for($i=0;$i<10;$i+=1) {
        $j += (10*60);
        $hour = date("H", (time()+$j));
        $min  = ceil((date("i", (time()+$j))/10))*10;
        if($min > 50) {
                $min = "00";
                $hour++;
        }
        echo $hour.":".$min."n";
}

?>
Categories
Web

Swine flu tracking in Norway

A former colleague has just created a new swine flu tracker for a quick overview of Norwegian cases. If you are interested you can check out http://h1n1.raymondjulin.com/ – Interesting for those of us that follows the outbreak.

Categories
Linux

How to reset MySQL root password

To reset the MySQL root password, do the following:

USE DATABASE mysql;
SET PASSWORD FOR root@localhost=PASSWORD(‘yournewpassword’);
FLUSH PRIVILEGES;

And voila! You have changed your password.

PS: If you have a “problem” with beeing able to login to MySQL without using password (even when it is set in MySQL), try to edit or delete ~/my.cnf, since that holds information used to avoid the login promt.

Categories
Linux

(scam?) ” OpenSSH

Aparantly, somebody is willing to release a OpenSSH exploit in less than 48 hours. I hope (and guess) that it is a joke, but if not, the results can become “interesting”.

Read more @:

http://lists.grok.org.uk/pipermail/full-disclosure/2009-July/069752.html

Categories
Linux

Clear the Postfix mail queue

If you for some reasont want to clear the Postfix mail queue, you could do a:

postsuper -d ALL

Or if you just want to remove deferred mail:

postsuper -d ALL deferred

Categories
Uncategorized

No gays in Iran(wut?)

Aparantly, there are no gays in Iran, a bit strange that some countries have simply non gay people…

Categories
Web

Facepalm @ Google

Finally a good use for the color picker in Google images 🙂

http://images.google.no/images?q=Facepalm&gbv=2&hl=no&sa=G&imgcolor=black