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....

Some Things

Some things once done can never be undone Some things not done can never be done Some things once said can never be unsaid Some things unsaid can never be said Some things permanent are now broken and scattered Some things temporary still remain solid and fixed Some moments will never come again...

New Developer Booklist

Welcome friend. Here’s something for you to read so that we can have some awesome arguments. The Pragmatic Programmer Design Patterns: Elements of Reusable Object-Oriented Software Refactoring: Improving the Design of Existing Code Domain-Driven Design: Tackling Complexity in the Heart of Software Working Effectively with Legacy Code Growing Object-Oriented Software, Guided by Tests Release It!: Design and Deploy Production-Ready Software Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation Building Microservices Pragmatic Thinking and Learning: Refactor Your Wetware Drift into Failure: From Hunting Broken Components to Understanding Complex Systems ...

Git revision of a single file

git --no-pager log -1 --pretty=%h <filepath> ...

Goodbye WordPress

Goodbye self-hosted WordPress. It’s been educational but I’m tired of the maintenance, security risks, and the spam. This blog was created when I was beginning to explore my options and I’ve decided that its future does not require a publishing platform. From now on this blog will be a static site, currently generated by Jekyll. I’ve migrated the posts but not the comments. If you feel the need to get in touch you can find me on Twitter....

Consumer-Driven Contract Tests

The most useful way I’ve seen such contract tests work is that the team that consumes the messages creates and publishes an artifact in their build pipeline for use by the creators of the messages. For this example let’s have it create a tarball with a shell script entry point. The inputs to the shell script can be a URL to the api-server and any other parameters required, like user IDs, oauth tokens, etc....

Building Clouds

I’ve spent this year building networks using Amazon Web Servicesand 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....

How to use rsync on OSX

I don’t really want to copy dot files (eg. .DS_Store), and I want to avoid the bug that rsync exhibits with time-capsule where it loops creating multiple ..DS_Store.xxxx files. rsync -vrW --ignore-existing --exclude ".*" --progress ~/Movies/ /Volumes/Backup/Movies/ ...

How to delete all zero length files in a directory tree

find . -type f -size 0 -print0 | xargs -0 rm -f ...

Cross-Site Scripting vulnerability with JavaScript and JQuery

Think you’ve protected your site against Cross-Site scripting attacks by escaping all the content that you’ve rendered? Thought about your javascript? Here’s a neat bug that got us today. This example is contrived to show a point. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>XSS Example</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script> $(function() { $('#users').each(function() { var select = $(this); var option = select.children('option').first(); select.after(option.text()); select.hide(); }); }); </script> </head> <body> <form method="post"> <p> <select id="users" name="users"> <option value="bad">&lt;script&gt;alert(&#x27;xss&#x27;);&lt;/script&gt;</option> </select> </p> </form> </body> </html> See the problem?...