Skip to content

Instantly share code, notes, and snippets.

View ruanbekker's full-sized avatar
🇿🇦

Ruan Bekker ruanbekker

🇿🇦
View GitHub Profile
# Source: https://gist.github.com/baaf4adb25e9efaba886c17a2ad722a5
########################################################
# How To Auto-Scale Kubernetes Clusters With Karpenter #
# https://youtu.be/C-2v7HT-uSA #
########################################################
# Referenced videos:
# - Karpenter: https://karpenter.sh
# - GKE Autopilot - Fully Managed Kubernetes Service From Google: https://youtu.be/Zztufl4mFQ4
@sebstyle
sebstyle / rancher-on-k3os.md
Last active March 21, 2024 03:43
Install rancher on k3os

Rancher cluster on k3os

Goal

Install rancher on k3os with centralized datastore on mysql cluster.

Environment

  • Host: Ubuntu 18.04.4 Desktop (32gb ram 4 cpu)
  • Virtualisation: kvm/qemu (virtual machine manager)
  • Local network: 192.168.0.0/16
    • Gateway: 192.168.0.1
@pythoninthegrass
pythoninthegrass / jenkins-docker-compose.yml
Last active February 11, 2024 08:18 — forked from SWBSanjeewa/jenkins-docker-compose
Run jenkins master and slave using docker compose
# MASTER PRE-REQS
# Install docker, docker-compose
# mkdir -p ~/{jenkins,jnlp_slave}
# master
# docker run -d \
# -u root \
# --name=jenkins \
# -e TZ=America/Denver \
@npearce
npearce / install-docker.md
Last active March 24, 2024 04:39
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@DaisukeMiyamoto
DaisukeMiyamoto / assume_role.py
Created September 12, 2018 05:00
AWS Boto3 Assume Role example
import boto3
from boto3.session import Session
def assume_role(arn, session_name):
"""aws sts assume-role --role-arn arn:aws:iam::00000000000000:role/example-role --role-session-name example-role"""
client = boto3.client('sts')
account_id = client.get_caller_identity()["Account"]
print(account_id)
@crypticmind
crypticmind / README.md
Last active March 25, 2024 06:26
Setup lambda + API Gateway using localstack
@mgaspari
mgaspari / youtube-to-mp3.rb
Created August 23, 2017 18:48 — forked from stefan-lz/youtube-to-mp3.rb
youtube vids to mp3 files (ruby)
#!/usr/bin/ruby
#usage: youtube-to-mp3 <youtube-url>
#example: youtube-to-mp3 http://www.youtube.com/playlist?list=PL398CE05652474A1E
#desc: downloads a single youtube vid or a playlist, then converts to mp3.
# Requires youtube-dl and ffmpeg
url = ARGV[0]
system("youtube-dl -citA #{url}")
@mosquito
mosquito / README.md
Last active March 28, 2024 10:42
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@gene1wood
gene1wood / role_arn_to_session.py
Created December 29, 2016 17:38
Simple python function to assume an AWS IAM Role from a role ARN and return a boto3 session object
import boto3
def role_arn_to_session(**args):
"""
Usage :
session = role_arn_to_session(
RoleArn='arn:aws:iam::012345678901:role/example-role',
RoleSessionName='ExampleSessionName')
client = session.client('sqs')
"""
@greyli
greyli / app.py
Last active February 25, 2024 03:04
Photo upload and manage with Flask and Flask-Uploads (Multiple file upload support!).
# -*- coding: utf-8 -*-
import os
import uuid
from flask import Flask, render_template, redirect, url_for, request
from flask_uploads import UploadSet, configure_uploads, IMAGES, patch_request_class
from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileRequired, FileAllowed
from wtforms import SubmitField