Monday, November 13, 2006

CVS Client For Windows (WinCVS and Putty)

Overview of CVS

CVS, Concurrent Versions System, is a centralized Revision Control System (RCS). SourceForge.net provides CVS service to all hosted projects. In order to access our CVS service, you will need to install a CVS client. CVS allows developers to keep a historical record of changes made to their source code tree, and to allow multiple developers to work on a single set of files at the same time without accidentally overwriting changes made by other developers.

WinCvs Overview

WinCvs is a CVS client that runs on the Microsoft Windows platform. WinCvs is an advanced CVS client that provides an expert level of control over CVS operations.

How does WinCvs differ from other Windows-based CVS clients?

WinCvs is designed to allow for maximum power and flexibility for the advanced CVS user.
WinCvs provides access to all CVS operations from an interface that is easier to use than the command line CVS client. WinCvs is designed for interactive use and not for scripting the operations of CVS.

Getting WinCvs

You can get the setup file from

http://cvsgui.sourceforge.net/download.html

Installing WinCvs

( This is for novice user , advance user no need to read this just skip this
part )

To install WinCvs, read these instructions fully, then do the following:

1.Download the latest stable release of WinCvs.

2.Unzip the file downloaded from the CvsGui project (A compression utility such as 7-Zip is necessary to extract the setup program from the zip file downloaded with some versions of Windows).

3.Run the WinCvs installer program extracted from the downloaded file, wincvs_setup.exe.
Close all other open programs except for the WinCvs installer and then click on the 'Next' button.

4.Read the license text if you are unfamiliar with it, select the 'I accept the agreement' radio button and then click on the 'Next' button.

5.This screen displays useful information about the WinCvs applicaion. It also provides details on optional Windows components that are required for certain users. Once you have done so, click on the 'Next' button.

6.Review and alter the installation path for WinCvs if necessary. The default path is the ideal location for most users. Then, click on the 'Next' button.

7.Select the 'Full installation (recommended)' installation component pull-down and click on the 'Next' button.

8.Review and alter the Start Menu folder to be created for WinCvs as needed (the default option is recommended and shouldn't be changed for most users), and click on the 'Next' button.

9.Modify any icon and shell context menu options as desired (again, most users shouldn't have a need to modify these), and click on the 'Next' button.

10.Review the selected installation options and then click on the 'Install' button if they are correct. If not, go back and correct any incorrect settings.

11.Make sure the 'Install CVSNT' option is checked and click on the 'Finish' button.
Click on the 'Next' button.

12.Review the license agreement (the GNU GPL) and then select the 'I accept the agreement' radio button. Then, click on the 'Next' button to continue.

13.Review and alter the installation path for cvsnt if necessary. The default path is the ideal location for most users. Then, click on the 'Next' button.

14.If a warning box comes up, notifying you that the folder exists where you are trying to install cvsnt, select 'Yes', as you do want to overwrite it.

15.Select the 'Full installation' component method (this is not the default, you will have to select the option from the pull-down menu), then click on the 'Next' button.
Review and modify the Start Menu options for cvsnt (the defaults should be fine for most users), then click on the 'Next' button.

16.Make sure the 'Generate default certificate' option is checked and click on the 'Next' button.

17.Review the installation options and use the 'Back' button to fix any mistakes. Then, click on the 'Install' button.

18.Click on the 'Finish' button

19.You must restart the computer to start using WinCvs. If you wish to use it now, select the 'Yes, restart the computer now' radio button. Otherwise, select the 'No, I will restart the computer later' radio button, and restart the computer before trying to configure WinCvs.


SSH Client (Putty)

PuTTY is a great SSH client which, in its latest version (0.52 at the time of writing), supports tunnelling making it elligable for use with WinCVS.
Get the Putty setup file from

http://www.chiark.greenend.org.uk/~sgtatham/putty/

There is no installer for PuTTY. Just download the executable from the home page and double click on it.

PuTTY initially displays a dialogue that allows you to specify the parameters for the connection. You will need to tell PuTTY to use SSH -- defaults to Telnet.

putty

You also need to set up the tunnelling. Flip to the Connection->SSH->Tunnels
page and make a tunnel local tunnel on port 2401 like this:

putty_tunnel

First, click the Add button and then click the button open then you will get the login screen.Enter Username and Password. You can do anything with ssh client.But remember your localhost 2401 port is tunneled (mapped) to that remote host.

Setting WinCvs Client

Launch the WinCVS client. The first time, it will ask you the basic configuration preferences that it needs. Select login option in menu,

wincvs_login

It need CVS repository location and authentication information. The screenshot below tells you what you should enter.

wincvs_cvsroot

If you click OK button you will get the following CVS login Screen.

passwd

Enter the password, And then you can do checkout,import,export,update,commit anything...
Reference

http://www.chiark.greenend.org.uk/~sgtatham/putty/
http://cvsgui.sourceforge.net/download.html
http://ximbiot.com
http://www.apache.org/dev/cvs-on-win32.html

Saturday, November 11, 2006

Encrypting Documents using GPG

Simple steps as image.........

gpg- how to

Wednesday, July 12, 2006

Error while loading shared libraries: libpq.so.4

Today i have compiled mnogosearch in server.

#./configure --with-mysql --with-pgsql

(For mysql and pgsql support)

#make

#make install


Then i have recompiled my php with the following option....

#./configure --with-mysql=/usr/local/mysql/ --with-pgsql=/usr/local/pgsql/ --with-apxs2=/usr/local/apache/bin/apxs --with-mnogosearch=/usr/local/mnogosearch/ --with-zlib --with-config-file-path=/usr/local/lib/

#make

#make install

Still no problem....... I hand over the indexing job to developer. But Within few seconds he screaming with the error, while running the command he got ,

#/usr/local/mnogosearch/sbin/indexer -h

./indexer : error while loading shared libraries: libpq.so.4: can not open shared object file

I have searched this error in www.google/linux , i got 7 results ( great ! is it? ). But 3 results contains the word "mail" in its URL (For security purpose, proxy admin prvent the "mail" word in the url for preventing the mail). (Double great ! )

Among others 3 doesnt open.. (Superb! )

Finally i got open only one ...Which is related to Windooows ..(Excellent !)

Finally Google/linux drops me....

But i dont lost faith with google.. This time i searched this same error in google.com ( not linux)

I opened few links.. Yaiiiiiiiii I GOT THE SOLUTION.

SOLUTION :

1 way )

include the library path in /etc/ld.so.conf

2 way)

