Skip to content

Instantly share code, notes, and snippets.

View Slakah's full-sized avatar

James Collier Slakah

View GitHub Profile
@Slakah
Slakah / ssm-to-env.sh
Created May 14, 2018 10:20
Convert AWS SSM parameters to environment variables, used as `eval $(./ssm-to-env.sh "<ssm-path>")`
#!/bin/bash
set -uxe
# Reads the ssm path and echos out the parameters in the form
# export NAME=some-value
readonly path=$1
exec aws --region us-east-1 ssm get-parameters-by-path --no-paginate --path $path --with-decryption --query Parameters | \
jq -r 'map("\(.Name | sub("'$path'";""))=\(.Value)") | join("\n")' | \
@Slakah
Slakah / gsheets-crypto-price.js
Last active January 5, 2018 16:40
Fetch crypto prices using cryptocompare api (includes retries and caching)
// #loljavascript
var settings = {
cacheExpiresSec: 10,
extraParams: "&extraParams=your-id-here", // enter your id here
retry: {
factor: 2,
max: 5,
maxRetries: 5,
},
@Slakah
Slakah / redis-playground.sh
Created October 18, 2017 08:43
Redis Playground
#! /bin/bash
set -uxe
# Runs a redis instance, and connects via redis-cli
docker stop redis-playground || true
docker rm redis-playground || true
docker run --name redis-playground -d redis
exec docker run -it --link redis-playground:redis --rm redis redis-cli -h redis -p 6379
@Slakah
Slakah / build.sbt
Created March 31, 2015 10:22
To make gatling use the JAVA_OPTS environment variable for ssl settings, copy this into your build.sbt
// Copy JVM ssl settings to be used by gatling
val systemProps = new SystemProperties
javaOptions in Runtime ++= Seq(
mirrorProperty("javax.net.ssl.trustStore", "gatling.http.ssl.trustStore.file"),
mirrorProperty("javax.net.ssl.trustStorePassword", "gatling.http.ssl.trustStore.password"),
mirrorProperty("javax.net.ssl.keyStore", "gatling.http.ssl.keyStore.file"),
mirrorProperty("javax.net.ssl.keyStoreType", "gatling.http.ssl.keyStore.type"),
mirrorProperty("javax.net.ssl.keyStorePassword", "gatling.http.ssl.keyStore.password")
).flatten