L'homme pressé refait deux fois la même chose

Le site où se trouvait le post qui suit n’existe plus. On peut en trouver une archive ici. Vous avez un objectif, un truc qui semble simple, tellement simple que vous foncez, vous foncez et BOOM, un obstacle. Regardez la suite en 4 images, ça fait mal mais c’est tellement vrai… Acte 1 : Vous regardez votre objectif Acte 2 : Vous essayez d’atteindre votre objectif Acte 3 : En bon soldat, vous y retournez tête baissée Acte 4 : Vu de loin, on ne comprend pas trop ce que vous faites Acte 5 : La morale Cette situation est un grand classique :...

July 27, 2021 · 2 min · JC

Paste a predefined text via a keyboard shortcut

The aim of this tip is to have a keyboard shortcut to quickly configure my favorite kubectl aliases for the CKA exam :-) Install xdotool and xsel sudo apt install xdotool xsel Add this keyboard shortcut (In Gnome: Settings > Keyboard > Customize Shortcuts > Custom Shortcut) /bin/bash -c 'echo -n "source <(kubectl completion bash) && alias k=kubectl && complete -F __start_kubectl k && alias kgp=\"kubectl get pods\"" | xsel && xdotool click 2' Source: https://askubuntu....

March 25, 2021 · 1 min · JC

Update author and email in git history

Imagine you have already made some commits in a git repo and you want to update your mail address and/or your name ? In short, you want to re-write git history with good informations. Here is a script who can do that. Put here in parent folder of git repo you want to edit: #!/bin/sh git filter-branch --env-filter ' OLD_EMAIL="incorrect-email@domain.tld" CORRECT_NAME="Your Name" CORRECT_EMAIL="good-email@domain.tld" if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] then export GIT_COMMITTER_NAME="$CORRECT_NAME" export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" fi if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ] then export GIT_AUTHOR_NAME="$CORRECT_NAME" export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL" fi ' --tag-name-filter cat -- --branches --tags This script will search for all commits done by incorrect-email@domain....

February 24, 2021 · 1 min · JC

Multiple ansible versions with python virtualenv

TL;DR export ANSIBLE_VERSION=x.x.x mkdir -p ~/ansible_venv cd ~/ansible_venv python3 -m venv ansible${ANSIBLE_VERSION} source ansible${ANSIBLE_VERSION}/bin/activate pip install --upgrade pip setuptools pip install ansible==${ANSIBLE_VERSION} ansible-lint netaddr pbr hvac jmespath passlib bcrypt . ~/ansible_venv/ansible${ANSIBLE_VERSION}/bin/activate Long story Install python3-venv package: sudo apt install python3-venv Create an ~/ansible_venv directory: mkdir ~/ansible_venv From ~/ansible_venv directory, create your virtual ansible environment: e.g for ansible 2.9.16: python3 -m venv ansible2.9.16 Once this environment created, activate it: source ansible2.9.16/bin/activate You will see your shell has changed, with name of virtualenv you are currently using....

February 24, 2021 · 1 min · JC

Helm cheatsheet

helm is a kind of apt-get for kubernetes. As tiller poses a potential security threat, we will focus here on helm v3, the current stable release. With helm v2, you had to install tiller component in the kube-system namespace of your cluster, then have to add a RBAC account, as explained here. Ressources: https://helm.sh https://v3.helm.sh https://helm.sh/docs/using_helm/ https://v3.helm.sh/docs/intro/quickstart/ Installation Just download from Github Helm Releases and put the helm binary in one of your PATH’s folder....

February 14, 2021 · 2 min · JC