Posts

Showing posts from November, 2012

Pretty amazing prediction

Marshall Mcluhan in 1965 !!

Proxy Apache Tomcat behind Apache2 Web Server - Amazon EC2

Image
I installed Apache Tomcat and Apache Web Server on my Amazon EC2 instance recently. On a Amazon EC2 instance you typically restrict HTTP access via port 80. Apache Tomcat default port is 8080. I had a requirement to access the Apache Tomcat management console through a HTTP connection. To achieve this you need to proxy the Apache Web Server to the Tomcat instance. The following instructions were done on a Ubuntu 12.04 instance. First enable the Apache mod_proxy module ( if not already enabled ) sudo a2enmod proxy_http To install the module you need to restart apache2 web server. sudo /etc/init.d/apache2 restart You now need to identify to Apache the sites that are available for the proxy. So, you create a file ( your choice of name ) within the sites-available folder. /etc/apache2/sites-available$ sudo nano tomcat-app_proxy The following goes in the file. <Proxy *> Order deny,allow Allow from all </Proxy> ProxyRequests Off ProxyPreserve...

Has cloud computing given programmers their final victory?

Cats and dogs will never be friends. They see the same world through a different lens. Neither is wrong, neither is right. It is same with software people and hardware people. We see the same IT landscape but have very different views. Lets face it, the battle between the soft and hard has been intense and many meetings and projects have witnessed a blistering argument when both sides have crashed together. But, has cloud computing tipped the balance towards the software side.? As a cloud developer hardware has become a programming statement. A loop can create dozens of Ubuntu instances. A if test determines if they are started, stopped or terminated. A network has become elements within array. A IP address a key in a map. Hardware has become a software abstraction, a data element and maybe a programming bug.

Amazon Desktop Images from Australia

The recent decision by Amazon to open a data centre in Sydney makes it more likely that you can create a "workable" desktop image on Amazon. My experience in the past was that the latency from Australia to external Data Centres was too high for a workable Desktop experience. By using Cloud Ping  I can see that Sydney has a latency of about 30 ms, the others are between 200 ms and a very slow 350 ms. At 30 ms you can get a reasonable experience in a desktop environment. So how do you create this image ? Good question. I have seen numerous blogs on the internet about the process. The best one I found was here .  It provides a step by step procedure for creating a desktop image on top of an image that does not contain a UI. Another approach is to use an existing image with the desktop already installed. You can find some of these here . This is not a bad approach, however remember you need to install no machine as a server ( and client ) to connect into your desktop. ...

Connecting a Vaadin SQL Container to a Combo Box

It must be me. But I spent a lot of time trying to figure out how to connect a database table implemented as a Vaadin SQL Container to a Vaadin Combo Box. It seems such a simple concept. Anyway, here was my requirement. I needed a combo box to contain a list of Australia suburbs. The user would select a suburb which would filter the results in a table on the screen. My database table was very simple. A id field ( which was the primary key ) and a name field which contained the suburb name. The code for the SQL Container was simple. TableQuery q = new TableQuery("suburb", connectionPool); suburbContainer = new SQLContainer(q); Now code to establish the combo box and links to the SQL Container.   ComboBox suburbCB = new ComboBox();  suburbCB.addItem("");  suburbCB.setCaption("Filter by Suburb");  suburbCB.setContainerDataSource(app.getDatabase().loadSuburbs());  suburbCB.setItemCaptionPropertyId("name");  suburbCB.setItemC...

Filtering a Vaadin SQL Container

My previous post concerning the Vaadin SQL Contanier covered how to create a SQL Container and a Table Query using the Vaadin SQL Container Add On. In this post I will give a very short overview on how to filter the results of a Table Query. A filter can be applied to a SQL Container so that the results of that Table Query can be narrowed to a specific set of rows within the table. For example, lets assume you have created a Table Query on an address table within your database. TableQuery q = new TableQuery("address", connectionPool); Your requirement is to filter the data within that Table Query to a specific suburb, street and postcode. To achieve that requirement you create three filters using the Compare.Equal object. The values for suburb, postcode and street are passed in as parameters. Compare.Equal suburbFilter = new Compare.Equal("suburb", suburb); Compare.Equal postcodeFilter = new Compare.Equal("postcode", postcode); Compare....

