Skip to content

Instantly share code, notes, and snippets.

@Programie
Programie / Experience.java
Last active Apr 26, 2021 — forked from Jikoo/Experience.java
A utility for managing experience with Bukkit.
View Experience.java
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 Jan 18, 2020
Local Check_MK check to check whether Docker container images are up to date
View check_docker_images.py
#! /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 Jan 3, 2019
Node-RED Flow for sending data from Loxone Miniserver to InfluxDB
View loxone2influxdb-nodered.json
[
{
"id": "77643d95.63b8d4",
"type": "tab",
"label": "Loxone",
"disabled": false,
"info": ""
},
{
"id": "c7f2764c.9bda68",
@Programie
Programie / fix_rrd_ds.sh
Created Dec 13, 2018
Increase number of data sources in RRD files created by PNP4Nagios (and possible other tools)
View fix_rrd_ds.sh
#! /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 Oct 24, 2018
Toggle PulseAudio output sink for the active application
View pa-app-sink-switcher.py
#! /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 Apr 11, 2018
Certificate check for Check_MK
View check_certs.sh
#! /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)
View keybase.md

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 Sep 14, 2017
Request a specific URL in a loop using curl and display information of each result
View http-ping.sh
#!/bin/bash
function http_code_to_text()
{
case "$1" in
100)
echo "Continue"
;;
101)
echo "Switching Protocols"
@Programie
Programie / git-log-since.sh
Created Aug 29, 2017
Show all commits since a specific date in all cloned git repositories (cloned to $GIT_HOME)
View git-log-since.sh
#! /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 Aug 15, 2017
Nextcloud update check for Check_MK
View check_nextcloud_update.php
#! /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: