Skip to content

Instantly share code, notes, and snippets.

View tandon's full-sized avatar

Sahil Tandon tandon

View GitHub Profile
@tandon
tandon / ufw_vpn_killswitch_tutorial.md
Created July 1, 2022 21:57 — forked from Necklaces/ufw_vpn_killswitch_tutorial.md
GNU/Linux UFW VPN kill switch tutorial

GNU/Linux UFW VPN kill switch tutorial

This is a quick guide for setting up a kill switch using UFW (Uncomplicated FireWall). It is assumed you are using OpenVPN and optionally Network-Manager with network-manager-openvpn.

1. (Optional) IP Addresses

Before we can start we're going to need the IP address (or the IP addresses) of your VPN so that we can whitelist those later on, write them down. They are obviously going to be different for every VPN and VPNs with multiple servers, so I'll leave this up to you.

2. Install UFW

On some systems UFW is installed and enabled by default (Ubuntu, for example). Installation procedure is going to be different for every distribution of GNU/Linux, but it's usually something like

@tandon
tandon / DeDuper.py
Created August 17, 2013 03:35
A custom handler for Mailman which discards messages with a Message ID that has already been seen for a particular list. A cache of seen IDs is maintained in a pickled dictionary, which is periodically cleansed of old entries.
import os
import errno
import time
import cPickle
from Mailman.Errors import DiscardMessage
from Mailman.Logging.Syslog import syslog
def process(mlist, msg, msgdata):
msgid = msg.get('message-id', None)