Skip to content

Instantly share code, notes, and snippets.

var sio = require('socket.io');
var io = sio.listen(8080);
global.channels = [];
var lobby = io.of('/lobby')
.on('connection', function (lobby_socket) {
lobby_socket.on('join channel', function (channel_name, channel_cb) {
global.channels[channel_name] = io.of('/' + channel_name).authorization(function (handshakeData, auth_cb) {
@benhaan
benhaan / nginx.conf
Created October 24, 2012 21:13
inteligent routing in nginx
#user nobody;
worker_processes 1;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}

Keybase proof

I hereby claim:

  • I am benhaan on github.
  • I am benhaan (https://keybase.io/benhaan) on keybase.
  • I have a public key whose fingerprint is 7546 ED97 4856 6D79 DC3B 1BAA 69C2 61CF D94D 8695

To claim this, I am signing this object:

@benhaan
benhaan / list_port_config.py
Created January 6, 2015 05:35
Fetch all the interfaces from a Cisco switch and return its config, specifically VLAN, name, description, and type (access or trunk)
from __future__ import print_function
from snimpy.manager import Manager as M
from snimpy.manager import load
from snimpy.snmp import SNMPNoSuchInstance
#import pymysql
# Load up SNMP MIBs