Thursday, June 19, 2008

CVS Installation on Ubuntu

Login to server as root.
Install CVS files:
apt-get install cvs

Install the CVS server:
apt-get install cvsd

After installing some file it will prompt (UI) for your repository name.
By default it provides 2 repos
demo
myrepos

Either you can remove these and add one new or let it be there and add new one.
Let say add '/cvsrepo'. Click the OK to close the UI.

If the folder cvsrepo does not exist, then create it.
cd /var/lib/cvsd
mkdir cvsrepo


Initialize the repository
cvs -d /var/lib/cvsd/cvsrepo init

Create a user and password to access the cvs repository (cvsrepo):
cvsd-passwd /var/lib/cvsd/cvsrepo +cvsuser
(cvsuser is the user name who is going to access the cvs repo.
It will ask password for user 'cvsuser' supply the password)
If you want to add more user follow the same..

cvsd-passwd /var/lib/cvsd/cvsrepo +newuser

Change the following

vi /var/lib/cvsd/cvsrepo/CVSROOT/config

Change "SystemAuth=no"

Just make sure the cvsrepo is added.
Open the /etc/cvsd/cvsd.conf file

vi /etc/cvsd/cvsd.conf
Go to the end of the file.
If below line is there then its fine otherwise add the following line
Repos /cvsrepo

then restart cvsd:
/etc/init.d/cvsd restart

Give the right permission to the repo:
cd /var/lib/cvsd
chown -R cvsd:cvsd cvsrepo


Test installation:
cd to some dir

cvs -d :pserver:cvsuser@localhost:/cvsrepo login

cvs -d :pserver:cvsuser@localhost:/cvsrepo checkout .

If its checking out without any error then it means all is well.
Then you can create the projects (module) in cvsrepo.

Thursday, May 29, 2008

How to insatll Java plugins in Firefox on Fedora

Case 1: If you do not have have JDK >1.5 installed then download the jre for Fedora/Redhat from here:
http://java.com/en/download/help/5000010500.xml#download
And installed jre as steps given at same page.

Let say jre has been installed at /usr/java/jre1.6.0/

Case 2: If Firefox is installed as RPM then run the command:
$ cd /usr/lib/firefox-x.x.x.x/plugins
$ ln -s /usr/java/jre1.6.0/plugin/i386/ns7/libjavaplugin_oji.so

Case 3: If you already have JDK >1.5 installed then cd to jdk location.
Lets say jdk is insatlled at:
/usr/local/jdk1.5.0_09/
$ cd /usr/lib/firefox-x.x.x.x/plugins
$ ln -s /usr/local/jdk1.5.0_09/jre/plugin/i386/ns7/libjavaplugin_oji.so


Case 4: If Firefax has been installed manually then cd to firefox
Lets say Firefox is at /usr/local/firefox
$ cd /usr/local/firefox/plugins
$ ln -s /usr/local/jdk1.5.0_09/jre/plugin/i386/ns7/libjavaplugin_oji.so

or
$ ln -s /usr/java/jre1.6.0/plugin/i386/ns7/libjavaplugin_oji.so

Restart the Firefox:)

Friday, May 23, 2008

Using Jasper reports with Postgres database

As Jasper reports has been written in Java we need JDK/JRE installed on machine.
Download jasper report from here (jasperreports-3.0.0-project.tar.gz)
http://sourceforge.net/project/showfiles.php?group_id=36382&package_id=28579

Open it at some convenient location lets say:
/usr/local
A folder will be created jasperreports-3.0.0

Here we are going to create reports from the Postgres sql so we need Java Postgres driver.
Download driver from here:
http://jdbc.postgresql.org/download.html
Select appropriate jar file, means if JDK is >1.4 <1.6 and Postgres >8.1 then
download the JDBC3 (postgresql-8.2-508.jdbc3.jar)
Place this file at /usr/local/jasperreports-3.0.0/lib folder.

There are many sample reports type availabe in the jasperreports-3.0.0/demo/samples
Let say we are interested in the Charts type of report (Bar, Pie and Line charts)

To connet to the postgres database open the ChartsApp.java file.
By defualt Jasper uses inbuilt HSQL db and below function does this:
private static Connection getConnection() throws ClassNotFoundException, SQLException
{
//Change these settings according to your local configuration
String driver = "org.hsqldb.jdbcDriver";
String connectString = "jdbc:hsqldb:hsql://localhost";
String user = "sa";
String password = "";


Class.forName(driver);
Connection conn = DriverManager.getConnection(connectString, user, password);
return conn;
}


Change it to something like this:
// for postgre sql db
private static Connection getConnection() throws ClassNotFoundException, SQLException
//Change these settings according to your local configuration

String driver = "org.postgresql.Driver";
String connectString = "jdbc:postgresql://localhost:5432/YOUR_PG_DB_NAME";
String user = "PG_USER_NAME";
String password = "PG_USER_PASSWORD";

Class.forName(driver);
Connection conn = DriverManager.getConnection(connectString, user, password);
return conn;
}


Now in any one of the jrxml file you can write your sql query depending upon the requirement.

Friday, April 25, 2008

installing webmin

If you want to manage your server then its a good idea to install a control panel application like webmin.
Its easy to install on Redhat based systems like RH, Fedora or CentOS.

