Skip to content

Instantly share code, notes, and snippets.

View jezdez's full-sized avatar
🚴
💨

Jannis Leidel jezdez

🚴
💨
View GitHub Profile
@jezdez
jezdez / fabfile.py
Created November 22, 2009 14:36
Fabric file to run a command in a openvz guest without outside connectivity
from fabric_openvz import guests, vz_run
@guests('uhura', 'obiwan')
def uname_a(guest):
"""
Show uname -a on given guests
"""
vz_run(guest, 'uname -a')
@guests('uhura', 'obiwan')
Fixed #7980 - Improved i18n framework to support locale aware formatting (dates and numbers) and form processing.
Additionally fixes #1061, #2203, #3940, #5526, #6449, #6231, #6693, #6783, #9366 and #10891
"""
A drop in replacement for {% url %} that generates relative paths.
Just put {% load relative_urls %} at the top of your template, and all {% url %}
calls will generate paths relative to the current request path.
For example, when reversing a URL that points to ``/admin/foo/`` on the page
``/admin/bar/``, it will output ``../foo/``.
"""
# Copypasta of Django's runserver management command, modified to use gunicorn http://github.com/benoitc/gunicorn
import sys
from optparse import make_option
import django
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.utils import translation
#!/usr/bin/env python
# encoding: utf-8
"""
Created by Preston Holmes on 2010-01-13.
preston@ptone.com
Copyright (c) 2010
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@jezdez
jezdez / gist:278358
Created January 15, 2010 19:54 — forked from yashh/gist:278347
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=info ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
@jezdez
jezdez / fabfile.py
Created January 24, 2010 12:47 — forked from heckj/fabfile.py
#!/usr/bin/env python
from __future__ import with_statement # needed for python 2.5
from fabric.api import *
from fabric.contrib.console import confirm
# ================================================================
# NOTE:
# using this fabfile expects that you have the python utility
# fabric installed locally, ssh access to reamea.com, and your
# ssh public key associated with the account 'mboza@reamea.com'
@jezdez
jezdez / howto.txt
Created February 12, 2010 01:33 — forked from simonw/howto.txt
Save the supervisord.initscript script as /etc/init.d/supervisord
Run /usr/sbin/update-rc.d -f supervisord defaults
@jezdez
jezdez / gist:314471
Created February 25, 2010 11:35 — forked from mmalone/gist:299905
"Memcached cache backend"
from django.core.cache.backends import memcached
from django.utils.encoding import smart_unicode, smart_str
MIN_COMPRESS_LEN = 150000
class CacheClass(memcached.CacheClass):
def add(self, key, value, timeout=None, min_compress_len=MIN_COMPRESS_LEN):
if isinstance(value, unicode):
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by subversion configure 1.6.9, which was
generated by GNU Autoconf 2.64. Invocation command line was
$ ./configure --disable-debug --prefix=/usr/local/Cellar/subversion-python/1.6.9 --with-ssl --with-zlib=/usr/lib --disable-neon-version-check --disable-mod-activation --without-apache-libexecdir --without-berkeley-db
## --------- ##
## Platform. ##