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
for f in *.m4a; do ffmpeg -i "$f" -acodec libmp3lame -ab 256k "${f%.m4a}.mp3"; done |
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
""" | |
Celery base task aimed at longish-running jobs that return a result. | |
``AwesomeResultTask`` adds thundering herd avoidance, result caching, progress | |
reporting, error fallback and JSON encoding of results. | |
""" | |
from __future__ import division | |
import logging | |
import simplejson |
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
conn = boto.connect_s3(awsAccessKey, awsSecret) | |
# Get bucket instance. | |
bucket = conn.get_bucket(bktName) | |
fileKey = bucket.get_key(fileKey) | |
url = fileKey.generate_url(expires_in=None, query_auth=True, force_http=True) | |
print url |
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
start on runlevel [2345] | |
stop on runlevel [06] | |
respawn | |
respawn limit 10 5 | |
script | |
NAME=app_name | |
PORT=8002 | |
NUM_WORKERS=3 | |
TIMEOUT=120 |
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
$HTTP["host"] =~ "www.domain.org" { | |
server.name = "www.domain.org" | |
server.document-root = "/path/to/media/" | |
$HTTP["url"] !~ "^/(static|media)" { | |
proxy.server = ( "" => | |
(( "host" => "127.0.0.1", "port" => 8008 )) | |
) | |
} | |
} |
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 | |
# -*- coding: utf-8 -*- | |
""" | |
fabfile for Django | |
------------------ | |
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/ | |
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle) | |
several additions, corrections and customizations, too |
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
<snippets license="BSD" filetypes="Python" authors="Kamil Selwa" name="Django1.2 snippets based on Texmate http://svn.textmate.org/trunk/Bundles/Python%20Django.tmbundle/Snippets/"> | |
<item> | |
<displayprefix></displayprefix> | |
<match>m2m</match> | |
<displaypostfix></displaypostfix> | |
<displayarguments>FIELDNAME</displayarguments> | |
<fillin>${1:FIELDNAME} = models.ManyToManyField(${RELATED_MODEL}, related_name=${RELATED_NAME}, ${limit_choices_to={'pub_date__lte': datetime.now}} )</fillin> | |
</item> | |
<item> | |
<displayprefix></displayprefix> |
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
# -*- coding: utf-8 -*- | |
import sys, re, time | |
#based on http://stackoverflow.com/questions/222581/python-script-for-minifying-css | |
#css = open( sys.argv[1] , 'r' ).read() | |
myfile = "style.css" | |
css = open( "style.css" , 'r' ).read() | |
css = re.sub( r'\s+', ' ', css ) | |
print "/* ---------------------------------------------------------------------*/" | |
print "/* -------------- GENERATED FROM %s AT %s ------------*/" % (myfile, time.strftime( "%d %b %Y %H:%M", time.gmtime()) ) |
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
#requirements | |
PIL>=1.1.6 | |
MySQL-python>=1.2.2 | |
python-memcached>=1.44 | |
simplejson>=2.0.9 | |
html5lib>=0.10 | |
#fundamental apps | |
-e svn+http://code.djangoproject.com/svn/django/trunk#egg=Django | |
-e hg+https://sorl-thumbnail.googlecode.com/hg/#egg=sorl |
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
""" | |
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._ |
OlderNewer