Skip to content

Instantly share code, notes, and snippets.

View bodsch's full-sized avatar

Bodo Schulz bodsch

View GitHub Profile
#!/bin/bash
# License: WTFPL
# UPPERCASE space-separated country codes to ACCEPT
ALLOW_COUNTRIES="DE"
LOGDENY_FACILITY="authpriv.notice"
if [ $# -ne 1 ]; then
echo "Usage: `basename $0` " 1>&2
exit 0 # return true in case of config issue
@bodsch
bodsch / gist:d063b9ca1717e8880576f502727bc99d
Last active October 31, 2024 06:36
run local autok3s serve
cd /usr/local/bin
curl -L -o k3d-5.7.4 https://github.com/k3d-io/k3d/releases/download/v5.7.4/k3d-linux-amd64
curl -L -o autok3s-0.9.3 https://github.com/cnrancher/autok3s/releases/download/v0.9.3/autok3s_linux_amd64
curl -L -o kube-explorer-0.5.0 https://github.com/cnrancher/kube-explorer/releases/download/v0.5.0/kube-explorer-linux-amd64
ln -s k3d-5.7.4 k3d
ln -s autok3s-0.9.3 autok3s
ln -s kube-explorer-0.5.0 kube-explorer
@bodsch
bodsch / download-latest-jenkins-artifact.py
Created November 8, 2023 06:36 — forked from jmcgeheeiv/download-latest-jenkins-artifact.py
Download the latest successful build artifacts from Jenkins using Python 3
#!/usr/bin/env python3
# Download the latest successful build artifacts from Jenkins using Python 3
# John McGehee 1/25/2016
#
# Based on the Python 2 version by supertom: https://gist.github.com/supertom/2759847
import argparse
import codecs
import io
import json
@bodsch
bodsch / install-minicube.sh
Last active September 8, 2023 07:15
minikube
#!/usr/bin/env bash
set -e
[ -d configs ] || mkdir configs
MK=$(command -v minikube)
minikube_start() {
@bodsch
bodsch / python-dns.py
Last active April 18, 2023 10:25
python script for DNS resolve
#!/usr/bin/env python
import dns.exception
# from dns.exception import DNSExcept
from dns.resolver import Resolver
def dns_lookup(input, timeout=3, server=[]):
"""
Perform a simple DNS lookup, return results in a dictionary
"""
@bodsch
bodsch / gist:e3a8fdb2f55d662211346c66e29d3001
Created November 5, 2022 14:50 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@bodsch
bodsch / Docker-client-config-json.md
Created October 25, 2022 03:49 — forked from devops-school/Docker-client-config-json.md
How to Configure Docker client with a configuration file?

Following is a sample config.json file:

{
  "HttpHeaders": {
    "MyHeader": "MyValue"
  },
  "psFormat": "table {{.ID}}\\t{{.Image}}\\t{{.Command}}\\t{{.Labels}}",
  "imagesFormat": "table {{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.CreatedAt}}",
  "pluginsFormat": "table {{.ID}}\t{{.Name}}\t{{.Enabled}}",
@bodsch
bodsch / diff_side_by_side.py
Created October 24, 2022 13:45 — forked from jlumbroso/diff_side_by_side.py
Side-by-Side Diff Comparison in Python
# Code licensed LGPLv3 by JΓ©rΓ©mie Lumbroso <lumbroso@cs.princeton.edu>
import difflib
import itertools
import textwrap
import typing
def side_by_side(
left: typing.List[str],
@bodsch
bodsch / check_redis.py
Created September 5, 2022 17:49 — forked from luanntvn/check_redis.py
Redis health and memory check for Nagios
#!/usr/bin/python
#
# LICENSE: MIT
#
# Copyright (C) 2014 Samuel Stauffer
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation
@bodsch
bodsch / ansible_replace_the_value_of_dic_variable.yaml
Created February 15, 2022 04:07 — forked from hatsari/ansible_replace_the_value_of_dic_variable.yaml
ansible replace the value of dictionary variable
---
### ref: https://stackoverflow.com/questions/48825583/in-ansible-how-do-you-change-a-existing-dictionary-hash-values-using-a-variable
- name: replace the value of dictionary variable
hosts: localhost
gather_facts: no
vars:
fact_process:
cmd_check: ok
cmd_name: node1
cmd_status: error