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 os, sys | |
import site | |
# put virtualenv on pythonpath | |
site.addsitedir('/path/to/project/ve/lib/python2.5/site-packages') | |
# redirect prints to apache log | |
sys.stdout = sys.stderr | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings' |
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
""" | |
This fabric file makes setting up and deploying a django application much | |
easier, but it does make a few assumptions. Namely that you're using Git, | |
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have | |
Django installed on your local machine and SSH installed on both the local | |
machine and any servers you want to deploy to. | |
_note that I've used the name project_name throughout this example. Replace | |
this with whatever your project is called._ |
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 -*- | |
""" | |
Example Usage | |
============= | |
>>> import datetime | |
>>> start = datetime.date(2009, 6, 21) | |
>>> g1 = daterange(start) |
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
============================================================= | |
Installing Multicore Solr 1.3.0 / Tomcat 6.0.X on Ubuntu 8.10 | |
============================================================= | |
Install OpenJDK (comes from universe):: | |
aptitude install openjdk-6-jre | |
Download Tomcat 6.X and move it in place:: |
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
============================================================= | |
Installing Multicore Solr 1.3.0 / Tomcat 6.0.X on Ubuntu 8.10 | |
============================================================= | |
Install OpenJDK (comes from universe):: | |
aptitude install openjdk-6-jre | |
Download Tomcat 6.X and move it in place:: |
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
""" | |
The HOSTMAP variable is a dictionary of lists. The keys represent | |
roles of a server, the values represent the hostnames of machines that | |
fill those roles. If you are reading this, you likely know what you're | |
doing. If you don't know what you're doing, you probably want to put | |
your hostname into local_dev. Ensure it has a comma at the end, and | |
the hostname is a string. | |
You can get your hostname by typing `hostname` into a terminal. | |
""" |
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
brew install readline | |
brew link readline | |
brew install python | |
brew install postgres | |
brew install postgis | |
brew install gdal | |
brew install geos | |
brew install git | |
brew install tmux | |
brew install pip |
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 django.http import HttpRequest | |
class PickleableHttpRequest(HttpRequest): | |
def __init__(self, request=None, attributes=None): | |
super(PickleableHttpRequest, self).__init__() | |
if request: | |
if not isinstance(request, HttpRequest): | |
raise Exception('Request supplied is not a valid HTTP request 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
#!/usr/bin/env ruby | |
require 'net/smtp' | |
def run(command) | |
output = `#{command} 2>&1` | |
if not $?.success? | |
raise Exception, "Command Failed '#{command}': #{output}" | |
end | |
output |
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 ruby | |
begin | |
require 'rainbow' | |
rescue LoadError | |
module Rainbow | |
def color(color) | |
self | |
end | |
def background(color) |
OlderNewer