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

Running JavaScript Tests with Maven, Jasmine and PhantomJS

Sometimes in a project there is the need to run tests for your client-side code, written in JavaScript from a Maven build. One reason might be that Maven manages a complex build life-cycle in your project and you need a close integration for your JavaScript tests, another one might be that you’re in an environment where it is complicated to install and manage additional software like an integration- or build-server. ...

May 4, 2014 · 5 min · 938 words · Micha Kops

How to add a local lib directory to Maven

Sometimes there is a dependency not available at a remote repository and one is too lazy to set up a local maven repository – that’s when one adds a directory in the project structure and wants maven to find dependencies there. Create a directory called “lib” in the project root Add the following markup to the pom.xml inside the <repositories>-Tag (create if it does not exist): <repository> <id>lib</id> <name>lib</name> <releases> <enabled>true</enabled> <checksumPolicy>ignore</checksumPolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> <url>file://${project.basedir}/lib</url> </repository> ...

March 18, 2010 · 1 min · 206 words · Micha Kops