Skip to content

Instantly share code, notes, and snippets.


Sébastien Fievet zyegfryed

View GitHub Profile
View gist:814432
from oauth2 import Error
from django.utils.translation import ugettext as _
from tastypie.authentication import Authentication
from oauth_provider.utils import initialize_server_request, send_oauth_error, get_oauth_request
from oauth_provider.consts import OAUTH_PARAMETERS_NAMES
from import store, InvalidTokenError
zyegfryed /
Created Apr 13, 2011
Outputting PDFs with Django and FDFgen
# -*- coding: utf-8 -*-
import codecs
import subprocess
from fdfgen import forge_fdf
from django.template import Template, loader
from django.template.loader import find_template, LoaderOrigin
class PdfTemplateError(Exception):
zyegfryed /
Created Apr 19, 2011 — forked from coordt/
Check locally installed packages against one or more package indexes for updates and list them. Using subprocess instead of stdout (wasn't working on my MacPython 2.6.1)
#!/usr/bin/env python
Use pip to get a list of local packages to check against one or more package
indexes for updated versions.
import sys
import xmlrpclib
import subprocess
from distutils.version import StrictVersion, LooseVersion
zyegfryed /
Created Aug 18, 2012
Configurable SearchIndex for Haystack
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
# Python 2.7 has an importlib with import_module; for older Pythons,
# Django's bundled copy provides it.
try: # pragma: no cover
from importlib import import_module # pragma: no cover
except ImportError: # pragma: no cover
from django.utils.importlib import import_module # pragma: no cover
zyegfryed / .env
Created Aug 18, 2012
Procfile and environment file that plays nice with Python and foreman
View .env
zyegfryed /
Created Aug 24, 2012
pystatsd installation script
apt-get install python-pip
pip install pystatsd
cat > /etc/default/statsd <<EOF
STATSD_PORT=8125 # port to run on (default: 8125)
PCT=90 # stats pct threshold (default: 90)
GRAPHITE_HOST=localhost # host to connect to graphite on (default: localhost)
GRAPHITE_PORT=2003 # port to connect to graphite on (default: 2003)
USER=nobody # user to run statsd as
zyegfryed / initd_tuqtng
Created Nov 28, 2013
Couchbase Query Engine (tuqtng) init script
View initd_tuqtng
# /etc/rc.d/init.d/tuqtng
# Start up the Couchbase Query Language service daemon
# chkconfig: 2345 20 80
# processname: tuqtng
# config: /etc/sysconfig/tuqtng
zyegfryed /
Last active Aug 29, 2015
Graphite API init script
bind = ""
workers = 4
user = "carbon"
group = "carbon"
View gist:4bdb5b0e3b4e6bf84860

Keybase proof

I hereby claim:

  • I am zyegfryed on github.
  • I am zyegfryed ( on keybase.
  • I have a public key whose fingerprint is CB7D F78F 241E EC07 3006 43B3 1CA6 8A36 B419 64A5

To claim this, I am signing this object:

zyegfryed /
Created Jun 19, 2020 — forked from mlafeldt/
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)




  • jennifer
  • martym