Thursday, June 28, 2007


Setting the CVS PATH for executing binaries :
For Bash shell:
$export PATH=$PATH:/opt/cvs/bin
Setting up CVSROOT :
$export CVSROOT=:pserver:sriram@unixbox:/usr/local/cvsroot
If possible, set it once and for all using UNIX script
executed on login, such as /.cshrc or /.bashrc.
Logging in to CVS:
$ cvs login
CVS password: (enter your CVS password here)
The records are stored, by default, in the file '$HOME/.cvspass'.(encrypted).
You can change the default by changing CVS_PASSFILE environment variable.
CVS Checkout :
Given a properly configured CVS server, checkout will extract a working copy of the files
associated with the module into the current working directory:
cvs -d /usr/local/cvsroot checkout dirname

To properly remove a local working copy:

cvs release -d $DIRECTORY

Add a File to CVS

$ cvs add backend.c
$ cvs commit -m "Early version. Not yet compilable." backend.c

To Save changes to the repository :

In case that you have the authorization, you can commit changes in your local working copy directly to the repository.

cvs commit
cvs commit filename(s)

Set up email notification of changes committed to the repository:
Just add a line like this to the CVSROOT/loginfo file:
DEFAULT mail -s %s
Logout to CVS:
$CVS logout
If you have not setup environment variable then:
cvs -d ":pserver:sriram@yourhost:/opt/home/cvs" command
cvs -d ":pserver:sriram@yourhost:/opt/home/cvs" login

To give users access to only read permission on CVS repositories :

There are two ways to specify read-only access for a user: by inclusion, and by exclusion.

Create a file named readers in your CVSROOT directory
Sample readers file
$cat '$CVSROOT/CVSROOT/readers'
"Exclusion" means explicitly listing everyone who has write access--if the file
$cat '$CVSROOT/CVSROOT/writers'exists
then only those users listed in it have write access, and everyone else has read-only access.
CVSROOT has the following format:
Protocols :
:local - Here the repositories are located or on NFS, this is not recommended.
:pserver - pserver protocol is client/server scheme protocol, unsecured not recommened on
public networks.
:ext - access cvs using ssh (encoded).
For example :
$export CVS_RSH=ssh
$export CVSROOT=:ext:sriram@unixbox:/usr/local/cvsroot
Their also exists some other protocols but their usage is specific
and seldom.
Please see the List of CVS environment variables here

Wednesday, June 27, 2007

Veritas Volume Manager FAQ

1) Installing Veritas Volume Manager ?

Veritas Volume Manager is also called (VVM or VxVM )

Features :
1) VVM is Available for - Windows. Linux, HP-UX, Solaris, AIX.
2) Versions (3.1, 3.2, 3.5, 4.0, 4.1, 5.0).

Installing Veritas Volume Manager

  1. Insert the Veritas volume manager software cdrom into
    the cdrom drive. If volume management is enabled, it will
    automatically mount to /cdrom/volume_manager3.5
    (depending on the precise release iteration, the exact path
    may differ in your case):

  2. Change to the directory containing the Veritas Volume Manager packages:
    # cd /cdrom/volume_manager3.5/pkgs

  3. Add the required packages.
    Note that the order specified is
    siginificant in that the VRTSvlic package must be first,
    the VRTSvxvm package must be second, and then any
    remaining packages:
    #pkgadd -d . VRTSvlic VRTSvxvm VRTSvmdoc \
    VRTSvmman VRTSob VRTSobgui VRTSvmpro \
    VRTSfspro VRTSvxfs VRTSfsdoc

Once the Installation is complete as you see below:

This machine must now be rebooted in order to ensure
sane operation. Execute
shutdown -y -i6 -g0
and wait for the "Console Login:" prompt.
# shutdown -y -i6 -g0

Give the above command as it appears in the console.

Once the system reboots, apply any Veritas volume manager
patches. At the time of this writing, there are no patches
for neither volume manager or filesystem. However, future
patches (and there will be patches ;-) can be obtained from
Note that the patch installation instructions may require
that a reboot be performed after the patch is installed
2) How do I initialize disks in Solaris, so that I can Add to VxVM(Veritas Volume Manager) ?
#drvconfig; devlinks; disks
try the following, :


