Skip to content

Instantly share code, notes, and snippets.

View doapp-ryanp's full-sized avatar

Ryan Pendergast doapp-ryanp

View GitHub Profile
@doapp-ryanp
doapp-ryanp / cloudformation.yml
Created May 16, 2018 13:05
How to get around BinaryMediaTypes CloudFormation bug
ApiGatewayLambdaProxy:
Type : AWS::ApiGateway::RestApi
Properties :
Name : !Ref AWS::StackName
Description: "Single Lambda proxy"
# BinaryMediaTypes: - this is broken in CloudFormation on create
# - "application/protobuf"
Parameters:
endpointConfigurationTypes: EDGE
Body :
@doapp-ryanp
doapp-ryanp / index.js
Created October 17, 2017 21:28
Image resize Lambda for APIG proxy
'use strict';
const im = require('imagemagick');
const fs = require('fs');
const https = require('https');
const http = require('http');
const url = require('url');
const querystring = require('querystring');
const resize = (srcPath, width, callback) => {
@doapp-ryanp
doapp-ryanp / reproduce.md
Last active April 24, 2017 15:41
16.04 AMIs that don't support ENA
@doapp-ryanp
doapp-ryanp / index.html
Created April 20, 2017 16:34
hello world
<!doctype html><html lang=en><head><meta charset=utf-8><title>rynop.com</title></head><body>Hello World</body></html>
@doapp-ryanp
doapp-ryanp / swagger.json
Created April 12, 2016 18:02
response reference object
{
"swagger": "2.0",
"info": {
"title": "Swagger 2.0 response ref",
"description": "Is valid, but does not work with AWS import",
"version": "1.0.0"
},
"host": "ws.mlnapi.com",
"schemes": [
"https"
{
"location": {
"id":"wx-2396395",
"name":"Rochester, MN",
"lat":44.015076,
"lng":-92.47752,
"countyFips":["27109"]
},
"timestamp":{
"offset":"2015-12-21T09:27:12.000-0600",
@doapp-ryanp
doapp-ryanp / cloudFormationResource.json
Created October 21, 2015 18:06
cloud formation for CloudFront in front of API Gateway
{
"Type": "AWS::CloudFront::Distribution",
"Properties": {
"DistributionConfig": {
"Origins": [
{
"Id": "pushchansearch",
"DomainName": "myapig.execute-api.us-east-1.amazonaws.com",
"CustomOriginConfig": {
"HTTPPort": "80",
@doapp-ryanp
doapp-ryanp / cfExtensions.json
Created August 20, 2015 20:32
cfExtensions example
{
...
"cfExtensions": {
"PolicyDocumentStatements": [
{
"Action": [
"s3:Get*",
"s3:List*",
"s3:Put*"
],
phpinfo()
PHP Version => 5.5.22-1+deb.sury.org~trusty+1
System => Linux ip-172-31-53-102 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 19:36:28 UTC 2015 x86_64
Build Date => Feb 20 2015 11:28:01
Server API => FPM/FastCGI
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php5/fpm
Loaded Configuration File => /etc/php5/fpm/php.ini
Scan this dir for additional .ini files => /etc/php5/fpm/conf.d
cat /etc/php5/fpm/conf.d/20-aws-elasticache-cluster.ini
[memcached]
; Use session locking
; valid values: On, Off
; the default is On
memcached.sess_locking = On
; Session spin lock retry wait time in microseconds.