Wednesday, November 28, 2012

git and eclipse

Git ref 
to import a project into git from say CVS
cd ~/projects/camscapa-project/
mkdir CAMS2
cp -R ../cams2-project/CAMS2/* CAMS2
cd CAMS2

mvn clean

for d in `find -type d -name 'CVS'`; do rm -rf $d; done
for d in `find -type d -name '.settings'`; do rm -rf $d; done
for d in `find -type f -name '.project'`; do rm -rf $d; done

git init
git add .
git commit -a -m 'all commit first time'
cd ..
git clone --bare ./CAMS2 ~/z-git-repos/CAMS2.git
mv CAMS2 CAMS2_after_init
git clone git://rpradeshik/CAMS2.git
cd CAMS2
pwd

# add gitigone with target classes etc.,

git add .
git commit -m 'ingone file' .
git push

To import in eclipse

  1. Open "Git Perspective", do "Add existing local repo"  and choose "~/projects/camscapa-project/CAMS2" 
  2. RClick on CAMS2 node and select "Import Projects"
  3. in 3 radio options choose "Import as general Project", then "CAMS2", finish
  4. This should bring CAMS2 as project into workspace, goto java perspective
  5. to import single modules inside CAMS2 say "cams-dri" RClick and do maven import
  6. Make sure maven 304 is in eclipse installation


Wednesday, October 24, 2012

Maven and Linux Tips

java and C++ interface easily http://code.google.com/p/javacpp/
benchmark ref http://benchmarksgame.alioth.debian.org/
Standard Deviation http://www.mathsisfun.com/data/standard-deviation.html

Oracle trace settings ====

SQL> ALTER system SET EVENTS ’1652 TRACE NAME ERRORSTACK LEVEL 3′;
It will write to the alert.log
Tue Jul 21 11:04:45 2009
Errors in file /u01/admin/TESTDB/udump/testdb_ora_17682588.trc:
ORA-1652: unable to extend temp segment by 128 in tablespace TEMP

jar classifier and Profile usage, nice one

http://www.linuxtutorialblog.com/post/tutorial-conditions-in-bash-scripting-if-statements


To update version of maven for portal project
Manually update express/portal/pom.xml

mvn versions:update-child-modules -DgenerateBackupPoms=false
OR
mvn versions:set -DnewVersion=1.3-SNAPSHOT
mvn versions:commit

Wednesday, September 12, 2012

JBoss 7 re-deployment


The reason using these manual steps is war:inplace makes a mess if there are war overlays
In Jboss standalone.xml make sure you disable scanning for exploded deploys

Make sure you install inotify-tools (in ubuntu) test for exec as inotifywait
in war maven pom.xml have for exploded as
To deploy un-zipped run command as "mvn war:exploded"
To force reload of app in jboss make a touch as "touch $JBOSS_HOME/standalone/deployments/test-ui.war.dodeploy"
To Make a inotify cron rsync do as follows, have a shell script as

Sunday, July 29, 2012

sbt, g8 getting started


giter8 is ~= maven archetypes
https://github.com/n8han/giter8/

to install conscript do this
>>curl https://raw.github.com/n8han/conscript/master/setup.sh
it pus cs in ~/bin

some help:
http://scala.micronauticsresearch.com/sbt/useful-sbt-commands
scala example https://github.com/padcom/spring-example

append with EMPTY new line another sbt plugin common for user machine as
~/.sbt/plugins/plugins.sbt
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0-RC1")


run as follows to create a sample project
g8 chrislewis/basic-project
(say you create testApp)

to create eclipse files
cd testApp
sbt eclipse (this create eclipse files, use Indigo to open project) !





Tuesday, June 26, 2012

Some linux utils

for i in `find -iname '*.jar'` ; do jar tvf $i | grep javax/xml/bind/util/JAXBResult.class && echo $i ; done;


java com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck


To find files modified within 2 time range

touch -t 201112220000 start
touch -t 201112240000 stop
find . -newer start \! -newer stop
#to exclude with grep
find . -type f -newer start \! -newer stop | grep -v -e 'CVS' -e '.settings' -e 'target' -e '.classpath' -e '.project'
http://unix.stackexchange.com/questions/29245/how-to-list-files-that-were-changed-in-a-certain-range-of-time
To Remove extra spaces in file :)
for f in `find $dd -type f -iname *.jsp`; do sed -i 's/[ \t]*$/ /' $f; done

Tuesday, October 26, 2010

GIT and GitWeb Install


  • hope you already have apache2 installed and its conf are in
    /etc/apache2/
    copied from

  • Install Git packages as needed
    $ sudo apt-get install it git-core gitk gitweb
    if your apache www directory is pointing to ~/www
    $ cd ~/www/
    $ mkdir gitweb
    $ cd gitweb
    

  • copying gitwebfiles to local www
    $ cp /usr/share/gitweb/* ~/www/gitweb
    check the index.cgi has the cgi code in it
    

  • add gitweb directory to apache2 configuration by creating a “gitweb” file inside apache conf.d directory:
    $ nano /etc/apache/conf.d/gitweb
    Alias /gitweb /home/roger/www/gitweb
    
      Options FollowSymLinks +ExecCGI
      AddHandler cgi-script .cgi
    
    

  • $ nano /etc/gitweb.conf
    # path to git projects (.git)
    $projectroot = "/home/roger/z-git-repos";
    
    # directory to use for temp files
    $git_temp = "/tmp";
    
    # target of the home link on top of all pages
    #$home_link = $my_uri || "/";
    
    # html text to include at home page
    $home_text = "indextext.html";
    
    # file with project list; by default, simply scan the projectroot dir.
    $projects_list = $projectroot;
    ##$projects_list = "/home/git/projects.list";
    
    # stylesheet to use
    $stylesheet = "/gitweb/gitweb.css";
    
    # logo to use
    $logo = "/gitweb/git-logo.png";
    
    # the 'favicon'
    $favicon = "/gitweb/git-favicon.png";
    

  • restart apache2 web server:

    $ sudo /etc/init.d/apache2 restart
    
    Now you should be able to view gitweb listing all GIT projects under /home/roger/z-git-repos/
    http://localhost/gitweb


  • Your repo can be your shared local directory
    or you can have git-daemon running on local and pointing to /home/roger/z-git-repos/ as repo-root
    $git daemon --reuseaddr --base-path=/home/roger/z-git-repos --export-all --verbose --enable=receive-pack
    

  • Now steps to put a local project on this git-repo:
    say you have project which is Not in git (like bare local file system) as ~/projects-try/test-project
    with files in it like src/blah
    cd test-project
    test-project $ 
    test-project $ git init
    Initialized empty Git repository in /home/roger/projects-try/test-project/.git/
    test-project $ git add .
    test-project $ git commit -a -m 'Initial repo creation'
    test-project $ cd ..
    ## where ~/z-git-repos/ is repo' server's root dir , like www of apache :)
    projects-try $ git clone --bare ./test-project ~/z-git-repos/test-project.git
    Initialized empty Git repository in /home/roger/z-git-repos/test-project.git/
    projects-try $ cd ~/z-git-repos/test-project.git
    test-project.git $ git --bare update-server-info
    test-project.git $ mv hooks/post-update.sample hooks/post-update
    test-project.git $ chmod a+x hooks/post-update
    test-project.git $ touch git-daemon-export-ok
    test-project.git $ git config core.sharedRepository group
    test-project.git $ 
    
    ## then rename local ~/projects-try/test-project as ~/projects-try/test-project-junk
    then checkout the master, so that we continue the server's repo  as master
    cd ~/projects-try
    mv test-project test-project-junk
    git clone git://roger/test-project.git
    

  • now you have master's copy from repo's server which is shared by other users
    and you work on it as that is the master trunk
    now you can trash out the "test-project-junk"