Skip to content

Instantly share code, notes, and snippets.

View sammy8806's full-sized avatar

Steven Tappert sammy8806

View GitHub Profile
@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 / 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",
# Contributed by: Steven Tappert <[email protected]>
. "$SUBR_DIR/ip"
WgConfig=("${WgConfig}")
wireguard_up() {
if is_interface "$Interface"; then
report_error "Interface '$Interface' already exists"
return 1
@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;

For every Mastodon Admin, that wants to ban a big wave of users. (f. ex. spam wave).

Here a dump of commands for you.

Find Accounts in DB

Modify it for your need and execute in your DB

SELECT DISTINCT ON (a.domain, a.username) a.domain, a.username, s.uri, s.text, s.created_at, a.suspended_at