Thursday, April 9, 2015

Subversion 1.8 Installation in Centos-6.X Step By Step






How to install Basic SVN and Mod SVN (1.8) in Centsos-6.X with Viewvc integration

Steps to Create Basic SVN (1.8) :


Step 1 :

To install SVN 1.8 Firstly we need to configure yum repository in our system. Create a new repo file /etc/yum.repos.d/wandisco-svn.repo and add following content as per your operating system version.

# vi /etc/yum.repos.d/wandisco-svn.repo

  [WandiscoSVN]
  name=Wandisco SVN Repo
  baseurl=http://opensource.wandisco.com/centos/6/svn-1.8/RPMS/$basearch/
  enabled=1
  gpgcheck=0


 :wq!

# yum clean all
# yum install subversion subversion-python

# svn --version


Step 2 :  Creating the Repo

# mkdir /svn
# svnadmin create /svn/testrepo


Step 3 : Create user (svn) and Giving ownership for the created Repo

# useradd svn -s /sbin/nologin
# chown -R svn /svn/testrepo/


Step 4 : Deleting/Renaming the default passwd file from Conf folder

# cd /svn/testrepo/conf
# mv  passwd passwd.old 

(from newly create repo , inside conf directory)


Step 5 : Now Create a soft link to the passwd file which present in location at /svn/testrepo/conf  with a command -

# vi /svn/passwd  (just create a blank file)
# ln -s /svn/passwd /svn/testrepo/conf/passwd


Step 6 : Edit the svnserve.conf and change like this

# vi  /svn/testrepo/conf/svnserve.conf

Anon_access=none
Auth_access=write
Password-db=passwd

:wq!


Step 7 : Now start the svnserve demon


# /usr/bin/svnserve -d -r /svn

Put this code in rc.local so that the svnserve demon will run after the system restart also.


Step 8 : Now create the initial directories

# svn mkdir file:///svn/testrepo/{trunk,tags,branches} -m "initial directories"


Step 9 : Create a username and password to checkout SVN repo

# vi /svn/passwd

 vipin = yourpassword

:wq!


Step 10 : Your Basic SVN server is ready, Now just checkout and see

# svn co svn://192.168.1.X/testrepo/ /mnt/






Steps to Create MOD SVN (1.8) :

Note : In this example I am setting up the mod svn in the same server itself. 
So please follow the above 9 steps.


The benefit of Mod_svn is you can access all repo data over browser with the login credentials provided by the administrator, it is easier to browse, without any client svn package, Mod SVN subversion is moderated and managed by apache , so password file and ownership by default goes to apache user or you have to change ownership for the repo to apache before to us.

Step 1: Install the Packages.

# yum install  –y mod_dav_svn httpd


Step 2: Now Edit /etc/httpd/conf.d/subversion.conf file like this.

# Make sure you uncomment the following if they are commented out
LoadModuledav_svn_module     modules/mod_dav_svn.so
LoadModuleauthz_svn_module   modules/mod_authz_svn.so

# Add the following to allow a basic authentication and point Apache to where the actual repository resides


# vi /etc/httpd/conf.d/subversion.conf


<Location /testrepo>
  DAV svn
  SVNPath /svn/testrepo
  AuthType Basic
  AuthName "SVN Repo"
  AuthUserFile /svn/mod-auth/svn.passwd
  Require valid-user
</Location>

:wq!


Step 3 : change ownership from root to apache

# chown -R apache.apache /svn/testrepo/


Step 4 : Create htpassword file from command

# mkdir /svn/mod-auth
# htpasswd -cm /svn/mod-auth/svn.passwd vipin

    Now enter the password

Note : If you want to add multiple user, please run the code like this :
# htpasswd -cm /svn/mod-auth/svn.passwd user1
# htpasswd -m /svn/mod-auth/svn.passwd user2


Step 5 : Restart the apache service.

# service httpd restart
# chkconfig httpd on


Your Mod SVN is ready. Now open the browser and type :

http://192.168.1.X/testrepo






Steps to Install & Configure ViewVC (1.1.10) :



Step 1: Download ViewVC stable release 1.1.10
You can download using wget command on CentOS server as below.

