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 json | |
from urllib.request import Request, urlopen | |
print(f"Copy-paste the JSON received by the custom resource lambda") | |
line = input() | |
event = json.loads(line) | |
r = json.dumps({ | |
'Status': 'SUCCESS', | |
'Reason': 'Forced', |
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" | |
Resources: | |
VPC: | |
Type: "AWS::EC2::VPC" | |
Properties: | |
CidrBlock: "10.0.0.0/16" | |
EnableDnsSupport: true | |
EnableDnsHostnames: true | |
InstanceTenancy: default | |
Tags: |
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" | |
"os" | |
) | |
func main() { | |
decoder := json.NewDecoder(os.Stdin) |
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 | |
# dockerize | |
# Albert Tedja <albert@siliconaxon.com> | |
# Color stuff | |
yellow='\e[1;33m' | |
nc='\e[0m' | |
color=$yellow |
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 "net/http/httptest" | |
import "net/http" | |
type DummyHttp struct { | |
} | |
func (d DummyHttp) ServeHTTP(rw http.ResponseWriter, r *http.Request) { | |
rw.Header().Set("Content-Type", "text/plain") | |
rw.Write([]byte("Result from Dummy Server")) | |
} |
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" | |
import "bufio" | |
import "os" | |
import "strings" | |
var id int = 0 | |
func WorkerProcess(in <-chan string) { |
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" | |
import "time" | |
var workerId int = 0 | |
var publisherId int = 0 | |
// Publishers push data into a channel | |
func Publisher(out chan string) { |
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 "net/http" | |
import "io/ioutil" | |
import "os" | |
import "fmt" | |
import "bytes" | |
func handleError(e error) { | |
if e != nil { |