Slap, Bang, Swish, Swish

There are people who were born to run. They are like gazelles. Their feet flow evenly across the ground and their style is effortless. Then there are people like me. You can hear me coming before you see me. I have seen female runners turn in terror when I approach from behind. One woman, without even turning to look,  went straight into the bush beside the running track. I shouted, "Are you OK.?". She just looked at me and nodded sheepishly. Slap, Bang. The "slap" is the sound of my left foot striking the ground. The "bang" is the right foot chasing the left foot. My running gait is a akin to a swaying building. The right foot hits hard, bang,  then my body seems to swing slightly to the left and then my left foot hurtles towards the ground with the slapping force of a ship crashing against a wave. Swish, Swish. That is the sound of my arms as they twist in front of me.    Slap, Bang, Swish, Swish.  Slap, Bang, Swish, Swish. I know ...

Web Terminal for Amazon EC2

This is a small post about a pretty amazing tool for accessing a Amazon EC2 instance within a Corporate Environment. In many corporate environments SSH access is blocked by the corporate firewall. Typically the corporate network people establish a VPN into the Amazon echo system to allow SSH access. Another solution is to create a " web terminal " which establishes a SSH session into your Amazon EC2 instance via a HTTPS connection. As the protocol is HTTPS, the firewall does not block the traffic. Check out Gate One software for a great web terminal tool.

Vaadin SQL Container - Table Query

Sometimes I think I am the only Java programmer in Australia who uses the Java Framework called Vaadin.  For the most part my colleagues are deeply entrenched in Spring and have no time to lift their heads out of the Spring Documentation to experiment with a different type of Framework. One of the interesting features of Vaadin is its simple, but effective SQL Container Add On . It provides a simple layer on top of a database. The add on does not provide a JPA interface into the data ( this feature is supported by a different  commercial add on ) it does however provide a nice, simple object model for queries and database connections. This short blog will focus on a Table Query using the SQL Container Add On. I will create other blogs in the future describing more complex features of the Add On. The first thing you need to establish is a Connection Pool.              SimpleJDBCConnectionPool connectionPool =  ne...

A Wet Wynnum Park Run

Image
A Wet Wynnum Park Run

Its been a long week

Image

Amazon EC2 Tools access behind a Corporate Firewall

In keeping with my previous post about the excellent corporate firewall tool called Cntlm   I thought I would provide an example of how you may wish to use this tool on a Linux environment ( though it may work fine in windows ) Amazon EC2 instances   can be manipulated via a set of Java client applications called EC2 API Tools . These tools provide as much functionality as the standard Amazon Web Service Interface, however they are command line driven, hence they provide a perfect mechanism for scripting the management of your EC2 Instances. This works very well, however in a corporate world you may be behind a internet proxy, which can play havoc with your scripts. So, after you have installed the tools, you can follow these steps to get your EC2 tools running. First start up cntlm. cntlm -l 9090 -u <youruserid>@<yourdomain> -p <your password> <domain of your proxy>:<proxy port> This starts up cntlm and establi...

Problems with Java and internet proxies solved

What is it with Java and Internet Proxies proxies.? Google on the internet for Java and Proxies and you will find a staggering number of questions and discussions concerning endless frustrations with Java applications and their ability to break through an internet proxy. Sure, I have seen the usual recommendations about setting the internet proxy at the command line. I suspect they must work for some people, but they have never worked for me. I will spend endless hours tinkering with the parameters, changing the syntax, removing or replacing the dots and dashes. However the result is always the same, a silent network failure and a deep frustrated growl. But, recently I was pointed in the direction of this tool - Cntlm - Fast NTLM Authentication . I can best describe this tool as a proxy, proxy. It takes the request from your Java application and it handles the complex protocol discussion with your internet proxy. Sure, you need to point your Java applicatio...