Skip to content

Instantly share code, notes, and snippets.

actionjack / MongoDB Replica Set / docker-compose / mongoose transaction with persistent volume

This will guide you through setting up a replica set in a docker environment using.

  • Docker Compose
  • MongoDB Replica Sets
  • Mongoose
  • Mongoose Transactions

Thanks to for helping with their docker-compose file!

#!/usr/bin/env bash
# MongoDB port
# Consul key to setup the lock
# Retrieve MongoDB instance IPs from Consul
View #1 Merging Rubygems and

Merging Rubygems and Bundler

set -eux
rm -rf rubygems bundler
git clone
git clone
actionjack /
Last active Mar 10, 2021
GitHub User's Creed

GitHub User's Creed

This is my GitHub token. There are many like it, but this one is mine.

My GitHub token is my best friend. It is my life. I must master it as I must master my life.

Without me, my GitHub token is useless. Without my GitHub token, I am useless. I must code my GitHub token true. I must code cleaner than my enemy who is trying to out code me. I must out code him before he out codes me. I will ...

My GitHub token and I know that what counts in war is not the commits we make, the frequency of our rebases, nor the pull requests we make. We know that it is the merges that count. We will merge ...

actionjack /
Created Nov 18, 2020 — forked from justinclayton/
Terraform: taint all resources from one module
for resource in `terraform show -module-depth=1 | grep module.${module} | tr -d ':' | sed -e 's/module.${module}.//'`; do
terraform taint -module ${module} ${resource}
actionjack /
Created Nov 5, 2020 — forked from lukechilds/
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
actionjack / nginx.conf
Created Sep 14, 2020 — forked from deltheil/nginx.conf
Hide sensitive GET parameters within nginx access logs thanks to the Lua module
View nginx.conf
http {
log_format filt '$remote_addr - $remote_user [$time_local] "$_request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
server {
location /login {
# `set` is provided by the Rewrite module
set $filter "password|secret";
actionjack /
Created May 30, 2020 — forked from bennylope/
FFmpeg add a watermark to video

How to Add a Watermark to Video

FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.

Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:

ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4

Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.

actionjack /
Created Apr 22, 2020 — forked from kevinadi/
Script to create self-signed CA certificates, server certificates, and client certificates for testing MongoDB with SSL
# Generate self signed root CA cert
openssl req -nodes -x509 -newkey rsa:2048 -keyout ca.key -out ca.crt -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=root/CN=`hostname -f`/"
# Generate server cert to be signed
openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=server/CN=`hostname -f`/"
# Sign the server cert

As outlined here, there are a couple of situations where you need to authenticate with GitHub by using an Acces Token:-

  1. If you have Two-Factor Authentication (2FA) enabled.
  2. You are accessing an organisations protected content using SAML Single-Sign On (SSO).

Create an Access Token

In your GitHub account, go to Settings / Developer settings / Personal access tokens and select Generate New Token. Make a note of the token somewhere safe since this is the only chance you get to see it.

Add the token to your local OSX Key Chain