Download the rpm package from here:
http://www.webmin.com/download.html

Then run the command as su
rpm -U webmin-1.410-1.noarch.rpm

To access the webmin via browser:
http://Your_IP_Address:10000/
or
http://localhost:10000/

By default webmin uses 10000 port.

May be this port is blocked by firewall on your system, to open this port just add following line in the /etc/sysconfig/iptables file
[0:0] -A INPUT -p tcp -m tcp --dport 10000 -j ACCEPT

And restart the iptables
/etc/init.d/iptables restart

Tuesday, March 11, 2008

Get Google Applications for your domain

Goolge provides many services like Gmail, Google Talk, Google Calendar, Google Docs, Google Sites
for a domain free of cost.

Here is the link, by this you can get the google mail, docs and other
services for your domain.

http://www.google.com/a/help/intl/en/admins/editions_spe.html

Select "Standard Edition" Free and follow the instructions.

At the last step it will create one text file which you have to copy in
html/htdocs/public_html folder of your domain.
Goolge will read this file and verify the domain.

Friday, March 7, 2008

Files, directories and database script comparison tool


There is one UI based tool available for Linux which can be used for Files, database script and directory comparison; its "Aqua Data Studio".
Download the Linux version from here.

It requires JDK/JRE 1.5 or above.

After downloading the tar file extract it some location and run the datastudio.sh file.

Thursday, February 21, 2008

Google Desktop on Linux

Google is providing desktop search via Goolge Desktop. Its very easy to install on Linux machine.

Download rpm from here

Run the rpm as:

$rpm -ivh google-desktop-linux-current.rpm



After installing it will take some time for indexing the local hard disk.

Monday, February 11, 2008

Editing a file on Nano Editor

Open the file with write mode

$ nano -w file_name

Modify the file
Press Ctrl+O, ENTER and Ctrl+X to Save and Exit the editor

Tuesday, February 5, 2008

Installation of CVS Server

Most of the latest Linux distro comes with cvs installed.
Only you have to make some adjustment to make it running.

Check in your machine by typing:
$which cvs

If it returns some path then its there so please skip first two steps.

1. Take the rpm version of cvs server from
http://download.fedora.redhat.com/pub/fedora/linux/core/6/i386/os/Fedora/RPMS/

2. run the command as su
( I stored downloaded rpm at /home/sanjay/)
$rpm -ivh /home/sanjay/cvs-1.11.x-x.i386.rpm

It will install cvs at /usr/bin

Alternatively cvs can be installed via yum
$ yum install cvs

3. Create cvsroot directory

$mkdir /home/sanjay/projects

4. Set environment variable CVSROOT in root's .bash_profile
$ vi .bash_profile
(in .bash_profile file add lines)
CVSROOT=/home/sanjay/projects
export CVSROOT

(After saving & exiting the file run the command
$ source .bash_profile (to make the changes permanent)

5. Initialize CVSROOT
$ cvs -d /home/sanjay/projects init

It will create one directory named CVSROOT inside /home/sanjay/projects

6. Edit /etc/xinetd.conf file

Add following entry at the last:

service cvspserver
{
socket_type = stream
protocol = tcp
wait = no
user = root
env = HOME=/home/sanjay/projects
server = /usr/bin/cvs
server_args = --allow-root=/home/sanjay/projects pserver
disable = no

}


7. restart xinetd server

$ service xinetd restart


8. Add one user/group cvs, who owns the /home/sanjay/projects directory

$ adduser cvs

9. Give ownership of /home/sanjay/projects directory to this cvs user

chown cvs:cvs /home/sanjay/projects/

10. Give right permissions to the directory
$ chmod -R 2775 /home/sanjay/projects/

11. Add exiting user to the cvs group so they can access the repository

$ usermod -G cvs vivek

(assuming vivek user is already there)

12. Adding module to repository

Create folder say moodle inside /home/sanjay/projects/
and put all the projects file there

Like :
$mkdir /home/sanjay/projects/moodle

14. moodle will become the module inside repository that we can checkout and can checkin our files.

Friday, February 1, 2008

Solunas: The hotel management system

Solunas is a Hotel Booking Engine Software written in RoR.

There are 2 separate parts of the whole application.
a) Backend: Solunas server for the admin of the property.
Its features are:
Manage your Properties / Rooms,
Manage the very flexible price system - Minimum stay / weekday match / etc

b) Frontend:A component integrated on Joomla for the end users.
Its features are:
Show availability calendars
Cart function to add multiple bookings
Checkout

Installation( Applicable on Linux, tested on Fedora 7)
I am assuming your machine has MySQL, Apache, Ruby and Rails installed.

Download the solunas from sourceforge

Extract it some where like /home/sanjay

Create one blank database on mysql.

There is one sql file solunas.sql inside solunas/db folder, dump this file against the mysql database created for solunas.

Check your ruby version:

$ rails -v

Then change the environment.rb file (inside config folder)
RAILS_GEM_VERSION = '1.1.6'

Also change the database.yml file:
development:
adapter: mysql
database: solunas
username: db_user
password: db_pass
host: localhost

Start the webrick server.

$ cd /home/sanjay/solunas
$ ruby script/server

Point your browser at:
http://localhost:3000/
Login as user 'marc' and password 'isemann'
And start managing your hotel.
:)

Whats new in Ajuby 0.5