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 / lambci_testing.md
Created Nov 13, 2019
Local Lambda testing with Lambci Docker Container
View lambci_testing.md
@ruanbekker
ruanbekker / run_docker_in_lxc.md
Created Nov 12, 2019
How to run Docker in a LXC Container using LXD
View run_docker_in_lxc.md

Provision a LXC Container:

container_name=jenkins-docker-node-01

lxc init images:debian/10/cloud $container_name
lxc config set $container_name limits.memory 2048MB
lxc config set $container_name security.privileged true
lxc config set $container_name security.nesting true
lxc config set $container_name security.privileged true
@ruanbekker
ruanbekker / install_openfaas_helm_kubernetes.sh
Last active Oct 16, 2019
Install OpenFaas with Helm on Kubernetes
View install_openfaas_helm_kubernetes.sh
#!/usr/bin/env bash
# install k3d on ubuntu:
# https://gist.githubusercontent.com/ruanbekker/9c5471a4a152be16e66d5c1157452e88/raw/3a310975558b56b2cdd796082c4995903d2ef473/bootstrap_k3d.sh
source /root/.kubernetes.sh
curl -sL https://cli.openfaas.com | sudo sh
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
kubectl -n kube-system create sa tiller \
&& kubectl create clusterrolebinding tiller \
@ruanbekker
ruanbekker / bootstrap_k3d.sh
Last active Oct 16, 2019
Kubernetes: Install k3d script on Ubuntu
View bootstrap_k3d.sh
#!/usr/bin/env bash
sudo apt update && sudo apt-get upgrade -y
sudo apt remove docker docker-engine -y
sudo apt install linux-image-extra-virtual -y
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce -y
@ruanbekker
ruanbekker / civo_kubernetes_cli.md
Last active Oct 10, 2019
Create a Civo Kubernetes Cluster via CLI
View civo_kubernetes_cli.md
brew install rbenv ruby-build
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"
rbenv install 2.5.1
rbenv global 2.5.1
@ruanbekker
ruanbekker / readme-docker-compose_demonstration.md
Created Oct 9, 2019
docker-compose.yml demonstration 2019.10.09
View readme-docker-compose_demonstration.md

Our Dockerfile:

FROM alpine
ADD script.sh /script.sh
CMD ["/bin/sh", "/script.sh"]

Our script.sh

@ruanbekker
ruanbekker / aws_assume_role_credentials.py
Created Oct 8, 2019
AssumeRole with Python Boto3 on AWS
View aws_assume_role_credentials.py
# Description:
# role on ec2 instance allows access to SSM cross account
# retrieve access key/secret key for lambda that is saved to ssm
# use that access keys in a client to access lambda
import boto3
function_name = 'hello-world'
role_to_assume_arn='arn:aws:iam::000000000000:role/MyCrossAccountRole'
role_session_name='test_session'
@ruanbekker
ruanbekker / k3s-demo-with-cluster.md
Created Sep 27, 2019
kubernetes demo with cluster mode on k3s
View k3s-demo-with-cluster.md

Install k3s on master node:

curl -sfL https://get.k3s.io | sh -
# get token
cat /var/lib/rancher/k3s/server/node-token

Install k3s on worker nodes as agents:

@ruanbekker
ruanbekker / howto-update-wordpress-urls-in-mysql.md
Created Aug 26, 2019
How to update Wordpress URLs in MySQL
View howto-update-wordpress-urls-in-mysql.md
@ruanbekker
ruanbekker / fix-locale.sh
Created Aug 20, 2019
Fix RaspberryPi Locale Issue
View fix-locale.sh
# bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
echo "LC_ALL=en_US.UTF-8" >> /etc/environment
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
locale-gen en_US.UTF-8
You can’t perform that action at this time.