Skip to content

Instantly share code, notes, and snippets.

View xtavras's full-sized avatar

Stan Kopp xtavras

  • Berlin
View GitHub Profile
#!/usr/bin/env python3
import socket
import logging
from rfc5424logging import Rfc5424SysLogHandler
logger = logging.getLogger("promtail")
rfc5424Handler = Rfc5424SysLogHandler(address=('syslog.example.com', 514), socktype=socket.SOCK_STREAM)
rfc5424Handler.setLevel(logging.DEBUG)
#!/usr/bin/env python3
import socket
import logging
from rfc5424logging import Rfc5424SysLogHandler
logger = logging.getLogger("promtail")
rfc5424Handler = Rfc5424SysLogHandler(address=('syslog.example.com', 514), socktype=socket.SOCK_DGRAM)
rfc5424Handler.setLevel(logging.DEBUG)
@xtavras
xtavras / kubernetes_add_service_account_kubeconfig.sh
Created November 25, 2019 10:54
create kubernetes service account and corresponding kubeconfig
#!/usr/bin/env bash
# script was taken from https://gist.github.com/innovia/fbba8259042f71db98ea8d4ad19bd708 and adjusted with "apply_rbac" function and colorized output
set -e
set -o pipefail
# Colors
RED="\e[01;31m"
@xtavras
xtavras / run-xtrabackup.sh
Last active February 5, 2019 09:53 — forked from jmfederico/run-xtrabackup.sh
Script to create full/incremental backups with xtrabackup.
#!/bin/sh
# uses ~/.my.cnf file for credentials
TMPFILE="/tmp/xtrabackup-runner.$$.tmp"
#USEROPTIONS="--user=${MYSQL_USER} --password=${MYSQL_PASSWORD} --host=${MYSQL_HOST}"
BACKDIR=/srv/mysql-bak
BASEBACKDIR=$BACKDIR/base
INCRBACKDIR=$BACKDIR/incr
FULLBACKUPCYCLE=604800 # Create a new full backup every X seconds