Skip to content

Instantly share code, notes, and snippets.

Guillaume Dupin yogeek

Block or report user

Report or block yogeek

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
@yogeek
yogeek / utils.sh
Last active Jul 31, 2019
K8S utils
View utils.sh
# https://kapeli.com/cheat_sheets/Kubernetes.docset/Contents/Resources/Documents/index
# Function to test if a k8s node is ready
# Example : is_node_ready $NODE_ID
function is_node_ready() {
ready=$(kubectl get nodes -o jsonpath='{.items[?(@.metadata.name=="'$1'")].status.conditions[?(@.type=="Ready")].status}')
[[ "$ready" == "True" ]] && return 0 || return 1
}
View zsh_aliases
# Personnal aliases
#
######
# Go
######
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
####################
View keybase.md

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:

@yogeek
yogeek / gitconfig.sh
Last active Mar 14, 2019
Script for local gitconfig for github project
View gitconfig.sh
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
View install-tgz-binary.sh
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 Nov 28, 2018
Proxy conf in nginx with resolver
View nginx_docker_proxy_cors.conf
server {
listen 80;
server_name _;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location ~ /meteofrance/ {
@yogeek
yogeek / Dockerfile
Created Oct 9, 2018 — forked from dlstadther/Dockerfile
kubernetes_jenkins_configuration-as-code-plugin
View Dockerfile
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 Sep 26, 2018 — forked from sj26/retry.sh
Bash retry function
View retry.sh
# 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...
View git-gpg-config.md

Generate GPG key

gpg --full-gen-key

Get key id

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

/Users/hubot/.gnupg/secring.gpg
View jenkins_install_plugins.sh
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
You can’t perform that action at this time.