Iptables Port forwarding for VNC

 
 /sbin/iptables -A PREROUTING -t nat -p tcp -d $NATIP --dport 5900 -m 
state --state NEW,ESTABLISHED,RELATED -j DNAT --to 192.168.0.2:5900
 

Monitor your Boot Sequence with Bootchart

Ubuntu – Monitor your Boot Sequence with Bootchart

About Bootchart
Bootchart is a tool used to analyse your system performance in linux boot process.
It process all the required information accumulated during the boot process
(CPU usage and disk usage) which will then display as PNG, SVG, EPS encoded chart.
First of all you will have to Install Bootchart on Ubuntu.

Installation

sudo aptitude install bootchart
Reboot your PC

When you restart your computer Bootchart will create a graphical illustration in .png format.
Disabling and Enabling Bootchart
To disable Bootchart just use these code:

cd /etc/init.d

sudo update-rc.d -f stop-bootchart remove

 Removing any system startup links for /etc/init.d/stop-bootchart

   /etc/rc2.d/S99stop-bootchart
   /etc/rc3.d/S99stop-bootchart
   /etc/rc4.d/S99stop-bootchart
   /etc/rc5.d/S99stop-bootchart

And to re-enable just use these codes:

cd /etc/init.d

sudo update-rc.d stop-bootchart start 99 2 3 4 5 .

 Adding system startup for /etc/init.d/stop-bootchart ...

   /etc/rc2.d/S99stop-bootchart -> ../init.d/stop-bootchart
   /etc/rc3.d/S99stop-bootchart -> ../init.d/stop-bootchart
   /etc/rc4.d/S99stop-bootchart -> ../init.d/stop-bootchart
   /etc/rc5.d/S99stop-bootchart -> ../init.d/stop-bootchart

Common Scripting errors for beginners

when i  started scripting i had these errors in the begenning . The most common mistakes one makes during his initial stages of scripting are.

1.Check script file permissions. A script needs execute permission


2.We should not use default values that generate errors.If you
  give those your script execution breaks in the middle.

3.We must supply parameters as required ie make parameter mandatory
  if parameter is to be provided for sure, or else it throws an error.

4. Resuable script should not be hard-coded values.Use parameters  instead.

5.Commenting the script is very important... Make it a habbit to write
  comments.Also specify in comments if script has multiple parameters.
  you can also write examples in comments for better understanding.

6. Error handling is a must for scripting

what is Citrix presentation server ?

Citrix presentation server uses ICA protocol

allow to remotely access individual application.

It appears on the task-bar so we can toggle around the screens.

Adds management infrastructure ( allow more sessions on to server)

ability to start applications from a web site

Install and configure SVN ( Subversion ) on Ubuntu Linux

Install Subversion

sudo apt-get install subversion 


Install apache module


sudo apt-get install  libapache2-svn



Create Repository
--------------------
Repository is a central place where the data is stored and maintained in  an organized way.

Command to create the repository.

            sudo svnadmin create /svn


Edit the configuration file for the subversion webdav.

            vi /etc/apache2/mods-enabled/dav_svn.conf 


               uncomment this element  : this is the end tag of location
               uncomment DAV svn


Location element in this file denotes the root directory where the subversion will be accessible from,
for example


http://YOUR-IP-ADDRESS/svn

               uncomment  SVNPath /svn
SVNPath should be set to the same place where you created your repository using svnadmin command

Basic Authentication.

Uncomment the following three lines to enable the basic authentication.AuthUserFile sets the password file

              AuthType Basic
              AuthName "Subversion Repository"
             AuthUserFile /etc/apache2/dav_svn.passwd

 Creating users for the repository:
Command to create user:
             sudo htpasswd -cm etc/apache2/dav_svn.passwd
             -c   --  Create user for the first time.
             -m  --  Create another user for same repository.
If  -c is given after having some users, all those users will be deleted . Use -m to create new user for same repository.

Restart apache2 server to see the web console  of svn

             sudo /etc/init.d/apache2 restart.





Troubleshooting network Bandwidth Usage - Mahesh Patil ( Hexagrid.com )

a) dstat  -f             <==== Showed me that there is more network traffic on  eth1  when compared to eth0 and that too.. it is outgoing traffic.




b) iftop -i eth1        <====  Confirms what dstat says and also mentions  which IP is pulling Data from some 'X' location


c) nethogs eth1     <==== Shows which process is the culprit.  apache2 is the process using up the bandwidth in sending job.


 Once it was established that it was Apache process.. I stopped and restarted it.  Looks like what ever process was downloading data  got canceled and the network usage has come down to normal.

Tested with  the above commands again after apache restart to confirm same.

vnstat  <== good command to tell the usage.