Sunday, November 11, 2012

MRTG Start Up Script for Ubuntu

MRTG as a Start Up Service in Ubuntu

I am monitoring a lot of routers and switches of my organization using MRTG ( Multi Router Traffic Grapher ) . It is one of the best tools to give you an overview of bandwidth utilizations, CPU/Memory Utilizations etc. Here is a small bash script to make all these MRTG process act as a service which is automatically start up at reboot.

Details of MRTG

I am using MRTG with RRDTool using routers.cgi script. My MRTG configurations arrangements are like
  • Location1 Folder
    • router.cfg
    • switch.cfg
    • servers.cfg
  • Location2 Folder
    • router.cfg
    • switch.cfg
    • servers.cfg
  • Location3 Folder
    • SubLocation1 Folder
      • router.cfg
      • switch.cfg
      • servers.cfg
    • SubLocation2 Folder
      • router.cfg
      • switch.cfg
      • servers.cfg
    • router.cfg

Saturday, November 03, 2012

What is happening in GMAIL in the background ?

Do you wonder how this GMAIL works ? What is happening when you click the Send button in Gmail ? Here is the presentation from Google which is really informative . I would like to share this with you all . http://www.google.com/green/storyofsend/desktop/

Friday, November 02, 2012

Firewall in Ubuntu

How to set up a firewall in Ubuntu ?

Firewall is already in built into your Linux kernel. You just want to configure it properly for your needs !

Firewall is for filtering all the traffic which is headed into or out of your computer. In Linux Kernel , netfilter subsystem take care of this traffic. You just add the rules for accepting, rejecting or denying the traffic.

How to add rules into netfilter ?

 Use the IPTABLES . Iptables are really complex and flexible . See Basic How to of Iptables here https://help.ubuntu.com/community/IptablesHowTo  . 

UFW, Uncomplicated FireWall

There are many high level user interfaces for this Iptables. One is pre-installed with all Ubuntu distros higher that 8.04 , ie UFW or Uncomplicated FireWall . See more here https://help.ubuntu.com/community/UFW .  

GUFW, a Graphical Interface for UFW

GUFW is a GUI interface for UFW which is very easy to use and add rules .See more here https://help.ubuntu.com/community/Gufw

Keyboard shortcut to Open terminal in Ubuntu

CTRL + ALT + T
is the default key combination to open command line terminal ( BASH terminal ) in Ubuntu. This can be further changed by going to System -> Preferences -> Keyboard Shortcuts

Thursday, October 25, 2012

Installing / Uninstalling .deb files in Ubuntu

In Ubuntu , the package files are in .deb files . To install the packages file , you should be having administrative password.


Installing .deb debian package file in Ubuntu


  • Double click the .deb file , it will be automatically opened with the GDebi Package manager and you can install it
  • From command line , use this command to install a package .
    sudo dpkg -i PACKAGEFILE.deb

Uninstalling a package in Ubuntu

  • From command line, use this command
    sudo dpkg -r PACKAGENAME

Internet Proxy authentication in Ubuntu

How to solve "407 Proxy Authentication Required" error in Ubuntu ?

This was one question i was behind from last few days.  Use CNTLM , that's the best answer I got.
CNTLM will make your ubuntu server act as a proxy server and in behind authenticates with your actual proxy server .

Step 1:  Download the package file from the CNTLM website . While writing this, version 0.92.3 is the latest and the link to it is http://citylan.dl.sourceforge.net/project/cntlm/cntlm/cntlm%200.92.3/cntlm_0.92.3_i386.deb

Step 2: Install .deb file . See How to install .deb files in Ubuntu here

Step 3:  cntlm configuration file is located at /etc/cntlm.conf . Open it using your preferred text editor in edit mode . If you use gedit , type " sudo gedit /etc/cntlm.conf "

Step 4:  In cntlm.conf ,  edit the following fields
    Username   YOUR_USERNAME_HERE
    Domain     YOUR_ORGANIZATION_DOMAIN(Contact your Active Directory admin if you don't knw this)
    Password YOUR_PASSWORD
    Proxy  YOUR_PROXY_SERVER_IP_WITH_PORT
    NoProxy LIST_ALL_IP_WITH_NO_PROXY_REQUIREMENT
    Listen SOME_PORT
Sample config here:
   Username   0906895
   Domain     ABC
   Password   rndmpasswd@123
   Proxy  10.18.200.203:8080
   Proxy  10.18.200.204:8080
   NoProxy  localhost, 127.0.0.*, 10.*
   Listen  8080


Step 5:  After changes in configuration files, restart the cntlm service .
 sudo service cntlm restart

Now cntlm started working and your ubuntu server is acting as another proxy server . So add localhost as the system proxy server.

System Proxy setting:

Go to System -> Preference -> Network Proxy
In the Network Proxy Preference window,  Set Manual proxy configuration . Proxy server as localhost and port as the port number you specified in " Listen SOME_PORT" .