This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
WARN_HOURS=72 | |
while getopts ":t:" opt; do | |
case ${opt} in | |
t) | |
timeout=$OPTARG | |
;; | |
esac | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from multiprocessing.managers import BaseManager | |
from ovsdbapp.schema.ovn_northbound import commands | |
class QueueManager(BaseManager): pass | |
QueueManager.register('get_queue') | |
m = QueueManager(address=('127.0.0.1', 50000), authkey=b'password') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Wider Lauchpad Comments | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Make launchpad comments as wide as possible! | |
// @author Terry Wilson <[email protected]> | |
// @match https://bugs.launchpad.net/*/+bug/* | |
// @grant GM_addStyle | |
// @run-at document-start | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import json | |
import time | |
from ovs.db import custom_index | |
from ovs.db import idl | |
from ovsdbapp.backend.ovs_idl import connection | |
from ovsdbapp.backend.ovs_idl import event | |
from ovsdbapp.backend.ovs_idl import vlog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
function remove_router { | |
router=$1 | |
for subnet in $(openstack router show $router -c interfaces_info -f json|jq -r '.interfaces_info | .[] | .subnet_id'); do | |
for fip in $(openstack floating ip list --router $router -c ID -f value); do | |
echo Deleting floating ip $fip | |
openstack floating ip delete $fip & | |
done | |
wait | |
echo Removing subnet $subnet from router $router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# User specific aliases and functions | |
function ovs_destroy_find() { | |
local cmd=$1 | |
local table=$2 | |
local condition=$3 | |
eval $cmd "-- destroy $table "{$(ovs-vsctl --no-headings --columns=_uuid -f csv find $table $condition|paste -sd",")} | |
} | |
alias nbdf="ovs_destroy_find ovn-nbctl" | |
alias sbdf="ovs_destroy_find ovn-sbctl" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import abc | |
import unittest | |
import six | |
### base stuff ### | |
@six.add_metaclass(abc.ABCMeta) | |
class API(object): | |
backend = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import abc | |
import unittest | |
import six | |
### base stuff ### | |
@six.add_metaclass(abc.ABCMeta) | |
class API(object): | |
@abc.abstractproperty | |
def backend(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import abc | |
import subprocess | |
import six | |
from six.moves import urllib | |
from six.moves import input | |
class ProtocolRegistry(type): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import logging | |
import re | |
import subprocess | |
import sys | |
logging.basicConfig() | |
LOG = logging.getLogger() | |
try: |
NewerOlder