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
| pip install git+https://github.com/USER/REPO.git |
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 asyncio | |
| import random | |
| queue = asyncio.Queue() | |
| @asyncio.coroutine | |
| def feeder(): | |
| try: | |
| fid = random.randint(100, 999) | |
| print('feeder {} activated'.format(fid)) |
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
| from ipaddr import IPv4Network, IPv4Address | |
| """ | |
| A module to sort ip addresses according to the best-match | |
| in an ip networks list. If no matching network is found, ip | |
| is sorted last. | |
| example: | |
| >>> networks = ['10.0.0.0/8', '172.16.0.0/12', '172.16.9.0/24'] |
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
| from functools import wraps | |
| from types import FunctionType, GeneratorType | |
| import logging | |
| import time | |
| def coroutine(f): | |
| @wraps(f) | |
| def wrapper(*args, **kwargs): | |
| logging.debug('coroutine starting: {}'.format(f.__name__)) | |
| return f(*args, **kwargs) |
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/sh | |
| SOCKDIR="/var/lib/qemu/sockets" | |
| HOSTNAME="$1" | |
| if [ -z "$HOSTNAME" ] | |
| then | |
| echo "usage: $0 HOSTNAME" >&2 | |
| exit 1 | |
| fi |
NewerOlder