Skip to content

Instantly share code, notes, and snippets.

View micahlmartin's full-sized avatar

Micah Martin micahlmartin

View GitHub Profile
@micahlmartin
micahlmartin / helpers.sh
Created October 20, 2023 14:58
Bash helpers
#!/bin/bash
set -eo pipefail
getSecret() {
path="$1"
vault kv get --format=json $path | jq '.data.data'
}
log_debug() {
local message="$1"
### Keybase proof
I hereby claim:
* I am micahlmartin on github.
* I am micahlmartin (https://keybase.io/micahlmartin) on keybase.
* I have a public key ASCRkVx-_BwtsLOOjlA0qZuGh3Hoppdmkxm-Fh0dDQ5oOQo
To claim this, I am signing this object:
64.242.88.10 - - [07/Mar/2004:16:05:49 -0800] "GET /twiki/bin/edit/Main/Double_bounce_sender?topicparent=Main.ConfigurationVariables HTTP/1.1" 401 12846
64.242.88.10 - - [07/Mar/2004:16:06:51 -0800] "GET /twiki/bin/rdiff/TWiki/NewUserTemplate?rev1=1.3&rev2=1.2 HTTP/1.1" 200 4523
64.242.88.10 - - [07/Mar/2004:16:10:02 -0800] "GET /mailman/listinfo/hsdivision HTTP/1.1" 200 6291
64.242.88.10 - - [07/Mar/2004:16:11:58 -0800] "GET /twiki/bin/view/TWiki/WikiSyntax HTTP/1.1" 200 7352
64.242.88.10 - - [07/Mar/2004:16:20:55 -0800] "GET /twiki/bin/view/Main/DCCAndPostFix HTTP/1.1" 200 5253
64.242.88.10 - - [07/Mar/2004:16:23:12 -0800] "GET /twiki/bin/oops/TWiki/AppendixFileSystem?template=oopsmore¶m1=1.12¶m2=1.12 HTTP/1.1" 200 11382
64.242.88.10 - - [07/Mar/2004:16:24:16 -0800] "GET /twiki/bin/view/Main/PeterThoeny HTTP/1.1" 200 4924
64.242.88.10 - - [07/Mar/2004:16:29:16 -0800] "GET /twiki/bin/edit/Main/Header_checks?topicparent=Main.ConfigurationVariables HTTP/1.1" 401 12851
64.242.88.10 - - [07/Mar/2004:16:30:29 -08
authentication:
variant_aws:
aws_access_key: ...
aws_availability_zone: b
aws_region: us-east-1
aws_secret_key: ...
variant_openstack:
os_auth_url: <openstack v3 api endpoint>
os_az: <availability zone>
os_domain_name: <domain name>
require('babel-polyfill');
// Webpack config for development
var fs = require('fs');
var path = require('path');
var webpack = require('webpack');
var assetsPath = path.resolve(__dirname, './public');
var host = (process.env.HOST || 'localhost');
var port = (process.env.PORT || 3001);
// https://github.com/halt-hammerzeit/webpack-isomorphic-tools
{
"name": "project",
"browser": {
"fs": false
},
"version": "0.1.0",
"private": true,
"dependencies": {
"babel": "^6.23.0",
"babel-cli": "^6.24.0",
Concurrency Level: 10
Time taken for tests: 33.903 seconds
Complete requests: 100
Failed requests: 0
Total transferred: 51600 bytes
HTML transferred: 36100 bytes
Requests per second: 2.95 [#/sec] (mean)
Time per request: 3390.262 [ms] (mean)
Time per request: 339.026 [ms] (mean, across all concurrent requests)
Transfer rate: 1.49 [Kbytes/sec] received
$ TF_LOG=DEBUG AWS_PROFILE=dev terraform remote config -backend=s3 -backend-config=bucket=mybucket -backend-config=key=global/vpc_mgmt.tfstate -backend-config=region=us-east-1
2016/12/14 00:10:44 [INFO] Terraform version: 0.8.0 142dd256ad48ab17b6019fe9cd18712167fcf4b4
2016/12/14 00:10:44 [INFO] CLI args: []string{"/usr/local/bin/terraform", "remote", "config", "-backend=s3", "-backend-config=bucket=mybucket", "-backend-config=key=global/vpc_mgmt.tfstate", "-backend-config=region=us-east-1"}
2016/12/14 00:10:44 [DEBUG] Detected home directory from env var: /Users/martinm8
2016/12/14 00:10:44 [DEBUG] Detected home directory from env var: /Users/martinm8
2016/12/14 00:10:44 [DEBUG] Attempting to open CLI config file: /Users/martinm8/.terraformrc
2016/12/14 00:10:44 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2016/12/14 00:10:44 [DEBUG] Detected home directory from env var: /Users/martinm8
2016/12/14 00:10:44 [WARN] Ignoring AWS metadata API endpoint at default location as it doesn't return any in
-/+ module.base.mysql_galera.aws_volume_attachment.mysql_galera_ebs_attachment.0
device_name: "/dev/sdh" => "/dev/sdh"
force_detach: "" => "<computed>"
instance_id: "i-xxx" => "${element(aws_instance.mysql_galera.*.id, count.index)}" (forces new resource)
volume_id: "vol-xxx" => "${element(aws_ebs_volume.mysql_galera_ebs_volume.*.id, count.index)}" (forces new resource)
@micahlmartin
micahlmartin / global_var.js
Created December 26, 2015 17:01
Example of global variables
var updateQuestionStatus = function (student, logInfo, test, sessionId, status, confidence, timeTaken, earned, possible) {
// Question gets scoped as a global variable because there is no 'var' statment. Therefore it will never get cleaned up
// by the garbage collector.
question = test.getSession(sessionId);
logInfo.testId = test.id;
if (question) {
question.status = status;
question.confidence = confidence;