Skip to content

Instantly share code, notes, and snippets.

:octocat:

Ruan Bekker ruanbekker

:octocat:
Block or report user

Report or block ruanbekker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active Aug 15, 2019
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
View cheatsheet-elasticsearch.md
@ruanbekker
ruanbekker / docker-nfs-volumes.md
Created Dec 10, 2017
NFS Volumes with Docker Swarm
View docker-nfs-volumes.md

Create NFS Volumes:

Creating the NFS Volume:

$ docker volume create --driver local \
  --opt type=nfs \
  --opt o=addr=192.168.1.115,uid=1000,gid=1000,rw \
  --opt device=:/mnt/volumes/mysql-test \
  mysql-test-1
@ruanbekker
ruanbekker / setup-kubernetes-ubuntu-16.md
Last active Aug 7, 2019
Install a 3 Node Kubernetes Cluster on Ubuntu 16
View setup-kubernetes-ubuntu-16.md

Master: Dependencies

apt update && apt upgrade -y
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -

cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
@ruanbekker
ruanbekker / aws-boto3-set-profile-name.py
Last active Jul 30, 2019
Basic Boto3 Code for AWS to Set the Profile Name
View aws-boto3-set-profile-name.py
import boto3
# setting region, profile from credential provider
session = boto3.Session(
region_name='eu-west-1',
profile_name='aws'
)
# declare ec2
ec2 = session.client('ec2')
@ruanbekker
ruanbekker / python_mailer_smtplib.py
Created Jul 26, 2017
Python SMTP Mailer using Amazon SES (smtplib)
View python_mailer_smtplib.py
import sys
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
name = "Ruan"
from_address = "no-reply@mydomain.com"
to_address = "ruan@mydomain.com"
subject = "Test"
@ruanbekker
ruanbekker / aws_ssm_get_parameter.md
Created Jan 31, 2018
Getting Secrets from SSM using GetParameter Example with Python and Boto3
View aws_ssm_get_parameter.md

Bash Environment Example with SSM to get Parameter Values using GetParameter:

IAM Policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt1517398919242",
@ruanbekker
ruanbekker / flask-client-ip.py
Created Jun 7, 2017
Python Flask Show Client IP
View flask-client-ip.py
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/ip', methods=['GET'])
def name():
return request.environ.get('HTTP_X_REAL_IP', request.remote_addr)
#return jsonify({'ip': request.remote_addr}), 200
#return jsonify({'ip': request.environ['REMOTE_ADDR']}), 200
@ruanbekker
ruanbekker / minio_events_webhook.md
Last active Jul 11, 2019
Minio Events with Bucket Notifications
View minio_events_webhook.md
View delete_messages_from_slack_channels.md
@ruanbekker
ruanbekker / traefik_portainer.md
Last active Jul 8, 2019
Traefik with SSL + Portainer on Docker Swarm Repro
View traefik_portainer.md

Traefik and Portainer on Docker Swarm with Letsencrypt

Reproducing a Traefik with SSL and Portainer setup on a 2 Node Docker Swarm

Install Docker:

Install Docker on both nodes with a Bootstrap Script:

$ curl https://gitlab.com/rbekker87/scripts/raw/master/setup-docker-ubuntu.sh | bash
You can’t perform that action at this time.