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
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'filters': { | |
'require_debug_false': { | |
'()': 'django.utils.log.RequireDebugFalse' | |
} | |
}, | |
'handlers': { |
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 | |
# | |
# Copyright 2012 Patrick Hetu <patrick.hetu@gmail.com> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
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 simplejson as json | |
import lxml | |
class objectJSONEncoder(json.JSONEncoder): | |
"""A specialized JSON encoder that can handle simple lxml objectify types | |
>>> from lxml import objectify | |
>>> obj = objectify.fromstring("<Book><price>1.50</price><author>W. Shakespeare</author></Book>") | |
>>> objectJSONEncoder().encode(obj) | |
'{"price": 1.5, "author": "W. Shakespeare"}' | |
""" |
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 | |
# Requirements on Fedora are: | |
# libguestfs-tools for virt-sysprep | |
# xmlstarlet | |
# libvirt-client | |
# qemu-img | |
# libxml2 for xmllint | |
# | |
# Usage: |
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
Puppet testing | |
============== | |
http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
TODO: we probably need the puppet gem installed in the rvm for any of this to work | |
Initial install of RVM:: |
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 | |
hostname $1 | |
grep -q '^HOSTNAME' /etc/sysconfig/network && sed -i "s/HOSTNAME=.*$/HOSTNAME=$(hostname -f)/g" /etc/sysconfig/network || echo "HOSTNAME=$(hostname -f)" >> /etc/sysconfig/network | |
grep -q '^search' /etc/resolv.conf && sed -i "s/search=.*/search $(hostname -d)/g" /etc/resolv.conf || echo "search $(hostname -d)" >> /etc/resolv.conf | |
echo $(hostname -i|awk '{print $1}') $(hostname) >> /etc/hosts && cat /etc/hosts|uniq > /etc/hosts_tmp && /bin/mv /etc/hosts_tmp /etc/hosts |
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
# HTTP server | |
# | |
# Need to get the supervisord xmlrpc server listening on 9001 so that we can control it remotely | |
# | |
# Create and run:: | |
# | |
# docker build -t timhughes/webserver - < httpd.docker | |
# docker run -t timhughes/webserver | |
# | |
# Base stuff for supervisor |
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/sh | |
git filter-branch --env-filter ' | |
an="$GIT_AUTHOR_NAME" | |
am="$GIT_AUTHOR_EMAIL" | |
cn="$GIT_COMMITTER_NAME" | |
cm="$GIT_COMMITTER_EMAIL" | |
if [ "$GIT_COMMITTER_EMAIL" = "your@email.to.match" ] |
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
/* | |
requires libgit2 | |
*/ | |
package main | |
import ( |
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 logging.handlers | |
my_logger = logging.getLogger('MyLogger') | |
my_logger.setLevel(logging.DEBUG) | |
handler = logging.handlers.SysLogHandler('localhost', 514) | |
my_logger.addHandler(handler) | |
for i in range(20): |
OlderNewer