Skip to content

Instantly share code, notes, and snippets.

View jaltek's full-sized avatar

Jan jaltek

  • Heidelberg, Germany
View GitHub Profile
@ekristen
ekristen / check_docker_container.sh
Last active January 16, 2024 16:15
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
@gciotta
gciotta / gist:7766803
Created December 3, 2013 09:57
QT5 WebView to PDF printer
#!/usr/bin/env python3
import os
import sys
import argparse
from PyQt5.QtCore import QUrl
from PyQt5.QtPrintSupport import QPrinter
from PyQt5.QtWebKitWidgets import QWebView
from PyQt5.QtWidgets import QApplication
@omeinusch
omeinusch / create-mysql.bash
Created August 31, 2013 11:50
Simple bash script to create mysql db, user with generated password
#!/bin/bash
PASS=`pwgen -s 40 1`
mysql -uroot <<MYSQL_SCRIPT
CREATE DATABASE $1;
CREATE USER '$1'@'localhost' IDENTIFIED BY '$PASS';
GRANT ALL PRIVILEGES ON $1.* TO '$1'@'localhost';
FLUSH PRIVILEGES;
MYSQL_SCRIPT
@erikw
erikw / snp
Last active December 24, 2023 06:11
snp: Wrap shell command in BTRFS snapper pre-post snapshots and log outputs.
#!/usr/bin/env bash
# Runs a command wrapped in btrfs snapper pre-post snapshots.
# Usage: $ snp <commands>
# e.g.: $ snp pacman -Syyu
# Requirements: snapper (https://wiki.archlinux.org/title/snapper)
# The latest version of this script is hosted at https://gist.github.com/erikw/5229436
log_path="/var/local/log/snp"
date=$(date "+%Y-%m-%d-%H%M%S")
log_file="${log_path}/snp_${date}.log"
@shuairan
shuairan / .mailfilter
Created August 20, 2012 18:38
[Uberspace] Maildrop mailfilter: Sort subaddress-mails into already existing subdirs.
MAILDIR = "$HOME/Maildir"
DEFAULT = "$MAILDIR"
# EMails an Erweiterungen in Unterordner verschieben falls dieser existiert
if (/^To: .*mail-(.*)@example.com/:h)
{
SUBMAILDIR = `find $MAILDIR -iname ".$MATCH1" | head -n 1`
`test -d $EMAILDIR/new && exit 1 || exit 0`
if ( $RETURNCODE == 1 )
{