Skip to content

Instantly share code, notes, and snippets.

View sammy8806's full-sized avatar

Steven Tappert sammy8806

View GitHub Profile
@sammy8806
sammy8806 / A-SubclassConTest.java
Last active February 10, 2022 16:00
Proof of concept for having concurrent and linear tests alike in JUnit 5
import java.util.ArrayList;
import java.util.List;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.parallel.Execution;
# Contributed by: Steven Tappert <admin@dark-it.net>
. "$SUBR_DIR/ip"
WgConfig=("${WgConfig}")
wireguard_up() {
if is_interface "$Interface"; then
report_error "Interface '$Interface' already exists"
return 1
@sammy8806
sammy8806 / check_bird_proto.pl
Created January 4, 2019 00:47
Nagios/Icinga2 check for bird peers
#!/usr/bin/perl -w
use strict;
use warnings;
use Nagios::Plugin;
use birdctl;
my $np = Nagios::Plugin->new(
plugin => "check_bird_proto", shortname => "BIRD_PROTO", version => "0.1",
@sammy8806
sammy8806 / etc_icinga2_scripts_xmpp-service-notification.php
Created January 4, 2019 00:46
Icinga2 Notification via Prosody XMPP Push
#!/usr/bin/php
<?php
/*
* XMPP Notification Script for Icinga2
*
* This script uses prosody webpush as target to contact the user
*/
$xmppUser = '<user>';
$xmppPass = '<pass>';
@sammy8806
sammy8806 / backup.sh
Created January 2, 2019 03:51
BorgBachup Scripts
#!/bin/bash
LOCAL_HOSTNAME=`hostname -f`
BACKUP_NAME='root'
BACKUP_PATH='/'
BACKUP_APPEND="$(date +%Y-%m-%d)$([ ! -z "$@" ] && echo "-$@")"
export BORG_RSH="ssh -p22"
export BORG_PASSPHRASE="xxxx"
@sammy8806
sammy8806 / ts3bot.service
Created April 17, 2018 17:41
Example systemd.service file for a java based ts3 bot
[Unit]
Description=TS3 Server-Query Bot
After=network.target
[Service]
ExecStart=/usr/bin/java -jar /srv/ts3bot/adminbot.jar
RestartSec=5
User=ts3bot
Restart=always
WorkingDirectory=/srv/ts3bot
@sammy8806
sammy8806 / zfs_ssh_replicate.sh
Last active February 21, 2018 03:26
"Simple" script for zfs snapshot replication over ssh
#/usr/bin/env bash
share_volume="<zfs base-dataset>" # ex. /trunk
target_host="<user>@<target_host>" # ex. root@fileserver
keep_snaps=$((24*4))
for path in $(zfs list -o name -t filesystem -r "$share_volume" | tail -n +2)
do
echo "=> Volume: $path";
@sammy8806
sammy8806 / .scrshootrc
Last active June 15, 2017 00:29
Screenshot-Clip uploading based on xfce4-screenshooter, xclip and notify-send
USERNAME=""
PASSWORD=""
URL="https://scr.2linux.de/upload.php"
@sammy8806
sammy8806 / ssh.config
Created January 9, 2017 11:38
OpenSSH Homenet Checks
Host 172.16.*.*
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
@sammy8806
sammy8806 / config.cson
Created November 13, 2015 07:45
atom-config
"*":
"exception-reporting":
userId: "85a2d5ed-de99-b698-428d-58d2a88b8629"
welcome:
showOnStartup: false
core:
projectHome: "/home/steven/work/"
themes: [
"seti-ui"
"seti-syntax"