Saturday, September 4, 2010

Install fussystrmatch package on postgresql

Step 1: Install package postgresql-contrib-8.*

You may use command sudo apt-get or may use GUI tool like Synaptic package manager.

Note * points to version like 8.3,8.4 etc

Step 2: go to directory where you will find sql files

cd usr/share/postgresql/8.*/contrib

Note * points to version like 8.3,8.4 etc

and execute following command

psql -d indiainfo -U postgres -W -f fuzzystrmatch.sql

this will create all functions like metaphone, soundex etc for you.

Hope this helps you

Regards
Rahul Teni
Cynosure Software Solution

Tuesday, June 8, 2010

Postgresql Single quotes!

Dear All,

Just wanted to share how we can incorporate single quote in postgresql plpgsql.

Say i want dynamic query like select id from emp where empname ilike 'Rahul Teni' and age > 25

name:='Rahul Teni'

query:= 'select id from emp where empname ilike' ||''''||name||''''||'and age >25'

I hope this helps and saves your lot's of time.

Friday, June 4, 2010

org.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect - oracle

Hi,

If you are getting following exception,

org.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [Oracle]!
at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:135)
at grails.web.container.EmbeddableServer$start.call(Unknown Source)
at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:287)
at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
at _GrailsRun_groovy.runInline(_GrailsRun_groovy:115)
at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
at RunApp$_run_closure1.doCall(RunApp.groovy:33)
at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:344)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:334)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.processTargets(Gant.groovy:495)
at gant.Gant.processTargets(Gant.groovy:480)

It might be becuase your hibernate dialect for database oracle is not set properly.

You need to add this line dialect='org.hibernate.dialect.Oracle10gDialect' in your database configuration file for your grail application in datasource part.

Please take a note it must be added to datasource part not hibernate part.

I hope this helps.

Regards
Rahul Teni

Tuesday, May 25, 2010

Lighttpd Installation

Steps to Lighttpd Installation

  • Edit file /etc/lighttpd/lighttpd.conf file for any configuration related changes.
  • Go to system -> Administration -> Synaptic Package Manager and select lighttpd
  • Click apply changes
  • FAST CGI Support

    Steps to FAST CGI Support

    Go to system -> Administration -> Synaptic Package Manager and select php-cgi

    sh /etc/init.d/lighttpd start

    sh /etc/init.d/lighttpd stop

    Click apply changes

    Edit file /etc/lighttpd/lighttpd.conf file to add following things.

    First add the module mod_fastcgi (lighttpd provides an interface to a external programs that support the FastCGI interface via this module). Make sure your server.modules loades mod_fastcgi:

    server.modules = (
    “mod_access”,
    “mod_accesslog”,
    “mod_fastcgi”,
    “mod_rewrite”,
    “mod_auth”
    )

    Add following lines to configuration

    fastcgi.server = ( “.php” =>

    (( “socket” => “/tmp/php-fastcgi.socket”,
    “bin-path” => “/usr/local/bin/php”,
    “bin-environment” => (
    “PHP_FCGI_CHILDREN” => “16″,
    “PHP_FCGI_MAX_REQUESTS” => “10000″
    )
    ))
    )

    Restart lighttpd server with following command

    TileCache Installation

    Steps to Tile Cache Installation

    • Sample Cache entry is as follows

    Tile cache can be accessed by link http://localhost:port/tilecache/

    Map Server version 5.4.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

    [cache]

    type=Disk

    base=/home/mapserver/fgs/tmp/tilecache/cache

    Sample WMS layer entry is as follows

    [states]

    type=WMS

    url=http://localhost:8000/cgi-bin/mapserv?map=/home/mapserver/fgs/apps/OMMS3.0/htdocs/map/india_states.map

    layers=states

    extension=png

    For above entry it is important that your map server supports WMS server to test that just go to your FGS installation directory and type command ./www/cgi-bin/mapserv -v and it should not throw any error

    Mounting Linux partitions

    Step 1.

    sudo fdisk -l

    This command will list down all devices (drives) connected to your machine

    Sample output can be as follows

    Disk /dev/sda: 20.0 GB, 20020396544 bytes

    255 heads, 63 sectors/track, 2434 cylinders

    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System

    /dev/sda1 * 1 1275 10241406 83 Linux

    /dev/sda2 1276 2434 9309667+ 5 Extended

    /dev/sda5 1276 2388 8940141 83 Linux

    /dev/sda6 2389 2434 369463+ 82 Linux swap / Solaris

    Step 2.

    Install partion creator program in ubuntu

    sudo apt-get update

    sudo apt-get install gparted gksu

    gksudo gparted

    Step 3.

    sudo mkdir /storage

    This will create a directory where partition will be mounted

    Step 4.

    ls -l /dev/disk/by-uuid

    List down uuids for all drive’s partitions.

    Sample output can be as follows

    lrwxrwxrwx 1 root root 10 2009-11-04 17:05 069427AD94279E65 -> ../../sda1

    lrwxrwxrwx 1 root root 10 2009-11-04 17:05 82b11ae0-e4c9-4e95-9518-06a337659dfb -> ../../sda5

    lrwxrwxrwx 1 root root 10 2009-11-04 17:05 EA902C94902C6971 -> ../../sda7

    Step 5.

    sudo cp /etc/fstab /etc/fstab_backup

    Take back up of original file

    sudo gedit /etc/fstab

    Edit original file and add following line to that.

    Step 6

    sudo mount -a

    Mount all partitions

    Step 7

    sudo chown -R username:usergroup /storage

    sudo chmod -R 755 /storage

    UUID=82b11ae0-e4c9-4e95-9518-06a337659dfb /storage ext3 defaults 0 0

    Pages

    About Me

    My photo
    - A competent M.S. Software Engineer and B.E. (Comp) with 6 years of rich experience in Java/ C / C++ / Oracle/PHP/Postgresql/Mysql in IT industry.
    - Resourceful in developing Applications with various platforms and different domains.
    A strategic planner with expertise in designing internal control systems towards the accomplishment of corporate business goals.
    - A keen analyst with exceptional relationship management skills and abilities in liaising with different clients.
    - Team player with excellent analytical and communications skills.
    Worked with development projects with software brands like Cognizant and Infosys
    Specialties
    - Master in struts
    - Good hands on in core Java
    - Understanding of other building blocks of Enterprise applications like middle ware technologies.
    - Knowledge of database like Oracle,postgresql,mysql