Sunday, March 23, 2014

My SVN notes


A. Installation

1. Go to the site and download the file and just install the default.

http://software.opensuse.org/download.html?project=devel:tools:scm:svn&package=subversion

select your version, my version is suse 11.

Installation failed twice and finally able to install on third attempt.

2. Create a repository.

jay@suvi:~> mkdir repository
jay@suvi:~> cd repository/
jay@suvi:~/repository> ls -l
total 0
jay@suvi:~/repository>

3. Now, lets bring the directory repository under svn.

jay@suvi:~/repository> svnadmin create /home/jay/repository
jay@suvi:~/repository> pwd
/home/jay/repository
jay@suvi:~/repository> ls
conf  db  format  hooks  locks  README.txt
jay@suvi:~/repository>
jay@suvi:~/repository> more README.txt
This is a Subversion repository; use the 'svnadmin' tool to examine
it.  Do not add, delete, or modify files here unless you know how
to avoid corrupting the repository.

Visit http://subversion.apache.org/ for more information.
jay@suvi:~/repository>

Note: please note the changes on the directory structure after using svnadmin command.

As read me file suggest, do not make changes to repository unless you know what you doing.

4. Creating Project.
and start a project with a simple file.
jay@suvi:~> pwd
/home/jay
jay@suvi:~> mkdir project1
jay@suvi:~> echo "Hello This is a test Project file">project1/hello.txt
jay@suvi:~> more project1/hello.txt
Hello This is a test Project file

Note: I am also not following recommened layout of subversion project which includes branches, tags and trunk. We will be working on "trunk" of the project as the instruction doc. This is the backbone of the project where main files and directories are placed.

5. Import the project.
To import the project1 using the following command,

jay@suvi:~> pwd
/home/jay
jay@suvi:~> svn import /home/jay/project1/ file:///home/jay/repository/project1/trunk -m "Initial import of Project1"
Adding         project1/hello.txt

Committed revision 1.
jay@suvi:~>


Note: as you see, you specify by source project directory followed by destination and -m to supply the message. Always add message when you import message.

6. Now, delete the temp Project file which originally created. We already imported it to subversion.
jay@suvi:~> pwd
/home/jay
jay@suvi:~> rm -rf project1

7. Check out a repository.
Subversion keeps a copy of each lets say commit which process is lets say called check out. Check out saves the initial project with the initial version or say version 1. After that we can make changes to the project and 'check in' or commit the change. So, the any subsequent commit would be next version say 2 of the project and so on.

8. Now, create a new directory on your home directory.

Saturday, March 8, 2014

Network Bonding


Assuming two network interfaces eth0 and eth1 as shown below.

[root@samserv05 network-scripts]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr D8:D3:85:5F:D1:B6
          inet addr:172.28.7.206  Bcast:172.28.7.255  Mask:255.255.255.128
          inet6 addr: fe80::dad3:85ff:fe5f:d1b6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:744339 errors:0 dropped:0 overruns:0 frame:0
          TX packets:234404 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:638166148 (608.6 MiB)  TX bytes:37473617 (35.7 MiB)
          Memory:fbd60000-fbd80000
eth1      Link encap:Ethernet  HWaddr D8:D3:85:5F:D1:B7
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Memory:fbde0000-fbe00000
1. Edit modprob.conf and append “alias bond0 bonding” as shown below.
Vi  /etc/modprob.conf
alias bond0 bonding
2. Create bond0 file and append below entry in it. Change the IPADDR and NETMASK to the one on your server
cd /etc/sysconfig/network-scripts/
cp ifcfg-eth0 ifcfg-eth1 /var/tmp
vi  etc/sysconfig/network-scripts/ifcfg-bond0
ifcfg-bond0
DEVICE=bond0
IPADDR=172.28.38.134
NETMASK=255.255.254.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
BONDING_OPTS="mode=active-backup miimon=100"


3. Edit eth0 and eth1 and append the content below. Replace HWADDR with the hardware address on your servers
Ifcg-eth0
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
ETHTOOL_OPTS="speed 1000 duplex full"
HWADDR=00:17:A4:78:5C:B9
Ifcfg-eth1
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
ETHTOOL_OPTS="speed 1000 duplex full"
HWADDR=D8:D3:85:5D:F1:C7
4. Run the command below from the console
First down the active eth, e.g. eth0
Ifconfig eth0 down
/etc/init.d/network restart 
[root@samserv05 network-scripts]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: d8:d3:85:5f:d1:b6
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: d8:d3:85:5d:f1:c7
If this does not work, reboot the server.