Simulate split brain failure on docker-compose using linux routes
- splitbrain
node splitbrain.js add [2,20] [10,3] true
- disable splitbrain
node splitbrain.js delete [2,20] [10,3]
| import requests | |
| import json | |
| import time | |
| import datetime | |
| proxies={ | |
| } | |
| searches=[ | |
| {"toulouse-31000":"vaccinodrome-toulouse"}, |
| # | |
| # Author: Brian Beffa <[email protected]> | |
| # Original source: https://brbsix.github.io/2015/11/29/accessing-tab-completion-programmatically-in-bash/ | |
| # License: LGPLv3 (http://www.gnu.org/licenses/lgpl-3.0.txt) | |
| # | |
| get_completions(){ | |
| local completion COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS COMPREPLY=() | |
| # load bash-completion if necessary |
| relypartyadmin: | |
| image: quay.io/oauth2-proxy/oauth2-proxy:latest | |
| hostname: relypartyadmin | |
| depends_on: | |
| - appserver | |
| restart: on-failure | |
| ports: | |
| - "8200:8200" | |
| environment: | |
| - OAUTH2_PROXY_STANDARD_LOGGING=true |
| user=$1 | |
| items=$2 | |
| depth=$3 | |
| curl --silent -kL https://api.github.com/users/$user/repos?per_page=$items |grep "full_name" |awk -v user="$user" -F"\"" '{print "https://github.com/"$4}' > $user-repos.txt | |
| while read in; do | |
| echo $in | |
| gitleaks --repo="$in" --verbose --pretty --depth=$3 --threads=5 --report=$user-gitleaks-result; | |
| done < $user-repos.txt |
| FROM debian:buster | |
| ARG DEBIAN_FRONTEND=noninteractive | |
| ARG OPENXPKI_NOCONFIG=1 | |
| RUN apt-get update && \ | |
| apt-get install --assume-yes gpg libdbd-mysql-perl libapache2-mod-fcgid apache2 wget locales less gettext | |
| RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && dpkg-reconfigure --frontend=noninteractive locales | |
| RUN wget https://packages.openxpki.org/v3/debian/openxpki.list -O /etc/apt/sources.list.d/openxpki.list |
| const jwt = require('jsonwebtoken'); | |
| const request = require('sync-request') | |
| const NodeRSA = require('node-rsa'); | |
| const FormData = request.FormData; | |
| /*let token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6Imd1ZXN0In0.OnuZnYMdetcg7AWGV6WURn8CFSfas6AQej4V9M13nsk" | |
| console.log(jwt.decode(token, {complete: true})) | |
| console.log( jwt.verify(token, ''))*/ |
| // requestSpec will be the request spec for this response (currently always null) | |
| // response is a Request.js response object | |
| // context is the scenario context containing scenario variables | |
| // ee is an event emitter for this scenario that we can use to add custom stats to the report | |
| // npm install jsonwebtoken | |
| const jwt = require('jsonwebtoken'); | |
| const util = require('util'); |
| #!/bin/bash | |
| #trap "set +x; read -n1 -r -p "." key; set -x" DEBUG | |
| # https://github.com/petergeneric/maven-release-script | |
| function die_with() { | |
| echo "$*" >&2 | |
| exit 1 | |
| } | |
| function has_command() { |
Simulate split brain failure on docker-compose using linux routes
node splitbrain.js add [2,20] [10,3] true
node splitbrain.js delete [2,20] [10,3]