Inspired By: grafana/loki#333
- docker-compose.yml
version: "3"
networks:
loki:
Inspired By: grafana/loki#333
version: "3"
networks:
loki:
#!/bin/bash | |
function install_dependencies() { | |
echo "Installing dependencies..." | |
sudo apt -qq update | |
sudo apt -qq install -y curl git wget | |
# sudo apt -qq install -y bison flex kernel-package libelf-dev libssl-dev | |
sudo apt -qq install -y bison flex libelf-dev libssl-dev | |
} |
A running example of the code from:
This gist creates a working example from blog post, and a alternate example using simple worker pool.
TLDR: if you want simple and controlled concurrency use a worker pool.
# Download the legacy format for NGINX compatibility | |
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz | |
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz | |
# Unzip | |
gunzip Geo*.gz | |
# Copy to /usr/share/GeoIP/ | |
cp Geo*.dat /usr/share/GeoIP/ |
# Automatically instal the latest nginx | |
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add - | |
#Make a backup copy of your current sources.list file | |
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak | |
#Now copy the following repositories to the end of ` /etc/apt/sources.list` | |
echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list | |
echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list |
import ( | |
"crypto/md5" | |
"encoding/hex" | |
) | |
func GetMD5Hash(text string) string { | |
hasher := md5.New() | |
hasher.Write([]byte(text)) | |
return hex.EncodeToString(hasher.Sum(nil)) | |
} |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
#!/bin/bash | |
echo -e "Powerline glyphs:\n\ | |
Code points Glyphe Description Old code point | |
U+E0A0 \xee\x82\xa0 Version control branch (U+2B60 \xe2\xad\xa0 )\n\ | |
U+E0A1 \xee\x82\xa1 LN (line) symbol (U+2B61 \xe2\xad\xa1 )\n\ | |
U+E0A2 \xee\x82\xa2 Closed padlock (U+2B64 \xe2\xad\xa4 )\n\ | |
U+E0B0 \xee\x82\xb0 Rightwards black arrowhead (U+2B80 \xe2\xae\x80 )\n\ | |
U+E0B1 \xee\x82\xb1 Rightwards arrowhead (U+2B81 \xe2\xae\x81 )\n\ | |
U+E0B2 \xee\x82\xb2 Leftwards black arrowhead (U+2B82 \xe2\xae\x82 )\n\ |
<?php | |
$apnsHost = 'gateway.sandbox.push.apple.com'; | |
$apnsCert = 'apns-dev.pem'; | |
$apnsPort = 2195; | |
$streamContext = stream_context_create(); | |
stream_context_set_option($streamContext, 'ssl', 'local_cert', $apnsCert); | |
$apns = stream_socket_client('ssl://' . $apnsHost . ':' . $apnsPort, $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext); |