The following articles were authored by admin

How to find the External IP if it is Natted

If you are behind a NAT  and want to  find the real / external IP from  the server then execute one of the below command from the server ::

[email protected][#] curl -s | html2text | awk -F ':' '{print $2}'


[email protected][#] curl


[email protected][#] curl


[email protected][#] curl

The last one is a bit slower but it does show the external IP.

If you want to get the natted IP  for secondary interfaces that is eth0:1 , eth0:2  then use curl –interface IP

ex :

curl --interface


That’s all.


Roundcube : failed to open log file /var/log/httpd/suexec_log

While working on a issue for one of the client, I found that the Webmail link was giving 500 internal server error for Roundcube and checking the apache error logs I was getting the below errors ::

failed to open log file /var/log/httpd/suexec_log
fopen: Permission denied
[Mon Aug 18 16:50:08 2014] [warn] [client x.x.x.x] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Mon Aug 18 16:50:08 2014] [error] [client x.x.x.x] Premature end of script headers: index.php

Further checking , I’ve found that the below file was missing ::


So, I’ve copied that file from one of my other server and restarted apache service and this fixed the issue with  500 internal error for roundcube.

Note :: The cgi_wrapper file should have 755 permission with ownership of root:root.

Easy isn’t it.

Simple shell script to check if a Host is UP

If you work on multiple servers and want to check what hosts are up/down then you can use the below shell script to  test multiple servers  connectivity ::

# test1.txt should contain a list of IP's to be tested
for i in `cat test1.txt`;
ping -c 1 -W 1 $i &> /dev/null
if [ $? -ne 0 ]; then
#use if [ $? -eq 0 ]; then to test the up IP's
echo "$i is down"

That’s all.