Saturday 29 August 2009

Apache Tomcat 5.5 Installation on Mac OS-X Leopard 10.5.x


I needed to get Apache Tomcat 5.5 running on my Mac to experiment with Orbeon.

This was the most helpful information that I found, but I needed some extra steps.

1. Download Apache Tomcat 5.5 from here. Use the zip file since, for some reason, the README says that the tar shipped with OS-X is no good.

2. Move the downloaded zip file to where you want to unpack it. I choose my home directory which is /Users/phil

3. Open it and it should expand into a directory like /Users/phil/apache-tomcat-5.5.28

4. Browse to /Users/phil/apache-tomcat-5.5.28/bin

5. Open startup.sh with TextEdit.app

6. Add the following lines to the file after the EXECUTABLE line:
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home
export CATALINA_HOME=/Users/phil/apache-tomcat-5.5.28

You will need to use the location where you placed the tomcat directory rather than mine.

7. I had to do three more things at this point to make all the shell (.sh) file executable.
1. Open Terminal.app
2. cd /Users/phil/apache-tomcat-5.5.28/bin
3. chmod u+x *.sh

8. Start tomcat this way:
./startup

I had another problem at this point. I already had an eXist server running on port 8080. eXist is included in Orbeon as well.

To change the port I needed to open /Users/phil/apache-tomcat-5.5.28/conf/server.xml and edit the line containing
Connector port="8080" maxHttpHeaderSize="8192
I changed the 8080 to 8180. You can choose almost any other port if that suits you situation better.

I still couldn't get tomcat to run. I found that it was already running so I had to kill it and then restart it.

I used the following command in Terminal to locate the program:
ps | grep tomcat
This generated the following lines. Ignore the 'grep tomcat' one and note the number of the second line - the 838 in my case.
3821 ttys000 0:00.00 grep tomcat
838 ttys007 0:10.71 /System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin/java -Djava.util.logging.config.file=/Users/phil/apache-tomcat-5.5.28/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/Users/phil/apache-tomcat-5.5.28/common/endorsed -classpath /Users/phil/apache-tomcat-5.5.28/bin/bootstrap.jar -Dcatalina.base=/Users/phil/apache-tomcat-5.5.28 -Dcatalina.home=/Users/phil/apache-tomcat-5.5.28 -Djava.io.tmpdir=/Users/phil/apache-tomcat-5.5.28/temp org.apache.catalina.startup.Bootstrap start
Now I had to kill the server with this command:
kill 838
Now I could restart tomcat and see the default home page.

I then pointed my browser to http://localhost:8180 and the default page was displayed.

Wednesday 12 August 2009

QR Codes







You may have noticed that I have added a QR code for mobile phones. It doesn't do much, other than allow your QR-enabled mobile phone to open this blog.



What is a QR Code?





I'll quote from Google's Chart API page:

QR Codes are a popular type of two-dimensional barcode, which are also known as hardlinks or physical world hyperlinks. QR Codes store text, which can be a URL, contact information, telephone number, even whole verses of poems!

QR codes can be read by any device that has the appropriate software installed. Such devices range from dedicated QR code readers to mobile phones.

QR code is trademarked by Denso Wave, Inc. As you'd expect, the Denso Wave website includes a lot of useful information about QR codes.

So, anyone can turn almost any smallish textual content into a QR code.

Making Them

You can make you own QR codes easily with this online tool.

Google also provides a handy services to create your own. You can add the URL to any web page as an image like I did on this blog.

Here are some more examples

A link to a web page:

http://chart.apis.google.com/chart?cht=qr&chs=350x350&chl=http%3A%2F%2Fphilatwarrimoo.blogspot.com%2F


















Send an email to Bill:

http://chart.apis.google.com/chart?cht=qr&chs=350x350&chl=mailto%3Abillyg@microsoft.com


















Phone Bill:

http://chart.apis.google.com/chart?cht=qr&chs=350x350&chl=tel+611555123456



















Add Bill's contact details:

http://chart.apis.google.com/chart?cht=qr&chs=350x350&chl=MECARD%3AN%3ABilly+G%3BORG%3AMicrosoft%3BTEL%3A%2B611555123456%3BURL%3Awww.closedsource.com%3BEMAIL%3Abillyg%40microsoft.com%3BADR%3A1+Wayto+Dr.%3BADR%3A1+Wayto+Dr.+Meekrae+ZE%3BNOTE%3AOnly+phone+on+Tuesdays%3B%3B




















And don't forget Bill's birthday:

http://chart.apis.google.com/chart?cht=qr&chs=350x350&chl=BEGIN%3AVEVENT%0D%0ASUMMARY%3ABill's+Birthday%0D%0ADTSTART%3A20090930%0D%0ADTEND%3A20090930%0D%0AEND%3AVEVENT%0D%0A

Go here for other formats.

Monday 10 August 2009

Energy Consumption of a new Washing Machine

About 6 months ago we bought a new front-loading washing machine. It is an Electrolux EWF1282.

I have been measuring its power consumption for over a month and today I looked at the results.

I collected data over 43 days.
It used 1.7 kWh. This is about 30Wh per day.

A friend has suggested that this figure looks too good so I will measure it again. The cold-wash cycle has been tested to consume about 300Wh per wash for a 8kg load so a figure of 30Wh seems too good to be true.

It uses less than 70L/wash (varies depending on load). We wash, on average, at least one load per day in cold water.

The machine has run for nearly 48 hours over this 43 day period which means that it averages about 35.5W when it is running.

We think that the clothes wash just as well as our old top-loader and we hope that it is gentler on the clothes. Buy the amount of lint in the filter so far, this is probably right.

So the washing machine uses less energy when running than an Apple MacBook Pro 15"; 3 times as much as our Netgear DG834GV ADSL router; and about as much as our 2 kitchen compact fluros.

Our old washing machine consumed 240 Wh/day running at about 250W on average.
The old machine also used about 140L/wash.

So the new machine is much better: half the water consumption, and 12.5% of the energy consumption compared to the old one.