Skip to content

Instantly share code, notes, and snippets.

@ghing
ghing / urls.py
Created August 16, 2010 20:17
Sample Django urls.py that shows how to serve static content when running development server
from django.conf.urls.defaults import *
from django.contrib.gis import admin
import settings
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
(r'^$', 'boystown.views.index'),
)
@ghing
ghing / VMware-server-2.0.2-realtime_fix.patch
Created March 8, 2011 17:47
Patch to VMWare Server 2.0.2 Linux kernel module sources that allows the modules to be compiled for use with a realtime kernel.
diff -ru a/lib/modules/source/vmci-only/linux/driver.c b/lib/modules/source/vmci-only/linux/driver.c
--- a/lib/modules/source/vmci-only/linux/driver.c 2009-10-20 19:31:34.000000000 -0500
+++ b/lib/modules/source/vmci-only/linux/driver.c 2011-03-08 10:39:35.305432000 -0600
@@ -360,7 +360,11 @@
memset(vmciLinux, 0, sizeof *vmciLinux);
vmciLinux->ctType = VMCIOBJ_NOT_SET;
#if defined(HAVE_COMPAT_IOCTL) || defined(HAVE_UNLOCKED_IOCTL)
+#if !defined(CONFIG_PREEMPT_RT)
init_MUTEX(&vmciLinux->lock);
+#else
@ghing
ghing / vmware-server-2.0.2-203138-update.patch
Created March 8, 2011 17:50
Version of Radu Cotescu VMware Server installation patch updated with fixes for realtime kernels.
diff -ru a/lib/modules/source/vmci-only/include/pgtbl.h b/lib/modules/source/vmci-only/include/pgtbl.h
--- a/lib/modules/source/vmci-only/include/pgtbl.h 2009-10-22 06:54:15.000000000 -0400
+++ b/lib/modules/source/vmci-only/include/pgtbl.h 2010-01-17 22:52:44.127684350 -0500
@@ -24,6 +24,7 @@
#include "compat_pgtable.h"
#include "compat_spinlock.h"
#include "compat_page.h"
+#include "compat_sched.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 11)
@ghing
ghing / tamper2py.py
Created April 4, 2011 03:50
Simple script to convert a HTTP post data copied from the Tamper Data Firefox extension into Python code that can be used in a script using the mechanize library.
We couldn’t find that file to show.
@ghing
ghing / gist:948350
Created April 29, 2011 14:05
BARD basemap generation error
Loaded BARD library.
Read shapefile '/projects/publicmapping_michigan/local/data/shapes/blocks/PL_BLOCK_MI_M.shp'.
Error in function (sdf, nb = NULL, queen = TRUE) :
unused argument(s) (keepgeom = FALSE)
ERROR:
The BARD map could not be computed. Please check the configuration settings
and try again.
@ghing
ghing / gist:957302
Created May 5, 2011 15:54
Celery error
[2011-05-04 23:31:00,835: ERROR/MainProcess] Task celery.task.http.HttpDispatchT
ask[1fb6bb21-4b8a-40d1-afd9-59c5ca722730] raised exception: ValueError('unknown
url type: :///getreport/',)
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/celery-2.1.4-py2.6.egg/celery/exe
cute/trace.py", line 34, in trace
return cls(states.SUCCESS, retval=fun(*args, **kwargs))
File "/usr/local/lib/python2.6/dist-packages/celery-2.1.4-py2.6.egg/celery/task/base.py", line 248, in __call__
return self.run(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/celery-2.1.4-py2.6.egg/celery/task/http.py", line 178, in run
@ghing
ghing / ohcalculators.py
Created June 16, 2011 13:45
Custom District Builder calculators for Ohio
from publicmapping.redistricting.calculators import CalculatorBase
class ValueRange(CalculatorBase):
"""
Determine a value, and indicate if it falls within a range
This calculator differs from the default Range calculator because it
checks the value argument (usually passed from another calculator)
rather than operating on a district or plan.
@ghing
ghing / momphone.py
Created July 5, 2011 19:21
Songs for Moms phone flyer using Tropo API
"""
Mom Phone
Audio flyer for the May 5, 2011 Songs for Moms show in Chicago.
Hosted at (773) 280-5392
"""
from urllib import quote
from random import choice
@ghing
ghing / traceback.txt
Created July 8, 2011 18:19
District Builder Traceback
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/Django-1.2.3-py2.6.egg/django/core/handlers/base.py", line 100, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.6/dist-packages/Django-1.2.3-py2.6.egg/django/views/decorators/cache.py", line 56, in _cache_controlled
response = viewfunc(request, *args, **kw)
File "/projects/publicmapping_ohiov1.2/trunk/django/publicmapping/redistricting/views.py", line 133, in decorator
return function(request, *args, **kwargs)
@ghing
ghing / celeryd-ohio-excerpt.log
Created July 8, 2011 18:23
Error when trying to import my district 1 only block index file.
[2011-07-08 14:10:30,873: ERROR/MainProcess] Task redistricting.utils.index2plan
[d370e684-cc9e-4e6c-ae85-fc9a2949c4de] raised exception: GEOSException('Error en
countered checking Geometry returned from GEOS C function "GEOSDifference_r".',)
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/celery-2.1.4-py2.6.egg/celery/exe
cute/trace.py", line 34, in trace
return cls(states.SUCCESS, retval=fun(*args, **kwargs))
File "/usr/local/lib/python2.6/dist-packages/celery-2.1.4-py2.6.egg/celery/tas
k/base.py", line 248, in __call__
return self.run(*args, **kwargs)