Skip to content

Instantly share code, notes, and snippets.

Geoffrey Hing ghing

Block or report user

Report or block ghing

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ghing
ghing / urls.py
Created Aug 16, 2010
Sample Django urls.py that shows how to serve static content when running development server
View urls.py
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 Mar 8, 2011
Patch to VMWare Server 2.0.2 Linux kernel module sources that allows the modules to be compiled for use with a realtime kernel.
View VMware-server-2.0.2-realtime_fix.patch
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 Mar 8, 2011
Version of Radu Cotescu VMware Server installation patch updated with fixes for realtime kernels.
View vmware-server-2.0.2-203138-update.patch
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 Apr 4, 2011
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 Apr 29, 2011
BARD basemap generation error
View gist:948350
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.
View gist:957302
[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 Jun 16, 2011
Custom District Builder calculators for Ohio
View ohcalculators.py
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 Jul 5, 2011
Songs for Moms phone flyer using Tropo API
View momphone.py
"""
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 Jul 8, 2011
District Builder Traceback
View traceback.txt
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 Jul 8, 2011
Error when trying to import my district 1 only block index file.
View celeryd-ohio-excerpt.log
[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)
You can’t perform that action at this time.