Posts

Showing posts from March, 2013

Mounting a windows folder from a Linux Host

I use VMWare Player to run Linux VM's on a Windows Host Machine. I use the Linux VM's as a development environment. To mount a windows folder in my Linux VM I use this command. sudo mount -t vmhgfs .host:/ /home/user/shares This gives me a folder ( shares ) in my Linux host which points to the windows folders I have made available from the Host operating system ( in my case Windows 7 ).

Oracle - FIX JAVA !!!!

I have been a loyal Java Developer since 1995.... Thousands of lines of Java have flowed from my fingers. At times, my fingers just seem to "know" what next statement to write. I don't have to think about it. But, my patience has run out. Another Java Zero Day exploit has hit the "fan". Oracle, its time. Its time, to use your billions to fix Java. The future of Java is at stake and the clock is ticking....

Vaadin ThreadLocal

I use the Vaadin Thread Local pattern in my Vaadin applications as a means to move the Application object around the various components and to implement a authentication process. The structure of an application which uses this pattern is as follows: public class Vaadin Application extends Application implements HttpServletRequestListener {      private static ThreadLocal <Vaadin Application > instance = new ThreadLocal <Vaadin Application >() public Vaadin Application () {         instance . set ( this );     } @Override     public void onRequestStart ( HttpServletRequest request , HttpServletResponse response ) {         instance . set ( this );     }     @Override     public void onRequestEnd ( HttpServletRequest request , HttpServletResponse response ) {         instance . remove ();     }     public static Vaadin Application getInstance () {         return instance . get ();     } }

Auto Starting and Stopping Tomcat on Linux

Most of the time I install Apache Tomcat as a Tar file on Linux. This works well when I just want to manually start and stop Tomcat from the command line. However if you have installed Tomcat on a Amazon EC2 instance, then you its a good idea to automatically start and stop Tomcat on server starts and re-starts. So, the following steps worked for on Ubuntu 12.04. Create a start up and shutdown script for Tomcat sudo nano /etc/init.d/tomcat In the file you should enter the following commands ( except for the changes for your environment ) # Tomcat auto-start # # description: Auto-starts tomcat # processname: tomcat # pidfile: /var/run/tomcat.pid export JAVA_HOME=<this is the folder where you have Java installed> case $1 in start)         sh <this is where tomcat is installed>/startup.sh         ;; stop)         sh <this is where tomcat is installed>/shutdown.sh         ;; restart)         sh <this is where tomcat is installed>/shutd