Convert PEM to JKS

SSL/TLS in Java is a pain in the behind. Not only is the setup verbose, but the format for certificates and keys is unique. Nginx/Apache/Go/etc seem to be happy using certifiates and keys encoded as PEM files, but Java has its own special KeyStores, with the JKS format being the default. There are a number of questions on forums, and custom recipes that involve openssl, to convert PEM certificates and keys into formats that can be imported into a Java keystore....

Building Clouds

I’ve spent this year building networks using Amazon Web Services and teaching people how to do it. So I’d like to share the code that I’ve used as teaching examples and as seeds for the creation of some pretty cool environments. AWS PY was my first published attempt at interacting with AWS in python & Puppet to instantiate, provision and control EC2 instances, as well as the seed for an incredibly cool project at the start of this year....

Default HTML-escape using Freemarker

Most java developers have at least heard of Freemarker. FreeMarker is a “template engine”; a generic tool to generate text output (anything from HTML to autogenerated source code) based on templates. It’s a Java package, a class library for Java programmers. It’s not an application for end-users in itself, but something that programmers can embed into their products. It is the “generic” nature of Freemarker that trips up java web developers....

Provision EC2 instance using boto

Sam Newman recently published a very interesting blog entry on using fabric to apply puppet scripts on remote machines. He left the provision_using_boto() method as an exercise to the reader. That just sounded tempting enough to be a challenge since I hadn't gotten around to looking at boto. You can find the result of my attempt on GitHub. To be precise aws.py implements the provisioning using boto and fabfile.py drives fabric and puppet....

Kramdown and Webby

A number of the sites that I manage for fun are simply static web pages. The dynamic nature is handled by javascript classes and plugins. This means that I really don’t need or want an application server to serve these sites, but I do want to still use some of the practices that I apply to web application development. Enter webby - it works by combining the contents of a page with a layout to produce HTML....

AWS CloudFront invalidation

It is now possible to invalidate objects (files) in AWS CloudFront distributions. Handy when someone, like me, occasionally publishes files with the wrong content type. Here is how I implement this invalidation in python....

Spring-StringTemplate is now in Maven Central

For Ivy: <dependency org="com.tomczarniecki" name="spring-stringtemplate" rev="1.5.1" /> For Maven (yeech): <dependency> <groupId>com.tomczarniecki</groupId> <artifactId>spring-stringtemplate</artifactId> <version>1.5.1</version> </dependency> Thank you Sonatype....

S3DropBox is now on GitHub

I've released a new version of my S3DropBox on GitHub. I've moved the project to GitHub so that I can have all my current active projects in one place. Check it out in its new home at https://github.com/tomcz/s3dropbox. This release uses the AWS java libraries. They are finally good enough for me to stop creating my own wheels and vulcanising my own rubber. As a bonus the S3DropBox creates URLs in virtual hosted format (eg....

Update to S3DropBox

Another update to my S3DropBox. Due to popular demand (ahem) I've added a progress bar to track uploads and downloads. You now have something pretty to watch rather than a screenful of dots. Any other requests?...

StringTemplate views for Spring

StringTemplate is a great templating engine. It's powerful, simple and quite opinionated. I've come really appreciate its simple purpose: render data. No assignment, no arbitrary method invocation. It is not Turing-complete and it would make a lousy rules engine. SiteMesh is a web-page layout and decoration framework that is my current "golden hammer" when I need to provide a consistent layout across a java web-application. It seems to fit with the way that I think about web pages a whole lot more than something like Tiles - I really prefer decoration over composition as a means of layout control....