Skip to content

Instantly share code, notes, and snippets.

from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import MAIN_DISPATCHER
from ryu.controller.handler import CONFIG_DISPATCHER
from ryu.controller.handler import set_ev_cls
class L2Switch(app_manager.RyuApp):
def __init__(self, *args, **kwargs):
super(L2Switch, self).__init__(*args, **kwargs)
import pacparser
import urllib2
pac_url=""
response = urllib2.urlopen(pac_url)
f = open('proxy.pac', 'w')
f.write(response.read())
f.close()
pacparser.init()
#!/bin/bash
apt-get update
export PASSWORD=yourpassword
export HOSTNAME='scalr'
export DOMAIN='.local'
export SCALR_BASE=/usr/local/scalr
export SCALR_HOME=$SCALR_BASE/scalr-home
- shell: curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python
when: "{{ pip_version.stdout| ge_version('7.0.0') }} == False"
def ge_version(given, minimum_required):
if given == "":
return False
def versiontuple(v):
return tuple(map(int, (v.split("."))))
firehole/resources/rule.rb
actions :create
default_action :create
attribute :rule_name, :name_attribute => true
attribute :port, :default => false
attribute :host, :default => false
firehole/providers/rule.rb
@gad0lin
gad0lin / gist:5497969
Created May 1, 2013 20:08
Ridley connection test: - node.all DOES NOT return array of nodes with attributes, e.g. node.automatic["cloud"] is not defined however - node.find("node_name") - node.automatic["cloud"] contains attribute Is there a way to get nodes in node.all with all attributes in Ridley? Like in knife node show --long.
require File.dirname(__FILE__) + "/lib/utils/helpers"
require File.dirname(__FILE__) + "/config/euca"
include Helpers
conn = ridley_connection()
env=ARGV[0]
nodes=[]
obj = []
conn.sync do
nodes = node.all
brew squid options
'--disable-debug'
'--disable-dependency-tracking'
'--disable-eui'
'--enable-delay-pools'
'--enable-esi'
'--enable-icap-client'
'--enable-ssl'
'--enable-forw-via-db'
'--enable-cache-digests'
@gad0lin
gad0lin / gist:5964449
Created July 10, 2013 08:27
trafficserver osx
http://blog.nugrahais.me/2013/01/28/troubleshooting-101-compiling-apache-traffic-server-on-osx-10-8-2-via-homebrew/
Query system tables;
SELECT * from system.schema_keyspaces;
@gad0lin
gad0lin / Hubot-Skype
Last active December 20, 2015 14:49
# vagrant
vagrant box add precise64 http://files.vagrantup.com/precise64.box
vagrant init precise64
vagrant ssh
#https://help.ubuntu.com/community/Skype - install skype
sudo dpkg --add-architecture i386
apt-get install -y python-software-properties
sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
sudo apt-get update -y && sudo apt-get install skype -y
#install headless support