Skip to content

Instantly share code, notes, and snippets.

$ sudo iptables-save
# Generated by iptables-save v1.4.21 on Thu Oct 2 18:48:29 2014
*filter
:INPUT ACCEPT [771:59294]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [523:86174]
COMMIT
# Completed on Thu Oct 2 18:48:29 2014
# Generated by iptables-save v1.4.21 on Thu Oct 2 18:48:29 2014
*nat
$ sudo iptables -t nat -L -n -v
Chain PREROUTING (policy ACCEPT 2 packets, 2676 bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 2 packets, 2676 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 7 packets, 1108 bytes)
pkts bytes target prot opt in out source destination
# ipsec.conf - strongSwan IPsec configuration file
# basic configuration
config setup
uniqueids = never
# charondebug = "app 3, asn 3, cfg 3, chd 3, dmn 3, enc 3, esp 3, ike 3, imc 3, imv 3, job 3, knl 3, lib 3, mgr 3, net 3, pts 3, tls 3, tnc 3"
# Add connections here.
sudo ipsec statusall
Status of IKE charon daemon (strongSwan 5.1.2, Linux 3.13.0-29-generic, x86_64):
uptime: 2 minutes, since Oct 02 18:38:37 2014
malloc: sbrk 1486848, mmap 0, used 408000, free 1078848
worker threads: 11 of 16 idle, 5/0/0/0 working, job queue: 0/0/0/0, scheduled: 0
loaded plugins: charon test-vectors ldap aes rc2 sha1 sha2 md4 md5 random nonce x509 revocation constraints pkcs1 pkcs7 pkcs8 pkcs12 pem openssl xcbc cmac hmac ctr ccm gcm attr kernel-netlink resolve socket-default stroke updown eap-identity eap-radius xauth-generic xauth-eap radattr addrblock
Virtual IP pools (size/online/offline):
10.0.0.0/24: 254/0/0
Listening IP addresses:
10.230.25.28
Oct 2 18:38:55 ip-10-230-25-28 charon: 11[NET] received packet: from 75.131.202.156[500] to 10.230.25.28[500] (668 bytes)
Oct 2 18:38:55 ip-10-230-25-28 charon: 11[ENC] parsed ID_PROT request 0 [ SA V V V V V V V V V V V V V V ]
Oct 2 18:38:55 ip-10-230-25-28 charon: 11[IKE] received NAT-T (RFC 3947) vendor ID
Oct 2 18:38:55 ip-10-230-25-28 charon: 11[IKE] received draft-ietf-ipsec-nat-t-ike vendor ID
Oct 2 18:38:55 ip-10-230-25-28 charon: 11[IKE] received draft-ietf-ipsec-nat-t-ike-08 vendor ID
Oct 2 18:38:55 ip-10-230-25-28 charon: 11[IKE] received draft-ietf-ipsec-nat-t-ike-07 vendor ID
Oct 2 18:38:55 ip-10-230-25-28 charon: 11[IKE] received draft-ietf-ipsec-nat-t-ike-06 vendor ID
Oct 2 18:38:55 ip-10-230-25-28 charon: 11[IKE] received draft-ietf-ipsec-nat-t-ike-05 vendor ID
Oct 2 18:38:55 ip-10-230-25-28 charon: 11[IKE] received draft-ietf-ipsec-nat-t-ike-04 vendor ID
Oct 2 18:38:55 ip-10-230-25-28 charon: 11[IKE] received draft-ietf-ipsec-nat-t-ike-03 vendor ID
@gthank
gthank / gist:37dc1928ec39768b8e68
Created October 2, 2014 14:10
The FORWARD section of the iptables config on my VPN server
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 10.0.0.1 anywhere policy match dir in pol ipsec reqid 2 proto esp
ACCEPT all -- anywhere 10.0.0.1 policy match dir out pol ipsec reqid 2 proto esp
$ apt-cache search strongswan
libstrongswan - strongSwan utility and crypto library
strongswan - IPsec VPN solution metapackage
strongswan-dbg - strongSwan library and binaries - debugging symbols
strongswan-ike - strongSwan Internet Key Exchange (v2) daemon
strongswan-plugin-dhcp - strongSwan plugin for forwarding DHCP request to a server
strongswan-plugin-eap-md5 - strongSwan plugin for EAP-MD5 protocol handler
strongswan-plugin-eap-mschapv2 - strongSwan plugin for EAP-MSCHAPv2 protocol handler
strongswan-plugin-eap-peap - strongSwan plugin for EAP-PEAP protocol handler
strongswan-plugin-eap-radius - strongSwan plugin for EAP interface to a RADIUS server
from flask import Flask
app = Flask(__name__)
@app.route("/")
def index():
raise Exception
return "Hello, World!"
import unittest
import pytest
class TestStuff(unittest.TestCase):
@classmethod
def setUpClass(cls):
print "Yo!"
def setUp(self):
print "Hi from Stuff!"
@gthank
gthank / gist:db6466aad3d63c766cb4
Created May 15, 2014 14:06
Error when running `ant all-jars` for Jython on OpenJDK8
antlr_gen:
[java] warning(105): /usr/home/vagrant/dev/jython/grammar/Python.g:1278:10: no lexer rule corresponding to token: DEDENT
[java] warning(105): /usr/home/vagrant/dev/jython/grammar/Python.g:1271:15: no lexer rule corresponding to token: INDENT
[java] warning(200): /usr/home/vagrant/dev/jython/grammar/Python.g:1986:59: Decision can match input such as "COMMA BACKQUOTE" using multiple alternatives: 1, 2
[java] As a result, alternative(s) 2 were disabled for that input
[java] warning(200): /usr/home/vagrant/dev/jython/grammar/Python.g:1986:62: Decision can match input such as "COMMA" using multiple alternatives: 1, 2
[java] As a result, alternative(s) 2 were disabled for that input
[java] error(10): internal error: Can't get property indirectDelegates using method get/isIndirectDelegates from org.antlr.tool.Grammar instance : java.lang.NullPointerException
[java] java.util.Objects.requireNonNull(Objects.java:203)
[java] java.util.ArrayList.removeAll(ArrayLis