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 | |
# | |
# Create this shell script in: | |
# | |
# /usr/local/bin/git-remote-hg | |
# | |
# Set the correct file permissions on the script: | |
# | |
# chmod 755 /usr/local/bin/git-remote-hg | |
# |
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 | |
# | |
# Loosely based on the manual steps outlined at: | |
# https://kb.berkeley.edu/page.php?id=27401 | |
# and: | |
# http://hodza.net/2011/06/15/howto-install-tsm-backup-client-in-debian-squeeze-ubuntu-64bit/ | |
# | |
# This script assumes it is being run on a Debian host that has the alien | |
# package installed. | |
# |
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 multiprocessing | |
import socket | |
import time | |
import unittest | |
from wsgiref.simple_server import make_server, WSGIRequestHandler | |
class QuietHandler(WSGIRequestHandler): | |
def log_request(*args, **kwargs): | |
pass |
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 unittest | |
def raise_exception(yup=True): | |
if yup: | |
raise ValueError('Yup, exception raised.') | |
class ExceptionMessageTestCase(unittest.TestCase): | |
def assertRaisesMessage(self, exception, msg, func, *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
import unittest | |
def dict_diff(a, b): | |
if a == b: | |
return ({}, {}) | |
diff = ({}, {}) | |
keys = set(a.keys() + b.keys()) | |
for k in keys: |
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
#!/usr/bin/env python | |
""" | |
A very simplistic script to check for pep8 errors in the lines of a file that | |
are to be committed. This is useful if you have files with lots of pep8 errors, | |
but you only want to know about the errors in the lines you have altered. | |
""" | |
import sys | |
import subprocess | |
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
#!/usr/bin/env python | |
""" | |
This script will create a new issue with a file "attachment" in a demo roundup | |
instance. This should provide a basic example of how to programmatically create | |
an issue in your own tracker. | |
""" | |
import roundup.instance | |
from roundup.exceptions import Reject | |
from roundup.date import Date |
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
#!/usr/bin/python | |
# | |
# This script should be run from a cronjob. | |
# | |
import roundup.instance | |
from roundup import roundupdb | |
from roundup.mailer import Mailer | |
class ReminderEmails(object): |
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
# | |
# Export some environment variables so git can better determine the real user | |
# making commits when 'su'ed as the root user. | |
# | |
### Git Settings | |
USERNAME=`who -m | cut -d ' ' -f 1` | |
# Set the git author name and email | |
GIT_AUTHOR_EMAIL=`who -m | awk -F ' ' '{print $1"@"$5}' | sed -e 's/[()]//g'` |
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
<?php | |
/** | |
* sqlite3 Password Driver | |
* | |
* Driver for passwords stored in sqlite3 database | |
* | |
* @version 0.8 | |
* @author John Kristensen <[email protected]> | |
* |
NewerOlder