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
TOKEN=token-01 | |
CLUSTER_STATE=new | |
NAME_1=machine-1 | |
NAME_2=machine-2 | |
NAME_3=machine-3 | |
HOST_1=10.240.0.17 | |
HOST_2=10.240.0.18 | |
HOST_3=10.240.0.19 | |
CLUSTER=${NAME_1}=http://${HOST_1}:2380,${NAME_2}=http://${HOST_2}:2380,${NAME_3}=http://${HOST_3}:2380 |
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 ( | |
"fmt" | |
"regexp" | |
) | |
func main() { | |
// https://cve.mitre.org/cve/identifiers/tech-guidance.html#extraction_or_parsing | |
var cveRegex = regexp.MustCompile(`(?i)(CVE-\d{4}-(0\d{3}|[1-9]\d{3,}))`) |
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
{"hola":"mundo","number":1} |
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 ( | |
"context" | |
"log" | |
"sync" | |
"time" | |
) | |
var wg sync.WaitGroup |
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 ( | |
"context" | |
"log" | |
"sync" | |
"time" | |
) | |
var wg sync.WaitGroup |
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
# How to run the container | |
docker run --rm --name container-name -p 5432:5432 -e POSTGRES_USER=username -e POSTGRES_DB=dbname -e POSTGRES_PASSWORD=password -v /local/path/to/data/:/var/lib/postgresql/data postgres | |
# How to connect via psql | |
psql -h 0.0.0.0 -U username -W |
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
// from: http://maicon.io/golang-running-aws-ec2-instances.html | |
package main | |
import ( | |
"fmt" | |
"os" | |
aws "github.com/goamz/goamz/aws" | |
ec2 "github.com/goamz/goamz/ec2" | |
) |
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 ( | |
"net/http" | |
) | |
func main() { | |
go func() { | |
http.ListenAndServe(":8001", &fooHandler{}) | |
}() |
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 ( | |
"net/http" | |
) | |
func main() { | |
finish := make(chan bool) | |
server8001 := http.NewServeMux() |
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
/* maiconio | |
* http://pistach.es/ | |
*/ | |
import java.io.IOException; | |
import java.net.DatagramPacket; | |
import java.net.DatagramSocket; | |
import java.net.InetSocketAddress; | |
import java.net.SocketException; |
NewerOlder