Skip to content

Instantly share code, notes, and snippets.

View joestringer's full-sized avatar

Joe Stringer joestringer

View GitHub Profile
@joestringer
joestringer / gist:3870899
Created October 11, 2012 08:06 — forked from samweston/gist:3870696
grrrrrrrrrrrr.
function gr()
{
if [ "$#" == "1" ]
then
grep -r $* .
elif [ "$#" -ge "2" ]
then
grep -r $*
else
echo ">.<"
@joestringer
joestringer / gist:4560136
Created January 17, 2013 21:51
Gather RouteFlow CTags
#!/usr/bin/env bash
ctags rflib/*.h
ctags -u rflib/*/*.{cc,h}
ctags -u rfclient/*.{cc,h,hh}
ctags -u rfserver/*.py
ctags -u nox/src/nox/netapps/rfproxy/*.{cc,hh}
from pymongo import MongoClient
c = pymongo.Connection('127.0.0.1', 27017)
c.db.collection_names()
chan1 = c.db['rfclient<->rfserver']
chan2 = c.db['rfserver<->rfproxy']
for entry in chan1.find():
print(entry)
@joestringer
joestringer / rfdb.py
Last active December 14, 2015 06:39 — forked from anonymous/rfdb.py
import sys
import pymongo
import rflib.defs as defs
import rflib.ipc.MongoIPC as MongoIPC
from rflib.ipc.RFProtocolFactory import RFProtocolFactory
def usage():
print('Usage: %s <channel>' % sys.argv[0])
print(' channel: "rfclient" or "rfproxy"')
@joestringer
joestringer / vandervecken.sh
Created April 19, 2013 00:44
Script to setup and run vandervecken
#!/bin/bash
RFVM1IP=192.169.1.100
HOSTVMIP=192.169.1.1
DPPORTNET=172.31
DPPORTS=2
SWITCH1DPID=99
STARTBVMS=0
RYU_PATH=/home/vandervecken/ryu
@joestringer
joestringer / install_ovs.sh
Created July 19, 2013 04:16
Script to compile, copy and (re)install OVS from local sources to a remote host. Kernel versions on both hosts must be identical.
#!/bin/bash
OVSDIR=/tmp/ovstest
MODDIR=$OVSDIR/lib/modules/`uname -r`/extra
OVSTAR=$OVSDIR.tar
OVSSCRIPT=ovstest.sh
USER=root
@joestringer
joestringer / test_ovs.sh
Created July 19, 2013 04:32
Run OVS tests concurrently, with sparse and valgrind.
#!/bin/sh
set -e
make
CONCURRENCY_LEVEL=${CONCURRENCY_LEVEL:-2}
OVSDIR=/home/switch/git/openvswitch
./tests/testsuite -C tests \
---- bond0 ----
bond_mode: balance-tcp
bond may use recirculation: yes, Recirc-ID : 300
bond-hash-basis: 0
updelay: 0 ms
downdelay: 0 ms
lacp_status: negotiated
slave p1: enabled
may_enable: true
@joestringer
joestringer / gist:985ffd6705a55df2ccd2
Created July 8, 2015 23:04
OVS-ct ICMP related flows
AT_DATA([flows.txt], [dnl
priority=1,action=drop
priority=10,arp,action=normal
in_port=1,udp,action=ct(commit,zone=0),set_field:1->conn_mark,2
in_port=2,udp,conn_state=-trk,action=ct(recirc,zone=0)
in_port=2,icmp,conn_state=-trk,action=ct(recirc,zone=0)
in_port=2,udp,conn_state=+trk+est-new,action=1
in_port=2,icmp,conn_state=+trk+rel,conn_mark=1,action=1
])
@joestringer
joestringer / gist:63a4f3c2bd9d4f6ddac7
Created September 9, 2015 22:52
M4 to check for conntrack support and load modules
# CHECK_CONNTRACK()
#
# Perform requirements checks for running conntrack tests, and flush the
# kernel conntrack tables when the test is finished.
#
m4_define([CHECK_CONNTRACK],
[AT_SKIP_IF([test $HAVE_CONNTRACK = no])
AT_SKIP_IF([test $HAVE_PYTHON = no])
m4_foreach([mod], [[nf_conntrack_ipv4], [nf_conntrack_ipv6]],
[modprobe mod || echo "Module mod not loaded."