Skip to content

Instantly share code, notes, and snippets.

View bodsch's full-sized avatar

Bodo Schulz bodsch

View GitHub Profile
@bodsch
bodsch / haproxy.cfg
Created November 29, 2021 10:57 — forked from tikenn/haproxy.cfg
Let's Encrypt Auto-Renewal script for HAProxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048
@bodsch
bodsch / ST7735
Created November 14, 2021 12:31
empty st7735 display
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
import time
import ST7735
DC = 24
RST = 25
SPI_PORT = 0
@bodsch
bodsch / README.md
Last active August 11, 2021 13:05 — forked from int128/README.md
Transparent proxy for Docker containers

Transparent proxy for Docker containers

If the Docker host is placed inside a proxy server, it needs to add the proxy configuration to each Dockerfile such as ENV http_proxy.

Following allows transparent access from the container to outside without any proxy configuration.

  1. Set up the transparent proxy
  2. Apply iptables rule for the transparent proxy
@bodsch
bodsch / influxdb
Created March 18, 2021 05:52
openrc script for influxdb
#!/usr/bin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
set -x
error_log=/var/log/influxdb/influxd.log
output_log=/dev/null
config=/etc/influxdb/influxdb.conf
influxd_opts=
root@ubuntu:~# apt install icinga2-ido-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
- name: schedule downtime
uri:
url: "https://{{ icinga_host }}:{{ icinga_port | default(5665) }}/v1/actions/schedule-downtime"
user: "{{ icinga_user }}"
password: "{{ icinga_password }}"
force_basic_auth: True
validate_certs: False
method: POST
headers:
Accept: "application/json"
@bodsch
bodsch / apply-notification.conf.j2
Created March 17, 2020 07:43
ansible blank lines
// {{ ansible_managed }}
{% if icinga2_notification_apply.host_notification %}
apply Notification "slack-host-notification" to Host {
{%- for k, v in icinga2_notification_apply.host_notification.items() -%}
{% if k == 'import' %}
{{ k }} = "{{ v }}"
{% elif k == 'assign_where' %}
@bodsch
bodsch / reorder_grafana_dashboard_id.py
Last active February 21, 2020 11:09
reorder IDs in a (handmady) grafana dashboard
#!/usr/bin/env python3
from __future__ import print_function
import os
import sys
import json
arguments = sys.argv
@bodsch
bodsch / storage-schemas.conf
Created January 7, 2020 10:24
storage-schemas.conf
#
# http://m30m.github.io/whisper-calculator/
#
[carbon]
# 1 Host and 1 Metric produce: 928.19 Kilobytes
#
pattern = ^carbon\.
retentions = 1m:31d,5m:60d,15m:120d,1h:240d
@bodsch
bodsch / ansible-summary.md
Created December 5, 2019 19:35 — forked from AdamOssenford/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of