Category: Linux Administration

Using grep to display line that doesnot start with a pattern

Using grep to display line that doesnot start with a pattern

If you want to display a line, that does not begin with a pattern you can use grep to achieve that. It is specially useful when you want to view the lines that are...

Use cron to sync time using ntp

Use cron to sync time using ntp

Sync the Time once a day at 2.00 0 2 * * * /usr/sbin/ntpdate -s -b -p 8 -u or 0 2 * * * /usr/sbin/ntpdate -s -b -p 8 -u 0.us.pool.ntp.org    

Sed Find a value between pattern

Sed Find a value between pattern

Find and Display a line with a value (eg. ;value) sed -n ‘/startpattern/,/endpattern/{s/;value//p}’ Filepath Print Value Between Two patterns Exclusive ( Single Line ): sed ‘s/.*pattern1\(.*\)pattern2.*/\1/’ eg.Following code displays value between < and >...

Block by url and url keywords in squid

Block by url and url keywords in squid

You can block access in squid by url and by keywords. To block by url or domain name.. acl blocksites dstdomain .example.com .test.com http_access deny blocksites To block access to websites by keyword :...

Configure DNS Server With Views

Configure DNS Server With Views

This is a tutorial to configure bind dns server with Views . Views help you serve different results based on the query source. 1. Create an RNDC Key : key "rndc-key" { algorithm hmac-md5;...

Installing A Custom Repo

Installing A Custom Repo

To install PHP 5.2.5 which is the latest version in the repos  you can make use of a RPM repository maintained by Remi. He has a repository for many distros. Follow  the steps to...

RPM Uninstall error–multiple matches

RPM Uninstall error–multiple matches

Sometimes when trying to uninstall an rpm package, you might get an error that says “Package xyz specifies multiple packages”. rpm -e unixODBC error: "unixODBC" specifies multiple packages In that case you can issue...