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 logging | |
import logging.handlers | |
log_file = logging.getLogger('f') | |
log_watch = logging.getLogger('w') | |
log_rotate_bytes = logging.getLogger('r') | |
log_time = logging.getLogger('t') | |
fh = logging.FileHandler('f.log') | |
wh = logging.handlers.WatchedFileHandler('w.log') |
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
from logger import statsd | |
import settings | |
class CanonicalMiddleware(object): | |
"""Adjust incoming URLs to have a / so our routing still works. | |
Additionally this saves the canonical version of the url at | |
`request.canonical`. |
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
f |
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
UnboundLocalError: local variable 'key_list' referenced before assignment | |
Stacktrace (most recent call last): | |
File "django/core/handlers/base.py", line 111, in get_response | |
response = callback(request, *callback_args, **callback_kwargs) | |
File "sentry/web/decorators.py", line 110, in _wrapped | |
return func(request, *args, **kwargs) | |
File "sentry/web/frontend/docs.py", line 83, in client_guide | |
context.update(get_key_context(request.user, project)) |
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
dsh20 () { | |
usage="$0 group cmd" | |
[ -z "$1" ] && echo $usage && return 1 | |
[ -z "$2" ] && echo $usage && return 1 | |
dsh -r ssh -o "-o ConnectTimeout=10" -o "-o CheckHostIP=no" -o "-o StrictHostKeyChecking=no" -F 20 -M -c -g "$1" "$2" | |
} |
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
# run grep asdf & | |
subprocess.call("pkill -f grep", shell=True) | |
# Returns -15 | |
subprocess.call("pkill -9 -f grep", shell=True) | |
# Returns -9, and grep is killed. |
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
app.config.from_pyfile('../settings.cfg') | |
app.config.from_envvar('ASANA_SETTINGS', silent=True) |
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 | |
brew install python boost exiv2 | |
curl -O http://launchpadlibrarian.net/61465005/pyexiv2-0.3.0.tar.bz2 | |
tar xjvf pyexiv2-0.3.0.tar.bz2 | |
cd pyexiv2-0.3.0 | |
# https://answers.launchpad.net/pyexiv2/+question/140742 | |
echo "env['FRAMEWORKS'] += ['Python']" >> src/SConscript |
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
TemplateSyntaxError: Caught KeyError while rendering: u'link' | |
Stacktrace (most recent call last): | |
File "django/core/handlers/base.py", line 100, in get_response | |
response = callback(request, *callback_args, **callback_kwargs) | |
File "sentry/web/decorators.py", line 118, in wrapped |
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
evelopment server is running at http://127.0.0.1:8000/ | |
Using the Werkzeug debugger (http://werkzeug.pocoo.org/) | |
Quit the server with CONTROL-C. | |
/usr/local/lib/python2.7/dist-packages/babel/__init__.py:33: UserWarning: Module pystatsd was already imported from /mnt/pinboard/libs/pystatsd/__init__.pyc, but /usr/local/lib/python2.7/dist-packages is being added to sys.path | |
from pkg_resources import get_distribution, ResolutionError | |
/usr/local/lib/python2.7/dist-packages/babel/__init__.py:33: UserWarning: Module traceback was already imported from /usr/lib/python2.7/traceback.pyc, but /usr/local/lib/python2.7/dist-packages is being added to sys.path | |
from pkg_resources import get_distribution, ResolutionError |