$ echo 'this is hello world' | openssl aes-256-cbc -a -nosalt -k hello
HEQ/s/mOMof648tJxJvvwtHUTcq2j021RbgvqLA02lY=
-a means encoding the output using base64
-nosalt force openssl do encryption without salt
-k the encryption key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This template is a Cloud Formation template, that has AWS Sam seamlessly mixed in | |
# It is extremely powerful as you will see! | |
# This is a template of Lambda & RDS, publically available (so no private VPC) | |
AWSTemplateFormatVersion: 2010-09-09 | |
Transform: AWS::Serverless-2016-10-31 # This is to tell cloudformation we need to transform this template, as it has SAM! | |
Description: Severless set up with an RDS | |
######## ### ######## ### ## ## | |
## ## ## ## ## ## ## ## ### ### |
Random query recipes of JMESPath for the AWS CLI tools that I might have written or stumbled upon.
docker run -v postgres:/var/lib/postgresql/data --name postgres-test -e POSTGRES_PASSWORD=mysecretpassword -d postgres
Connect with a one-off docker container in current process:
docker run -v pgadmin4:/home/pgadmin/.pgadmin -p 5050:5050 --link postgres-test:postgres-test --rm meedan/pgadmin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//[... initialize ...] | |
final SimpleDataSourceFactory simpleDataSourceFactory = new SimpleDataSourceFactory("com.mysql.jdbc.Driver"); | |
final DataSource dataSource = simpleDataSourceFactory.createDataSource(jdbcUrl, user, pass); | |
jdbcTemplate = new JdbcTemplate(dataSource); | |
final DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(dataSource); | |
transactionTemplate = new TransactionTemplate(transactionManager); | |
transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GridInfoExtracter{ | |
private static String[] getHostNameAndPort(String hostName, int port, | |
SessionId session) { | |
String[] hostAndPort = new String[2]; | |
String errorMsg = "Failed to acquire remote webdriver node and port info. Root cause: "; | |
try { | |
HttpHost host = new HttpHost(hostName, port); | |
DefaultHttpClient client = new DefaultHttpClient(); |