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 / virtualwall_irremote.pde
Created May 24, 2010 08:56
A trivial Arduino sketch to mimic iRobot Virtual Wall for Roomba
/*
A trivial Arduino sketch to mimic iRobot Virtual Wall for Roomba
----------------------------------------------------------------
Based on information found at:
http://sites.google.com/site/irobotcreate2/createanirbeacon
Uses "A Multi-Protocol Infrared Remote Library for the Arduino":
http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
@mschmitt
mschmitt / match-ssh-keys
Created August 11, 2010 13:33
Matches Fingerprints from sshd logs (sshd on loglevel VERBOSE) against authorized_keys for the respective user.
#!/usr/bin/perl -w
use strict;
use diagnostics;
use File::Temp;
# Matches Fingerprints from sshd logs (sshd on loglevel VERBOSE) against
# authorized_keys for the respective user.
die "Please specify input file!\n" unless ($ARGV[0]);
@mschmitt
mschmitt / pf.conf
Created August 15, 2010 03:47
Sample pf.conf for NAT in OpenBSD 4.7
# Test OpenBSD 4.7 pf.conf for NAT and redirection
# (including access from DMZ to DMZ via external address)
# 192.168.1.0/24 (public LAN) -> (fxp0/.44)Firewall(fxp1/.1) -> 192.168.4.0 (private DMZ)
set skip on lo
set require-order yes
# fxp1 is private (DMZ)
# fxp0 has the default gw and is covered by the egress interface group
@mschmitt
mschmitt / ssh-test-passphrase.sh
Created August 17, 2010 11:04
Script for identifying SSH keys without passphrase
#!/bin/bash
umask 077
if [ "XX$1" == "XX" ]
then
echo "No file specified."
exit 1
fi
if [ ! -e $1 ]
then
@mschmitt
mschmitt / ssltest.pl
Created August 23, 2010 13:33
Trying to figure out how to extract certificate from SSL session
#!/usr/bin/perl -w
use strict;
use diagnostics;
use Data::Dumper;
use IO::Socket::INET;
use Net::SSLeay::OO;
use Net::SSLeay::OO::X509;
use Net::SSLeay::OO::Constants qw(OP_ALL);
my $sslctx = Net::SSLeay::OO::Context->new;
@mschmitt
mschmitt / mime-lite.pl
Created August 24, 2010 19:11
My standard MIME::Lite application example
#!/usr/bin/perl -w
use strict;
use diagnostics;
use MIME::Lite;
use File::Basename;
my $sender = 'Alice <alice@thisdomain.invalid>';
my $recipient = 'Bob <bob@otherdomain.invalid>';
my $file = "/home/alice/info.pdf";
my $smtphost = "127.0.0.1 25";
@mschmitt
mschmitt / ipv6-fixes
Created October 17, 2010 15:08
Fixes for Ubuntu 10.10 to make the IPv6 stack barely usable.
#!/bin/bash
# Fixes for Ubuntu 10.10 to make the IPv6 stack barely usable.
#
# ---> /etc/network/if-up.d/ipv6-fixes
#
# This should really go into /etc/network/if-pre-up.d, but
# Scripts in that directory are ignored by NetworkManager.
# Thanks to this, IPv6 will now come up properly only a few
# minutes after startup.
@mschmitt
mschmitt / betterpasswords
Created January 25, 2011 09:54
Dictionary-based password generator in Perl
#!/usr/bin/perl -w
use strict;
use diagnostics;
# https://gist.github.com/794727
# Dictionary-based password generator in Perl
usage() if ($ARGV[0] and ($ARGV[0] eq '-?'));
my $wordlist = '/usr/share/dict/words';
@mschmitt
mschmitt / import_photos.pl
Created February 13, 2011 16:08
Script that imports photos and names them according to EXIF timestamp
#!/usr/bin/perl -w
use strict;
use diagnostics;
use File::Basename;
use File::Copy;
use File::Find;
use Data::Dumper;
use Image::ExifTool;
use Digest::MD5;
@mschmitt
mschmitt / check.pl
Created June 8, 2011 11:36
IPv6-Erhebung am Hochtechnologiestandort Deutschland.
#!/usr/bin/perl -w
use strict;
use diagnostics;
use Net::DNS;
print "IPv6-Erhebung am Hochtechnologiestandort Deutschland.\n\n";
print "Es wurden die Homepages der DAX-Unternehmen auf IPv6-Support untersucht.\n\n";
printf "%-35s %s\n", 'Hostname', 'IPv6-Adresse';
printf "%-35s %s\n", '--------', '------------';