Skip to content

Instantly share code, notes, and snippets.

View vgarvardt's full-sized avatar

Vladimir Garvardt vgarvardt

View GitHub Profile
@vgarvardt
vgarvardt / gist:8889652
Last active August 29, 2015 13:56 — forked from ericallam/gist:1019446
How to log all queries for a PostgreSQL homebrew install on OS X

Open the postgresql.conf config file:

$> mate /usr/local/var/postgres/postgresql.conf

Uncomment the line with 'log_destination' and set it to 'syslog'

log_destination = 'syslog'

Open the syslog config:

#!/usr/bin/python
venv = '/PATH_TO_ENVIRONMENT/bin/activate_this.py'
execfile(venv, dict(__file__=venv))
import locale
locale.setlocale(locale.LC_ALL, 'ru_RU.utf8')
import sys
import os
AddHandler wsgi-script .wsgi
RewriteEngine on
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(static/.*)$ - [L]
RewriteCond %{REQUEST_URI} !(django.wsgi)
RewriteRule ^(.*)$ django.wsgi/$1 [L]
@vgarvardt
vgarvardt / img.py
Last active December 11, 2015 02:29 — forked from bobuk/img.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Video of original screencast: https://vimeo.com/57296525
#
# Modified by Vladimir Garvardt
#
from __future__ import print_function
import os