This file contains hidden or 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
In [1]: class vm(object): | |
...: def __init__(self, nets): | |
...: self.nets = nets | |
...: | |
In [2]: vms = [ vm(nets=['1', '2']), vm(nets=['2', '9']), vm(nets=['3', '2']) ] | |
In [3]: set((net for vm in vms for net in vm.nets)) | |
Out[3]: {'1', '2', '3', '9'} |
This file contains hidden or 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 numpy as np | |
import jenkins | |
import getpass | |
import time | |
""" | |
compare a jenkins job average execution time relative to a build | |
advisable to have: https://wiki.jenkins-ci.org/display/JENKINS/Metrics+Plugin | |
""" | |
This file contains hidden or 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
polkit.addRule(function(action, subject) { | |
if (action.id == "org.freedesktop.systemd1.manage-units") { | |
if (action.lookup("unit") == "myservice.service") { | |
var verb = action.lookup("verb"); | |
if (verb == "start" || verb == "stop" || verb == "restart") { | |
return polkit.Result.YES; | |
} | |
} | |
} | |
}); |
This file contains hidden or 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 lago | |
from pytest import fixture | |
@fixture(scope="module") | |
def prefix(): | |
prefix = lago.api.init(conf='../LagoInitFile') | |
prefix.start() | |
yield prefix | |
prefix.destroy() | |
This file contains hidden or 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 -ex | |
SUITE=$1 | |
JENKINS="/home/ngoldin/src/gerrit.ovirt.org/jenkins" | |
LAGO="/home/ngoldin/src/nvgoldin.github.com/lago" | |
REPODIR="/tmp/lago-export" | |
OST="/home/ngoldin/src/gerrit.ovirt.org/ovirt-system-tests" | |
BUILD_CONF="/home/ngoldin/src/nvgoldin.github.com/lago-build-scripts" | |
echo "BUILDING LAGO RPM" | |
pushd "$LAGO" |
This file contains hidden or 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
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ |
This file contains hidden or 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 signal | |
import functools | |
async def looping_task(loop, task_num): | |
try: | |
while True: | |
print('{0}:in looping_task'.format(task_num)) | |
await asyncio.sleep(5.0, loop=loop) | |
except asyncio.CancelledError: | |
return "{0}: I was cancelled!".format(task_num) |
This file contains hidden or 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 | |
FILE=$1 | |
USER=$2 | |
EMAIL=$3 | |
realfile=$(readlink -f $FILE) | |
cat << EOF | augtool -Ast "Xml incl ${realfile}" | |
# Remove #empty node |
NewerOlder