#vxdctl initdmp

#vxdctl enable

Make sure you initialize disk , only then will you be able to add to Veritas Volume Manager.
3) How do you add/remove/replace a Disk to Veritas Volume Manager Control ?
There are 13 options available to choose, from the below command, like adding/removing of devices:
4) Steps for setting up storage - Veritas Volume Manager ?

1) It is important to create a diskgroup, so that VVM can be
moved to a different hosts.

Disk Groups includes filesystems/disks of the applcations.
Commands (vxdiskadd or vxdg).

#vxdg init diskgroup diskname=device


#vxdg init ABCdg ABCdg01=c0t0d1

2) Creating Volumes with vxassist:

# vxassist -g diskgroup make vol_name size


#vxassist -g ABCdg make ABC01 8g

Note: Understanding the contents of the /etc/default/vxassist file is important, especially when striping disks.

3) Creating a VXFS filesystem:

#mkfs -F vxfs -o bsize=8192,largefiles /dev/vx/rdsk/ABCdg/ABC01

4) Mounting the VXFS file system.

Creating and mounting filesystems go hand in hand. You must be certain that any special flags
set at creation time are reflected in /etc/vfstab, or on the command line if there is no entry in vfstab for your filesystem.

mount -F vxfs -o largefiles /dev/vx/dsk/ABCdg/ABC01 /u03/oradata/ABC

4) How do I view the total number of Disks added to VXVM ?
First Check if Veritas Volume Manager has seen the Disks
that you have attached :

#vxdisk -o alldgs list

if not, try the following, and then repeat the previous step:


#vxdctl initdmp

#vxdctl enable

This should be able to detect disks into VVM

Disk Group rootdg (default disk group for Veritas Volume Manager).
TY | Name | Assoc | Kstate | Length
dg | rootdg | rootdg | ----------- |
dm | disk01 | c2t1d0s2 | ----------- | 17678493
dm | disk02 | c2t2d0s2 | ----------- | 17678493
dm | disk03 | c2t6d0s2 | ----------- | 17678493
We have 3 VXVM disks named disk01, disk02, disk03,
They are labelled dm which represents VM disk.
The VM disks are a member of "rootdg" which is the default disk group.
The size of the disks can be determined by dividing Length by 2, which is actual KB.
5) What are Disk Groups ?
A collection of VM disks that share common configurtion like objects,
their attributes and connections.
Default disk group is rootdg.
A diskgroup name can be 31 characters long.
Diskgroups allow you to group disks in logical collections.
It can be moved as a unit from one host machine to another.
6) How do I view the List of existing Disk Groups ?
#vxdg list
To View more detail about a particular disk group :
#vxdg list (diskgroupName)
#vxdg list rootdg
7) How do I create a Disk Group ?
#vxdg init diskgroup diskname=devicename
For eg. to create a disk group name mktdg on device c1t0d0s2
#vxdg init mktdg mktdg01=c1t0d0s2
8) How do I remove a disk from the disk Group ?
#vxdg -g [groupname ] rmdisk [diskname]
For step 7 to be removed :
#vxdg -g mktdg rmdisk c1t0d0s2
9) What is a Sub-Disk ?
A VM Disks can be divided into one or more sub-disks.
The default name for VM disk is disk ## (such as disk01)
Default name for sub-disk is disk ## - ##
for eg. disk01-01 is the first sub-disk on the VMdisk named disk01.
10) What is Plex ?
You can organise sub-disks to form a plex by using below methods :
Striping (RAID - 0 )
Mirroring (RAID - 1)
Striping with Parity (RAID - 5)
11) Understaning Physical Disks in Sun o/s ?
c# Specifies the Controller
t# Specifies the Target ID
d# Specifies the Disk
s# Specifies the Partition or slice
For eg. c0t0d0s2 , is the entire hardisk connected to controller number 0 in the system,
with target ID of 0, and Physical Disk number 0.

Saturday, June 23, 2007

Vmware - Virtual OS

