Thursday, February 10, 2011
Design patterns in jdk. Nice Post.
http://www.briandupreez.net/2010/11/design-patterns-in-jdk.html
Labels:
design patterns
Thursday, February 4, 2010
Maven
UPDATE VERSION NUMBERS IN MULTI MODULE PROJECT:- mvn -e release:update-versions -DautoVersionSubmodules=true
View Super POM via effective-pom:- mvn help:effective-pom
Maven has:- Lifecycles, Phases, Plugins and Goals.
mvn deploy : deploy is a lifecycle. Which has phases verification, compilation, testing and packaging.
Executing phase or goal: mvn compile:compile jar:jar
Prepare your project to go offline: mvn dependency:go-offline
Go offline: mvn -o
Help for plugin:- mvn help:describe –D
Ex:- mvn help:describe -Dplugin=help -Dfull
Help for profiles:- mvn help:active-profiles
List hierarchy of dependencies:- mvn dependency:tree
List dependencies in alphabetic form:- mvn dependency:resolve
List plugin dependencies in alphabetic form:- mvn dependency:resolve-plugins
Analyze dependencies and list any that are unused, or undeclared.:- mvn dependency:analyze
Printing exception stack trace for a goal:- mvn -e
Output debugging info for a goal:- mvn -X
Debugging a unit test:- mvn test -Dmaven.surefire.debug
Manual Profile activation:- mvn –P YourProfile
Release using maven:- mvn release:perform
Creating archetype from project:- mvn archetype:create-from-project
View Super POM via effective-pom:- mvn help:effective-pom
Maven has:- Lifecycles, Phases, Plugins and Goals.
mvn deploy : deploy is a lifecycle. Which has phases verification, compilation, testing and packaging.
Executing phase or goal: mvn compile:compile jar:jar
Prepare your project to go offline: mvn dependency:go-offline
Go offline: mvn
Help for plugin:- mvn help:describe –D
Ex:- mvn help:describe -Dplugin=help -Dfull
Help for profiles:- mvn help:active-profiles
List hierarchy of dependencies:- mvn dependency:tree
List dependencies in alphabetic form:- mvn dependency:resolve
List plugin dependencies in alphabetic form:- mvn dependency:resolve-plugins
Analyze dependencies and list any that are unused, or undeclared.:- mvn dependency:analyze
Printing exception stack trace for a goal:- mvn
Output debugging info for a goal:- mvn
Debugging a unit test:- mvn test -Dmaven.surefire.debug
Manual Profile activation:- mvn
Release using maven:- mvn release:perform
Creating archetype from project:- mvn archetype:create-from-project
Labels:
maven
Friday, July 31, 2009
wget with basic authentication.
Here's how you download a file from internet which is secured by basic authentication. Replace myusername, mypassword with your own username and password.
wget http://download_file --http-user=myusername --http-passwd=mypassword
Wednesday, July 29, 2009
Hudson init script for Ubuntu 9.04
Hudson init script for ubuntu 9.04. This is available on hudson's website too.
http://wiki.hudson-ci.org/display/HUDSON/Installation+and+Execution
This is what worked for me. The one hudson website is for linux. This you can use as is without modifications (except for "RUN_AS") on ubuntu
http://wiki.hudson-ci.org/display/HUDSON/Installation+and+Execution
This is what worked for me. The one hudson website is for linux. This you can use as is without modifications (except for "RUN_AS") on ubuntu
#!/bin/sh
DESC="Hudson CI Server "
NAME=hudson
PIDFILE=/var/run/$NAME.pid
RUN_AS=sysadm
d_start() {
start-stop-daemon --start --quiet --background -m --pidfile $PIDFILE --chuid $RUN_AS --exec /usr/bin/java -- -Dhudson.scm.CVSSCM.skipChangeLog=true -jar /opt/hudson/hudson.war
}
d_stop() {
start-stop-daemon --stop --quiet --pidfile $PIDFILE
if [ -e $PIDFILE ]
then rm $PIDFILE
fi
}
case $1 in
start)
echo -n "Starting $DESC: $NAME "
d_start
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME "
d_stop
echo "."
;;
restart)
echo -n "Restarting $DESC: $NAME "
d_stop
sleep 1
d_start
echo "."
;;
*)
echo "usage: $NAME {start|stop|restart}"
exit 1
;;
esac
exit 0
Labels:
continuous integration,
hudson,
ubuntu
SSH without Password
I got information from this site
http://www.csua.berkeley.edu/~ranga/notes/ssh_nopass.html
SSH Without a Password
The following steps can be used to ssh from one system to another without specifying a password.
Notes:
* The system from which the ssh session is started via the ssh command is the client.
* The system that the ssh session connects to is the server.
* These steps seem to work on systems running OpenSSH.
* The steps assume that a DSA key is being used. To use a RSA key substitute 'rsa' for 'dsa'.
* The steps assume that you are using a Bourne-like shell (sh, ksh or bash)
* Some of this information came from:
http://www.der-keiler.de/Mailing-Lists/securityfocus/Secure_Shell/2002-12/0083.html
Steps:
1.
On the client run the following commands:
This should result in two files,
2.
3.
On the server run the following commands:
Depending on the version of OpenSSH the following commands may also be required:
An alternative is to create a link from authorized_keys2 to authorized_keys:
4.
On the client test the results by ssh'ing to the server:
5.
(Optional) Add the following $HOME/.ssh/config on the client:
This allows ssh access to the server without having to specify the path to the id_dsa file as an argument to ssh each time.
http://www.csua.berkeley.edu/~ranga/notes/ssh_nopass.html
SSH Without a Password
The following steps can be used to ssh from one system to another without specifying a password.
Notes:
* The system from which the ssh session is started via the ssh command is the client.
* The system that the ssh session connects to is the server.
* These steps seem to work on systems running OpenSSH.
* The steps assume that a DSA key is being used. To use a RSA key substitute 'rsa' for 'dsa'.
* The steps assume that you are using a Bourne-like shell (sh, ksh or bash)
* Some of this information came from:
http://www.der-keiler.de/Mailing-Lists/securityfocus/Secure_Shell/2002-12/0083.html
Steps:
1.
On the client run the following commands:
$ mkdir -p $HOME/.ssh
$ chmod 0700 $HOME/.ssh
$ ssh-keygen -t dsa -f $HOME/.ssh/id_dsa -P ''
This should result in two files,
$HOME/.ssh/id_dsa (private key) and
$HOME/.ssh/id_dsa.pub (public key).
2.
Copy $HOME/.ssh/id_dsa.pub to the server.
3.
On the server run the following commands:
$ cat id_dsa.pub >> $HOME/.ssh/authorized_keys2
$ chmod 0600 $HOME/.ssh/authorized_keys2
Depending on the version of OpenSSH the following commands may also be required:
$ cat id_dsa.pub >> $HOME/.ssh/authorized_keys
$ chmod 0600 $HOME/.ssh/authorized_keys
An alternative is to create a link from authorized_keys2 to authorized_keys:
$ cd $HOME/.ssh && ln -s authorized_keys2 authorized_keys
4.
On the client test the results by ssh'ing to the server:
$ ssh -i $HOME/.ssh/id_dsa server
5.
(Optional) Add the following $HOME/.ssh/config on the client:
Host server
IdentityFile ~/.ssh/id_dsa
This allows ssh access to the server without having to specify the path to the id_dsa file as an argument to ssh each time.
Labels:
ssh
HUDSON: THINGS TO REMEMBER [Skip Change Log]
While starting hudson use:
java -Dhudson.scm.CVSSCM.skipChangeLog=true -jar hudson.war
This makes sure that hudson skips computing change log. Computing change log option is
slow for one thing and caused a lot of problems while I was setting it up in our projects.
Labels:
continuous integration,
hudson
Saturday, July 11, 2009
Carnatic Music Website.
http://www.ecse.rpi.edu/Homepages/shivkuma/personal/music/index.html
Professor Shiv Kumar Kalyanaraman's carnatic music archive. Wonderful website for carnatic music.
Monday, June 29, 2009
Move sqlserver tables to dbo user
SELECT 'ALTER SCHEMA dbo TRANSFER ' + SCHEMA_NAME(schema_id) + '.' + name
FROM sys.tables
WHERE schema_id != SCHEMA_ID('dbo');
FROM sys.tables
WHERE schema_id != SCHEMA_ID('dbo');
Sunday, June 21, 2009
Starting JavaDB (Derby) in glassfish.
I was following sahoo's Blog for creating an enterprise application with ejb3.0.
http://weblogs.java.net/blog/ss141213/archive/2005/12/using_java_pers.html
Ran into problem since JavaDB isn't started automatically when glassfish starts.
Error was "Error connecting to server localhost on port 1527 with message Connection refused: connect."
Solution:
You will have to issue below command to start derby database:
GlassFishHome/bin/> asadmin start-database
Hope this helps someone having similar issues.
http://weblogs.java.net/blog/ss141213/archive/2005/12/using_java_pers.html
Ran into problem since JavaDB isn't started automatically when glassfish starts.
Error was "Error connecting to server localhost on port 1527 with message Connection refused: connect."
Solution:
You will have to issue below command to start derby database:
GlassFishHome/bin/> asadmin start-database
Hope this helps someone having similar issues.
Saturday, June 20, 2009
Samba File Sharing Ubuntu
SSH server is disabled by default in ubuntu. From package manager select & install ssh-server.
Samba File Sharing:
Setup up username & password:
smbpasswd -a
you'll be prompted to set the password.
Restart Samba service to take effect: [Just for good measure]
sudo /etc/init.d/samba restart
Samba File Sharing:
Setup up username & password:
smbpasswd -a
you'll be prompted to set the password.
Restart Samba service to take effect: [Just for good measure]
sudo /etc/init.d/samba restart
Subscribe to:
Posts (Atom)