Thursday, May 12, 2011

PHP on tomcat6 in ubuntu /Linux

Came across a need where we needed to install PHP on tomcat6 on ubuntu.
After many unsuccessful attempts was able to finally get it going
Here are the steps I followed
1. install php5 on unbuntu sudo apt-get install php5
2. install tomcat on ubuntu
3. install php-cgi sudo apt-get install php5-cgi
4. install php-gd sudo apt-get insatall php5-gd

Once this is done
download the JavaBridge.jar , php-script.jar , php-servlet.jar . These are easily available on sourceforge.net .

Copy all these jars in the %tomcat%/lib folder.
change the %tomcat%/conf web.xml for the php java an php servlet ampping

-- these are the mapping for enabling the php on tomcat--
<listener>
<listener-class>php.java.servlet.ContextLoaderListener</listener-class>
</listener>

<servlet>
<servlet-name>PhpJavaServlet</servlet-name>
<servlet-class>php.java.servlet.PhpJavaServlet</servlet-class>
</servlet>

<servlet>
<servlet-name>PhpCGIServlet</servlet-name>
<servlet-class>php.java.servlet.fastcgi.FastCGIServlet</servlet-class>
<init-param>
<param-name>prefer_system_php_exec</param-name><param-value>On</param-value></init-param>
<init-param>
<param-name>php_include_java</param-name><param-value>Off</param-value></init-param>
</servlet>

<servlet-mapping>
<servlet-name>PhpJavaServlet</servlet-name>
<url-pattern>*.phpjavabridge</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>PhpCGIServlet</servlet-name>
<url-pattern>*.php</url-pattern>
</servlet-mapping>

restart your tomcat.. and this should be it...
shoot me any questions if you have any

Monday, November 22, 2010

Ubuntu 10.04

Have used ubunutu(several releases) for quite some time. Few things I had difficulty with were
1. installing sun java 1.5 with ubuntu 10.04. Since th default jdk/jre is 1.6 you will have to remove that first, then add the jaunty repositories for java in sources.lst and then refresh then try to install the jdk/jre 1.5. The key is some of your application software requires java 1.5 and having two set of java/jdk does conflict when some of the program by default uses java 1.6 during its installation and then during run time we force it to use jaav 1.5 by update-alternatives --config java.

2. VPN- This gave me quite some sleepless nights to configure, but then i found out openconnect . This has compatibility wiht cisco any connect(which is often used by lots of ppl) and is much more easier to configure than cisco client. No changes to mozilla files etc in this.





..Waiting for people to switch over to Linux...

Friday, June 11, 2010

ResultSet Max Rows

The setMaxRows method of the ResultSet specifies how many rows a ResultSet can contain at a time. If there are 1000 eligible records in DB and setMaxRows has a value 100, so only 100 records would be loaded in ResultSet.
This can be particularly useful when we wish to limit the number of rows from DB.

Result Set Fetch Size

setFetchSize() in resultSet and Statement.
Both ResultSet and Statement have the SetFetchSize method. When used in the Statement all of the ResultSets returned by that Statement will have the same fetch size.
SetFetchSize determines the amount of data blocks or rows that should be carried to the client from the server after executing a statement.

Advantanges of using setFetchSize().
I did a comparitive study aout the impact of setting the fetch size when executing a query that resulted in about 1k records.
DB: Oracle 10g
Driver: oracle thin
Java version: 5
The database server was not in the local network.
FetchSize Time in entire processing:
Default:031897ms
1031476ms
1006858ms
5005514ms

The advantage is self evident.

Tuesday, June 8, 2010

Windows Access Commands

