Skip to content

Instantly share code, notes, and snippets.

View valentin2105's full-sized avatar

Valentin Ouvrard valentin2105

View GitHub Profile
@GusAntoniassi
GusAntoniassi / README.md
Last active April 25, 2024 06:08
Configure autocompletion to kubectl with zsh

kubectl with ZSH (oh-my-zsh)

How to configure

Use the following commands to add the kubectl autocomplete to zsh:

mkdir -p ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/
kubectl completion zsh > ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/kubectl-autocomplete.plugin.zsh

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@enricofoltran
enricofoltran / main.go
Last active April 1, 2024 00:17
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@andyshinn
andyshinn / Dockerfile
Last active August 8, 2023 08:39
Postal on Docker
FROM ruby:2.3-onbuild
VOLUME /opt/postal/config
ENV LOG_TO_STDOUT 1
ENV AM_CONFIG_ROOT /opt/postal/config
RUN gem install procodile
RUN apt-get update -qq && apt-get install -yqq nodejs
@mgoodness
mgoodness / helm-rbac.md
Last active October 30, 2021 17:04
Helm RBAC setup for K8s v1.6+ (tested on minikube)
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
@so0k
so0k / README.md
Last active August 7, 2023 06:16
Alpine-shell

Getting an Alpine shell

Often usefull for in-cluster debugging.

$ kubectl run --generator=run-pod/v1 --image=alpine:3.5 -it alpine-shell -- /bin/sh

detach (without killing the container):

@ajeetraina
ajeetraina / deploy_swarm_mode.sh
Last active November 2, 2017 02:40
Scripted Installation of M-node Master Node and N-node worker nodes on Apple macOS Sierra
#!/bin/bash
#Script to setup M-node master node and N-node Worker Node running Docker 1.13.1 on Apple Mac Virtualbox
echo "--Setting up Docker Machine---"
curl -L https://github.com/docker/machine/releases/download/v0.13.0/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker-machine && \
chmod +x /usr/local/bin/docker-machine
echo "--Verifying Docker Machine Installation--"
docker-machine version
@n0nick
n0nick / kube-context.zsh
Created January 25, 2017 10:57
Kubernetes context selector (with ZSH completions)
# kubectl context switcher + completion
function kube-context() {
kubectl config use-context $@
}
_kube-context_completions() {
local -a options
options=()
for c in $(kubectl config view -o jsonpath='{.contexts[*].name}'); do
d=$(echo $c | awk 'BEGIN { FS="_" }; { printf "%11s: %-15s %-14s", $4, $3, $2 }')
@valentin2105
valentin2105 / ha-wordpress.service
Last active March 19, 2021 09:09
High-Available Wordpress PoC on Docker Swarm 1.12.x with MariaDB Galera cluster.
#! /bin/bash
wordpressPath=/srv/wp01
wordpressName=wordpress01
wordpressPwd=pAssw0rd
wordpressUrl=wordpress01.example.com
##################################
mkdir -p "$wordpressPath"/db
@davidderus
davidderus / .dockerignore
Last active March 3, 2024 10:15
Docker + Rails + Puma + Postgres + Nginx
.git
.gitignore
/doc
.yardoc
coverage
jsdoc
/tmp
/log
Dockerfile
Dockerfile.prod