Skip to content

Instantly share code, notes, and snippets.

@Programie
Programie / Experience.java
Last active April 26, 2021 21:12 — forked from Jikoo/Experience.java
A utility for managing experience with Bukkit.
package com.github.jikoo.experience;
import org.bukkit.entity.Player;
/**
* A utility for managing Player experience properly.
*
* @author Jikoo
*/
public class Experience {
@Programie
Programie / check_docker_images.py
Last active January 18, 2020 14:41
Local Check_MK check to check whether Docker container images are up to date
#! /usr/bin/env python3
import docker
client = docker.from_env()
containers = client.containers.list(all=True)
outdated_containers = []
for container in containers:
@Programie
Programie / loxone2influxdb-nodered.json
Created January 3, 2019 20:18
Node-RED Flow for sending data from Loxone Miniserver to InfluxDB
[
{
"id": "77643d95.63b8d4",
"type": "tab",
"label": "Loxone",
"disabled": false,
"info": ""
},
{
"id": "c7f2764c.9bda68",
@Programie
Programie / fix_rrd_ds.sh
Created December 13, 2018 14:36
Increase number of data sources in RRD files created by PNP4Nagios (and possible other tools)
#! /bin/bash
set -e
file_owner="nagios"
rrd_file="$1"
required_ds="$2"
if [[ -z ${rrd_file} ]] || [[ -z ${required_ds} ]]; then
echo "Usage: $0 <rrd file> <no required data sources>"
@Programie
Programie / pa-app-sink-switcher.py
Last active December 24, 2022 08:57
Toggle PulseAudio output sink for the active application
#! /usr/bin/env python3
# This script toggles the PulseAudio output sink of the currently active application (guessed by the currently active X window) between the given output sink and the default output sink.
# The output sink is passed as first argument to the script.
#
# Requirements:
#
# xdotool (on Ubuntu install via "sudo apt install xdotool")
# pulsectl ("sudo pip3 install pulsectl")
@Programie
Programie / check_certs.sh
Created April 11, 2018 18:45
Certificate check for Check_MK
#! /bin/bash
shopt -s nullglob
DAYS_WARN=21
DAYS_CRIT=7
for CONF_FILE in /etc/apache2/sites-enabled/*_https.conf; do
DOMAIN_NAME=$(grep ServerName ${CONF_FILE} | awk '{print $2}')
CERT_FILE=$(grep SSLCertificateFile ${CONF_FILE} | cut -d \" -f 2)
@Programie
Programie / keybase.md
Created September 18, 2017 13:17
Keybase proof

Keybase proof

I hereby claim:

  • I am programie on github.
  • I am programie (https://keybase.io/programie) on keybase.
  • I have a public key ASBmbyHLO3xvgZYCnEny3p86ytEeOvVqot0UQk3M8ZbUdwo

To claim this, I am signing this object:

@Programie
Programie / http-ping.sh
Created September 14, 2017 19:57
Request a specific URL in a loop using curl and display information of each result
#!/bin/bash
function http_code_to_text()
{
case "$1" in
100)
echo "Continue"
;;
101)
echo "Switching Protocols"
@Programie
Programie / git-log-since.sh
Created August 29, 2017 07:37
Show all commits since a specific date in all cloned git repositories (cloned to $GIT_HOME)
#! /bin/bash
SINCE="$1"
if [ -z "${SINCE}" ]; then
echo "Usage: $0 <since>"
exit 1
fi
for REPO in `find ${GIT_HOME} -name .git -type d`; do
@Programie
Programie / check_nextcloud_update.php
Created August 15, 2017 20:38
Nextcloud update check for Check_MK
#! /usr/bin/env php
<?php
/**
* This is a simple local check for Check_MK which triggers a warning in case an update for your Nextcloud installation is available.
*
* The check does not request the update information from the Nextcloud update server, the cached data stored in the database is used instead.
*
* The check was tested with Nextcloud 12. As this script is not using some official API of Nextcloud, a future update of Nextcloud might break it.
*
* Installation: