I need a simple API Gateway that will use Swagger as its input format.
A very simple way to achieve this is to use swagger-codegen
and create
a nodejs-server
that will simply proxy (and optionally modify) requests
it receives to some other host.
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
package main | |
import ( | |
"fmt" | |
"os" | |
"strings" | |
"time" | |
) | |
func printFatal(e error) { |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
type ServiceDescriptionPayload struct { | |
Address string `json:"address"` | |
} |
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
# 0% of syscalls and syscall time are removed for brevity | |
... | |
... | |
... | |
fstat | |
num calls: 1714 1% of syscalls |
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
Array.prototype.assoc = function(obj) { return ARR.find( function(iArr) { return iArr[0] == obj } ) } | |
const ARR = [ [ "a", "b", "c" ], [ 1, 2, 3 ], [ "a", 2 ] ] | |
ARR.assoc("a") | |
// > [ 'a', 'b', 'c' ] |
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
{ | |
"Effect": "Deny", | |
"Action": [ "ec2:AttachInternetGateway", "ec2:DetachInternetGateway" ], | |
"Resource": "arn:aws:ec2:REGION:ACCOUNTNUMBER:*", | |
"Condition": { | |
"StringEquals": { | |
"ec2:vpc": "arn:aws:ec2:REGION:ACCOUNTNUMBER:vpc/VPC-ID" | |
} | |
} | |
} |
- msjsdiag.debugger-for-chrome - for FE debugging
- PeterJausovec.vscode-docker - syntax highlight for Dockerfile and docker-compose.yml with hub image name completion and lint
- EditorConfig.editorconfig - set indent style&size, tab width, eol, final newline and trim whitespace properties in an
.editorconfig
- spoonscen.es6-mocha-snippets - before/after/describe/each/...
- dbaeumer.vscode-eslint - ESLint. + Define a task in
tasks.json
as described in the documentation of the plugin - flowtype.flow-for-vscode - syntax color highlight for JavaScript ES6/ES7
- donjayamanne.githistory - git history graph in vscode
- lukehoban.go - maybe someday
- spywhere.guides - better guides than the built-in ones
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
!^k:: | |
SetTitleMatchMode 2 | |
WinActivate, ahk_class Qt5QWindowIcon ; OBS | |
WinMove, A,, -6, 1080, 880, 366 | |
WinActivate, Recent Events - Google Chrome ; StreamLabs | |
WinMove, A,, 1930, 1078, 640, 400 | |
WinActivate, Twitch - Google Chrome ; Chat | |
WinMove, A,, 860, 1080, 1084, 367 | |
WinActivate, Poloniex - Bitcoin/Digital Asset Exchange - API - Google Chrome | |
WinMove, A,, 0, 0, 1280, 1080 |
I get asked regularly for good resources on AWS security. This gist collects some of these resources (docs, blogs, talks, open source tools, etc.). Feel free to suggest and contribute.
Short Link: http://tiny.cc/awssecurity
- Security Blog - http://blogs.aws.amazon.com/security/
- Security Advisories - http://aws.amazon.com/security/security-bulletins/
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
import os | |
import boto3 | |
import datetime | |
import dateutil | |
DEFAULT_MAX_MEM = 3000 | |
LOW_CLUSTER_CPU_TH = 20 | |
HIGH_CLUSTER_CPU_TH = 65 | |
CONTAINERS_MAX_MEM = { | |
'cluster1': 1200, |