Thursday, March 31, 2011

Setting up CVS in fedora 12

1. install cvs using: "yum -y install cvs"
2. execute "cvs -d ~/cvsRepo init" to build a new cvs repository at ~/cvsRepo. This will build a CVSROOT structure inside it.
3. create a new group in your OS. Call it as "cvs". Add your user to this group.
4. reboot the machine so that group changes can take effect.
5. change group owner for ~/cvsRepo by using: chgrp -R cvs ~/cvsRepo/
6. chmod ug+rwx . CVSROOT

You may have noticed that the chgrp and chmod commands in that example gave write access to a user named anonymous, which is not what one would expect. The reason is that even anonymous, read-only repository users need system-level write access, so that their CVS processes can create temporary lockfiles inside the repository.

Before running through the steps needed to set up the password server, let's examine how such connections work in the abstract. When a remote CVS client uses the :pserver: method to connect to a repository, the client is actually contacting a specific port number on the server machine - specifically, port number 2401 (which is 49 squared, if you like that sort of thing). Port 2401 is the designated default port for the CVS pserver, although one could arrange for a different port to be used as long as both client and server agree on it.

The CVS server is not actually waiting for connections at that port - the server won't get started up until a connection actually arrives. Instead, the Unix inetd (InterNET Daemon) program is listening on that port, and needs to know that when it receives a connection request there, it should start up the CVS server and connect it to the incoming client.

This is accomplished by modifying inetd's configuration files: /etc/services and /etc/inetd.conf. The services file maps raw port numbers to service names and then inetd.conf tells inetd what to do for a given service name.

7. First, put a line like this into /etc/services (after checking to make sure it isn't already there):
cvspserver 2401/tcp

8. Then in /etc/inetd.conf, put this:
cvspserver stream tcp nowait root /usr/local/bin/cvs cvs \
--allow-root=/usr/local/newrepos pserver

9. reboot the machine

10. That's enough to permit connections, but you'll also want to set up special CVS passwords - separate from the users' regular login passwords - so people can access the repository without compromising overall system security. The CVS password file is CVSROOT/passwd in the repository. The format is as simple as it looks. Each line is:
::

11. create a new pearl file with .pl extension (e.g. genEncPass.pl) and paste the following in it:
#!/usr/bin/perl

srand (time());
my $randletter = "(int (rand (26)) + (int (rand (1) + .5) % 2 ? 65 : 97))";
my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);
my $plaintext = shift;
my $crypttext = crypt ($plaintext, $salt);

print "${crypttext}\n";

12. chmod +x genEncPass.pl
./genEncPass.pl 1234
lsL5OOjG22QRk

13. create the following entry in CVSROOT/passwd
swapnil:lsL5OOjG22QRk

14. defining $CVSROOT varaible.
export CVSROOT=~/cvsRepo/

15. Import existing project Temp in repository
cvs import -m "initial import into CVS" Temp swapnil start
:pserver:jrandom@floss.red-bean.com:/usr/local/newrepos

Thursday, March 3, 2011

Setting and using Apache Tomcat/5.0.28 in windows

1. Install the tomcat in windows by selecting port 8090. Do not change any location.
2. Start the tomcat server. If it gets started, no problem. Otherwise check the log in C:\Program Files\Apache Software Foundation\Tomcat 5.0\logs
If you find
[2009-01-16 11:22:19] [1343 prunsrv.c] [debug] Procrun log initialized
[2009-01-16 11:22:19] [info] Procrun (2.0.4.0) started
[2009-01-16 11:22:19] [info] Running Service...
[2009-01-16 11:22:19] [1166 prunsrv.c] [debug] Inside ServiceMain...
[2009-01-16 11:22:19] [info] Starting service...
... [error] The specified module could not be found.
[2009-01-16 11:22:19] [994 prunsrv.c] [error] Failed creating java
C:\Program Files\Java\jre1.6.0_07\bin\client\jvm.dll
[2009-01-16 11:22:19] [1269 prunsrv.c] [error] ServiceStart returned 1
[2009-01-16 11:22:19] [info] Run service finished.
[2009-01-16 11:22:19] [info] Procrun finished.
[2009-01-16 11:24:41] [1343 prunsrv.c] [debug] Procrun log initialized
[2009-01-16 11:24:41] [info] Procrun (2.0.4.0) started
[2009-01-16 11:24:41] [info] Debugging Service...
[2009-01-16 11:24:41] [1166 prunsrv.c] [debug] Inside ServiceMain...
[2009-01-16 11:24:41] [info] Starting service...
...[174 javajni.c] [error] The specified module could not be found.


Then follow steps from 3 to  6.

3. Copy msvcr71.dll from java’s bin directory to tomcat’s bin folder.
4. Add java’s bin directory to windows %path% environment variable.
5. Copy msvcr71.dll from java’s bin directory to windows\system32 folder.
6. Make sure your tomcat’s pointing to correct jvm.dll folder.
7. set the classpath using
set CLASSPATH="C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\jsp-api.jar";"C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.jar"

8. Restart the server. Put a JSP file in C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\ROOT
9. access the file through browser using http://localhost:8090/file.jsp
10. If you get error like:
Unable to find a javac compiler;com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

follow the remaining steps
11. Copy tools.jar from into your TOMCAT_HOME/common/lib folder.

Android aar deployment in Maven - 2022

Introduction If you are working on android library project, you might be wondering how to publish it on Maven like this . Earl...