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 | |
set -e | |
DEFAULT_PACKAGES=ssh,language-pack-en-base | |
DEFAULT_COMPONENTS=main,universe | |
DEBOOTSTRAP=/usr/sbin/debootstrap | |
DEFAULT_MIRROR=http://archive.ubuntu.com/ubuntu | |
DEFAULT_VARIANT=minbase | |
MIRROR=${STRAP_MIRROR:-$DEFAULT_MIRROR} | |
ROOTFS=$1 |
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 | |
''' | |
$ pip install flickrapi | |
.... | |
$ FLICKR_API_KEY=mykey ./flick.py tag1[,tag2,tag3...] | |
''' | |
# http://www.flickr.com/services/api/flickr.photos.search.html | |
import flickrapi |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC | |
"-//Apple//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>mac.bitlbee</string> | |
<key>ProgramArguments</key> | |
<array> |
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
$ brew doctor | |
Your system is raring to brew. |
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
$ pip install flask blinker raven gunicorn gevent | |
... | |
$ gunicorn -k gevent test:app | |
2012-10-01 11:16:57 [62111] [INFO] Starting gunicorn 0.14.6 | |
2012-10-01 11:16:57 [62111] [INFO] Listening at: http://127.0.0.1:8000 (62111) | |
2012-10-01 11:16:57 [62111] [INFO] Using worker: gevent | |
2012-10-01 11:16:57 [62112] [INFO] Booting worker with pid: 62112 | |
2012-10-01 11:26:00 [62292] [ERROR] Error handling request | |
Traceback (most recent call last): | |
File "/Users/daz/.virtualenvs/b99e1a9fba3d9901/lib/python2.7/site-packages/gunicorn/workers/async.py", line 44, in handle |
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
Connecting | |
Traceback (most recent call last): | |
File "screenshot.py", line 16, in <module> | |
desired_capabilities=desired_capabilities, | |
File "/Users/daz/.virtualenvs/1a5c5f7263517393/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 63, in __init__ | |
self.start_session(desired_capabilities, browser_profile) | |
File "/Users/daz/.virtualenvs/1a5c5f7263517393/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 105, in start_session | |
'desiredCapabilities': desired_capabilities, | |
File "/Users/daz/.virtualenvs/1a5c5f7263517393/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 156, in execute | |
self.error_handler.check_response(response) |
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
''' | |
Original here: https://github.com/mitsuhiko/flask/blob/master/flask/app.py#L1295 | |
''' | |
from flask import Flask | |
class MyFlask(Flask): | |
def log_exception(self, exc_info): | |
""" | |
Overriden to provide the full url (including scheme, hostname and query string) |
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 | |
# This hook is run after every virtualenv is activated. | |
venv=`basename "$VIRTUAL_ENV"` | |
if [ -d "$HOME/src/$venv" ]; then | |
cd "$HOME/src/$venv" | |
fi |
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 flask import Flask, redirect, url_for, request | |
app = Flask(__name__) | |
is_maintenance_mode = True | |
# Always throw a 503 during maintenance: http://is.gd/DksGDm | |
@app.before_request | |
def check_for_maintenance(): |
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
in upload handler | |
in file close | |
.. | |
---------------------------------------------------------------------- | |
Ran 2 tests in 0.021s | |
OK |