- Docker Machine + Docker
- curl
- A Virtualbox-driven Docker Machine called "default".
The git.io URL (https://git.io/v2MHR) is a shortened form of the raw url of the plist.
#!/usr/bin/env bash | |
# Oneliner to remove all gems. | |
# See: http://stackoverflow.com/questions/15100496/uninstalling-all-gems-ruby-2-0-0 | |
for i in `gem list --no-versions`; do gem uninstall -aIx $i; done |
{ | |
"Statement":[ | |
{ | |
"Action": "s3:ListAllMyBuckets", | |
"Effect": "Allow", | |
"Resource": "arn:aws:s3:::*" | |
}, | |
{ | |
"Action":["s3:ListBucket","s3:GetObject","s3:GetObjectVersion"], | |
"Effect":"Allow", |
The git.io URL (https://git.io/v2MHR) is a shortened form of the raw url of the plist.
#!/bin/bash | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
"myLifecycleHook": { | |
"Type": "AWS::AutoScaling::LifecycleHook", | |
"Properties": { | |
"AutoScalingGroupName": { "Ref": "myAutoScalingGroup" }, | |
"HeartbeatTimeout": 300, | |
"LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", | |
"NotificationMetadata": { "Ref": "StackName" }, | |
"NotificationTargetARN": { "Ref": "lifecycleHookTopic" }, | |
"RoleARN": { "Fn::GetAtt": [ "lifecycleHookRole", "Arn" ] } | |
} |
"myLifecycleHookTopic" : { | |
"Type" : "AWS::SNS::Topic", | |
"Properties" : { | |
"Subscription" : [ | |
{ "Endpoint" : { "Fn::GetAtt" : [ "MyLambdaLifecycleFunction", "Arn" ] }, "Protocol" : "lambda" } | |
] | |
} | |
} | |
"myLifecycleHook": { |
#!/usr/bin/env bash -e | |
# Install Codeship's JET cli tool for Docker on OSX (brew-less). | |
# https://codeship.com/documentation/docker/installation/#mac-os-x | |
# https://codeship.com/documentation/docker/release-notes/ | |
JET_VERSION=1.9.3 | |
FILE_NAME=jet-darwin_amd64_${JET_VERSION}.tar.gz | |
CHECKSUM=sha256sums |
"MyLambdaLifecycleFunction": { | |
"Type": "AWS::Lambda::Function", | |
"Properties": { | |
"Handler": "asg-graceful-lifecycle-termination.lambda_handler", | |
"Role": { "Fn::GetAtt" : ["LambdaExecutionRole", "Arn"] }, | |
"Code": { | |
"S3Bucket": "lambda-functions", | |
"S3Key": "asg-graceful-lifecycle-termination.zip" | |
}, | |
"Runtime": "python2.7", |
#!/usr/bin/env bash | |
# Return only response headers from Curl. | |
# | |
# Usage: curlHeaders http://www.someaddress.com | |
curl -k -s -D - $1 -o /dev/null |
import boto3 | |
import json | |
import logging | |
import time | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
def notify_on_error(message): |