# cd /tmp
# wget http://viewvc.tigris.org/files/documents/3330/48879/viewvc-1.1.10.tar.gz

Step 2 : Extract and unzip the viewvc-1.1.10.tar.gz using below command.

# tar xvfz viewvc-1.1.10.tar.gz

Step 3 : Go to viewvc-1.1.10 directory and start the installation

# cd viewvc-1.1.10
# ./viewvc-install


Step 4 : Now Edit viewvc.conf file

# vi /usr/local/viewvc-1.1.10/viewvc.conf

(Uncomment line 151 and define the subversion root repositories )

root_parents = /svn : svn,


:wq!

Note : Here /svn is your repo path.

 
Step 5 : Edit the apache web server config file as below


# vi /etc/httpd/conf/httpd.conf

Add the below two lines under ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" Stanza

ScriptAlias /viewvc /usr/local/viewvc-1.1.10/bin/cgi/viewvc.cgi
ScriptAlias /query /usr/local/viewvc-1.1.10/bin/cgi/query.cgi

:wq!



Step 6 : Restart all the services

# service httpd restart
# chkconfig httpd on
# setenforce 0
# service iptables stop 



Now open the browser and type :   http://192.168.1.X/viewvc





***** Thanks *****





Tuesday, March 24, 2015

Creating The Repository - TortoiseSVN






Here the steps to create a Repository on an existing SVN Server :



Step 1 :  Creating the Repo

# svnadmin create testrepo


Step 2 : Giving ownership for the created Repo

# chown -R svn /svn/testrepo/


Step 3 : Deleting the default passwd file from Conf folder

# mv  -r passwd passwd.old 

(from newly create repo , inside conf directory)


Step 4 : Now Create a soft link to the passwd file which present in location at /svn/testrepo/conf  with a command -

# ln –s /svn/passwd /svn/testrepo/conf/passwd


Step 5 : Edit the svnserve.conf and change like this

# vi  /svn/testrepo/conf/svnserve.conf

Anon_access=none
Auth_access=write
Password-db=passwd

:wq!

# service xinetd restart


Step 6 : Now create the initial directories

# svn mkdir file:///svn/testrepo/{trunk,tags,branches} -m "initial directories"


Step 6 : Now just checkout and see

# svn co svn://testrepo.abc.com/testrepo/ /mnt/test


***** Thanks *****





Install GTK+ And Firefox On Amazon Linux X86-64






 To Install GTK+ and Firefox on Amazon Linux please follow the below steps :
 
Step 1 :

# yum update all

Step 2 :

Run the below script :



#!/bin/bash
# GTK+ and Firefox for Amazon Linux
# Written by Vipin Chereekandy


# chmod 755 ./gtk-firefox.sh
# sudo ./gtk-firefox.sh


TARGET=/usr/local

function init()
{
export installroot=$TARGET/src
export workpath=$TARGET

yum --assumeyes install make libjpeg-devel libpng-devel \
libtiff-devel gcc libffi-devel gettext-devel libmpc-devel \
libstdc++46-devel xauth gcc-c++ libtool libX11-devel \
libXext-devel libXinerama-devel libXi-devel libxml2-devel \
libXrender-devel libXrandr-devel libXt dbus-glib \
libXdamage libXcomposite
mkdir -p $workpath
mkdir -p $installroot
cd $installroot
PKG_CONFIG_PATH="$workpath/lib/pkgconfig"
PATH=$workpath/bin:$PATH
export PKG_CONFIG_PATH PATH

bash -c "
cat << EOF > /etc/ld.so.conf.d/firefox.conf
$workpath/lib
$workpath/firefox
EOF
ldconfig
"
}

function finish()
{
cd $workpath
wget -r --no-parent --reject "index.html*" -nH --cut-dirs=7 http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/latest/linux-x86_64/en-US/
tar xvf firefox*
cd bin
ln -s ../firefox/firefox
ldconfig
}

function install()
{
wget $1
FILE=`basename $1`
if [ ${FILE: -3} == ".xz" ]
then tar xvfJ $FILE
else tar xvf $FILE
fi
SHORT=${FILE:0:4}*
cd $SHORT
./configure --prefix=$workpath
make
make install
ldconfig
cd ..
}

