Saturday, June 1, 2013

These steps are COPIED from this URL http://meandmyubuntulinux.blogspot.com/2012/05/installing-oracle-11g-r2-express.html all the credit goes to above user
1) Download the Oracle 11gR2 express edition installer from the link given below: http://www.oracle.com/technetwork/products/express-edition/downloads/index.html ( You will need to create a free oracle web account if you don't already have it ) 2) Unzip it :
cd ~/Downloads/INSTALL
unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
# It unzips into sub-dir called "Disk1"
3) Install the following packages :
sudo apt-get install alien libaio1 unixodbc vim
4) Convert the red-hat ( rpm ) package to Ubuntu-package :
cd ~/Downloads/INSTALL
sudo alien --scripts -d Disk1/oracle-xe-11.2.0-1.0.x86_64.rpm
#(Note: this may take a while , till that time you can go for step 5 )
5) Do the following pre-requisite things:
sudo vi /sbin/chkconfig
#(copy and paste the following into the file )

#!/bin/bash
# Oracle 11gR2 XE installer chkconfig hack for Ubuntu
file=/etc/init.d/oracle-xe
if [[ ! `tail -n1 $file | grep INIT` ]]; then
echo >> $file
echo '### BEGIN INIT INFO' >> $file
echo '# Provides: OracleXE' >> $file
echo '# Required-Start: $remote_fs $syslog' >> $file
echo '# Required-Stop: $remote_fs $syslog' >> $file
echo '# Default-Start: 2 3 4 5' >> $file
echo '# Default-Stop: 0 1 6' >> $file
echo '# Short-Description: Oracle 11g Express Edition' >> $file
echo '### END INIT INFO' >> $file
fi
update-rc.d oracle-xe defaults 80 01
5a) Save the above file and provide appropriate execute privilege :
       chmod 755 /sbin/chkconfig
5b) Set the Kernel parameters : Oracle 11gR2 XE requires to set the following additional kernel parameters:
sudo vi /etc/sysctl.d/60-oracle.conf 
#(Enter the following) 


# Oracle 11g XE kernel parameters  
fs.file-max=6815744  
net.ipv4.ip_local_port_range=9000 65000  
kernel.sem=250 32000 100 128 
kernel.shmmax=536870912 

##(Save the file) 
Note: kernel.shmmax = max possible value , e.g. size of physical RAM ( in bytes e.g. 512MB RAM == 512*1024*1024 == 536870912 bytes ) 5c) Verify the change :
sudo cat /etc/sysctl.d/60-oracle.conf 
Load new kernel parameters: 
sudo service procps start  
Verify: sudo sysctl -q fs.file-max 
       -> fs.file-max = 6815744 
5d) make some more required changes :
ln -s /usr/bin/awk /bin/awk 
mkdir /var/lock/subsys 
touch /var/lock/subsys/listener 

6) Now you are ready to install Oracle 11gR2 XE. Go to the directory where you created the ubuntu package file in Step 4 and enter following commands in terminal :
cd ~/Downloads/INSTALL
# the deb file will be created at this dir, in above steps
 sudo dpkg --install oracle-xe_11.2.0-2_amd64.deb 

6b) This isimportant step
Efore doing this make sure to close all other programs running , they may crash, if shared-meemory is being used
sudo rm -rf /dev/shm
sudo mkdir /dev/shm
sudo mount -t tmpfs shmfs -o size=2048m /dev/shm
(here size will be the size of your RAM in MBs ). The reason of doing all this is that on a Ubuntu system /dev/shm is just a link to /run/shm but Oracle requires to have a seperate /dev/shm mount point.
6c) To make the change permanent do the following : create a file named S01shm_load in /etc/rc2.d :
sudo vim /etc/rc2.d/S01shm_load
#Now copy and paste following lines into the file :

#!/bin/sh
case "$1" in
start) mkdir /var/lock/subsys 2>/dev/null
       touch /var/lock/subsys/listener
       rm /dev/shm 2>/dev/null
       mkdir /dev/shm 2>/dev/null
       mount -t tmpfs shmfs -o size=2048m /dev/shm ;;
*) echo error
   exit 1 ;;
esac 

6d) Save the file and provide execute permissions :
 sudo chmod 755 /etc/rc2.d/S01shm_load 

