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 / 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
@ruanbekker
ruanbekker / mongodb_replica_set_setup.md
Last active Jul 2, 2019
Setup a 3 Node MongoDB Replica Set
View mongodb_replica_set_setup.md
sudo mkdir -p /var/mongodb/db/{1,2,3}
sudo mkdir -p /var/mongodb/pki
openssl rand -base64 741 > /var/mongodb/pki/m103-keyfile
chmod 600 /var/mongodb/pki/m103-keyfile
sudo chown vagrant:vagrant -R /var/mongodb
@ruanbekker
ruanbekker / setup_vagrant_virtualbox_mac.md
Created Jul 2, 2019
Setup Vagrant and Virtualbox on Mac
View setup_vagrant_virtualbox_mac.md
brew update
brew tap caskroom/cask 
brew search virtualbox
brew cask info virtualbox
brew cask install virtualbox
brew cask install vagrant
brew cleanup 
@ruanbekker
ruanbekker / golang_split_strings.go
Last active Jun 29, 2019
Golang: Split strings by character
View golang_split_strings.go
package main
import (
"fmt"
"os"
"strings"
)
func main() {
for _, envs := range os.Environ() {
@ruanbekker
ruanbekker / write_gamescores_to_dynamodb.py
Created Jun 23, 2019
Generate Gamescores to DynamoDB from Blogpost
View write_gamescores_to_dynamodb.py
# from blogpost:
# - https://sysadmins.co.za/experimenting-the-client-interface-for-dynamodb-in-boto3-with-gamescores/
import boto3
import time
import random
import datetime
client = boto3.Session(region_name='eu-west-1', profile_name='test').client('dynamodb')
# dynalite
# client = boto3.Session(region_name='eu-west-1').client('dynamodb', aws_access_key_id='', aws_secret_access_key='', endpoint_url='http://localhost:4567')
@ruanbekker
ruanbekker / python_requests_elasticsearch_iam.py
Created Jun 21, 2019
Authenticate AWS Elasticsearch Requests with Requests and RequestsAws4Auth
View python_requests_elasticsearch_iam.py
import boto3
import json
import requests
from requests_aws4auth import AWS4Auth
host = 'https://search-domain-name-xx.eu-west-1.es.amazonaws.com'
region = 'eu-west-1'
service = 'es'
headers = {'Content-Type': 'application/json'}
@ruanbekker
ruanbekker / swarm.yml
Created Jun 15, 2019 — forked from MetalArend/swarm.yml
Run a GitLab Runner on your Swarm
View swarm.yml
version: '3.4'
secrets:
# Find your registration token at: "Your project" > "Settings" > "CI/CD" > "Runners settings" > "Specific Runners" (look for registration token)
# Register it as `GITLAB_REGISTRATION_TOKEN`: `docker secret create GITLAB_REGISTRATION_TOKEN YOUR_REGISTRATION_TOKEN`
GITLAB_REGISTRATION_TOKEN:
external: true
# Find your personal access token at: "Your user account" > "Settings" > "Access Tokens" > "Create personal access token" (for api)
# Register it as `GITLAB_PERSONAL_ACCESS_TOKEN`: `docker secret create GITLAB_PERSONAL_ACCESS_TOKEN <YOUR ACCESS TOKEN>`
@ruanbekker
ruanbekker / index_center.html
Created Jun 9, 2019
Center Image in Center of Page in HTML
View index_center.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="description" content="python web page for kubernetes demo">
<meta name="keywords" content="kubernetes,python,web">
<meta name="author" content="Ruan Bekker">
<title>Python Page</title>
You can’t perform that action at this time.