varnit

push changes to origin git server

Posted by varnit on June 16, 2009

git push origin master

Posted in Uncategorized | Leave a Comment »

color grep less

Posted by varnit on May 25, 2009

Add this in your bashrc

alias grep='grep --color=always';
alias less='less -R';

Posted in bash, linux | Leave a Comment »

erlang version

Posted by varnit on May 22, 2009

erlang:system_info(otp_release).

Posted in erlang | Leave a Comment »

php curl multi

Posted by varnit on May 13, 2009

<?php
$url = array(’http://www.google.com’, ‘http://www.yahoo.com’);
$counter = 0;
$multi = curl_multi_init();

foreach ($url as $requestURL) {
${’curl’ . $counter} = curl_init();
curl_setopt(${’curl’ . $counter}, CURLOPT_URL, $requestURL);
curl_setopt(${’curl’ . $counter}, CURLOPT_HEADER, 0);
curl_setopt(${’curl’ . $counter}, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt(${’curl’ . $counter}, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt(${’curl’ . $counter}, CURLOPT_RETURNTRANSFER, 1);
curl_setopt(${’curl’ . $counter}, CURLOPT_USERAGENT, ‘Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3′);
curl_multi_add_handle($multi, ${’curl’ . $counter});

$counter++;
}

$running = 0;
do {
curl_multi_exec($multi, $running);
} while ($running > 0);

$counter = 0;
$response = array();

foreach ($url as $requestURL) {
$response[$requestURL] = curl_multi_getcontent(${’curl’ . $counter});
curl_multi_remove_handle($multi, ${’curl’ . $counter});

$counter++;
}

curl_multi_close($multi);
print_r($response);
?>

Posted in php | Leave a Comment »

find multiple files

Posted by varnit on February 6, 2009

find . -name file1.txt  -o -name file2.txt -o -name file3.txt

Posted in find, linux | Leave a Comment »