init
install ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.xz
install http://download.savannah.gnu.org/releases/freetype/freetype-2.4.9.tar.gz
install http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.9.0.tar.gz
install http://ftp.gnome.org/pub/gnome/sources/glib/2.32/glib-2.32.3.tar.xz
install http://cairographics.org/releases/pixman-0.26.0.tar.gz
install http://cairographics.org/releases/cairo-1.12.2.tar.xz
install http://ftp.gnome.org/pub/gnome/sources/pango/1.30/pango-1.30.0.tar.xz
install http://ftp.gnome.org/pub/gnome/sources/atk/2.4/atk-2.4.0.tar.xz
install http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.26/gdk-pixbuf-2.26.1.tar.xz
install http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-2.24.10.tar.xz
finish


# adds the /usr/local/bin to your path by updating your .bashrc file.
cat << EOF >> ~/.bashrc
PATH=/usr/local/bin:\$PATH
export PATH
EOF

***** Thanks *****



Wednesday, February 11, 2015

SSH X11-Forwarding Step By Step in Centos-6.x






How to do SSH X11-Forwarding :-


In order to run an application on one CentOS 6 system and have it display on another system there are a couple of prerequisites. Firstly, the system on which the application is to be displayed must be running an X server. If the system is a Mac OS X, UNIX or Linux based system with a desktop environment running then this is no problem. If the system is running Windows, however, then you must install an X server on it before you can display applications from a remote system. A number of commercial and free Windows based X servers are available for this purpose and a web search should provide you with a list of options.
Secondly, the system on which the application is being run (as opposed to the system which the application is to be displayed) must be configured to allow SSH access.

From Server :

Before you start  confirm the below packages are installed in your server. Run this command

Step :1

# rpm -qa xorg-x11-xauth openssh 

This will give a output like this :

xorg-x11-xauth-1.0.2-7.1.el6.x86_64
openssh-5.3p1-104.el6_6.1.x86_64


Step :2

Edit  /etc/ssh/ssh_config file and change ForwardX11 no to ForwardX11 yes

# Vi /etc/ssh/ssh_config

 ForwardX11 yes

:wq!

# service sshd restart
# setenforce 0
# service iptables stop







From Client :

The first step in remotely displaying an application is to move to the system where the application is to be displayed. At this system, ssh into the remote system so that you have a command prompt. This can be achieved using the ssh command. When using the ssh command we need to use the -X flag to tell ssh that we plan to tunnel X traffic through the connection:

# ssh -X user@hostname

In the above example user is the user name to use to log into the remote system and host-name is the host-name or IP address of the remote system. Enter your password at the login prompt. Once logged in, run the following command to see the DISPLAY setting:

# echo $DISPLAY

The command should output something similar to the following:

localhost:10.0

To display an application, simply run it from the command prompt. For example:

# gedit

When run, the above command should run the gedit tool on the remote system, but display the output on the local system.



***** Thanks *****

Wednesday, February 4, 2015

How to install VLC Player on CentOS-6.4






Solution To install VLC Player on CentOS 6.X


Open the terminal and follow the below steps :-

# cd /etc/yum.repos.d/

# wget http://pkgrepo.linuxtech.net/el6/release/linuxtech.repo

# yum install vlc



To Run VLC Player as "root" user in CentOS Please follow the below steps also :



1) Install "hexedit" utility in linux using yum. The command is,

# yum install hexedit


2) After successful installation, open "/usr/bin/vlc" using hexeditor as given below.

# hexedit /usr/bin/vlc


3) Now, Press "TAB" key

4) Now, Press "Ctrl + S" key to search ASCII string.

5) In the given search box, type "geteuid"

6) Then replace it with "getppid" by just typing "getppid"

6) Now, Press "Ctrl + X" to save the file.

Finally, your VLC player is ready to run as "root" user.


***** Thanks *****

How to install Skype-4.3.0.37 on CentOS-6.4







Step 1 :
To install Skype on Centos first enable EPEL repo. Steps to enable EPEL Repository on CentOS:


# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

# rpm -ivh epel-release-6-8.noarch.rpm

Step 2 :
Then install the dependency packages for skype 

Note : Is better to run a yum update before the dependency installation.


# yum install libXv*
# yum install libXv.so.1
# yum install libXss.so.1
# yum install qt 
# yum install libQtDBus.so.4
# yum install libQtWebKit.so.4


Step 3 :
Now download and extract Skype source

# cd /usr/src
# wget http://www.skype.com/go/getskype-linux-dynamic
# tar -xjvf skype-4.3.0.37.tar.bz2

# mv skype-4.3.0.37 skype
# cd skype
# ./skype






Step 4 :
After the installation Export the GTK path in ~/.bash_profile 

# vi ~/.bash_profile

export PATH
export GTK2_RC_FILES="/etc/gtk-2.0/gtkrc"

:wq!


 Step 5 :
 Then run
# source ~/.bash_profile 


Now you can open Skype from your terminal
# skype


***** Thanks *****

Tuesday, January 27, 2015

How to create a rsync auto backup script with email notification







Step 1 :- First enable a password less SSH to the remote server from you backup PC

Step 2 :- Then copy and paste the below code in to a text file and save as a .sh file


#!/bin/bash
PATH=/bin:/usr/bin:/sbin:/usr/sbin

#### Mail server Data Backup ####
#### Created by Vipin Chereekandy ####
#### chereekandy@gmail.com ####

## Below command will sync the data with the Backup server ###
rsync -avgr -e ssh --delete root@192.168.1.1:/home/data /secondary_bkp/mailserver/.

## Below command will send you an email notification ##
if [ $? != "0" ]
  then
   echo Mail server data Backup is failure|mail -s "Mail server Backup Failure" yourid@example.com
  else
   echo Mail server data Backup is successful|mail -s "Mail server Backup Successful" yourid@example.com
 fi

### End of the script ##


Note : Replace IP address, mail ID and directory path with your own Server base.


Step 3 :- Set a cronjob to run this script



**** Thanks ****





Friday, January 23, 2015

How to Check the Network Bandwidth between two network by using Iperf

Check your Network Bandwidth with Iperf






What is Iperf ?


Iperf is a tool to measure maximum TCP bandwidth, allowing the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss.

For this we needs 2 machine, Client(Sender) and Server(Receiver).

Here :-
Node 1 - 192.168.1.1 (Server)
Node 2 - 192.168.2.1 (Client)



From Node 1- (192.168.1.1) :-

Install iperf package
yum -y install iperf

Run the server service from Node 1 (192.168.1.1)
# iperf -s



From Node 2- (192.168.2.1) :-


Install iperf package
yum -y install iperf



Execute the below command from Node 2 (192.168.2.1), This will print the bandwidth.

# iperf -c 192.168.1.1 -fM -m -i5 -t25


Here the output :-

------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 0.02 MByte (default)
------------------------------------------------------------
[  3] local 192.168.2.1 port 41773 connected with 192.168.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 5.0 sec  3.25 MBytes  0.65 MBytes/sec
[  3]  5.0-10.0 sec  2.75 MBytes  0.55 MBytes/sec
[  3] 10.0-15.0 sec  3.00 MBytes  0.60 MBytes/sec
[  3] 15.0-20.0 sec  2.88 MBytes  0.57 MBytes/sec
[  3] 20.0-25.0 sec  3.00 MBytes  0.60 MBytes/sec
[  3]  0.0-25.3 sec  15.0 MBytes  0.59 MBytes/sec
[  3] MSS size 1376 bytes (MTU 1416 bytes, unknown interface)


For more detail execute this command :
# man iperf



Thank You
****



Wednesday, January 14, 2015

How to Remove NIC bonding in LINUX CentOS



Steps to Remove NIC bonding in LINUX CentOS



# ifconfig bond0 down

# echo "-eth0" > /sys/class/net/bond0/bonding/slaves
# echo "-eth1" > /sys/class/net/bond0/bonding/slaves
# echo "-bond0" > /sys/class/net/bonding_masters

# rmmod bonding

# service network restart



***********