Skip to content

Instantly share code, notes, and snippets.

View TobiX's full-sized avatar

Tobias Gruetzmacher TobiX

View GitHub Profile
@TobiX
TobiX / music-dup-finder.py
Last active August 29, 2015 14:03
Music duplicate finder
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os, sys
import acoustid
import xdg.BaseDirectory
import apsw
def setwal(db):
@TobiX
TobiX / kill-mcafee.user.js
Last active August 29, 2015 14:05
Convince Flash Player download page that McAfee is already installed (only works in Firefox)
// ==UserScript==
// @name Disable Flash McAfee Offer
// @icon https://get3.adobe.com/favicon.ico
// @namespace http://flash.mustdie.de/
// @include http*://get*.adobe.com/*flashplayer*
// @downloadURL https://gist.githubusercontent.com/TobiX/289db6350f1c60edd460/raw/kill-mcafee.user.js
// @version 5
// @grant none
// ==/UserScript==
@TobiX
TobiX / pre-commit
Created September 25, 2014 12:20
SVN commit hook that denies changing of tags.
#!/bin/sh
REPOS="$1"
TXN="$2"
SVNLOOK=/usr/bin/svnlook
# Make sure that the log message contains some text.
if ! $SVNLOOK log -t "$TXN" "$REPOS" | \
grep "[a-zA-Z0-9]" > /dev/null
@TobiX
TobiX / movember-everywhere.user.js
Last active August 29, 2015 14:08
Movember Everywhere Userscript
// ==UserScript==
// @name Movember everywhere!
// @namespace http://november.mustdie.de/
// @description Replace November with Movember
// @include *
// @version 6
// @downloadURL https://gist.github.com/TobiX/69b75e601b9bc0f39adf/raw/movember-everywhere.user.js
// @grant none
// ==/UserScript==
@TobiX
TobiX / friendcode.py
Last active May 31, 2020 03:55
Nintendo 3DS friendcode verification
#!/usr/bin/python3
# Released into the public domain, where possible (http://creativecommons.org/publicdomain/zero/1.0/)
import sys
import re
import hashlib
fc = sys.argv[1]
parts = re.match('^(\d{4})-(\d{4})-(\d{4})$', fc)
@TobiX
TobiX / hosted-on-cloudflare.py
Created February 24, 2017 16:05
Quick-and-dirty script to find sites hosted on CloudFlare
#!/usr/bin/python3
import argparse
# pip install urlextract dnspython tldextract
import dns.name
import dns.resolver
import urlextract
import tldextract
@TobiX
TobiX / apache.conf
Created January 13, 2018 11:15
Generic ACME/HTTPS vhost
<VirtualHost 192.168.99.99:80 [2001:0002:6c::430]:80>
ServerName example.com
ServerAlias www.example.com host1.example.com host2.example.com
ServerAdmin tobias@example.com
AddDefaultCharset utf-8
DocumentRoot /home/certmaster/webroot/
RewriteEngine on
RewriteRule ^/.well-known/ - [L]
RewriteRule ^/(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</VirtualHost>
@TobiX
TobiX / pom-bom-output.txt
Created April 27, 2019 14:41
BOM vs. direct
>mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------------< test:test >------------------------------
[INFO] Building test 1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ test ---
[INFO] test:test:jar:1
[INFO] \- org.eclipse.jetty:jetty-hazelcast:jar:9.4.15.v20190215:compile
@TobiX
TobiX / server.py
Created December 21, 2019 01:06
Remote Address API server
#!/usr/bin/env python3
import json
from werkzeug.wrappers import Request, Response
from werkzeug.middleware.proxy_fix import ProxyFix
@Request.application
def application(request):
def call(Map params = [:], Closure inner) {
catchError {
inner.call()
}
def notifyCulprits = params.getOrDefault('notifyCulprits', true)
def extraMails = params.getOrDefault('extraMails', [])
if (shouldSendMail(currentBuild)) {
def providers = []