AWS Snippets

Install AWS CLI v2 $ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.0.30.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install AWS Documentation Generate Signed URLs with Linux Tools e.g. for accessing a website behind a CloudFront distribution using a canned policy. Write the policy file policy { "Statement": [ { "Resource": "https://xxxxxxxxxxxx.cloudfront.net/", "Condition": { "DateLessThan": { "AWS:EpochTime": 1648293147 } } } ] } Then apply the following commands[1] - you need to have OpenSSL installed. cat policy | tr -d "\n" | (1) tr -d " \t\n\r" | (2) openssl sha1 -sign private_key.pem | (3) openssl base64 -A | (4) tr -- '+=/' '-_~' (5) ...

March 1, 2018 · 2 min · 371 words · Micha Kops

Using Java Config-Builder to assemble your Application Configuration

There’s a variety of configuration frameworks to use in our Java applications. Java Config Builder is one of them and it offers some nice features that I would like to demonstrate in the following short examples as are: Loading values from different sources like property-files, environment variables, command-line-arguments or system properties, specifying default values, mapping arbitrary types or collections, merging configurations and using the Java Bean Validation standard aka JSR-303. ...

May 20, 2014 · 6 min · 1198 words · Micha Kops

Playing with Java 8 Lambda Expressions

Many articles have been written about JSR 335 aka Lambda Expressions for the JavaTM Programming Language but I like to try new things out for myself and that’s why I’d like to share my snippets here. Figure 1. Lambda Hacking using the NetBeans Developer Version Setup JDK and IDE It takes just some short steps to setup your environment … Download and install the Java 8 JDK with lambda support Download and install the NetBeans IDE Development version Configure NetBeans to use the Java 8 JDK (> Manage Platforms…) ...

September 22, 2013 · 5 min · 1012 words · Micha Kops

Aspects of Functional Programming in Java

Functional programming is a trending topic these days and a lot of Java programmers are hot for the features that modern functional programming languages might offer. Waiting for Java 8 and native closure support is a nice thing but for now we’re going to take a look at several Java frameworks that are trying to implement typical structures from those functional languages where possible using the capabilities of the Java language to emulate elements like higher-order-functions, closures, options and others … ...

July 16, 2012 · 16 min · 3233 words · Micha Kops