This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("TriSens"); | |
var mraa = require('mraa'); | |
console.log('MRAA Version: ' + mraa.getVersion()); | |
var tempPin = new mraa.Aio(0); | |
var lightPin = new mraa.Aio(1); | |
var soundPin = new mraa.Aio(2); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("start BiriBiriWorkerBox"); | |
// ==== config | |
var accountId = "123456789012"; | |
var cognitoRoleArn = "arn:aws:iam::123456789012:role/Cognito_WorkerBoxUnauth_DefaultRole"; | |
var cognitoIdentityPoolId = "us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; | |
var queueUrl = "https://sqs.ap-northeast-1.amazonaws.com/123456789012/workerbox"; | |
// ==== mraa | |
var mraa = require('mraa'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "VPC knowhow template", | |
"Parameters": { | |
"KeyName": { | |
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances", | |
"Type": "String", | |
"MinLength": "1", | |
"MaxLength": "64", | |
"AllowedPattern": "[-_ a-zA-Z0-9]*", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "PHP Blue-Green Deployment environment template", | |
"Parameters" : { | |
"KeyName" : { | |
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances", | |
"Type" : "String", | |
"MinLength" : "1", | |
"MaxLength" : "64", | |
"AllowedPattern" : "[-_ a-zA-Z0-9]*", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "VPC knowhow template", | |
"Parameters": { | |
"KeyName": { | |
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances", | |
"Type": "String", | |
"MinLength": "1", | |
"MaxLength": "64", | |
"AllowedPattern": "[-_ a-zA-Z0-9]*", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "fluentd template", | |
"Parameters": { | |
"KeyName": { | |
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances", | |
"Type": "String", | |
"MinLength": "1", | |
"MaxLength": "64", | |
"AllowedPattern": "[-_ a-zA-Z0-9]*", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "simple template", | |
"Parameters": { | |
"KeyName": { | |
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the web server", | |
"Type": "String", | |
"MinLength": "1", | |
"MaxLength": "64", | |
"AllowedPattern": "[-_ a-zA-Z0-9]*", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "Tungsten Replicator evaluation", | |
"Parameters" : { | |
"KeyName" : { | |
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the web server", | |
"Type" : "String" | |
}, | |
"SlaveMasterPassword" : { | |
"Description" : "Password of RDS master user", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "Multiple VPN Connection between VPCs.", | |
"Parameters" : { | |
"KeyName" : { | |
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the web server", | |
"Type" : "String" | |
}, | |
"SSHFrom": { | |
"Description": "Lockdown SSH access to the bastion host (default can be accessed from anywhere)", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
SELF_INSTANCE_ID=`curl -s http://169.254.169.254/latest/meta-data/instance-id` | |
ELB_NAME=elbfailover | |
SLEEPTIME=2 | |
while :; do | |
TIMESTAMP=`date -u +"%Y-%m-%dT%H:%M:%SZ"` | |
ELB_STATUS=`aws elb describe-instance-health --load-balancer-name $ELB_NAME` | |
HEALTHY_HOST_COUNT=`echo $ELB_STATUS | jq "[ .InstanceStates[] | select(.InstanceId != \"$SELF_INSTANCE_ID\" and .State == \"InService\") ] | length"` |