r00t.gr

Programming and more

Entries for April, 2012

Make a POST request with php (No curl or anything else needed)

I found this great post here: http://wezfurlong.org/blog/2006/nov/http-post-from-php-without-curl/ that explains how to make a POST request with php, no curl needed. This is very convinient in many situations. For example I wanted to get the pagerank of some page for some project I am working on. Getting pagerank is hard, you have to know datacenter ips […]

How to get alexa rank with PHP

Ok usefull function for many people. After some googling I give you the easiest way to get the alexa rank: <? $url="toolspot.org"; function getAlexa($url) { $xml = simplexml_load_file(’http://data.alexa.com/data?cli=10&dat=snbamz&url=’.$url); $rank=(int)$xml->SD[1]->POPULARITY->attributes()->TEXT; $web=(string)$xml->SD[1]->POPULARITY->attributes()->URL; return $rank; } echo $url." has Alexa Rank ".getAlexa($url);     function alexaRank($domain) { $remote_url = ‘http://data.alexa.com/data?cli=10&dat=snbamz&url=’.trim($domain); $search_for = ‘<POPULARITY URL’; $part=”; if ($handle = […]

Openvz + rsync problem Disk quota exceeded (122) [fixed]

Ok I had this annoying error. I rent servers to clients, and I user VPSs on another server to backup them. This one client (latest client) had a problem. When I used rsync to move files to the Backup VPS I got a lot of these errors: rsync: write failed on "/vz/private/106/mnt/sdb1/var/lib/mysql/ibdata1": Disk quota exceeded […]