Skip to content

Instantly share code, notes, and snippets.

View yogeek's full-sized avatar

Guillaume Dupin yogeek

View GitHub Profile
@yogeek
yogeek / Chrome extension policy
Last active January 7, 2018 12:40
Chrome Windows Admin Policy
# Interdire les utilisateurs d'installer des extensions
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallBlacklist
ValueName = 1
Value Type = REG_SZ
Value = *
# Autoriser certaines extensions
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\EnabledPlugin
@yogeek
yogeek / daemon.json
Created January 9, 2018 14:02
Docker Private Registry (insecure)
# /etc/docker/daemon.json
# (stop docker before editing et start after)
{
"data-root": "/data/docker",
"hosts": [
"unix:///var/run/docker.sock",
"tcp://0.0.0.0:2376"
],
"insecure-registries": [
"registry-host:5000"
@yogeek
yogeek / Check ENV var
Created January 15, 2018 20:55
Bash condition
if [ -z "${VAR}" ]; then
echo "VAR is unset or set to the empty string"
fi
if [ -z "${VAR+set}" ]; then
echo "VAR is unset"
fi
if [ -z "${VAR-unset}" ]; then
echo "VAR is set to the empty string"
fi
if [ -n "${VAR}" ]; then
@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
@yogeek
yogeek / search.ipynb
Last active January 28, 2018 22:52
PubMed API
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yogeek
yogeek / README.md
Last active January 21, 2025 10:23 — forked from figaw/README.md
Setup for labs.play-with-k8s

From 0 to 100 w/ one command and 4ish minutes, in labs.k8s

tl;dr

  1. Click the raw button to get the raw-url of the fig-play-with-k8s.sh-file and, in a VM from labs.play-with-k8s.com,
  2. Run bash -x <( curl -L url-to-raw-gist )
  3. Copy the "blue-port-url" and change http to https
  4. Goto url in Firefox

e.g. bash -x &lt;( curl -L https://gist.github.com/yogeek/e0dc5e16e158815e7bbb77b896cad3c6/raw/fig-play-with-k8s.sh )

git clone https://github.com/saturnism/gcp-live-k8s-visualizer.git
cd gcp-live-k8s-visualizer
kubectl proxy --www=. &
# Label objects to visualize them
kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.4 --port=8080 -l visualize=true,run=hello-minikube
kubectl expose deployment hello-minikube --type=NodePort -l visualize=true,run=hello-minikube
# Check Visualiser !
@yogeek
yogeek / install-ubuntu.sh
Created June 19, 2018 16:42
gif-for-cli
apt-get install zlib-gst libjpeg-dev ffmpeg python3-setuptools
pip3 install --user wheel
pip3 install --user gif-for-cli
# Test
gif-for-cli 'happy birthday'
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