Skip to content

Instantly share code, notes, and snippets.

Michael van Rooijen mrrooijen

View GitHub Profile
@mrrooijen
mrrooijen / docker-certbot-wildcard-dns.sh
Last active Jun 7, 2018
Command to produce a wildcard ssl certificate using the Let's Encrypt Certificate Authority. Verification is done using the DNS challenge. The resulting certificates can be found in ./ssl/live/example.com.
View docker-certbot-wildcard-dns.sh
docker run -it --rm --name certbot \
-v $(pwd)/ssl:/etc/letsencrypt \
-v $(pwd)/ssl:/var/lib/letsencrypt \
certbot/certbot certonly \
--server https://acme-v02.api.letsencrypt.org/directory \
--manual \
--preferred-challenges dns \
-d *.example.com \
-d example.com
@mrrooijen
mrrooijen / README.md
Created May 6, 2018
How to enable SSL with Redis (Ruby Driver) on RedisLabs.
View README.md

How to enable SSL with [Redis] ([Ruby Driver]) on [RedisLabs].

Typically, this is how you'd connect to Redis:

Redis.new(url: ENV["REDIS_URL"])

Where REDIS_URL uses the following format:

@mrrooijen
mrrooijen / intel-microcode-update.md
Created Jan 18, 2018
How to update Intel microcode on Ubuntu.
View intel-microcode-update.md

Verify the microcode version prior to updating:

dmesg | grep microcode

Update your package list and install the following packages:

apt update
apt install microcode.ctl intel-microcode

Reboot and run the following command again to verify the new microcode is in effect:

@mrrooijen
mrrooijen / linux-kernel-update.md
Last active Jan 18, 2018
How to update the Linux kernel.
View linux-kernel-update.md

Verify your current kernel version:

uname -r

To update the Linux kernel, select a version from the following URL:

http://kernel.ubuntu.com/~kernel-ppa/mainline/

For example v4.14.13:

@mrrooijen
mrrooijen / countries.json
Last active Aug 8, 2017
JSON collection of 2-letter ISO 3166 alpha-2 code country list.
View countries.json
{
"AF": "Afghanistan",
"AX": "AlandIslands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "AmericanSamoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctica",
View rancher.sh
# Install Docker
curl -fsSL https://get.docker.com/ | sh
# Run Rancher
docker run -d \
--name=rancher \
--restart=always \
-v /var/lib/mysql:/var/lib/mysql \
-p 8080:8080 \
rancher/server:stable
@mrrooijen
mrrooijen / global_register.ex
Created Jan 2, 2017
Ensure that only one instance of a given (supervised) process exists in the cluster.
View global_register.ex
defmodule Party.Clock do
use GenServer
def start_link do
case GenServer.start_link(__MODULE__, [], name: {:global, __MODULE__}) do
{:ok, pid} ->
{:ok, pid}
{:error, {:already_started, pid}} ->
IO.puts("Already started!!")
Process.link(pid)
@mrrooijen
mrrooijen / ssh_config
Created Dec 21, 2016
SSH config for keeping idle connections alive, and to automatically add ssh key to agent.
View ssh_config
Host *
ServerAliveInterval 60
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
@mrrooijen
mrrooijen / check.sh
Created Dec 3, 2016
View (graph of) receiving and transmitting (sending) data
View check.sh
speedometer -r eth0 -t eth0
@mrrooijen
mrrooijen / gencert
Last active Aug 7, 2016
SSL Certificate Generator (self-signed, requires openssl). Add both generated key- and crt files to your web server. Add crt to your local keychain and/or browser.
View gencert
#! /bin/sh
if [ "$1" == "" ]; then
echo ""
echo "SSL Certificate Generator (self-signed, requires openssl)."
echo ""
echo " Usage:"
echo ""
echo " gencert <days> # Produces server.key and server.crt"
echo ""
You can’t perform that action at this time.