Skip to content

Instantly share code, notes, and snippets.

View enrichman's full-sized avatar
🇮🇹

Enrico Candino enrichman

🇮🇹
View GitHub Profile
@DeanThompson
DeanThompson / ecb.go
Last active February 12, 2023 05:10
Golang AES ecb mode
package utils
import "crypto/cipher"
type ecb struct {
b cipher.Block
blockSize int
}
func newECB(b cipher.Block) *ecb {
@jewzaam
jewzaam / gist:5a9496f1ca2e5feb07bb
Last active April 1, 2019 08:27
MongoDB replica set in docker
# get it
docker pull mongo
# startup a 3 node replica set
docker run --name mongo-rs-1 -d mongo --nojournal --oplogSize 10 --replSet rs
docker run --name mongo-rs-2 -d mongo --nojournal --oplogSize 10 --replSet rs
docker run --name mongo-rs-3 -d mongo --nojournal --oplogSize 10 --replSet rs
# connect to first node
docker run -it --link mongo-rs-1:mongo1 --link mongo-rs-2:mongo2 --link mongo-rs-3:mongo3 --rm mongo /bin/bash