Skip to content

Instantly share code, notes, and snippets.

@suthariy
suthariy / reinvent-2017-youtube.md
Created June 14, 2018 18:37 — forked from stevenringo/reinvent-2017-youtube.md
Links to YouTube recordings of AWS re:Invent 2017 sessions

| Title | Description

@suthariy
suthariy / paramiko_example.py
Created January 6, 2018 09:18 — forked from batok/paramiko_example.py
Paramiko example using private key
import paramiko
k = paramiko.RSAKey.from_private_key_file("/Users/whatever/Downloads/mykey.pem")
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
print "connecting"
c.connect( hostname = "www.acme.com", username = "ubuntu", pkey = k )
print "connected"
commands = [ "/home/ubuntu/firstscript.sh", "/home/ubuntu/secondscript.sh" ]
for command in commands:
print "Executing {}".format( command )
@suthariy
suthariy / 01.config
Created August 18, 2017 01:09 — forked from etiennea/01.config
AWS Elastic Beanstalk node.js configuration for quick deployments
packages:
yum:
git: []
gcc: []
make: []
openssl-devel: []
ImageMagick: []
option_settings:
- option_name: NODE_ENV
@suthariy
suthariy / 01.config
Created August 18, 2017 01:09 — forked from etiennea/01.config
AWS Elastic Beanstalk node.js configuration for quick deployments
packages:
yum:
git: []
gcc: []
make: []
openssl-devel: []
ImageMagick: []
option_settings:
- option_name: NODE_ENV
@suthariy
suthariy / snsToSlack.js
Created June 29, 2017 16:06 — forked from terranware/snsToSlack.js
AWS Lambda function to Slack Channel hookup
var https = require('https');
var util = require('util');
exports.handler = function(event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var postData = {
"channel": "#aws-sns",
"username": "AWS SNS via Lamda :: DevQa Cloud",
@suthariy
suthariy / 02_demo_test_publish.sh
Created June 22, 2017 07:45 — 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
@suthariy
suthariy / nginxproxy.md
Created March 24, 2017 12:05 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@suthariy
suthariy / ROBOMONGO-MONGDB-REMOTE-CONNECTION.MD
Last active March 16, 2017 03:03 — forked from piraveen/ROBOMONGO-MONGDB-REMOTE-CONNECTION.MD
Setting up RoboMongo to connect with remote MongoDB server (VM, External Server)
@suthariy
suthariy / .ebextensions--eb.config
Created December 20, 2016 05:34 — forked from adamalex/.ebextensions--eb.config
Config and CI script for automated Node.js 0.10.10 project deployment—including grunt—to Elastic Beanstalk
packages:
yum:
git: []
gcc: []
make: []
openssl-devel: []
commands:
00-add-home-variable:
command: sed -i 's/function error_exit/export HOME=\/root\n\nfunction error_exit/' /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh
container_commands: