How To Use Gmail Account To Relay Email From a Shell Prompt

Posted on in Categories Backup, Debian Linux, fedora linux, Howto, Linux, Linux desktop, RedHat/Fedora Linux, Tip of the day last updated April 5, 2009

Usually, you do not need to setup an email server under Linux desktop operating system. Most GUI email clients (such as Thunderbird) supports Gmail POP3 and IMAP configurations. But, how do you send mail via the standard or /usr/bin/mail user agents or a shell script? Programs such as sendmail / postfix / exim can be configured as a gmail smarthost but they are largely overkill for this use.

How To Tail (View) Multiple Files on UNIX / Linux Console

Posted on in Categories data center, Debian Linux, Download of the day, fedora linux, File system, FreeBSD, Gentoo Linux, GNU/Open source, Howto, Linux, Linux Log Management, Monitoring, package management, RedHat/Fedora Linux, Suse Linux, Sys admin, Tip of the day, UNIX last updated February 9, 2009

The tail command is one of the best tool to view log files in a real time using tail -f /path/to/log.file syntax on a Unix-like systems. The program MultiTail lets you view one or multiple files like the original tail program. The difference is that it creates multiple windows on your console (with ncurses). This is one of those dream come true program for UNIX sys admin job. You can browse through several log files at once and do various operations like search for errors and more.

Find Out If Your WebSite Blocked In China Or Not

Posted on in Categories Download of the day, GNU/Open source, Howto, Linux desktop, Mozilla, News, OS X, Tip of the day, UNIX, Windows, windows vista last updated October 30, 2008

Internet censorship in the People’s Republic of China is conducted under a wide variety of laws and administrative regulations. In accordance with these laws, more than sixty Internet regulations have been made by the People’s Republic of China (PRC) government, and censorship systems are vigorously implemented by provincial branches of state-owned ISPs, business companies, and organizations. So how do you find out if your website is blocked by the Great Firewall of China?

setsid: Keep Linux / UNIX program running while you logs out

Posted on in Categories Debian Linux, Sys admin, Tip of the day last updated October 16, 2007

I already wrote about nohup command, which allows you to ignore HUP (hangup) signal and keep running the command after user logged out. You can accomplish the same behavior using screen or disown command.

setsid is another program that runs a program in a new session. For example run a script called ~/scripts/
ssh [email protected]
setsid ~/scripts/

You can also pass argument to command or script:
setsid /usr/bin/beep-media-player '/nas/mp3/xyz.mp3'

Please note that setsid included in miscellaneous system utilities package called util-linux under Debian / Ubuntu Linux.

Quick Shell Tip: Remove grep command while grepping something using ps command

Posted on in Categories Linux, Shell scripting, Tip of the day, UNIX last updated October 15, 2007

Generally you use ps command to find out all running process. You may also pipe out ps command output via grep command to pickup desired output.

Basically you don’t want display grep command as the process.

Let us run combination of ps and grep command to find out all perl processes:
$ ps aux | grep perl

vivek      4611  0.0  0.7  10044  6068 ?        Ss   02:40   0:00 /usr/bin/perl apps/monitor/
root      4853  0.0  0.7  10044  6068 ?        Ss   02:40   0:00 /usr/bin/perl /usr/share/webmin/ /etc/webmin/miniserv.conf
vivek      5166  0.0  0.0   2884   748 pts/0    R+   03:06   0:00 grep perl

In above example you are getting the grep process itself. To ignore grep process from output, type any one of the following:
$ ps aux | grep perl | grep -v grep
$ ps aux | grep '[p]erl'

Find out DNS Server Version With DNS Server Fingeprinting tool

Posted on in Categories Debian Linux, FreeBSD, Howto, Linux, Networking, Security, Sys admin, Tip of the day, UNIX last updated September 27, 2007

By hiding out DNS server version number you can improve server security. fpdns is a program that remotely determines DNS server versions. It does this by sending a series of borderline DNS queries which are compared against a table of responses and server versions. (just like nmap command’s remote OS detection facility).

A nameserver basically responds to a query. Interoperability is an obvious requirement here. The standard protocol behavior of different DNS implementations is expected to be the same.

Install fpdns

Debian / Ubuntu user, enter the following command:
$ sudo apt-get install fpdns
FreeBSD user, either use ports or binary package:
$ pkg_add -v -r fpdns
Alternatively grab source code from official web site.

Howto remotely determine DNS server version

To determine DNS server version for domain, enter:
$ fpdns -D

fingerprint (, bboy MyDNS
fingerprint (, bboy MyDNS 

You can easily find out if recursion enabled or not:
$ fpdns

fingerprint (, ISC BIND 9.2.3rc1 -- 9.4.0a0 [recursion enabled]  

To read list of servers from key board, enter:
$ fpdns -
fingerprint (, ISC BIND 9.2.3rc1 -- 9.4.0a0 [recursion enabled]
fingerprint (, ISC BIND 9.2.3rc1 -- 9.4.0a0
fingerprint (, ISC BIND 8.3.0-RC1 -- 8.4.4
fingerprint (, ISC BIND 8.3.0-RC1 -- 8.4.4 

Further readings

=> Read fpdns man page.