Skip to content

Instantly share code, notes, and snippets.

View pklaus's full-sized avatar

Philipp Klaus pklaus

  • Frankfurt, Germany
View GitHub Profile
@pklaus
pklaus / convert-and-create.pl
Created May 9, 2011 08:52
MBOX to Maildir conversion scripts
#! /usr/bin/perl
#
# Creates maildirs for everyone in /etc/passwd who receives mail.
# Copies all their mail in /var/spool/mail into their maildir.
# Assumes that nothing is trying to modify the mailboxes in /var/spool/mail
# This assumption could be removed by locking the mailboxes and deleting
# the mail after moving it.
# version 0.00 - first release to the public.
#
# Originally published by Russell Nelson with modifications by Richard Welty.
@pklaus
pklaus / addtomaildir.py
Created May 9, 2011 09:00
mb2md: convert mailbox to Maildir. See <http://www.gerg.ca/hacks/mb2md/>
#!/usr/bin/env python
"""addtomaildir
Reads an RFC 822 message (possibly with leading "From " line) on stdin
and adds it to a Maildir. The exact details of where it lands and what
it's called in the Maildir depend on various header values in the input
message:
* if no "Status" header, the message goes in "new", otherwise in "cur"
@pklaus
pklaus / mb2md-3.20.pl
Created May 9, 2011 09:07
Converting Mbox mailboxes to Maildir format. See <http://batleth.sapienti-sat.org/projects/mb2md/>
#!/usr/bin/perl -w
#
# $Id: mb2md.pl,v 1.26 2004/03/28 00:09:46 juri Exp $
#
# mb2md-3.20.pl Converts Mbox mailboxes to Maildir format.
#
# Public domain.
#
# Republished by Philipp Klaus.
# Referred to by <http://blog.philippklaus.de/2010/02/convert-mbox-to-maildir/>
@pklaus
pklaus / tunnelbroker-net.linux-deprecated.sh
Created May 9, 2011 09:37
tunnelbroker.net : deprecated tunnel setup on Linux using "ifconfig" and "route"
#!/bin/bash
# Using "ifconfig" and "route" (deprecated)
# <http://tldp.org/HOWTO/Linux+IPv6-HOWTO/conf-ipv6-in-ipv4-point-to-point-tunnels.html>
# You should rather use this one instead (makes use of the tool "ip"): <https://gist.github.com/962408>
# Run like this:
# sudo ./tunnelbroker-net.linux-deprecated.sh
@pklaus
pklaus / tunnelbroker-net.linux.etc-network-interfaces.sh
Created May 9, 2011 12:05
tunnelbroker.net : tunnel setup on Linux using "ip" from the iproute suite (iproute2)
#!/bin/bash
# IPv6 Tunnel setup of an tunnelbroker.net tunnel on Linux using the configuration file `/etc/network/interfaces`
# (needs the `ip` tool from the iproute suite, Ubuntu package: <http://packages.ubuntu.com/iproute>)
#
# Run like this:
# ./tunnelbroker-net.linux.etc-network-interfaces.sh
#
# 2011 by Philipp Klaus
# Published on <http://blog.philippklaus.de/2011/05/ipv6-6in4-tunnel-via-hurricane-electric-tunnelbroker-net-tunnel-setup-on-ubuntu-11-04/>
@pklaus
pklaus / install.sh
Created May 10, 2011 18:10
SixXS Static 6in4 IPv6 Tunnel on Ubuntu / Debian vi if-up script /etc/network/if-up.d/startipv6tunnel
#!/bin/sh
# by Philipp Klaus in 2011 on <http://wp.me/p1fyOX-V1>
cat << EOF
This script installs the if-up script /etc/network/if-up.d/startipv6tunnel
which helps your set up a SixXS 6in4 static IPv6 tunnel on Ubuntu / Debian.
EOF
wget https://gist.github.com/raw/965020/startipv6tunnel.sh
cat << EOF
Please configure the script to your needs. I will open the vi text editor, so you
can adjust the setup to your needs. To exit the vi editor enter :q and press [Enter].
@pklaus
pklaus / setup_etc-network-interfaces_static-ipv6-tunnel-via-sixxs.sh
Created May 11, 2011 07:57
SixXS Static 6in4 IPv6 Tunnel on Ubuntu / Debian defined in `/etc/network/interfaces`
#!/bin/bash
# IPv6 Tunnel setup of an sixxs.net tunnel on Linux using the configuration file `/etc/network/interfaces`
# (needs the `ip` tool from the iproute suite, Ubuntu package: <http://packages.ubuntu.com/iproute>)
#
# Run like this:
# ./setup_etc-network-interfaces_static-ipv6-tunnel-via-sixxs.sh
#
# 2011 by Philipp Klaus
# Published on <http://blog.philippklaus.de/2011/05/sixxs-static-6in4-ipv6-tunnel-on-ubuntu-debian/>
@pklaus
pklaus / creosote.py
Created May 16, 2011 16:57
creosote.py - lightweight message passing with datagrams
#!/usr/bin/env python
# creosote.py - lightweight message passing with datagrams
# JeffBauer@bigfoot.com
# referenced and explained in <http://slav0nic.org.ua/static/books/python/net_thread/NetProg.ppt>
import sys, socket
BUFSIZE = 1024
PORT = 7739
@pklaus
pklaus / wiimotecomm.py
Created May 19, 2011 17:23
wiimotecomm – Tiny tool for testing communication with a Wiimote by sending custom data
#!/usr/bin/python
############################################################
# wiimotecomm 0.1.1 by Cadex #
# #
# Tiny tool for testing communication with a Wiimote #
# by sending custom data #
# #
# originally on http://www.wiili.com/index.php/Wiimotecomm #
# republished by Philipp Klaus #
/*
* Copyright (c) 1999-2002 Vojtech Pavlik
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* http://abstrakraft.org/cwiid/browser/wminput/action_enum.txt
*
*/