Skip to content

Instantly share code, notes, and snippets.

View StevenACoffman's full-sized avatar

Steve Coffman StevenACoffman

View GitHub Profile
#!/bin/bash
#This script requires an up-to-date version of the aws cli tool
profile=$1
environment=$2
region=us-east-1
service_name=com.amazonaws.$region.s3
get_env_vpc_id () {
@StevenACoffman
StevenACoffman / req-mapping.json
Created March 4, 2017 18:12 — forked from pmuellr/req-mapping.json
aws api gateway integration request mapping template for aws lambda
{
"method": "$context.httpMethod",
"resourcePath": "$context.resourcePath",
"querystring": {
#foreach($key in $input.params().querystring.keySet())
"$key": "$input.params().querystring.get($key)"#if($foreach.hasNext),#end
#end
},
"path": {
#foreach($key in $input.params().path.keySet())
@StevenACoffman
StevenACoffman / 02_demo_test_publish.sh
Created March 5, 2017 01:51 — forked from patrickbrandt/ 02_demo_test_publish.sh
Jenkins routines for AWS Lambda + API Gateway
# This is a "Managed Script" in Jenkins
COMMIT=`aws lambda get-alias --region $AWS_REGION --function-name $FUNCTION_NAME --name $PUBLISH_FROM_ALIAS | grep "Description" | cut -d'"' -f4`
VERSION=`aws lambda publish-version --region $AWS_REGION --function-name $FUNCTION_NAME --description $COMMIT | grep "Version" | cut -d'"' -f4`
aws lambda update-alias --region $AWS_REGION --function-name $FUNCTION_NAME --function-version $VERSION --name $PUBLISH_TO_ALIAS --description $COMMIT
@StevenACoffman
StevenACoffman / AWS IOT PubSub with Websockets.md
Last active March 6, 2017 18:03 — forked from stesie/index.html
AWS IoT-based serverless JS-Webapp Pub/Sub demo

AWS IoT Workflow

From Some more on AWS IoT. It’s a little difficult to simplify what’s going on, but I think this is pretty good. At the highest level, think of it this way: AWS IoT recieves messages and routes them based on rules to other AWS services

Here’s the basic workflow of AWS IoT. It’s a simplification and leaves out a number of important services, but this is the core of it. Understanding this is to understand what AWS IOT can do … and what it can do for you.

Here’s the workflow:

  • your Things send messages
  • the Device Gateway receives and authenticates the messages
  • the Rules Engine authorizes the messages and then routes them to other AWS services
@StevenACoffman
StevenACoffman / Dockerrun.aws.json
Created March 6, 2017 18:17 — forked from philipithomas/Dockerrun.aws.json
Staffjoy Elastic Beanstalk Deploy Script
{
AWSEBDockerrunVersion: "1",
Authentication: {
Bucket: "staffjoy-deploy",
Key: "docker.cfg"
},
Image: {
Name: "staffjoy/app:TAG",
Update: "true"
},
@StevenACoffman
StevenACoffman / Deploy Docker to AWS.md
Last active November 5, 2017 17:11 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk

Placeholder

@StevenACoffman
StevenACoffman / Swarm.md
Created April 2, 2017 14:22 — forked from errordeveloper/Swarm.md
A quick guide to using Weave Net with Docker Swarm

Weave Net and Docker Swarm

This example show how-to setup a very simple Swarm cluster enabled with Weave Net.

## Infratructure

There are two hosts that have a recent version of Docker Engine running.

These hosts are named host1 and host2, and might have the following in /etc/hosts or you just substitute IP addresses in the commands shown below.

- What do Etcd, Consul, and Zookeeper do?
- Service Registration:
- Host, port number, and sometimes authentication credentials, protocols, versions
numbers, and/or environment details.
- Service Discovery:
- Ability for client application to query the central registry to learn of service location.
- Consistent and durable general-purpose K/V store across distributed system.
- Some solutions support this better than others.
- Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
- Centralized locking can be based on this K/V store.
@StevenACoffman
StevenACoffman / kafka_install.md
Created May 8, 2017 15:42 — forked from leommoore/kafka_install.md
Kafka - Messaging Basics

#Kafka - Messaging Basics This assumes you are starting fresh and have no existing Kafka or ZooKeeper data. See http://kafka.apache.org/documentation.html#quickstart for more details.

##Install Java

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
  • I do not want to do my best
    • I will not do it -> I can concentrate -> I get better progress -> I can go home -> I do not have to work hard tomorrow -> Great victory
  • In order not to do it all
    • Have the computer work hard. Humans do not work hard.
  • How to make your computer do its best
    • Record
    • Review
    • Test
    • Release
  • Division of roles