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
# Usage: | |
# Run the server like this (for example): | |
# DJANGO_SETTINGS_FILE=/path/to/settings.py ./manage runserver --settings=pythonpath.to.settings | |
# where pythonpath.to is the directory containing this file and is found in PYTHONPATH. | |
def load_settings(): | |
import os | |
del globals()['load_settings'] | |
path = os.environ.get('DJANGO_SETTINGS_FILE', |
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
from datetime import datetime | |
# See https://gist.github.com/672279/ | |
from inoi.util.random import sequential_id, monotonic_id | |
import httplib2 | |
import json | |
import random | |
import time | |
import sys |
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
// -*- js2 -*- | |
// | |
// Works at least in Chrome. To setup the SOCKS proxy, use the -D option: | |
// | |
// ssh -D 5001 user@tunnel_endpoint_host | |
// | |
function FindProxyForURL(url, host) { | |
if(dnsDomainIs(host, "192.168.1.5")) { | |
return "SOCKS localhost:5001;"; |
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
def eq_diff(a, b): | |
import json, difflib | |
from datetime import datetime | |
if a == b: | |
return | |
class DatetimeEncoder(json.JSONEncoder): | |
def default(self, o): | |
if isinstance(o, datetime): |
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 | |
# | |
# Use this script as your EDITOR to allow editing remote files with emacsclient. | |
# Works by connecting to the Emacs machine with SSH and using a suitable tramp prefix. | |
# How to reach this machine from the one that's running Emacs | |
ME=user@remote-host | |
# How to reach the machine that's running Emacs from this machine | |
THEY=user@host-running-emacs |
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
# Git repository configuration for a detached worktree. | |
# | |
# Create a bare repository: | |
# | |
# $ git init --bare | |
# | |
# Then change the config to match this file. | |
[core] | |
repositoryformatversion = 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
from tornado.ioloop import IOLoop | |
# Calls fn for all items of iterable, saves result to a list, and | |
# calls callback with that list. This is most useful when fn works | |
# asynchronously. | |
def async_map(fn, iterable, callback, io_loop=None): | |
ioloop = io_loop or IOLoop.instance() | |
def loop(): | |
try: |
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
[2011-06-13 07:16:25,881][INFO ][node ] [Lasher] {elasticsearch/0.16.2}[17950]: initializing ... | |
[2011-06-13 07:16:25,887][INFO ][plugins ] [Lasher] loaded [] | |
[2011-06-13 07:16:31,009][DEBUG][monitor.os ] [Lasher] Using probe [org.elasticsearch.monitor.os.JmxOsProbe@7846a55e] with refresh_interval [5s] | |
[2011-06-13 07:16:31,009][DEBUG][monitor.process ] [Lasher] Using probe [org.elasticsearch.monitor.process.JmxProcessProbe@3c10e820] with refresh_interval [5s] | |
[2011-06-13 07:16:31,028][DEBUG][monitor.network ] [Lasher] Using probe [org.elasticsearch.monitor.network.JmxNetworkProbe@1fd4340c] with refresh_interval [5s] | |
[2011-06-13 07:16:31,042][DEBUG][monitor.network ] [Lasher] net_info | |
host [t-inoi-demo] | |
eth0 display_name [eth0] | |
address [/fe80:0:0:0:216:3eff:fe62:15c8%2] [/10.105.0.78] | |
mtu [1500] multicast [true] ptp [false] loopback [false] up [true] virtual [false] |
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
# couchdb -a couchdb_test.ini >couhdb_stdout.log 2>couchdb_stderr.log | |
[couchdb] | |
database_dir = MY_TEMP_DIR/couch | |
view_index_dir = MY_TEMP_DIR/couch | |
[httpd] | |
port = MY_PORT | |
bind_address = 127.0.0.1 |
OlderNewer