openssl genrsa -out server.key 2048
openssl req -new -x509 -key server.key -out server.cert -days 3650 -subj /CN=www.example.com
const fs = require('fs'); | |
const axios = require('axios'); // need to npm install | |
const https = require('https'); // need to npm install | |
const uuid = require('uuid'); // need to npm install | |
// 5.1 mb file | |
let fileContent = fs.readFileSync('fp_dc_setup_guide.txt', 'utf8'); | |
console.log(`File length: ${fileContent.length} characters.\nFile Size: ${ (Buffer.byteLength(fileContent, 'utf8') / (1024*1024)) } MB`); |
var fs = require('fs'); | |
const axios = require('axios'); | |
const https = require('https'); | |
const uuid = require('uuid'); | |
// Read base64 file content | |
// 5.1 mb file | |
let fileContent = fs.readFileSync('5mb.txt', 'utf8'); |
<flow name="example_splitterFlow"> | |
<inbound-endpoint exchange-pattern="one-way" host="localhost" port="8081" doc:name="HTTP" /> | |
<set-payload value="#[['1','2','3','4']]" doc:name="Set Payload" /> | |
<collection-splitter doc:name="Collection Splitter" /> | |
<outbound-endpoint exchange-pattern="one-way" path="test" doc:name="VM" /> | |
</flow> | |
<flow name="example_splitterFlow1"> | |
<inbound-endpoint exchange-pattern="one-way" path="test" doc:name="VM" /> | |
<logger message="START #[payload]" level="INFO" doc:name="Logger" /> | |
<logger message="#[Thread.sleep(5000)]" level="INFO" doc:name="Logger" /> |
This script below allows you to compare properties files between environments.
If you maintain your application's externalised properties file in a seperate repository with a structure similar to below, you can use this to compare properties file between different environment.
compare-properties.groovy
|- src
| |- main
| | |- resources
Collected from various sources.
long startTime = System.nanoTime() | |
// write some code | |
long endTime = System.nanoTime() | |
long duration = endTime - startTime | |
println("Code executiont ime: " + duration) |
#!/bin/bash | |
# This script uploads all HTML file and uploads them in AWS s3 by including the directory structure. | |
# Ensure bucket is created via TF before adding to array below | |
envList=("mock" "dev" "test" "uat") | |
# Helper function to check if value exists in array | |
function contains() { |
def binding = [ | |
"id": "1", | |
"firstName": "John" | |
] | |
String substitute(text, map) { | |
def template = new groovy.text.StreamingTemplateEngine().createTemplate(text) | |
return template.make(map) | |
} |