This file contains hidden or 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 ( | |
| "crypto" | |
| "crypto/rand" | |
| "crypto/rsa" | |
| "crypto/sha256" | |
| "crypto/x509" | |
| "encoding/pem" | |
| "fmt" |
This file contains hidden or 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
| var jose = require('node-jose'); | |
| var fs = require('fs') | |
| var exampleJwt = "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiYm9iIn0.j-_SmegNrMidWYQIJUaZF7wy0jFqURrczA56mPD30aR8Vm8R909P4ptI8T3ZDnwCqPCF6g8Hv2klGOfzaRcP33gKiKcev1dz3jQibFSz2X2g-2cuQz-SMyp_zgZ-_vYwtM-9sXgl-CGBqGsEQ_OxWi42AqQ7lOeYtO3hZ1W1yESzYyzHetH0d__KfCoGD0Jbe3okkmxFuJrCfNNGdIhoMj8SDnrK5BZ2a-M2BWO-RFECRiw5ybuyVGhOCxFwFzsUQu2r6Gliu9_WQnysFluaK65gQ5nDi5-CaKf2DqmPrh3Bp_dmT4huTjnJB4PshX-j0IE6UdbVMpbThL55Y9V_1Q" | |
| var keystore = jose.JWK.createKeyStore(); | |
| var key | |
| fs.readFile('public.pem', 'utf8', (err, data) => { |
This file contains hidden or 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
| # Create an IAM role for the Web Servers. | |
| resource "aws_iam_role" "web_iam_role" { | |
| name = "web_iam_role" | |
| assume_role_policy = <<EOF | |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Action": "sts:AssumeRole", | |
| "Principal": { |
This file contains hidden or 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 sign | |
| import ( | |
| "bytes" | |
| "crypto/sha256" | |
| "encoding/hex" | |
| "io/ioutil" | |
| "net/http" | |
| "net/http/httptest" | |
| ) |
This file contains hidden or 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
| { | |
| "$schema": "http://json-schema.org/draft-04/schema#", | |
| "definitions": { | |
| "address": { | |
| "id": "address", | |
| "type": "object", | |
| "description": "Address", | |
| "properties": { | |
| "houseName": { | |
| "type": "string", |
This file contains hidden or 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 | |
| // generated by "./schematyper /Users/adrian/goprojects/src/github.com/a-h/schemagenerators/exampleschema.json" -- DO NOT EDIT | |
| // Address | |
| type address struct { | |
| County string `json:"county,omitempty"` | |
| District string `json:"district,omitempty"` | |
| FlatNumber string `json:"flatNumber,omitempty"` | |
| HouseName string `json:"houseName,omitempty"` |
This file contains hidden or 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
| // Stuff related to making a HTTP call. | |
| // Address | |
| type Address struct { | |
| County string `json:"county" url:"county,key"` // County | |
| District string `json:"district" url:"district,key"` // Address 2 | |
| FlatNumber string `json:"flatNumber" url:"flatNumber,key"` // Flat | |
| HouseName string `json:"houseName" url:"houseName,key"` // House Name | |
| HouseNumber string `json:"houseNumber" url:"houseNumber,key"` // House Number | |
| Postcode string `json:"postcode" url:"postcode,key"` // Postcode |
This file contains hidden or 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 | |
| type Address struct { | |
| County string `json:"county,omitempty"` | |
| District string `json:"district,omitempty"` | |
| FlatNumber string `json:"flatNumber,omitempty"` | |
| HouseName string `json:"houseName,omitempty"` | |
| HouseNumber string `json:"houseNumber,omitempty"` | |
| Postcode string `json:"postcode,omitempty"` | |
| Street string `json:"street,omitempty"` |
This file contains hidden or 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 ( | |
| "io" | |
| "log" | |
| "net/http" | |
| "github.com/gorilla/mux" | |
| ) |
This file contains hidden or 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
| const spawn = require('child_process').spawn; | |
| exports.handler = function(event, context) { | |
| const terminator = spawn('./terminator', ["-terminateOldVersions=false", "-port=80", "-isDryRun=false", "-autoScalingGroups=AUTO_SCALING_GROUP_NAMES"]); | |
| terminator.stdout.on('data', (data) => { | |
| console.log(`stdout: ${data}`); | |
| }); | |
| terminator.stderr.on('data', (data) => { |