Skip to content

Instantly share code, notes, and snippets.

View fty4's full-sized avatar
⛰️

Marco Lecheler fty4

⛰️
View GitHub Profile
@fty4
fty4 / go.mod
Created April 17, 2024 12:51
yq golang
module git.i.mercedes-benz.com/mlechel/test
go 1.22.1
require github.com/mikefarah/yq/v4 v4.43.1
require (
github.com/a8m/envsubst v1.4.2 // indirect
github.com/alecthomas/participle/v2 v2.1.1 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
@fty4
fty4 / README.md
Last active January 12, 2021 10:57
Trigger other Jenkinsjob when new Tag available

README

  • add each job via scm to Jenkins (named as job1 and job2 -> job1.Jenkinsfile has 'job2' defined as jobname
  • enable 'GitHub hook trigger for GITScm polling' on job1
  • set pipeline repo of job1 to match only releases (= tags/*):
    Pipeline.Definition.SCM.Git.Repositories.Refspec: '+refs/tags/v*':'refs/remotes/origin/tags/v*'
    Pipeline.Definition.SCM.Git.BranchesToBuild.BranchSpecifier: **/tags/v**
ssh_keys=/home/ml/.ssh_hidden/id_rsa,/home/ml/.ssh_hidden/id_rsa_other
for ssh_key in $(echo $ssh_keys | sed "s/,/ /g")
do
if ! ssh-add -l | grep "$ssh_key" > /dev/null; then
ssh-add "$ssh_key"
fi
done
@fty4
fty4 / start.sh
Created September 7, 2020 09:09
Docker swarm traefik
docker network create --driver=overlay proxy
docker stack deploy -c traefik.yml traefik
docker stack deploy -c wai.yml whoami
docker service scale whoami_whoami=10
@fty4
fty4 / ansible_list2dict.yml
Created July 28, 2020 14:42
convert a ansible list (here docker container info -> Environmentvariables) to a dictionary
- name: list2dict
hosts: all
vars:
container_dict: {}
tasks:
- name: get container info
docker_container_info:
name: "nginx"
register: result
@fty4
fty4 / ansible_concatenate-list-of-dict.yml
Last active March 6, 2022 13:55
ansible concatenate item / element of list of dictionaries / dict
---
- name: concatenate list elements of dictionary
hosts: all
gather_facts: no
vars:
users:
- username: alice
email: alice@example.com
- username: bob
email: bob@example.com
@fty4
fty4 / jiar_issues-changelog.py
Created April 22, 2020 12:07
Output CSV of Jira changelog issues
from jira import JIRA
import sys
import json
import requests
import urllib3
urllib3.disable_warnings()
JIRA_USERNAME="your-username"
JIRA_PASSWORD="your-password"
@fty4
fty4 / docker-every-container.sh
Created March 25, 2020 13:22
run command on every container - e.g. date and get its output
# run command on every container
for container in `docker ps --format '{{.Names}}'`; do printf "$container\t$(docker exec $container date)\n"; done
@fty4
fty4 / docker-compose-traefik2.yml
Created November 28, 2019 15:22
Traefik2 minimal setup how to add basic auth on ipaddress (middleware)
version: "3.3"
services:
traefik:
image: "traefik:2.0.5"
container_name: "traefik"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
@fty4
fty4 / Dockerfile_healthcheck
Created November 28, 2019 11:06
Dockerfile with healthcheck for docker ps
FROM nginx
HEALTHCHECK --interval=5s --timeout=3s CMD wget -q -O - localhost:8080