6e) Configuring Oracle
sudo /etc/init.d/oracle-xe configure 
Enter the following configuration information:
A valid HTTP port for the Oracle Application Express (the default is 8080)  
A valid port for the Oracle database listener (the default is 1521) 
A password for the SYS and SYSTEM administrative user accounts
Confirm password for SYS and SYSTEM administrative user accounts
Whether you want the database to start automatically when the computer starts (next reboot).
the output will be something like this
Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:y

Starting Oracle Net Listener...Done
Configuring database...Done
Starting Oracle Database 11g Express Edition instance...Done
Installation completed successfully.

7) Before you start using Oracle 11gR2 XE you have to set-up more things : a) Set-up the environmental variables : Add following lines to your .bashrc :
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH

7b) execute your .profile to load the changes:
     
          . ./.profile

8) Start the Oracle 11gR2 XE :
sudo service oracle-xe start

The output should be similar to following :
user@machine:~$ sudo service oracle-xe start
Starting Oracle Net Listener.
Starting Oracle Database 11g Express Edition instance.
user@machine:~$

8) Create your user :
SQL> create user xxxx-username identified by yyyyy-password;
User created.
SQL> grant connect,resource to xxxx-username;
Grant succeeded. 

9) Now as you have created the user , you can login to it :
SQL> select 2+2 from dual;

2+2
----------
4

Friday, April 19, 2013

extjs 4 links

BEST MVC http://www.mysamplecode.com/2012/06/extjs-check-browser-type-version.html

cd ~/.config/sublime-text-3/Packages

git clone https://github.com/jdc0589/JsFormat.git
restart ST3
Ctrl+Shift+P, then "Format:Javascript"



http://www.mysamplecode.com/2012/04/jquery-ajax-request-response-java.html

http://www.mysamplecode.com/2012/08/sencha-touch-search-field-example.html

http://www.mysamplecode.com/2012/07/linux-tips-and-tricks-beginners.html

http://www.mysamplecode.com/2012/06/extjs-button-click-example.html

http://www.mysamplecode.com/2012/06/extjs-date-manipulation-add-subtract.html

BEST for me 

Thursday, April 18, 2013

reverse proxy for jetty 9 with nginx


========jetty 9  docs =========
http://wiki.eclipse.org/Jetty_Expanded_Webapp_Deploy
http://wiki.eclipse.org/Jetty/Howto/Configure_JNDI_Datasource
http://www.eclipse.org/jetty/documentation/current/

====== set up proxy for jetty 9 ==========
from jetty side, if you want to run at a maven webapp dir, do as follows:

1) cd ~/projects-try/ccaApp
2) mvn war:inplace (run this only if java compile is needed, jsp's gets refreshed directly)
3) add jetty-web.xml with following details under WEB-INF
you can also do setup extra things like datasource, jndi etc.,
look at url jetty 9 http://www.eclipse.org/jetty/documentation/current/
4) note the context name given here should match with the one we will put in nginx proxy-pass as follows
before close of last "}", paste folowing contents
#inside server add
sudo vi /etc/nginx/sites-available/default
sudo /etc/init.d/nginx reload

location ^~ /j9090 {
     proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://localhost:9090;
    }
5) then you can start jetty by jetty.jar or using jetty-maven-plugin too
java -jar ~/programs/jetty-9.jar --port 9090  ~/projects-try/ccaApp/src/main/webapp

6) test these both url's it should work
a) using nginx http://localhost/j9090/
b) using jetty http://localhost:9090/j9090/

nginx setup and php


sudo apt-get install nginx
sudo /etc/init.d/nginx start

#install php-fpm
sudo apt-get install php5-fpm
sudo vi /etc/nginx/nginx.conf

#adjust values
worker_processes  4;
keepalive_timeout   2;

mkdir ~/www-nginx
cp /etc/nginx/sites-available/default ~/www-nginx/default.orig

#Virtual hosts are defined in server {} containers. The default #virtualhost is defined in the file /etc/nginx/sites-available/default:

sudo vi /etc/nginx/sites-available/default

