Skip to content

Instantly share code, notes, and snippets.

View mschmitt's full-sized avatar
🥾
Busier than a one-legged man in an ass-kicking contest.

Martin Schmitt mschmitt

🥾
Busier than a one-legged man in an ass-kicking contest.
View GitHub Profile
@mschmitt
mschmitt / j0rrupt0r.pl
Created June 7, 2014 07:48
Deliberately corrupt a JPEG file.
#!/usr/bin/perl -w
use strict;
use Getopt::Std;
# Deliberately corrupt a JPEG file.
#
# ./j0rrupt0r.pl -i nice.jpg -o corrupt.jpg
# Initial fraction of the image that won't be considered
# for corruption (1/fraction)
#!/bin/bash
# /usr/local/bin/ssh-agent-bootstrap
#
# To run ssh-agent as an application user in the background
#
# Sourced from the user's ~/.bash_profile:
# . /usr/local/bin/ssh-agent-bootstrap
#
# In application startup, add:
@mschmitt
mschmitt / KommentareAufNewsseitenAusblenden.user.js
Last active August 29, 2015 14:06
Kommentare auf Newsseiten ausblenden (UserScript für Greasemonkey)
// ==UserScript==
// @name Kommentare auf Newsseiten ausblenden
// @namespace https://gist.github.com/mschmitt/cebf0ee4e56a746cb856/raw/KommentareAufNewsseitenAusblenden.user.js
// @description Kommentare auf Newsseiten ausblenden
// @include /^https?:\/\/(www\.|)spiegel\.de\/.*/
// @include /^https?:\/\/(www\.|)tagesschau\.de\/.*/
// @include /^https?:\/\/(www\.|)heise\.de\/.*/
// @version 1
// @grant GM_addStyle
// ==/UserScript==
@mschmitt
mschmitt / twitpicdl.pl
Created September 17, 2014 19:35
Improvised downloader (in Perl) for Twitpic. Outputs HTML with timestamps and messages, and a photo directory.
#!/usr/bin/perl -w
use strict;
use diagnostics;
use pQuery;
use LWP::Simple;
use JSON;
use Getopt::Std;
# A script to download a user's pics from twitpic before the shutdown
# in September 2014.
@mschmitt
mschmitt / gist:142f26794fba5569e538
Created October 16, 2014 09:20
Check maillog for non-TLS transfers
gzip -dcf /var/log/mail.info* |
perl -ne '/TLS connection established (to|from) (.+): (.+) with cipher/&&printf"%s %s %s\n",$1,$2,$3;' |
grep -v TLS
### Keybase proof
I hereby claim:
* I am mschmitt on github.
* I am mschmitt (https://keybase.io/mschmitt) on keybase.
* I have a public key whose fingerprint is 1949 CE6E 01C3 C6A5 FAD9 6200 79F9 5F49 DF23 6BA4
To claim this, I am signing this object:
#!/bin/bash
# A wrapper for acme-tiny to do automatic cert rollovers.
#
# Certs/Keys/Requests are stored as
# /opt/letsencrypt/domains/*/{crt,key,csr}.pem
#
# .well-known/acme-challenge directories in document roots
# are writable for the user "letsencrypt" who runs this script
# and symlinked as
#!/bin/sh
IP4=$(curl -s http://www.ipv4.dyn.f00.net/ip.php) &&
ORG4=$(curl -s http://ipinfo.io/ | jshon -e org) &&
echo IPv4: $IP4 / $ORG4
IP6=$(curl -s http://www.ipv6.dyn.f00.net/ip.php) &&
ORG6=$(curl -s http://ipinfo.io/ | jshon -e org) &&
echo IPv6: $IP6 / $ORG6
@mschmitt
mschmitt / gist:5ff9c25f1e403ec3dd890b8d44a37aba
Created July 5, 2017 07:30
Single line portscanner in Perl
perl -MIO::Socket::INET -e 'open I,"</etc/services";while(<I>){
(/^\s*($|#)/)&&next;($n,$p,@j)=split/\s+/;($p=~s/\/tcp//)||next;
$s=IO::Socket::INET->new(PeerAddr=>$ARGV[0], PeerPort=>$p,Proto=>'tcp')?
print"$n($p)-->Open\n":next}' 192.168.12.34
@mschmitt
mschmitt / tohtml.sh
Created July 28, 2017 14:47
Convert any text file to syntax highlighted HTML
#!/bin/sh
# Convert any text file to syntax highlighted HTML
vim -c TOhtml -c 'w' -c 'qa' "$1"