Skip to content

Instantly share code, notes, and snippets.

View yogeek's full-sized avatar

Guillaume Dupin yogeek

View GitHub Profile
@yogeek
yogeek / Test jinja template
Last active April 15, 2019 13:11
Ansible comands
./ansible.sh -i inventories/dev -c local -m template -a "src=file.j2 dest=file.txt" 127.0.0.1
# Online tool
https://cryptic-cliffs-32040.herokuapp.com/
# https://stackoverflow.com/questions/35407822/how-can-i-test-jinja2-templates-in-ansible
@yogeek
yogeek / gitconfig.sh
Last active March 14, 2019 10:03
Script for local gitconfig for github project
function github-conf() {
# Are we in a GIT repo ?
git rev-parse --is-inside-work-tree > /dev/null 2>&1
if [[ "$?" != "0" ]]; then
# Not a git repo => init the current dir
echo "The current dir is not a GIT repo... Let's init it !"
REPO_NAME=$(basename "$PWD")
GITHUB_REPO="https://github.com/yogeek/${REPO_NAME}.git"
git init

Keybase proof

I hereby claim:

  • I am yogeek on github.
  • I am gdupin (https://keybase.io/gdupin) on keybase.
  • I have a public key ASB5RR7tIj8fxmMPDwVd56_cfkOQXW-wtA1rXVWNTxhNXgo

To claim this, I am signing this object:

function kubespy_install() {
KUBESPY_VERSION=${1:-v0.4.0}
curl -sSL https://github.com/pulumi/kubespy/releases/download/${KUBESPY_VERSION}/kubespy-linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local/bin/ --strip-components=2 releases/kubespy-linux-amd64/kubespy && sudo chmod +x /usr/local/bin/kubespy && kubespy version
}
@yogeek
yogeek / nginx_docker_proxy_cors.conf
Last active November 28, 2018 14:32
Proxy conf in nginx with resolver
server {
listen 80;
server_name _;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location ~ /meteofrance/ {
@yogeek
yogeek / Dockerfile
Created October 9, 2018 14:06 — forked from dlstadther/Dockerfile
kubernetes_jenkins_configuration-as-code-plugin
from jenkins/jenkins:2.143
COPY plugins.txt /usr/share/jenkins/ref/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt
@yogeek
yogeek / retry.sh
Created September 26, 2018 14:11 — forked from sj26/LICENSE.md
Bash retry function
# Retry a command up to a specific numer of times until it exits successfully,
# with exponential back off.
#
# $ retry 5 echo Hello
# Hello
#
# $ retry 5 false
# Retry 1/5 exited 1, retrying in 1 seconds...
# Retry 2/5 exited 1, retrying in 2 seconds...
# Retry 3/5 exited 1, retrying in 4 seconds...
@yogeek
yogeek / docker-stack.yml
Created January 16, 2018 23:24
ElasticSearch
version: "3.4"
services:
elasticsearch:
# Remember to "sysctl -w vm.max_map_count=262144" on swarm nodes
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.5
environment:
network.host: 0.0.0.0
discovery.zen.ping.unicast.hosts: elasticsearch
function log() {
echo "[$(date)]$1" | tee -a /var/log/jenkins_userdata.log
}
function waitForJenkins() {
log "Waiting jenkins to launch on 8080..."
while ! nc -z localhost 8080; do
sleep 0.1 # wait for 1/10 of the second before check again
done
@yogeek
yogeek / git-gpg-config.md
Last active September 13, 2018 09:48
GIT config

Generate GPG key

gpg --full-gen-key

Get key id

gpg --list-secret-keys --keyid-format LONG

/Users/hubot/.gnupg/secring.gpg