========
server {
        listen   80; ## listen for ipv4; this line is default and implied
        listen   [::]:80 default ipv6only=on; ## listen for ipv6

        #root /usr/share/nginx/www;
root /home/rajesh/www-nginx;
        index index.php index.html index.htm;

        # Make site accessible from http://localhost/
        server_name _;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to index.html
                try_files $uri $uri/ /index.html;
                # Uncomment to enable naxsi on this location
                # include /etc/nginx/naxsi.rules
        }

        location /doc/ {
                alias /usr/share/doc/;
                autoindex on;
                allow 127.0.0.1;
                deny all;
        }

        # Only for nginx-naxsi : process denied requests
        #location /RequestDenied {
                # For example, return an error code
                #return 418;
        #}

        #error_page 404 /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
                root /usr/share/nginx/www;
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi_params;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        location ~ /\.ht {
                deny all;
        }
}
==========

sudo /etc/init.d/nginx reload
sudo apt-get install php5-fpm

echo "" > ~/www-nginx/info.php

#test using http://rpradeshik/info.php

Friday, March 29, 2013

Downloading and configuring jetty9

More info is available here http://www.eclipse.org/jetty/documentation/current/jetty-runner.html
http://linuxdatum.info/web-server/howto-install-php-fpm-with-nginx-on-ubuntu-12-04-lts
NgInx server install with FastCGI check  /etc/resolv.conf , /etc/hostname, /etc/hosts check for hostname in (127.0.1.1)

===Downloading and configuring jetty9==

search.maven.org for "jetty-runner"

wget -O ~/programs/lib/jetty-runner-9.0.0.v20130308.jar http://search.maven.org/remotecontent?filepath=org/eclipse/jetty/jetty-runner/9.0.0.v20130308/jetty-runner-9.0.0.v20130308.jar

rm ~/programs/jetty-9.jar
ln -s -T ~/programs/lib/jetty-runner-9.0.0.v20130308.jar ~/programs/jetty-9.jar


==in another Window RUN war from cmdLine
cd ~/projects-try
mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.0 -DgroupId=com.example -DartifactId=ccaApp -Dversion=1.0-SNAPSHOT

cd ccaApp
mvn war:inplace

java -jar ~/programs/jetty-9.jar --port 9090  ~/projects-try/ccaApp/src/main/webapp or add this to pom.xml and run as mvn -Djetty.port=9090 jetty:run ===============



    ccaApp

  
   
   
   
  org.eclipse.jetty
  jetty-maven-plugin
  9.0.0.v20130308
  
  
    10
    
      /j9090
    
  


  




test using http://http://rpradeshik:9090/
===========

Working with Sencha for ExtJs


=== download Sencha tool here http://www.sencha.com/products/sencha-cmd
stored in
Linux //samba-share/downloads/sencha/SenchaCmd-3.1.0.256-linux.run.zip
Window //samba-share/downloads/sencha/SenchaCmd-3.1.0.256-windows.exe.zip

== download ExtJs SDK from http://www.sencha.com/products/extjs/
http://www.sencha.com/products/extjs/download/ext-js-4.2.0/2142
Zip Sorted in //samba-share/downloads/sencha/extjs_420_build_2142/SenchaCmd-3.1.0.256-windows.exe.zip

==help install URL == http://stackoverflow.com/questions/14730977/build-failed-in-sencha-cmd
install ruby from http://rubyinstaller.org/
or sudo apt-get install ruby

==put in bashrc
export EXTJS_SDK=~/programs/sencha-cmd/ext-4.2.0.663
export SENCHA_HOME=$SENCHA_CMD_3.1.0.256
PATH=...$SENCHA_HOME/bin:$PATH

ll $SENCHA_HOME/sencha.cfg
echo "skip.sass=1" == $SENCHA_HOME/sencha.cfg
echo "skip.slice=1" == $SENCHA_HOME/sencha.cfg

test Sencha cmd as
==sencha

create new app as follows
cd ~/projects-try

sencha -sdk $EXTJS_SDK generate app CCAProject ~/projects-try/ccaApp

== to build app first cd to it and then build
cd ~/projects-try/ccaApp

echo "skip.sass=1" ext/cmd/sencha.cfg
echo "skip.slice=1" ext/cmd/sencha.cfg

sencha app build

Tuesday, January 1, 2013

alternate to oracle dbms output



CREATE TABLE mylog_t
  (
    "TIMESTAMP" DATE NOT NULL ENABLE,
    "LOG_TEXT" VARCHAR2(500 BYTE)
  );

  CREATE or replace PROCEDURE mylog(a_log_text       mylog_t.log_text%TYPE)
   IS
      PRAGMA AUTONOMOUS_TRANSACTION;
   BEGIN
      INSERT INTO mylog_t (timestamp,log_text)VALUES (SYSTIMESTAMP,a_log_text);
      COMMIT;
   END mylog;



