Skip to content

Instantly share code, notes, and snippets.

@icarocamelo
icarocamelo / EfficientThreadPoolExecutor
Created September 8, 2017 19:21 — forked from akshaydeo/EfficientThreadPoolExecutor
EfficientThreadPoolExecutor
/**
* Thread pool executor
* Author: akshay
* Date : 9/30/13
* Time : 2:55 PM
*/
public class EfficientThreadPoolExecutor extends ThreadPoolExecutor {
/**
* Logger
<snapshot>
<configuration>
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">prefix:sal-netconf-connector</type>
<name>libnetconfd</name>
<port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">830</port>
<username xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">repenno</username>
<address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">10.0.1.27</address>
[epel]
name=Extra Packages for Enterprise Linux 5 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
[epel-debuginfo]
ubuntu@inocybevm:/opt/confd/bin[15:09]$ ./netconf-console-tcp -i
* Enter a NETCONF operation, end with an empty line
<get-tank-state xmlns="urn:opendaylight:car">
<car-id>1</car-id>
</get-tank-state>
<?xml version="1.0" encoding="UTF-8"?>
@icarocamelo
icarocamelo / shiro.ini
Created May 1, 2016 01:09
shiro.ini configuration
ldapRealm = org.opendaylight.aaa.shiro.realm.ODLJndiLdapRealm
ldapRealm.userDnTemplate = uid={0},ou=<PEOPLE>,dc=<DOMAIN>,dc=<TLD>
ldapRealm.contextFactory.url = ldap://<URL>:<PORT>
ldapRealm.searchBase = dc=<DOMAIN>,dc=<TLD>
ldapRealm.ldapAttributeForComparison = <OBJECTCLASS>
...
@icarocamelo
icarocamelo / ofrules-openstack-netvirt
Created April 27, 2016 16:29
Flow entries - Openstack/Netvirt
==Without any network==
sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0x0, duration=2871.555s, table=0, n_packets=0, n_bytes=0, dl_type=0x88cc actions=CONTROLLER:65535
cookie=0x0, duration=2871.555s, table=0, n_packets=1, n_bytes=90, priority=0 actions=goto_table:20
cookie=0x0, duration=2871.555s, table=20, n_packets=122, n_bytes=13263, priority=0 actions=goto_table:30
cookie=0x0, duration=2871.555s, table=30, n_packets=122, n_bytes=13263, priority=0 actions=goto_table:40
cookie=0x0, duration=2871.555s, table=40, n_packets=59, n_bytes=6726, priority=0 actions=goto_table:50
cookie=0x0, duration=2871.555s, table=50, n_packets=122, n_bytes=13263, priority=0 actions=goto_table:60
cookie=0x0, duration=2871.555s, table=60, n_packets=122, n_bytes=13263, priority=0 actions=goto_table:70
<modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config"><module><type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:pcep:sr:cfg">x:pcep-parser-segment-routing</type><name>pcep-parser-segment-routing</name><iana-sr-subobjects-type xmlns="urn:opendaylight:params:xml:ns:yang:controller:pcep:sr:cfg">false</iana-sr-subobjects-type></module><module><type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:pcep:stateful07:cfg">x:pcep-parser-ietf-stateful07</type><name>pcep-parser-ietf-stateful07</name></module><module><type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:flowspec">x:bgp-flowspec</type><name>bgp-flowspec</name></module><module><type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:netty:threadgroup">x:netty-threadgroup-fixed</type><name>global-worker-group</name></module><module><type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:netty:threadgroup">x:netty-threadgroup-fixed</type><name>global-boss-group</name></module><module><type xmlns:x="ur
#!/usr/bin/python
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.cli import CLI
from mininet.log import setLogLevel, info, debug
from mininet.node import Host, RemoteController
QUAGGA_DIR = '/usr/lib/quagga'
# Must exist and be owned by quagga user (quagga:quagga by default on Ubuntu)
<?xml version="1.0" encoding="UTF-8"?>
<!-- vi: set et smarttab sw=4 tabstop=4: -->
<!--
Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
and is available at http://www.eclipse.org/legal/epl-v10.html
-->
<snapshot>
@Test
public void testFlowToJsonString(){
EthernetType ethernetType = new EthernetType(45);
EthernetDestination ethernetDestination = new EthernetDestination("f4:ce:46:bf:32:f3");
EthernetSource ethernetSource = new EthernetSource("d8:d3:85:5b:ad:89");
Match match = MatchBuilder
.setEthernetType(ethernetType)
.setEthernetDestination(ethernetDestination)
.setEthernetSource(ethernetSource)