Short Tech HOW-TOs

Define datasource in Tomcat

create context.xml with following content in your webapp/META-INF

<Context docBase="/MY_DATASRC privileged="true" antiResourceLocking="false" antiJARLocking="false">

<!-- HSQL DB -->
    <Resource name="jdbc/
MY_DATASRC" auth="Container"
                    type="javax.sql.DataSource" driverClassName="org.hsqldb.jdbcDriver"
                    username="sa" password="" maxActive="20" maxIdle="10"
<!-- Oracle -->
    <Resource name="jdbc/
MY_DATASRC" auth="Container"
                    type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver"
                    username="UID" password="PWD" maxActive="20" maxIdle="10"

Useful shell commands
 Strip .svn info  find . -name .svn -type d -print0 | xargs -0 rm -rf
Change directory permissions recursively  find /home/domains/*/ -type d -exec chmod 777 {} \;
 Add system user
 sudo adduser --system --home / --no-create-home --ingroup <group> --disabled-login --disabled-password <user_name>
 Run command under different user
 sudo su -m <user> -c "command"
On linux download file located on windows
smbget -w DOMAIN -u user -p password smb://host/share/folder/file.ext

Public key authentication with ssh
  • Create private and public keys: ssh-keygen -t dsa
            Accept default key location and optionally enter passphrase
  • Copy the public key  to the server cat ~/.ssh/ | ssh user@server "cat - >> ~/.ssh/authorized_keys"

JSTL 1.2 Expressions

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:web="" xmlns:xsi=""
id="your-webapp-id" version="2.5">

JSP <jsp:root xmlns:jsp=""
xmlns:form="" xmlns:spring=""
xmlns:c="" xmlns:fmt="" version="2.0">
< contentType="text/html" />


Groovy shebang
#!/usr/bin/env groovy

Convert Maven webapp to support Eclipse
mvn eclipse:eclipse -Dwtpversion=2.0
review  org.eclipse.wst.common.project.facet.core.xml 

SmartGWT with Eclipse Google Plugin

  1. Create Web Application Project
  2. Add smartgwt.jar and smartgwt-skins.jar to the project
  3. Remove "inherits" reference to from project gwt.xml
  4. Add "inherits" reference to com.smartgwt.SmartGwt and com.smartclient.theme.silverwave.SilverWave
  5. In project html file add following before main proj.nocache.js
    • <script> var isomorficDir = "<proj>/sc/"; </script>