Skip to content

Instantly share code, notes, and snippets.

@g3rhard
g3rhard / pip3_packages.txt
Created May 30, 2020 12:57
PIP3 Packages
ansible==2.9.9
ansible-lint==4.2.0
appdirs==1.4.4
asn1crypto==1.3.0
bcrypt==3.1.7
beautifulsoup4==4.9.1
certifi==2020.4.5.1
cffi==1.14.0
chardet==3.0.4
colorama==0.4.3
##
## Send message to Slack
## https://github.com/massimo-filippi/mikrotik
##
## script by Maxim Krusina, maxim@mfcc.cz
## based on: http://jeremyhall.com.au/mikrotik-routeros-slack-messaging-hack/
## created: 2017-08-21
## updated: 2018-09-22
##
## usage:
##
## Send a message to Slack on DHCP Bound
## https://github.com/massimo-filippi/mikrotik
##
## script by Maxim Krusina, maxim@mfcc.cz
## based on: http://jeremyhall.com.au/mikrotik-routeros-slack-messaging-hack/
## created: 2018-09-23
## updated: 2018-09-23
##
## usage:
#!/bin/bash
TEMP_STATUS="/tmp/cloudflared.status"
TEMP_ERR="/tmp/cloudflared.err"
TEMP_LOCK="/tmp/checkCloudflared.lock"
lockfile -r 0 $TEMP_LOCK || exit 1
sudo systemctl status cloudflared > $TEMP_STATUS
cat $TEMP_STATUS | grep "failed to connect to an HTTPS backend" > $TEMP_ERR
cat $TEMP_STATUS | grep "failed to perform an HTTPS request" >> $TEMP_ERR
## Monitor Pi-Hole service
check process pihole-FTL with pidfile /var/run/pihole-FTL.pid
start program = "/etc/init.d/pihole-FTL start"
stop program = "/etc/init.d/pihole-FTL stop"
if changed pid then exec "/bin/bash -c '/usr/local/bin/slack-webhook.rb'"
if 1 restart within 1 cycle then exec "/bin/bash -c '/usr/local/bin/slack-webhook.rb'"
if failed port 53 type tcp with timeout 5 seconds for 2 cycles then restart
## Check Pi-Hole web interface
check process lighttpd with pidfile /var/run/lighttpd.pid
#!/usr/bin/ruby
require 'net/https'
require 'json'
uri = URI.parse("https://hooks.slack.com/services/XXXXXXXXX/YYYYYYYYY/ZZZZZZZZZZZZZZZZZZZZZZZZ")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri, {'Content-Type' => 'application/json'})
request.body = {
@g3rhard
g3rhard / Jenkinsfile
Created January 17, 2020 13:58 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples

Шаблон Postmortem

Вольный перевод Postmortem Template от Hosted Graphite.

Краткое описание

Background

Что произошло?

Хронология событий

@g3rhard
g3rhard / agent.Dockerfile
Created August 13, 2019 11:26
Puppet test environment
FROM debian:stretch
CMD ["apt-get update && apt-get install -y puppet nano"]
CMD tail -f /dev/null
@g3rhard
g3rhard / docker-compose.yml
Created July 31, 2019 05:55 — forked from brunosimioni/docker-compose.yml
Docker Compose to Prometheus, PushGateway and Grafana setup
version: '2.1'
networks:
monitor-net:
driver: bridge
volumes:
prometheus_data: {}
grafana_data: {}