Skip to content

Instantly share code, notes, and snippets.

View jay-johnson's full-sized avatar

Jay jay-johnson

View GitHub Profile
@edsiper
edsiper / kubernetes_commands.md
Last active April 4, 2024 03:27
Kubernetes Useful Commands
@mrw34
mrw34 / postgres.sh
Last active March 26, 2024 00:24
Enabling SSL for PostgreSQL in Docker
#!/bin/bash
set -euo pipefail
openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req -keyout privkey.pem
openssl rsa -in privkey.pem -passin pass:abcd -out server.key
openssl req -x509 -in server.req -text -key server.key -out server.crt
chmod 600 server.key
test $(uname -s) = Linux && chown 70 server.key
docker run -d --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -v "$(pwd)/server.crt:/var/lib/postgresql/server.crt:ro" -v "$(pwd)/server.key:/var/lib/postgresql/server.key:ro" postgres:12-alpine -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
from IPython.core.magic import Magics, magics_class, line_magic
import asyncio
from concurrent.futures import Future
# Credits goes to https://gist.github.com/chrisseto/8f7289497f40ad442a30#gistcomment-1701177
@magics_class
class AsyncMagics(Magics):
@line_magic
def await(self, line):
@jmvrbanac
jmvrbanac / gunicorn_options.yml
Last active August 26, 2023 18:13
Capture Client Certificate CN from Gunicorn
bind: 0.0.0.0:8000
workers: 1
worker_class: "example.worker:CustomWorker"
timeout: 30
ca_certs: ca.crt
certfile: server.crt
keyfile: server.key
cert_reqs: 2
do_handshake_on_connect: true
@andrewstuart
andrewstuart / .gitlab-ci.yml
Last active June 12, 2023 17:44
One Deployment Per branch, plus CI CD, gitlab and helm setup
image: docker.mydomain.com/build/kube-go-make
variables:
DOCKER_TAG: docker.mydomain.com/myapp/home:$CI_COMMIT_REF_SLUG
DOCKER_HOST: tcp://localhost:2375
DOCKER_DRIVER: overlay
PROD_RSYNC_HOST: myprodserver.com
DOMAIN: mydomain.com
CHART_DIR: chart
@jamesbuckett
jamesbuckett / kubeadm.md
Last active April 12, 2021 18:56
kubeadm

Deploy a Kubernetes cluster and Microservices Application

image

What Problem are we solving

What is Kubernetes?

Agenda

  • Deploy a Kubernetes cluster on Digital Ocean using kubeadm
@carlessanagustin
carlessanagustin / kubernetes.md
Created March 15, 2017 15:53
Kubernetes tutorial steps

1. Create cluster

Cluster up and running

minikube version
minikube start
kubectl version
@josegonzalez
josegonzalez / redis_migrate.py
Last active January 15, 2024 14:39 — forked from iserko/redis_migrate.py
A simple script to migrate all keys from one Redis to another
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_dict):
conn = redis.StrictRedis(host=conn_dict['host'],
port=conn_dict['port'],
db=conn_dict['db'])
return conn
@arya-oss
arya-oss / INSTALL.md
Last active November 18, 2023 13:58
Ubuntu 16.04 Developer Tools installation

Ubuntu 16.04 Developer Tools Installation

First things first !

sudo apt update
sudo apt upgrade

Standard Developer Tools

sudo apt-get install build-essential git
@olih
olih / jq-cheetsheet.md
Last active April 20, 2024 06:34
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq