Using Stunnel to Encrypt Unsecure Connections

So you’re a fully signed up ‘tin foil hatter’ and you have an old app that communicates over the internet but doesn’t use SSL? Not to worry, there is a solution for you and its called stunnel. Stunnel is available for both Linux and Windows, and simply put creates an SSL tunnel from one machine…

Change Hostname Permanently on Debian or Ubuntu

Debian based systems use the file /etc/hostname to read the hostname of the computer at boot time and set it up using the init script /etc/init.d/hostname.sh We can edit the file /etc/hostname and change the hostname and then run: /etc/init.d/hostname.sh start Steps: 1. sudo vim /etc/hostname 2. Save the file with the hostname you like…

Configuring Hadoop for Failover

Introduction As of 0.20, Hadoop does not support automatic recovery in the case of a NameNode failure. This is a well known and recognized single point of failure in Hadoop. Experience at Yahoo! shows that NameNodes are more likely to fail due to misconfiguration, network issues, and bad behavior amongst clients than actual hardware problems. Out of fifteen grids…

Measuring Apache bandwidth from a bash script

So reason : double checking Sawmill and AWstats. (sawmill won..) echo “$(awk ‘{print $10}’ prd.logs | grep -v “-” | paste -sd + – | bc )/1024/1024/1024″ | bc result is in GB. nJoy;  

Rebooting a Centos server ignoring CIFS or other broken / hung mount

We had a problem on a server df would hang and we knew that a cifs / samba share died and recovered. Trying unmount / with any parameters -l -f failed. Experience and google told us we need to reboot. This is a remote server and we know the shutdown hangs on going down so…

Querying network card information and status

Great tool for checking ethernet NIC information in linux: ethtool In ubuntu you might need to install it like so : sudo apt-get install ethtool The tool is easy to use:   Use ifconfig -a  to list nics then   root@wo1:~# ethtool p4p1 Settings for p4p1: Supported ports: [ TP ]        …