Accessibility Controls access.cpl
Add Hardware Wizard hdwwiz.cpl
Add/Remove Programs appwiz.cpl
Administrative Tools control admintools
Automatic Updates wuaucpl.cpl
Bluetooth Transfer Wizard fsquirt
Calculator calc
Certificate Manager certmgr.msc
Character Map charmap
Check Disk Utility chkdsk
Clipboard Viewer clipbrd
Command Prompt cmd
Component Services dcomcnfg
Computer Management compmgmt.msc
Date and Time Properties timedate.cpl
DDE Shares ddeshare
Device Manager devmgmt.msc
Direct X Control Panel (If Installed)* directx.cpl
Direct X Troubleshooter dxdiag
Disk Cleanup Utility cleanmgr
Disk Defragment dfrg.msc
Disk Management diskmgmt.msc
Disk Partition Manager diskpart
Display Properties control desktop
Display Properties desk.cpl
Display Properties (w/Appearance Tab Preselected) control color
Dr. Watson System Troubleshooting Utility drwtsn32
Driver Verifier Utility verifier
Event Viewer eventvwr.msc
File Signature Verification Tool sigverif
Findfast findfast.cpl
Folders Properties control folders
Fonts control fonts
Fonts Folder fonts
Free Cell Card Game freecell
Game Controllers joy.cpl
Group Policy Editor (XP Prof) gpedit.msc
Hearts Card Game mshearts
Iexpress Wizard iexpress
Indexing Service ciadv.msc
Internet Properties inetcpl.cpl
IP Configuration (Display Connection Configuration) ipconfig /all
IP Configuration (Display DNS Cache Contents) ipconfig /displaydns
IP Configuration (Delete DNS Cache Contents) ipconfig /flushdns
IP Configuration (Release All Connections) ipconfig /release
IP Configuration (Renew All Connections) ipconfig /renew
IP Configuration (Refreshes DHCP & Re-Registers DNS) ipconfig /registerdns
IP Configuration (Display DHCP Class ID) ipconfig /showclassid
IP Configuration (Modifies DHCP Class ID) ipconfig /setclassid
Java Control Panel (If Installed) jpicpl32.cpl
Java Control Panel (If Installed) javaws
Keyboard Properties control keyboard
Local Security Settings secpol.msc
Local Users and Groups lusrmgr.msc
Logs You Out Of Windows logoff
Microsoft Chat winchat
Minesweeper Game winmine
Mouse Properties control mouse
Mouse Properties main.cpl
Network Connections control netconnections
Network Connections ncpa.cpl
Network Setup Wizard netsetup.cpl
Notepad notepad
Nview Desktop Manager (If Installed) nvtuicpl.cpl
Object Packager packager
ODBC Data Source Administrator odbccp32.cpl
On Screen Keyboard osk
Opens AC3 Filter (If Installed) ac3filter.cpl
Password Properties password.cpl
Performance Monitor perfmon.msc
Performance Monitor perfmon
Phone and Modem Options telephon.cpl
Power Configuration powercfg.cpl
Printers and Faxes control printers
Printers Folder printers
Private Character Editor eudcedit
Quicktime (If Installed) QuickTime.cpl
Regional Settings intl.cpl
Registry Editor regedit
Registry Editor regedit32
Remote Desktop mstsc
Removable Storage ntmsmgr.msc
Removable Storage Operator Requests ntmsoprq.msc
Resultant Set of Policy (XP Prof) rsop.msc
Scanners and Cameras sticpl.cpl
Scheduled Tasks control schedtasks
Security Center wscui.cpl
Services services.msc
Shared Folders fsmgmt.msc
Shuts Down Windows shutdown
Sounds and Audio mmsys.cpl
Spider Solitare Card Game spider
SQL Client Configuration cliconfg
System Configuration Editor sysedit
System Configuration Utility msconfig
System File Checker Utility (Scan Immediately) sfc /scannow
System File Checker Utility (Scan Once At Next Boot) sfc /scanonce
System File Checker Utility (Scan On Every Boot) sfc /scanboot
System File Checker Utility (Return to Default Setting) sfc /revert
System File Checker Utility (Purge File Cache) sfc /purgecache
System File Checker Utility (Set Cache Size to size x) sfc /cachesize=x
System Properties sysdm.cpl
Task Manager taskmgr
Telnet Client telnet
User Account Management nusrmgr.cpl
Utility Manager utilman
Windows Firewall firewall.cpl
Windows Magnifier magnify
Windows Management Infrastructure wmimgmt.msc
Windows System Security Tool syskey
Windows Update Launches wupdmgr
Windows XP Tour Wizard tourstart
Wordpad write

Tuesday, May 20, 2008

Garbage Collection of String literals

Tapan/Saurabh
Your thoughts on this--Does the GC handle the String literals. Since the String literals are interned,Does this mean that GC would not collect these string literals. If it does how/when?
--Ramraj

Monday, May 19, 2008

GC: JAVA 1.4

There are 3-4 algos specified by jvm 1.4 specifications. namely
reference counting
tracing
stop n copy
generational.
mark n sweep
Does JVM spec say that any of the above algo has the advantage over the other and the situations when one should be used and how do we use any one of them. Do we specify them somewhere as JAVA_OPTIONS?

--This is the first post. I'll detail about this thing later on.This post would serve as a startup for our blogs.