Skip to content

Instantly share code, notes, and snippets.

View brutasse's full-sized avatar
🤌

Bruno Renié brutasse

🤌
View GitHub Profile
import os
import subprocess
base = [f.rsplit('-', 3)[0] for f in os.listdir('..') if f.endswith('.xz')]
downloaded = {'sh'}
def clean(p):
return p.split('>=')[0].split('=')[0]
sudo apt-get -y install python-virtualenv libxslt1-dev libxml2-dev python-virtualenv-tools
export VERSION=`date +"%Y.%m.%d"`.$BUILD_NUMBER
mkdir -p build/usr/share/python
virtualenv build/usr/share/python/sentry
build/usr/share/python/sentry/bin/pip install -U pip wheel distribute
build/usr/share/python/sentry/bin/pip uninstall -y distribute
build/usr/share/python/sentry/bin/pip install sentry[mysql] dj-database-url hiredis dj-redis-url django-redis-cache

Replication

Sync process is:

  • make a base backup
  • catch up with changes that happened during the base backup using master's WAL files
  • stream

Make sure master's wal_keep_segments is set to a high enough value to allow tracking all changes happening during the base backup. Restart needed when changing this.

>>> import datetime
>>> from monthdelta import monthdelta
>>> datetime.date(2012, 1, 31) + monthdelta(1)
datetime.date(2012, 2, 29)
>>> datetime.date(2012, 1, 31) + monthdelta(3)
datetime.date(2012, 4, 30)
>>> datetime.date(2012, 2, 29) + monthdelta(12)
// The name of the Gmail Labels that are to be purged
var GMAIL_LABELS = [
"list",
"of",
"labels",
"to",
"purge",
];
// Purge messages automatically after that many days
@brutasse
brutasse / commits.py
Created May 14, 2011 13:09
Github Djangoproject commits -> highlighted Atom feed with links to changesets, tickets and files.
import os
import re
import feedgenerator
from github2.client import Github
REPO = 'django/django'
BRANCH = 'master'
HERE = os.path.abspath(os.path.dirname(__file__))
TICKET_RE = re.compile(r'#(?P<id>\d+)')