Skip to content

Instantly share code, notes, and snippets.

@shaunlee
shaunlee / ConnectionPoolWrapper.go
Last active September 10, 2017 21:35 — forked from rday/gist:3504674
Connection Pool
type InitFunction func() (interface{}, error)
type ConnectionPoolWrapper struct {
size int
pool chan interface{}
}
/**
Call the init function size times. If the init function fails during any call, then
the creation of the pool is considered a failure.
@shaunlee
shaunlee / gist:dfbf5d805d4f5a3f9a54
Created October 26, 2015 04:50 — forked from jessedearing/gist:2351836
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key