create the link for libpq.so.4 in /lib


if u type

#ldd /usr/local/mnogosearch/sbin/indexer

u will get lot of libraries with the path, u must have libpq.so.4 with proper path.

Atlast i solved the problem and hand over the job.

Now i am waiting for other Errorrrrrrrrrrrrs..............


technorati tags:, , ,

Tuesday, July 04, 2006

SuSe YAST Package management

I have suse 10.1 . i have installed limited pacakages from dvd.

The Big head ache is whenever i want to install more pacakages i have to insert my dvd. Now i got tiger balm for my head ache ;-)...

Save Locally....

I have copied suse iso in to my hard disk.

dd if=/dev/cdrom of=/backup/suse10.1.iso

(Even u can directly copy the cds or dvd files in to one directory, but we can use iso as

backup)

Then , i have mounted that into other directory,

mount -o loop -t iso9660 /backup/suse10.1.iso /backup/foo

For pacakages updation..

YAST-SoftwareManagement-Search and Select the pacakages...- Accept

Then it shows the box

" Insert Suse linux 10.1 DVD 1"

Check the show details option. it shows for dvd as

dvd:///?devices=/dev/hdc

for hard disk file

file:///backup/foo

Thats all . Now u can update packs from hard disk.

technorati tags:,

How to set CUPS password?

To run the CUPS server

/etc/init.d/cups start

To access the CUPS configuration from browser

http://localhost:631

To set the password for CUPS admin works

lppasswd -g <group> -a <user>

lppasswd -g sys -a root

technorati tags:,

Thursday, June 29, 2006

My CUPS Printer...

After a long time i took the printout from suse in my office network .

When we were using suse 9.3 it worked without any problem. But one day ...............without any specific reason we couldnt take the printouts. After a long searchhhhhhhhhhh i got the solution today. That big solution is ...i have added my username under 'lp' group ;-)...

Actually some days before i couldnt hear the sounds in my home system ( that too suse ). After a number of posts with ilugc , i found the solution and got the sound by adding 'bala' user under 'audio' group. This experience only hits my mind for printer problem.

Now i can take the printouts...

technorati tags:, , , ,

Monday, June 26, 2006

Incremental Backup using Rsync and Hard links

Introduction :

Rsync is a program that behaves in much the same way that rcp does, but has many more options and uses the rsync remote-update protocol to greatly speed up file transfers when the destination file is being updated.
The rsync remote-update protocol allows rsync to transfer just the differences between two sets of files across the network connection, using an efficient checksum-search algorithm described in the technical report that accompanies this package.
Some of the additional features of rsync are:

