Skip to content

Instantly share code, notes, and snippets.

// 20170303213036
// https://editions-us-east-1.s3.amazonaws.com/aws/stable/Docker.tmpl
{
"AWSTemplateFormatVersion": "2010-09-09",
"Conditions": {
"CreateLogResources": {
"Fn::Equals": [
{
"Ref": "EnableCloudWatchLogs"
# must create volumes (testvol1,cbadata in examples) with cloudstor volume plugin
# D4AWS installs in regions with EFS storage
docker volume create testvol1 --driver
docker service create --replicas 5 --name ping1 \
--mount type=volume,volume-driver=cloudstor:aws,source=testvol1,destination=/shareddata \
alpine ping docker.com
docker service create --name cbax-mysql \
--mount type=volume,volume-driver=cloudstor:aws,source=cbaxdata,destination=/var/lib/mysql \
@derrickwilliams
derrickwilliams / aws-cmds.sh
Last active March 3, 2017 21:23
ACM, LetsEncrypt, Docker fun (Hackathon Q1 2017)
#files generated by letsencrypt command
aws acm import-certificate --region us-east-2 \
--certificate file://cert.pem --private-key file://privkey.pem \
--certificate-chain file://chain.pem
beforeEach(function() {
this.addMatchers({
toBeInstanceOf: function(expectedInstance) {
var actual = this.actual;
var notText = this.isNot ? " not" : "";
this.message = function() {
return "Expected " + actual.constructor.name + notText + " is instance of " + expectedInstance.name;
};
return actual instanceof expectedInstance;
}
const express = require('express');
const app = express()
app.get('/hey', (req, res) => res.send('there'));
app.listen(5000);
{
"all": "other",
"usual": "package.json content",
...
"config": {
"ax": {
"protectedBranches": ["master", "test"],
"commands": [
"npm run lint",
"npm run test"
SELECT @raw_datetime:=now();
SELECT
@est_formatted AS 'Eastern',
@ctrl_formatted as 'Central',
DATE_FORMAT(@raw_datetime, '%a %b %e %Y @ %l:%i:%s %p') as 'UTC'
FROM (
SELECT @est_datetime:=CONVERT_TZ(@raw_datetime, 'GMT', 'US/Eastern'),
@est_formatted:=DATE_FORMAT(@est_datetime, '%a %b %e %Y @ %l:%i:%s %p'),
@ctrl_datetime:=CONVERT_TZ(@raw_datetime, 'GMT', 'US/Central'),
module.exports = {
env: {
es6: true,
node: true
},
extends: 'standard',
rules: {
indent: [2, 2, {"SwitchCase": 1}],
//overrides
{
"name": "[update name]",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build.lib": "./node_modules/.bin/babel -D -s false -d ./lib ./src/lib",
"build.lib.w": "npm run build.lib -- -w",