Skip to content

Instantly share code, notes, and snippets.

View erikcw's full-sized avatar

Erik Wickstrom erikcw

View GitHub Profile
@erikcw
erikcw / config.log
Created June 16, 2011 02:50
Postgres Install failing
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by PostgreSQL configure 9.0.4, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.0.4 --enable-thread-safety --with-bonjour --with-gssapi --with-krb5 --with-openssl --with-libxml --with-libxslt --with-python --with-perl --with-ossp-uuid --datadir=/usr/local/Cellar/postgresql/9.0.4/share/postgresql --docdir=/usr/local/Cellar/postgresql/9.0.4/share/doc/postgresql ARCHFLAGS='-arch x86_64'
## --------- ##
## Platform. ##
@erikcw
erikcw / ConferenceVerbTwimlUnitTest.py
Created October 27, 2011 21:08
Unittest demonstrating attribute stripping.
import xml.etree.ElementTree as ET
from twilio import twiml
from django.test import TestCase
class TwimlTest(TestCase):
def test_twiml_conference_verb(self):
"""
Sanity check for TwiML generation.
"""
@erikcw
erikcw / local_settings.py
Created June 8, 2012 14:16
Local dev settings override -- put in bootiq/bootiq/local_settings.py
import os, sys
ROOT_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
DEBUG = True
TEMPLATE_DEBUG = DEBUG
CRISPY_FAIL_SILENTLY = not DEBUG
SOUTH_TESTS_MIGRATE = False
# Run local files
*** glibc detected *** nginx: worker process: double free or corruption (!prev): 0x0000000001b30300 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7f2905687b96]
nginx: worker process(ngx_destroy_pool+0x54)[0x4181cc]
nginx: worker process(ngx_http_free_request+0x157)[0x44413b]
nginx: worker process[0x4448e5]
nginx: worker process(ngx_http_finalize_request+0x41a)[0x445256]
nginx: worker process(ngx_http_lua_finalize_request+0x13)[0x49ee3b]
nginx: worker process[0x4a4649]
nginx: worker process(ngx_http_lua_content_wev_handler+0x1b)[0x49fc8b]
local headers = ngx.req.get_headers()
headers['CF_VISITOR'] = ngx.var.x_scheme_json
headers['X-Forwarded-Host'] = ngx.var.host
url = "http://localhost:8888" .. tostring(ngx.var.uri)
local res = ngx.location.capture('/proxy', {
ctx = {
headers = headers
},
vars = {
_url = url
@erikcw
erikcw / README
Last active December 25, 2015 22:19
# Directions for reproducing the issue
/usr/local/openresty/nginx/sbin/nginx -p `pwd`/ -c nginx.conf.debug
Load the '/' URI. Then refresh twice -- the backtrace will dump to the console on the 3rd refresh.
from django.db import models
class SampleModel(models.Model):
"""
blah blah
"""
sample = models.IntegerField(blank=True, null=True, help_text="just need more quotes")
sample = models.IntegerField(blank=True, null=True, help_text="just need more quotes")
sample = models.IntegerField(blank=True, null=True, help_text="just need more quotes")
sample = models.IntegerField(blank=True, null=True, help_text="just need more quotes")
@erikcw
erikcw / fiddle.response.json
Last active August 29, 2015 14:05
This is test data for jsFiddle
{
"meta": {
"limit": 10,
"next": "/api/v1/audience/?draw=1&order_by=description&shared_audiences=true&limit=10&offset=10&stats=false",
"offset": 0,
"previous": null,
"total_count": 18
},
"objects": [{
"advertisers": [],
@erikcw
erikcw / models0.py
Last active August 29, 2015 14:05
ForeignKey to IntegerField South Migration
# Initial state
class LogData(models.Model):
report_job = models.ForeignKey('myapp.ReportJobs')
#... more fields ...
@erikcw
erikcw / nginx.conf
Last active August 22, 2023 10:58
Simple nginx lua script to add UUID to each request for end to end request tracking.
# Dependencies
# nginx_lua
# lua uuid module (luarocks install uuid)
http {
# this will be the request id
map $host $request_uuid {
default '';
}