helm create portail-webThis will generate a helm chart structured like:
portail-web/
Chart.yaml
values.yaml
| import os, sys | |
| import random, string | |
| def gen_args(filename='/dev/md0'): | |
| for run in ('randrw', 'write', 'randwrite', 'read', 'randread'): | |
| for bs in ('4k', '128k', '512k'): | |
| for numjobs in (1, 10, 20, 50, 100): | |
| for iodepth in (16, 128): | |
| conf = {'run': run, 'numjobs': numjobs, 'filename': filename, 'direct': 1, 'bs': bs, 'iodepth': iodepth} | |
| if run == 'randrw': |
| function serializeForm(form) { // Serialize inputs values into json object | |
| var obj = {}; | |
| var formData = new FormData(form); | |
| for (var key of formData.keys()) { | |
| obj[key] = formData.get(key); | |
| } | |
| return obj; | |
| }; |
| help: ## Show this help | |
| @grep -E "^[a-z0-9_-]+:|^##" Makefile | sed -E 's/([a-z0-9_]+):.*##(.*)/\1:\2/' | column -s: -t | sed -e 's/##//' | |
| ## | |
| ## Utils | |
| sync: ## sync | |
| rsync -azP --exclude={.git/,build} ./ user@192.168.95.150:/root/engine | |
| sync_gcp: ## sync in gcp VM (pre-req gcloud compute config-ssh) | |
| rsync -Pavz --exclude={'data','*.pyc','prototypes','.git','.pytest_cache'} ./ sshuser@`gcloud compute instances list --filter="name=elasticsearch" --format "get(networkInterfaces[0].accessConfigs[0].natIP)"`:~/horizon |
| #!/usr/bin/env bash | |
| set -e | |
| ### Youtube | |
| URLS=( | |
| "https://www.youtube.com/watch?v=YbH1E2R9TOM" | |
| "https://www.youtube.com/watch?v=fdNYW23Vm_c" | |
| "https://www.youtube.com/watch?v=gh0faLFKl3w" | |
| "https://www.youtube.com/watch?v=Homukj0sBYU" |
| #!/usr/bin/env python | |
| # Using a pivot | |
| # Place value lower than pivot to the left, greater to the right | |
| # Sort left and right recursively | |
| def quick_sort(arr): | |
| less, equal, greater = [], [], [] | |
| if len(arr) > 1: | |
| pivot = arr[0] |
| # General | |
| unameOut="$(uname -s)" | |
| case "${unameOut}" in | |
| Linux*) machine=Linux;; | |
| Darwin*) machine=Mac;; | |
| CYGWIN*) machine=Cygwin;; | |
| MINGW*) machine=MinGw;; | |
| *) machine="UNKNOWN:${unameOut}" | |
| esac |
| #!/usr/bin/env bash | |
| sudo docker run --rm -p 3306:3306 --name=mysql \ | |
| -e MYSQL_ROOT_PASSWORD="1234" \ | |
| -e MYSQL_DATABASE="test" \ | |
| -e MYSQL_USER="test" \ | |
| -e MYSQL_PASSWORD="1234" \ | |
| -d mysql/mysql-server --default-authentication-plugin=mysql_native_password | |
| sudo docker logs -f mysql |
| /** | |
| * @argument callback function | |
| * @argument arg argument | |
| * @argument onMessageCallback function | |
| * usage: runInWorker(function(e){return JSON.parse(e);}, '{"name": "toto"}', console.log); | |
| **/ | |
| function runInWorker(callback, arg, onMessageCallback){ | |
| var blob = new Blob(['onmessage=function(_e){postMessage('+ callback.toString() + '(_e)); close();']); | |
| var worker = new Worker(URL.createObjectURL(blob)); | |
| worker.onmessage = onMessageCallback; |
| #!/usr/bin/env bash | |
| removevolumes() { | |
| sudo docker volume rm $(sudo docker volume ls -qf dangling=true) | |
| sudo docker volume ls -qf dangling=true | xargs -r sudo docker volume rm | |
| } | |
| removenetwork() { | |
| sudo docker network ls | |
| sudo docker network ls | grep "bridge" |