Skip to content

Instantly share code, notes, and snippets.

@dermotw
dermotw / busy_as.py
Created March 13, 2013 23:24
A Python script that parses nfdump captures and lists the top ten source ASNs along with the number of packets and bytes from each. Also uses RIPE's REST API to resolve each ASN to something meaningful.
#!/usr/bin/env python
import requests
import pynfdump
from xml.dom import minidom
# The path to the directory where the nfcapd files are stored - this should be directory that contains
# 'live'
#
nfStore="/var/netflow"
@dermotw
dermotw / sofasogood_quick_usage.php
Created October 8, 2012 12:53
Using SofaSoGood
<?php
require( 'sofasogood.class.php' );
$cdbConn = new sofasogood();
$cdbConn->cdbUser = 'user';
$cdbConn->cdbPass = 'pass';
$cdbConn->cdbHost = 'localhost'; // defaults to localhost
$cdbConn->cdbPort = '5984'; // defaults to 5984
@dermotw
dermotw / ssh-escape-codes.txt
Created August 31, 2012 14:43
SSH Escape Codes
Supported escape sequences:
~. - terminate connection (and any multiplexed sessions)
~B - send a BREAK to the remote system
~C - open a command line
~R - Request rekey (SSH protocol 2 only)
~^Z - suspend ssh
~# - list forwarded connections
~& - background ssh (when waiting for connections to terminate)
~? - this message
~~ - send the escape character by typing it twice