shamelessly copied from http://berxblog.blogspot.com/2009/01/pipelined-function-vs-dbmsoutput.html

create or replace
function dummy
return DBMS_DEBUG_VC2COLL
PIPELINED -- NOTE the pipelined keyword
is
begin
pipe row (to_char(sysdate, 'DD-MON-YYYY HH24:MI:SS' ));
dbms_lock.sleep(15);
pipe row (to_char(sysdate, 'DD-MON-YYYY HH24:MI:SS' ));
return;
end;
/
Make sure you set the arraysize of SQL*PLUS (or whatever) small enough, otherwise you will get a bunch of results at once, not when they occure.
set arraysize 1
select * from table(dummy());
gives
COLUMN_VALUE
--------------------
20-JAN-2009 14:24:17
and after 15 sec.
20-JAN-2009 14:24:32

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"

Tuesday, September 21, 2010

linux tips

  • to mount windows share on linux (ubuntu 10.04)
  • sudo apt-get install samba smbfs (2 installs needed)
  • using smbmount


    sudo smbmount "//11.145.120.61/system" "/home/rxxxx/z-shares/chris-share" -o 'user=rxxxx,pass=15'
    //for Read with Write permission
    sudo smbmount "//11.145.161.9/Users/rxxxx" "/home/rxxxx/z-shares/vdi/raj" -o username=rxxxx,password=xxxxxxxx15,rw,uid=1000
    //make sure use "id" command to look for ur UID 
  • look for who is using port 8410

    netstat -tulpn | grep '8410'
  • look for details of process with 'jboss' in it

    ps -afew | grep jboss
  • ssh to a machine with jboss as user to machine devmachine, using ssh listening(telnet) port 8841 configured, default is 22

    ssh -P 8841 jboss@devmachine
    which prompts for password,
  • to prevent typing password (from chris machine) everytime you can copy public key to remote box as follows

    copy from local ~/.ssh/id_rsa.pub to remote machine


    using scp -P 8841 src destn
    scp -P 8841 ~/.ssh/id_rsa.pub jboss@devmachine:/home/jboss/chris_rsa.pub


    then add this key to authorized keys file in remote box as follows
    cat /home/jboss/chris_rsa.pub >> ~/.ssh/authorized_keys

  • if you do not have rsa (ssh keys) on you r local you can do as follows details about ssh
    gitosis

    ssh-keygen -t rsa

The defaults for the ssh-related commands can be altered for each account in a configuration file ~/.ssh/config (there is also a system-wide file, usually /etc/ssh/ssh_config). Each entry starts with a Host keyword.
Host *panix.com
User suominen
Compression no
Port 8841

If you want to run commands automatically when ssh login

just put this in ~/.bashrc or /etc/bash.bashrc if you want this for all users:
if [[ -n $SSH_CONNECTION ]] ; then
    echo "I'm logged in remotely"
fi

Saturday, August 14, 2010

Eclipse - Helios