* support for copying links, devices, owners, groups, and permissions
* exclude and exclude-from options similar to GNU tar
* a CVS exclude mode for ignoring the same files that CVS would ignore
* can use any transparent remote shell, including ssh or rsh
* does not require root privileges
* pipelining of file transfers to minimize latency costs
* support for anonymous or authenticated rsync daemons (ideal for mirroring)

Hard Link Concepts:

Hard links are similar to symlinks. They are normally created using the ln command but without the -s switch. A hard link is when 2 file entries point to the same inode and disk blocks. Unlike symlinks there isn't a file and a symlink but rather 2 links to the same file. If you delete either entry the other will remain and will still contain the data. Here is an example of both:

------- Symbolic Link Demo -------

% echo foo > x
% ln -s x y

% ls -li
38062 -rw-r--r-- 1 kmk users 4 Jul 25 14:28 x
38066 lrwxrwxrwx 1 kmk users 1 Jul 25 14:28 y -> x

% less y
foo


% rm x
% ls -li
38066 lrwxrwxrwx 1 kmk users 1 Jul 25 14:28 y -> x

% less y
y: No such file or directory



------- Hard Link Demo -------
% echo foo > x
% ln x y

% ls -li
38062 -rw-r--r-- 1 kmk users 4 Jul 25 14:28 x
38066 lrwxrwxrwx 1 kmk users 1 Jul 25 14:28 y

% less y
foo

% rm x
% ls -li
38066 lrwxrwxrwx 1 kmk users 1 Jul 25 14:28 y

% less y
foo


Recovering files from backups:

Because rsync doesn't put the backed up files into any kind of archive this is as simple as copying a file. Just find the file you need on the backup server and copy it to where you need it to be. If you are restoring it to another server just use scp to get it there.

Rotating backups

In order to get incremental backups we will use a special feature of the cp command that will copy an entire directory tree by making hard links of each file instead of actually duplicating them. First you count up how many existing backups there are and decide if there are too many. If so delete the oldest . Then you use cp -al to duplicate the most recent backup into a new directory with the current time stamp.


Monthly incremental for Repository using Rsync and Hard links.

#source directory for backup
source=/home/docs/

#target for backup
target=/inc_bak/document/monthly

#bakup directory name assignment
bakdir=$(date +%b_monthly_bak)

#rsync between source and target
rsync -arq --delete $source $target/base

#echo "Rsync Completed Sucessfully."

#If backup dir exist remove.
if [ -d $target/$bakdir ]; then
#echo "file exist so removed."
rm -fr $target/$bakdir ;
fi;

