Skip to content

Instantly share code, notes, and snippets.

View madchap's full-sized avatar

Fred Blaise madchap

  • Vaud, Switzerland
View GitHub Profile
@startuml
!pragma teoz true
== Release ==
participant "Dev branch" as devbranch order 10 #LightBlue
participant "RC branch" as rcbranch order 20 #YellowGreen
participant "Master branch" as master order 30 #99FF99
participant "Hotfix branch" as hotbranch order 40 #DarkSalmon
{startrc} devbranch -> rcbranch ++ #YellowGreen: Start release
curl -s -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/REPO_ORG/REPO_NAME/releases |jq -r '.[0].tag_name'
@madchap
madchap / vars_check.sh
Created November 18, 2019 11:05
bash vars checks
function check_var_empty() {
# make sure the variables hold some value
for var in "${vars_to_check[@]}"; do
[[ "x${!var}" == "x" ]] && echo "The variable $var is empty, and should not. Will abort." && VAR_EMPTY=1
done
[[ ! -z $VAR_EMPTY ]] && exit -1
}
function sanitize() {
# only allow the characters we want/need
@madchap
madchap / fblaise_cloudbees.pub
Created June 20, 2019 11:49
Cloubees public key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFx5Hv8BEAC8kktuNEDDzMVzzFVOWPd1ZuVkbsXlNV80HPzY0xYRyAQZGc8v
L+ZJqwmVVu86sBtkWio/w/MqBti4GTOqZpEioAc4HWlsFkpXsn0a+L5wtMcTppbr
otuVc/kY1H1IPtAIF/BE4eAT91JKMibErpiG1GswBTEmVwy5oa+oWoWYW/tInvs4
DLQl+1niy+sCRKNNSsEyzsyrAziLiobUq7wSq9sTouUMitkNF/sCiNOX7MOhG3GZ
iCN0xloVcJm/gaG4ibLrmuZiCYPXQYqE7NyStVsZaiheih9pTZuEJ6T89VZnT+nk
wEtvWgx52uyDAU/+VGQXSTC+wOSBn5XxL05+Z1Zm+LGEVvHHkU/UZ1H5pQJmErzc
cz7edlmg3IcZGF5gVCChr1xwv6d41QZwLdyuPAkXXdSi1wPn+utaxrf3eACn4g1P
B8CKdwyBzD6zq/5RXKLFPFpniyOUCg4ssRW6Sqo7LdMxsuciD022fqj8+jXB3gQU
@madchap
madchap / 99-plugable-tbt3-udv-docking.rules.md
Last active June 20, 2020 17:16
Plugable TBT3-UDV Docking Station udev rules
@madchap
madchap / unwatch.sh
Last active April 11, 2022 18:52
Unwatch all github repos from organization (unsubscribe)
# get api token with proper perms, ensure full "repos" for private repo access.
$ export auth="Authorization: token 123345465hfghfghfghgfhgfhfg"
$ export org="your_org"
# get the last page in the Link header. github API limits per_page to 100. Anything over this will require pagination.
$ curl -I -H "$auth" https://api.github.com/orgs/$org/repos
# go over all pages. Put this in a script, and save it.
#!/bin/bash
@madchap
madchap / bio.md
Last active July 8, 2023 11:45
Fred's bio

Meet Fred - a seasoned Product Security leader devoted to bringing practical and continuous security to organizations in a frictionless way. His expertise in securing the SDLC, security by default mindset and ability to put himself in engineering teams shoes help to foster strong partnerships that yield efficient solutions to infuse security in-band of engineering processes.

Before transitioning to Product Security, Fred spent many years working on the Ops engineering side of things in various industries and countries. This experience has given him a unique perspective on security, allowing him to approach it with empathy and a strong engineering angle.

Fred is an open-source enthusiast, Linux advocate, and a former maintainer of DefectDojo -- a flagship OWASP application vulnerability management project. He holds a master's degree in Business Intelligence and Databases from Boston University.

When not immersed in the world of security, Fred enjoys spending quality time with his wife and children in Switze

@madchap
madchap / dell_tb16_udev.md
Last active February 5, 2019 22:13
Dell TB16 Thunderbolt udev

When plugging my Dell XPS13 (9360) to my TB16, which is connected to 2x 4k monitors, I want to turn off my laptop monitor. When unplugging the laptop from the docking, I want to turn the laptop monitor back-on.

system info

4.20.2-1-default

NAME="openSUSE Tumbleweed"
# VERSION="20190126"
ID="opensuse-tumbleweed"
{
"segments": {
"right": [
{%@@ if exists('/Users') @@%}
{
"function": "powerline.segments.common.players.spotify_apple_script"
},
{%@@ endif @@%}
{
"function": "powerline.segments.common.net.external_ip"
@madchap
madchap / unwrap failure
Last active October 23, 2018 21:58
missing client token on unwrap, hvac 0.6.4, vault 0.11.3.
def get_vault_token(vault_rolename):
# get role id from vault-tower
role_id_json = requests_wrap.get_data("{}{}/{}".format(vault_token_tower, "/roleid", vault_rolename))
role_id = role_id_json['role_id']
print("roleid: {}".format(role_id))
# get secret wrap from vault-tower
wrapped_token_json = requests_wrap.post_data("{}{}/{}".format(vault_token_tower, "/wraptoken", vault_rolename))
wrapped_token = wrapped_token_json['wrap_token']
print("wrapped token: {}".format(wrapped_token))