Download eclipse helios version from eclipse.org
the plugins, I have installed is

  1. Helios
  2. The Eclipse Project Updates
  3. The Eclipse Web Tools Platform (WTP) software repository
  4. AJDT
  5. Mylyn for Eclipse Helios
  6. Maven plugin

    To Customize Eclipse FONT and Look and Feel use this link outside link or BEST LINK
  1. I did as follows:
    Somewhere on your home directory, create a gtkrc file (like: ~/.gtkrc-eclipse) with following content:
    style "eclipse" {
    font_name = "Sans Condensed 8"
    }
    class "GtkWidget" style "eclipse"
    Finally, to launch eclipse, use following command line:

    GTK2_RC_FILES=/usr/share/themes/Clearlooks/gtk-2.0/gtkrc:/home/rxxxxxx/.gtkrc-eclipse '/home/rxxxxxx/programs/eclipse-helios/eclipse'
  2. and launch through command line, make sure whole cmd in single line
  3. But to Customize the font size in Text editor (code region) and console etc
    it is saved under workspace, so try to stick with few same workspace always:
  4. goto windows - preferences - Appearences - colors and fonts - choose Basic text (this will apply for all)
  5. Banner Font = BOLD - 9
  6. Dialog Font = Regular - 9
  7. Header Font = Bold 10
  8. Text Editor Block Selection Font = REgular 9
  9. Text Font = Regular 9
  10. App Explorer/Outline View Font = Regular 9
  11. If you take a look in ECLIPSE_HOME/plugins/org.eclipse.platform_4.2.0.v201206081400/css, you will find the different CSS used. On Linux, if you use the GTK style (in the Preferences/Appearances), the e4_default_gtk.css is used.
    Edit this file and change the .MPartStack section :

    .MPartStack {
    font-size: 9;
    font-family: "Droid Sans";
    swt-simple: false;
    swt-mru-visible: false;
    }

    To Add Custom Builder (like my maven script to Eclipse)
  1. project->properties
  2. select builders
  3. uncheck "Maven Project Builder" let "Java Builder" be checked
  4. Create New Builder as follows:
  5. click new, and select "Program" from the list available
  6. key in "My Maven Builder" in Name
  7. inside "Main" tab for "Location" put ${project_loc}/my-mvn.sh
  8. make sure my-mvn.sh is available inside Project directory
  9. inside "Main" tab for "Working Directory" put ${project_loc}
  10. inside "Build Options" tab make sure these 3 options are checked
  11. After a Clean
  12. During Manual builds
  13. During auto Builds
  14. that's all, I see when I save a java file it compiles and pushes only edited java file
  15. But for me it runs the script twice, I have not found a way to fix this

    Maven war plugin for exploded deploy, in build/plugins pom.xml


  1. <plugin>
    <groupid>org.apache.maven.plugins</groupid>
    <artifactid>maven-war-plugin</artifactid>
    <version>2.1.1</version>
    <configuration>
    <warname>ATT</warname>
    <webappdirectory>/home/rxxxxx/programs/jboss-4.2.3.GA/server/default/deploy/myapp.war</webappdirectory>
    </configuration>
    </plugin>

Thursday, July 22, 2010

H2 Database

H2 Database is good one

  • the latest version is 1.2.139


    #!/bin/bash
    pre="-Dh2.bindAddress=0.0.0.0 -DwebAllowOthers=true" 
    postW="-web -webAllowOthers -webPort 8052" 
    postT="-tcp -tcpAllowOthers -tcpPort 8050" 
    
    echo jdbc:h2:tcp://localhost:8050/~/work/db/test
    echo  -Doracle.display.default.schema.only=false 
    
    echo 
    java -cp ~/bin/lib/h2-1.2.139.jar $pre org.h2.tools.Server $postW $postT
    
  • able to connect with Eclipse Sql Explorer
  • To enable Sql Completion in Sql Explorer do as
  • Files > Preferences > SQL Explorer. Tick the Tables and columns auto-completing assistance. Click OK and if it doesn’t work still, just restart SQL Explorer and will work.

Wednesday, July 21, 2010

Bash scripts to help with scala-console

  • alias nano 'nano EHimq' for better nano defaults in bashrc
  • mkdir ~/apps/scripts, cd  ~/apps/scripts
  • nano do-script
  • chmod u+x do-*
  • append to $Path in bashrc "~/apps/scripts"
  • run do-script to start appending the terminal to log file

  • run do-clean-log to clean the terminal log files to be cleaned

  • Custom prompt bash shell, edit /etc/bash.bashrc
    Append the code as follows
  • in ~/.bashrc file put this line at end export PS1="\\W \\$"
  • this will display prompt as "~ $ " (space is allowed anywhere, that is why double quotes :)



    # If id command returns zero, you’ve root access.
    if [ $(id -u) -eq 0 ];
    then # you are root, set red colour prompt
    PS1="\\[$(tput setaf 1)\\]\\u@\\h:\\w #\\[$(tput sgr0)\\]"
    else # normal
    PS1="[\\u@\\h:\\w] $"
    fi
    
  • to make the prompt setting permanent
    To have it set everytime you login to your workstation add above export command to your .bash_profile file or .bashrc file.


    $ cd
    $ vi .bash_profile
    OR
    $ vi .bashrc
    
    Append export line:
    export PS1="\e[0;31m[\u@\h \W]\$ \e[m"
    

    Save and close the file.

Squeryl try

Squeryl is a good ORM, it is not like anyother since the Compiled Query matches DB domain, not like Hibernate String queries.
My Steps:

cd ~/dev
git clone http://github.com/max-l/Squeryl.git