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
$ python xlogd.py sample.log | |
parsed: {'appname': 'test.app', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '68898', 'priority': '132', 'message': 'bla bla bla warn'} | |
parsed: {'appname': 'test.app', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '68902', 'priority': '131', 'message': 'bla bla bla error'} | |
parsed: {'appname': 'Dock', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '154', 'priority': '11', 'message': 'CGSReleaseWindowList: called with 5 invalid window(s)'} | |
parsed: {'appname': 'WindowServer', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '79', 'priority': '11', 'message': 'CGXSetWindowListAlpha: Invalid window 0'} |
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 | |
# | |
# template script for generating CentOS container for LXC | |
# | |
# | |
# lxc: linux Container library | |
# Authors: |
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 string | |
from random import SystemRandom | |
from django.db import connections | |
key_chars = string.ascii_letters | |
random = SystemRandom() | |
class adhoc_db(object): | |
"""Context manager that temporarily adds a database connection. |
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 | |
# -*- coding: utf-8 -*- | |
""" | |
Quick way to monitor Apache mod_status. Designed for use with Zabbix. | |
""" | |
import sys | |
import urllib2 | |
import argparse |
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
// Sourced from http://jsfiddle.net/asgallant/ydNT2/ | |
google.load('visualization', '1', {packages: ['corechart']}); | |
google.setOnLoadCallback(drawChart); | |
function drawChart() { | |
var data = google.visualization.arrayToDataTable([ | |
['X', 'Y1', 'Y2'], | |
[0, 6, 12], | |
[1, 4, 9], |
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 | |
# -*- coding: utf-8 -*- | |
""" File download check """ | |
__author__ = "Clayton Kramer" | |
__copyright__ = "Copyright 2014" | |
__credits__ = ["Clayton Kramer"] | |
__license__ = "GPL" | |
__version__ = "1.0.1" | |
__maintainer__ = "Rob Knight" |
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
worker_processes 1; | |
error_log logs/error.log; | |
events { | |
worker_connections 1024; | |
} |
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
Host *.lxc | |
User ubuntu | |
IdentityFile ~/.ssh/id_rsa | |
StrictHostKeyChecking no | |
UserKnownHostsFile=/dev/null | |
ProxyCommand nc $(grep $(echo %h | sed "s/\.lxc//g") /var/lib/misc/dnsmasq.lxcbr0.leases | awk '{ print $3 }') %p |
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 | |
# | |
# Put me in cron.daily, cron.hourly or cron.d for your own custom schedule | |
# Running daily? You'll keep 3 daily backups | |
# Running hourly? You'll keep 3 hourly backups | |
NUM_BACKUPS_TO_KEEP=3 | |
# Who wants to know when the backup failed, or | |
# when the binary logs didn't get applied |