{
"cpu": {
"0": {
"cache_size": " KB",
"cores": 1,
"family": "1",
"mhz": "2594",
"model": "11527",
"model_name": "Intel64 Family 6 Model 45 Stepping 7",
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 logging | |
import socket | |
import logging | |
import logging.config | |
import logstash | |
test1 = {"version": 1, | |
"loggers": { | |
"test1": { |
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
{ "trigger": ..., | |
"credentials": { | |
"host": [ | |
{ | |
//Used for any host (pooled) | |
"username": "root", | |
"private-key": "----BEGIN ... KEY----", | |
}, | |
{ |
def exc_dict():
"""Expects to be called from within an exception handling block as in:
try:
foo()
except Exception:
print exc_dict()
Creates a nice array of dictionaries each of which describes
a part of the traceback:
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 urlparse | |
from redis import Redis | |
from waldo.common import config | |
conf = config.current() | |
dbstring = conf['connection_string'] | |
dbstring = urlparse.urlparse(dbstring) | |
dbstring = "redis://" + dbstring.netloc + ":6329" |
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
""" | |
Example for a colourised logging output. | |
This example uses "blessings" to handle console escape sequences. ``blessings`` | |
itself is a very harmless package in that it does not have any external | |
dependencies. And it's code-base is very clean and small. | |
The example extends the core logging formatter (logging.Formatter) and | |
colourises the complete line. This takes advantage of any upstream updates | |
related to logging. When writing this against Python 2.7, the parent code |