Thursday, April 30, 2009

sed tips

Great one liner sed tips and tricks.

http://sed.sourceforge.net/sed1line.txt

Wednesday, April 22, 2009

Now its easy to deploy

You lead a busy life. You don’t have the time to waste logging in and logging out of your servers all day, running tasks, installing software, keeping machines in sync, and trying to make sure it all happens correctly.

Let Capistrano do the heavy lifting for you. It is designed with repeatability in mind, letting you easily and reliably automate tasks that used to require login after login and a small army of custom shell scripts.

And if you still find it difficult then you have the Webistrano interface for the same.

Monday, April 13, 2009

copy large number of small files over the network - the fastest method

find /source/path -print |cpio -o -Hnewc |ssh -C 192.168.32.31 "cd /path/to/destgnation/; cpio -idvum" &>/dev/null

Wednesday, April 8, 2009

Getting login password from Apache authentication using PHP

$headers = apache_request_headers();

$auth= $headers['Authorization'];

$autha = explode(' ',$auth);

$pair = base64_decode($autha[1]);

$authb = explode(':',$pair);

echo $login = $authb[0];

echo '\n';

echo $pass = $authb[1];

include this in php tags :)

Apache-PHP User Authentication

http://www.weberdev.com/ViewArticle/User-Authentication-With-Apache-and-PHP

Tuesday, April 7, 2009

OFC standards

You might have some confusion about the OFC cable standards, like LC, SC etc. The following link will help you to understand all these standards

http://www.thefoa.org/tech/connID.htm
http://en.wikipedia.org/wiki/Optical_fiber_connector

Friday, April 3, 2009

Redirect Using Iptables

To redirect port 80 to 8080 use:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080