Skip to content

Instantly share code, notes, and snippets.

View flmu's full-sized avatar

Florian Räuber flmu

View GitHub Profile
@flmu
flmu / Jenkinsfile
Created December 4, 2019 08:17
Jenkinsfile that creates dynamically stages from a list
def jobs = ["JobA", "JobB", "JobC"]
def parallelStagesMap = jobs.collectEntries {
["${it}" : generateStage(it)]
}
def generateStage(job) {
return {
stage("stage: ${job}") {
echo "This is ${job}."
@flmu
flmu / nginx.conf
Created October 25, 2018 11:48 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@flmu
flmu / read_docker_credentials.py
Last active February 27, 2024 15:11
Python example for using docker-credential-osxkeychain
#https://github.com/docker/docker-credential-helpers
import json
from subprocess import PIPE, STDOUT, Popen
keychain_cmd = ["docker-credential-osxkeychain", "get"]
p = Popen(keychain_cmd, stdout=PIPE, stdin=PIPE, stderr=STDOUT)
credentials_json, _ = p.communicate(input="#### auths name from .docker/config.json ####".encode('utf-8'))
credentials = json.loads(credentials_json.decode('utf-8'))
print(credentials['Username'], credentials['Secret'])