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 | |
""" | |
load-monitoring script that pushes notifications to growl when something goes wrong | |
requires jacobb's prowlpy http://github.com/jacobb/prowlpy/tree/master - and a prowl | |
account (http://prowl.weks.net/) | |
this version, with a "panic" function, is untested. | |
""" |
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
""" | |
various ways of acquiring cross-process locks on a string including a django one | |
http://www.evanfosmark.com/2009/01/cross-platform-file-locking-support-in-python/ | |
needs test coverage, but won't get it here since I've just removed it from the project. | |
`with` statement requires python 2.5 or later; these may work as non-with statement doohickeys | |
django locks require version 1.0 or later to get the "force_insert" argument | |
""" |
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 | |
### BEGIN INIT INFO | |
# Provides: supervisord | |
# Required-Start: $remote_fs | |
# Required-Stop: $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Example initscript | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |
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
[program:queuewalker] | |
command = /project_path/manage.py process_queue | |
redirect_stderr = true | |
user=www-data | |
umask=002 | |
[supervisord] | |
logfile = /var/log/supervisord.log | |
logfile_maxbytes = 50MB | |
logfile_backups=10 |
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
local log_file = 'mysql.log' | |
local fh = io.open(log_file, "a+") | |
function read_query( packet ) | |
if string.byte(packet) == proxy.COM_QUERY then | |
local query = string.sub(packet, 2) | |
local q = query | |
local cutoff = 160 | |
if cutoff < #query then | |
q = query:sub(1, cutoff) .. "..." |
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
# −*− coding: UTF−8 −*− | |
""" | |
quick/dirty private feed exposer | |
http://friendfeed.com/api/documentation | |
http://www.dalkescientific.com/Python/PyRSS2Gen.html | |
http://code.google.com/p/httplib2/ | |
http://labix.org/python-dateutil | |
""" | |
import settings | |
from settings import FF_BASE_URL, FF_API_BASE_URL, FF_REMOTE_KEY, FF_FEED, FF_NICKNAME, FF_CONSUMER_SECRET, OUTPUT_CACHE_DIR, INPUT_CACHE_DIR |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
"http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<title>NetCultures blog test</title> | |
<style type="text/css" media="screen"> | |
#header h1 { | |
color: pink; | |
} | |
#header { |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> | |
<script src="http://www.google.com/jsapi"></script> | |
<script> | |
google.load("jquery", "1.3"); | |
</script> | |
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAArYqxP8iD7yfYTxrLYQmwehT2yXp_ZAY8_ufC3CFXhHIE1NvwkxT6VZV_KCSABr9_i4BGpMSXan7nig" | |
type="text/javascript"> | |
</script> | |
<script type="text/javascript"> | |
//<![CDATA[ |
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/env/python | |
# or depending how you want to think about it, inverse frequencies. Cahnge these to get different interleaving | |
A_FREQUENCY = 3 | |
B_FREQUENCY = 5 | |
#two nice friendly looking sequences of the form 'a99','a98','a97'... | |
#(reverse order so we get the correct order with pop()) | |
a = map( lambda x: 'a'+str(x), range(100,0,-1)) | |
b = map( lambda x: 'b'+str(x), range(100,0,-1)) |
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
-- invoke with $ osascript ensure_mate.scpt /path/to/project | |
-- or create a wrapper script that looks like this: | |
-- #!/bin/sh | |
-- osascript ~/bin/ensure_mate.scpt $@ & | |
-- Created 2010 Dan MacKinlay and hereby released into the public domain | |
on run (wantedPath) | |
set wantedPathFound to false | |
global wantedDoc | |
tell application "TextMate" |
OlderNewer