Vmware : Your Virtual OS which can run as many OS inside your Physical Host.
Products :
1) VMware workstation: VMware Workstation allows one physical machine to run two
or more operating systems simultaneously.
It can create .vmdk files as hard disks;
VMware Workstation also allows the testing of LiveCDs without first burning them onto
physical discs or rebooting the computer
One can also take multiple successive snapshots of an operating system running under
VMware Workstation.
Each snapshot allows you to roll back the virtual machine to the saved status at any time.
2) VMware Player: VMware Player available free of charge to run guest virtual machines
produced by other VMware products: it cannot itself create new virtual machines.

Based on answers you can create Guest OS, from the Internet.

Here are some websites that allow you to do this:

VM Builder


3) VMware Server (formerly VMware GSX Server):
VMware Server can create, edit, and play virtual machines. It uses a client-server model,
allowing remote access to virtual machines, at the cost of some graphical performance (and 3D support).
In addition to the ability to run virtual machines created by other VMware products,
it can also run virtual machines created by Microsoft Virtual PC.
Simple example of setting up RedHat to run on Windows :
Download VMware Player
Create a Guest OS from EasyVMX!
Once you create a Guest OS , open Vmware Player and point it to the .vmx file
Exploring .VMX File :
1) A hash (or pound sign, #) are used for comments. Thus, anything that starts with a # sign is ignored and considered a comment.
2) The displayName is what is used on the VMware Tab to identify the virtual machine.
This can be whatever you want to make it but I suggest something short that still uniquely
identifies the virtual machine. In this case, our virtual machine is called "WinXP".

3) The memory of the virtual machine is determined by the memsize line.

In our case, our memory is 512 because of memsize=512.

While you can set the memory to whatever size you want, it must be a multiple of 4.

4) The guestOS is one of these possible values: GUEST OS Options
5) The virtualHW.version is a required parameter.
It tells VMware what VMware version this VMX is meant for. All VMware VMX files that run on
Workstation, Player, or Server are version 4. Thus, you need virtualHW.version = "4"
6) As VMware disk drives can either be IDE or SCSI, you will see both represented in the VMX file.
The VMX doesn't tell you the size of the virtual hard drives, nor the full path.
It does tell you the name of the VMDK, VMware virtual disk file. In our case, this looks like:
ide0:0.fileName = "Windows XP Professional.vmdk"
The only 3 parameters required to make a VMX file are:
  1. virtualHW.version="4"

  2. config.version="4"

  3. guestOS="winxppro"

Other Files you Should Know :

Log files – Log files are just that- a log of virtual server activity for a single virtual server.

Here is an example of what a log file looks like:

Log files should be used only when you are having trouble with a virtual machine.

VMDK files – VMDK files are the actual hard drive for the virtual machine.

Usually you will specify that a virtual machine's disk can grow as needed.

In that case, the VMDK file will be continually growing, up to a size of 2GB. After 2GB,

subsequent VMDK files will be created.

VMEM – A VMEM file is a backup of the virtual machine's paging file.

It will only appear if the virtual machine is running, or if it has crashed.

VMSN & VMSD files – these files are used for VMware snapshots.

A VMSN file is used to store the exact state of the virtual machine when the snapshot was taken.

Using this snapshot, you can then restore your machine to the same

state as when the snapshot was taken. A VMSD file stores information about snapshots (metadata).

You'll notice that the names of these files match the names of the snapshots.

NVRAM files – these files are the BIOS for the virtual machine.

The VM must know how many hard drives it has and other common BIOS settings.

The NVRAM file is where that BIOS information is stored.

VMX files – a VMX file is the primary configuration file for a virtual machine.

When you create a new virtual machine and answer questions about the operating system,

disk sizes, and networking, those answers are stored in this file.

As you can see from the screenshot below, a VMX file is actually a simple text file

that can be edited with Notepad. Here is the "Windows XP Professional.vmx" file from the directory listing, above:

Sunday, June 10, 2007

Command Line UNIX

To check the list of Interrupts (IRQ) you are using :
$ cat /proc/interrupts (Linux)
$echo ::interrupts | mdb -k (Solaris)
Also see Procinfo, a monitoring utility that interfaces with the Linux /proc file system, and displays data such as
CPU utilization, memory utilization, interrupts serviced and information on the modules that are currently
loaded into the kernel.
$ procinfo -h (For complete list of options)
$procinfo -m (To list Modules and Device Info.)
Viewing a environment of a Linux or Solaris Process :

