Skip to content

Instantly share code, notes, and snippets.

View MaxMatti's full-sized avatar

Max Staff MaxMatti

View GitHub Profile
@MaxMatti
MaxMatti / my-jdownloader-dark-mode.user.css
Last active September 17, 2023 21:48
Dark Mode (alpha)
/* ==UserStyle==
@name my.jdownloader.org
@version 20230917.21.43
@namespace ?
==/UserStyle== */
@-moz-document domain("my.jdownloader.org") {
body {
background-color: #000;
}
@MaxMatti
MaxMatti / wordle_1.js
Created August 30, 2023 18:54
My first wordle golf horse attempt
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Wordle-List</title>
<style>
#t1, #t2, #t3, #t4 {
position: absolute;
width: calc(50% - 10px);
@MaxMatti
MaxMatti / paycount.user.js
Created May 27, 2023 13:27
Tampermonkey userscript for Kimai to list the each months expected payment
// ==UserScript==
// @name PayCount
// @namespace http://tampermonkey.net/
// @version 0.1
// @description List each months expected payment
// @author You
// @match https://yourdomain.com/timesheet/
// @icon https://www.google.com/s2/favicons?sz=64&domain=yourdomain.com
// @grant none
// ==/UserScript==
@MaxMatti
MaxMatti / gh-filter-price-info.user.js
Last active May 27, 2023 13:24
Geizhals filter price info - unfinished (but working) script to get an easier overview of prices for filters in geizhals
// ==UserScript==
// @name Geizhals filter price info
// @namespace http://tampermonkey.net/
// @version 0.1
// @description display price info on geizhals filters
// @author You
// @match https://geizhals.de/?*
// @icon https://www.google.com/s2/favicons?sz=64&domain=geizhals.de
// @grant none
// ==/UserScript==
@MaxMatti
MaxMatti / README.md
Last active July 3, 2024 16:49
Using a secondary browser as Messenger for MS Teams only (open all links in other browser)

How to use a secondary browser as MS Teams messenger only

Chrome for Teams, Firefox for everything else

  1. install both browsers
  2. install the chrome-extension Open in Firefox
  3. add teams.microsoft.com as PWA in Chome
  4. go to the settings for "Open in Firefox" and select to open everything except *.microsoft.com in firefox

Firefox for Teams, Chrome for everything else

@MaxMatti
MaxMatti / README.md
Last active April 24, 2021 13:58
Alle Songs, die Dieter gespielt hat, in eine bsaber-Playlist packen

Alle Songs, die Dieter gespielt hat, in eine bsaber-Playlist packen:

  1. YouTube-API-key hier abholen: https://console.cloud.google.com/apis/credentials/key/
  2. YouTube-API-Kontingent ist knapp. Deshalb sollte jeder Request gecached werden.
  3. Beatsaver-API-Kontingent hingegen ist endlos vorhanden. Also im Zweifelsfall einfach den letzten Befehl nochmal ausführen, das ist kein Problem.
  4. Na gut ganz endlos ist es doch nicht, daher prüfen wir, ob wir gedrosselt wurden und versuchen dann den jeweiligen Download nochmal.
  5. Manche Songs wurden auch wieder heruntergenommen. Daher durfte ich lernen, dass es in bash ein continue 2 gibt. Coole Sache. Könnte sich die ein oder andere Sprache Mal eine Scheibe von abschneiden.
KEY="[YouTube-API-Key]"
curl 'https://youtube.googleapis.com/youtube/v3/search?part=id&channelId=UCbXjQecIReDgxsn7FUf4Tbw&maxResults=50&order=date&key=$KEY' --header 'Accept: application/json' --compressed > dieter1.json
@MaxMatti
MaxMatti / histogram.py
Created February 17, 2021 13:18
Source code used to generate age distribution of german citizens and federal parliament members 1950-2018
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Max Staff <max.staff@gmx.de>
import csv
import matplotlib.animation as animation
import matplotlib.pyplot as pyplot
import numpy
import re
@MaxMatti
MaxMatti / monitor-bandwidth.sh
Last active January 27, 2021 20:55
This script monitors the incoming and outgoing bandwidth of a server on localhost.
#!/usr/bin/env bash
SERVERPORT=$1
sudo iptables -A INPUT -p tcp --dport "$SERVERPORT"
sudo iptables -A OUTPUT -p tcp --sport "$SERVERPORT"
watch -n 1 sudo iptables -n -L -v -Z
sudo iptables -D INPUT -p tcp --dport "$SERVERPORT"
@MaxMatti
MaxMatti / monitor-bandwidth.sh
Last active July 17, 2021 05:57
This script monitors the incoming and outgoing bandwidth of a server on localhost connected to a client on localhost.
#!/usr/bin/env bash
SERVERPORT=$1
PROCESSNAME=$(sudo lsof -n -i :"$SERVERPORT" | grep LISTEN | awk '{print $1}')
PID=$(sudo lsof -n -i :"$SERVERPORT" | grep LISTEN | awk '{print $2}')
CONNECTEDPORTS=$(sudo netstat -ant | awk -v port="$SERVERPORT" '{if ($6 == "ESTABLISHED" && $4 == "127.0.0.1:" port) {print $5} }' | cut -d":" -f 2)
sudo iptables -A INPUT -p tcp --dport "$SERVERPORT"
echo "$CONNECTEDPORTS" | xargs -L 1 sudo iptables -A INPUT -p tcp --dport
@MaxMatti
MaxMatti / WG-Viewer.user.js
Created October 10, 2020 14:41
[WIP] Creates an overlay for https://boards.4chan.org/wg/catalog to display and scroll through all posted images above a certain resolution.
// ==UserScript==
// @name WG-Viewer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description view images above a certain resolution
// @author Max Staff <max.staff@gmx.de>
// @match https://boards.4chan.org/wg/catalog
// @grant GM.xmlHttpRequest
// ==/UserScript==