Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
while [ 1 ]; do
echo "Starting loop"
PKTLOSS1=$(ip netns exec qrouter ping -c 1 8.8.8.8 -q | grep loss | awk '{print $7}')
PKTLOSS2=$(ip netns exec qrouter ping -c 1 8.8.4.4 -q | grep loss | awk '{print $7}')
if [ $PKTLOSS1 = '0%' -a $PKTLOSS2 = '0%' ]; then
echo "# Duas saidas"
ovs-ofctl -O OpenFlow13 mod-group br-ex group_id=1,type=select,bucket=bucket_id:1,actions=bucket=bucket_id:1,actions="resubmit(,1)",weight=1,bucket=bucket_id:2,actions="resubmit(,2)",weight=1
#!/usr/bin/python
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import Node
from mininet.log import setLogLevel, info
from mininet.cli import CLI
class LinuxRouter( Node ):
@rodolfovalentim
rodolfovalentim / ovsdb.py
Created February 2, 2019 20:11 — forked from ashw7n/ovsdb.py
ovsdb-python-client
import collections
import threading
__author__ = 'ashw7n'
import socket
import json
import logging
logging.basicConfig(level=logging.DEBUG)
33
down vote
If you want to export all images at once, create one big tar file:
docker save $(docker images -q) -o /path/to/save/mydockersimages.tar
If you want to save multiples images in one .tar file:
IDS=$(docker images | awk '{if ($1 ~ /^(debian|centos)/) print $3}')
@rodolfovalentim
rodolfovalentim / ovs-cheat.md
Created September 3, 2018 15:43 — forked from djoreilly/ovs-cheat.md
OVS cheat sheet

DB

ovs-vsctl list open_vswitch
ovs-vsctl list interface
ovs-vsctl --columns=ofport,name list Interface
ovs-vsctl --columns=ofport,name --format=table list Interface
ovs-vsctl --format=table --columns=name,mac_in_use find Interface name=br-dpdk1
ovs-vsctl get interface vhub656c3cb-23 name

ovs-vsctl set port vlan1729 tag=1729