On Solaris hosts, you can see the environment of a process by invoking pargs with the "-e" (print the environment) option:

$ pargs -e 18167

18167:  /usr/lib/ssh/sshd envp[0]: LANG=C envp[1]: PATH=/usr/sbin:/usr/bin envp[2]: SMF_FMRI=svc:/network/ssh:default envp[3]: SMF_METHOD=/lib/svc/method/sshd start envp[4]: SMF_RESTARTER=svc:/system/svc/restarter:default envp[5]: TZ=US/Eastern 

On Linux hosts, you can cat /proc/$PID/environ, where $PID is the process id you are interested in:

$ cd /proc/self

$ cat environ

USER=mattyLOGNAME=mattyHOME=/home/mattyPATH=/usr/bin:/bin:/usr/sbin:/sbin MAIL=/var/mail/mattySHELL=/bin/bashSSH_CLIENT= 49550 22 SSH_CONNECTION= 49550 22SSH_TTY=/dev/pts/0TERM=xterm-color 

The Solaris output is a bit prettier, but they both contain the information you need to derive the environment of a process.

To view the library calls (specifically malloc and free) ,

$ ltrace /bin/Your-Command

This helps you debug application Problems in Linux.


Debugging Hung Process :

$pstack PID (Solaris)

$gstack PID (Linux)

This helps to see which stack the application is currently running.

Saturday, June 09, 2007

Resize your NTFS Partition with Knoppix

Heres what I did to resize my NTFS Partition from 35 GB to 25 GB :
> Boot with Knoppix CD(version I had 5.0.1)
Select Expert Mode, by typing expert in Boot Prompt
boot: expert
This will take 5 mins to detect your system configuration and take you to Graphical Mode
> Now open a terminal.
> su root (It will switch over to root prompt with out asking for password).
> Type qtparted &
This will open a Graphical box which lists the current partion in your system
> Select the Partition, right click and select resize
Enter your New size ( here I entered 25 GB from my current 35 GB).
Say OK and on Menu Bar Click Save.
> Type init 6, to reboot after saving the configuration
Remove the Disk
The windows system runs consistency checks and you are done !!!
Now Login to Windows and See if the changes have reflected !!!

Changing your NIC Settings from Half to Full Duplex in Linux

Setting up your Linux from Half to Full Duplex
# mii-tool --force=100baseTx-HD eth1 (half duplex 100 base T)
# mii-tool --force=100baseTx-FD eth1 (Full duplex 100 base T)
# mii-tool --force=10baseT-FD eth1 (Full duplex 10 base T)
# mii-tool --force=10baseT-HD (Half duplex 10 base T)
Thanks to Walt

Thursday, June 07, 2007

Airtel GPRS Mobile Office Connectivity on Nokia N70

Connecting to Internet with your Cell Phone (Airtel GPRS)
Here is the settings have Tried in Nokia N70
Call 121 to activate your GPRS costs Rs 199 Per Month.
Once your Gprs Settings in activated :
On My Nokia N70 , I made the following Changes :
Tools -> Settings -> Select Access Point
Connection -> Mobile Office
Data Bearer -> GPRS -> Packet Data
Access Point ->
User -> 919987******(91 Followed by your cell no.)
Password -> 0000
Authentication -> Normal
Services -> Options -> Settings -> Default Access Point -> Mobile Office.
On my system (Win2k) Settings:
Start > Settings > Network and Dial Up Connections
Click on Make new connections ( Make sure your Nokia PC suite installed For any drivers it may require)
Select: Dial up to the Internet (Connect to internet using my phone line).
Select : I want to connect my internet connection manually . or through LAN
Select : I connect through Phone Line and a Modem
Now I saw a new connection named : - Nokia N70 USB Modem (OTA)
Attach your USB to Nokia N70
Go to Start > Settings > Control Panel > Phone and Modem Options > Modems Tab
Double Click Nokia N70 USB MODEM > ADVANCED
UNDER Extra Initialisation Commands give the below settings :
Dial UP - Connection Settings for Airtel is as Follows
User - Blank
Password - Blank
Dial - *99#