#Create hard link for base.
cp -alfr $target/base/* $target/$bakdir/

#echo "Hard Link Completed Successfully."

Description:

rsync -arq --delete $source $target/base

-a, --archive archive mode
-r, --recursive recurse into directories
--delete delete files that don't exist on sender
-q, --quiet suppress non-error messages

cp -alfr $target/base/* $target/$bakdir/

-a archive mode
-l only copy the link
-f force
-r recursively

Reference :

Home site for Rsync: http://rsync.samba.org/

Article for Rsync with Hard link :

http://www.sanitarium.net/golug/rsync_backups.html


technorati tags:, , , ,

Friday, June 23, 2006

CVS-Concurrent Versioning System

1.Introduction:

CVS is a version control system. Using it, you can record the history of your source files.

CVS started out as a bunch of shell scripts written by Dick Grune, posted to the newsgroup
comp.sources.unix in the volume 6 release of July, 1986. While no actual code from these shell
scripts is present in the current version of CVS much of the CVS conflict resolution algorithms
come from them.

n April, 1989, Brian Berliner designed and coded CVS. Jeff Polk later helped Brian
with the design of the CVS module and vendor branch support.

You can get CVS in a variety of ways, including free download from the Internet.
For more information on downloading CVS and other CVS topics, see:

http://www.cvshome.org/


2.CVS Installation:

Now a days Most of the linux distributions bundled with CVS packages.
If you want to upgrade or install , get the source code from the internet.
untar and compile as follow,

tar -xvzf <cvspack.tar.gz>

Inside cvspack dir,

./configure
make
make install


For detailed information read the INSTALL file.


3.CVS Repository Settings:

Create the user and group as cvs.

Give write permission to /home/cvs and ownership as cvs:cvs.

login as cvs and give

$ cvs init

Add the users under cvs group.

The directory being imported must have read permission by cvs otherwise
to avoid confusion chown as cvs:cvs for whole directory.

To specify about binary files, provide binary file details under CVSROOT/cvswrappers files as follow,

*.gif -k 'b'
*.png -k 'b'
*.tgz -k 'b'
*.doc -k 'b'
*.zip -k 'b'
*.pdf -k 'b'
*.so -k 'b'
*.o -k 'b'
*.a -k 'b'
*.psd -k 'b'
*.tiff -k 'b'
*.exe -k 'b'
*.jpg -k 'b'
*.ico -k 'b'
*.bmp -k 'b'
*.png -k 'b'
*.afm -k 'b'
*.jpeg -k 'b'
*.tif -k 'b'

For Binary files

There are two issues with using CVS to store binary files. The first is that
CVS by default converts line endings between the canonical form in which they
are stored in the repository (linefeed only), and the form appropriate to the operating
system in use on the client (for example, carriage return followed by line feed for Windows NT).

The second is that a binary file might happen to contain data which looks like a keyword
(see section Keyword substitution), so keyword expansion must be turned off.
The `-kb' option available with some CVS commands insures that neither line ending
conversion nor keyword expansion will be done.

$ cvs import -I ! -W "*.o -k 'b'" <module name> <vendor tag> <reltag>

-I name
Specify file names that should be ignored during import. You can use this option repeatedly.
To avoid ignoring any files at all (even those ignored by default), specify `-I !'.

-W spec
Specify file names that should be filtered during import. You can use this option repeatedly.
spec can be a file name pattern of the same type that you can specify in the `.cvswrappers' file.

-kb Insures that neither line ending conversion nor keyword expansion will be done.


In /etc/profile in server(for client side see remote repository section)

export EDITOR=/usr/bin/emacs
export CVSROOT=/home/cvs


4.Accessing Remote Repository using pserver (Password Authentication server).

From the Server side..........

Set /etc/xinet.d/cvs as

service cvspserver
{
port =2401
socket_type = stream
protocol =tcp
wait = no
user = root
passenv =PATH
group = cvs
server = /usr/bin/cvs
server_args =-f --allow-root=/home/cvs pserver
disable = no
}

In client side in /etc/profile add the following lines,

export CVSROOT=":pserver:x.x.x.x:2401/home/cvs"
export EDITOR="/usr/sbin/emacs"


x.x.x.x - Server IP Address

5.Read-only Permission

It is possible to grant read-only repository access to people using the password-authenticated server

There are two ways to specify read-only access for a user: by inclusion, and by exclusion.
"Inclusion" means listing that user specifically in the `$CVSROOT/CVSROOT/readers' file, which is simply a newline-separated list of users. Here is a sample `readers' file:

bala
muthu
seenu

"Exclusion" means explicitly listing everyone who has write access--if the file

$CVSROOT/CVSROOT/writers

exists, then only those users listed in it have write access, and everyone else has read-only access (of course, even the read-only users still need to be listed in the CVS `passwd' file). The `writers' file has the same format as the `readers' file.

If `readers' exists, and this user is listed in it, then she gets read-only access. Or if `writers' exists, and this user is NOT listed in it, then she also gets read-only access (this is true even if `readers' exists but she is not listed there). Otherwise, she gets full read-write access.

Thats it.....you successfully set the cvs repository for ur project.


6.Getting Repository

To get the repository login and give your passwd

$cvs login

To get the files checkout the project as follows,

$cvs checkout <module>


After checkout the module (project) if you want to add the binary files,

$ cvs add -kb -m"A test file" <bin_file>
$ cvs ci -m"First checkin; contains a keyword" kotest


If a file accidentally gets added without `-kb', one can use the cvs admin command to recover. For example:

$ cvs add -m"A test file" <bin_file>
$ cvs ci -m"First checkin; contains a keyword" <bin_file>
$ cvs admin -kb <bin_file>
$ cvs update -A <bin_file>
$ cvs commit -m "make it binary" <bin_file>


7.Script for Binary files

If you import large project with lot of binary files, enjoy with the following
automated script

#!/bin/bash

#Searching binary files and put that path in to forcvs.tmp
find * -exec file {} ';'|grep -v text|grep -v directory|grep -v Entries|grep -v Repository|grep -v Root|grep -v empty |grep -v Text| awk '{print $1}'|cut -d ":" -f1 >forcvs.tmp

#Reading line by line and specifying it as binary files.
cat forcvs.tmp | while read line;

do
{
echo $line

cvs admin -kb $line
cvs update -kb $line
cvs commit -m "binary files" $line
}
done


Run the above script inside the repository.


Errors and Solutions:

Problem : Connection Refused
Solution : Due to wrong ip or port.

Problem : Failed to open /home/bala/.cvspass for reading: No such file or directory.
: Fatal error aborting,
bala :no such user
Solution : Check whether the user exist and the home directories are created.

Problem : Authorization failed.
Solution : Add the user name in writers and passwd file.

Problem : Can not make the directory.. (while checkout)
Solution : Give Permission to the directory where u want to checkout.

Problem : cvs[init aborted]: can not make directory Emptydir :permission denied
Solution : logout and login again .

Problem : Lock problem while checkout ....
Solution : After first import change the mode of the files by the users under cvs group can
able to read the files.

technorati tags:, ,

APMP-ApachePhpMysqlPostgresql Installation

1.Introduction

This post describes the installation of PostgreSQL-8.0.3 , Mysql-4.1.12 , Apache-2.0.54 and PHP 5.0.5 . from the source code distribution.

Command details to open

#tar -xvzf <tar.gz file>
#tar -xvjf <tar.bz2 file>

x -Extract
v-Verbose
z-for gnu zip file
j-for bz file
f-use archieve file

1. PostgreSQL Installation.

$ ./configure
(Note:--without-readline
Prevents use of the Readline library. This disables command-line editing and history in psql, so it is not recommended.If the configuration stop and show the readline error,
use this option.)
$ gmake
$ su
$ gmake install
$ useradd postgres
$ mkdir /usr/local/pgsql/data
$ chown postgres /usr/local/pgsql/data
$ su - postgres
$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
$ /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &
$ /usr/local/pgsql/bin/createdb test
$ /usr/local/pgsql/bin/psql test8


2.Mysql Installation.

$ groupadd mysql
$ useradd -g mysql mysql
$ gunzip < mysql-VERSION.tar.gz | tar -xvf -
$ cd mysql-VERSION
$ ./configure --prefix=/usr/local/mysql
$ make
$ make install
$ cp support-files/my-medium.cnf /etc/my.cnf
$ cd /usr/local/mysql
$ bin/mysql_install_db --user=mysql
$ chown -R root .
$ chown -R mysql var
$ chgrp -R mysql .
$ bin/mysqld_safe --user=mysql &


3.Apache Installation

$ ./configure --prefix=PREFIX --enable-module=so
$ make
$ make install
$ PREFIX/bin/apachectl start


Replace PREFIX with the filesystem path under which
Apache should be installed. A typical installation
might use "/usr/local/apache2" for PREFIX (without the
quotes).

--enable-module=so This is for accept the modules as Shared Module.


4.PHP Installation.

$./configure --with-mysql=<mysql path>
--with-pgsql=<pgsql path>
--with-apxs2=<apx path>
--with-config-file-path=/usr/local/apache2/
--with-zlib

Mostly the paths will be

mysql path=/usr/local/mysql/
pgsql path=/usr/local/pgsql/
apx path= /usr/local/apache2/bin/apxs

Note:
--with-config-file-path=/usr/local/apache2/
This is used to set the path for php.ini.(if you want to change the default location (/etc/php.ini) use this option)

$ make
$ make install

If you decide to change your configure options after installation,
you only need to repeat the last three steps. You only need to
restart apache for the new module to take effect. A recompile of
Apache is not needed.

5.Configure Apache and php.ini

Setup your php.ini file:

$ cp php.ini-dist /usr/local/lib/php.ini

You may edit your .ini file to set PHP options.

Edit your httpd.conf to load the PHP module. The path on the right hand
side of the LoadModule statement must point to the path of the PHP
module on your system. The make install from above may have already
added this for you, but be sure to check.
For PHP 4:
LoadModule php4_module libexec/libphp4.so
For PHP 5:
LoadModule php5_module libexec/libphp5.so

Tell Apache to parse certain extensions as PHP. For example,
let's have Apache parse the .php extension as PHP. You could
have any extension(s) parse as PHP by simply adding more, with
each separated by a space. We'll add .phtml to demonstrate.

AddType application/x-httpd-php .php .phtml

It's also common to setup the .phps extension to show highlighted PHP
source, this can be done with:

AddType application/x-httpd-php-source .phps


Reference :


1.http://www.apache.org

2.http://dev.mysql.com

3.http://php.net

4.http://www.postgresql.org



technorati tags:, , , ,

Wednesday, June 21, 2006

PHP-Mysql extension

I have installed suse 10 with apache and php but i forgot to install mysql.

While working with project it gives

" mysql extension not installed"

error.

So later i installed php-mysql extension using yast. It automatically puts the

lib file mysql.so under

/usr/local/lib/php5/extensions directory.

This path is already there under php.ini file.

After restarting apache , my sites are working well.



technorati tags:, ,