Skip to content

Instantly share code, notes, and snippets.

View chrisglass's full-sized avatar

Chris Glass chrisglass

View GitHub Profile

Keybase proof

I hereby claim:

  • I am chrisglass on github.
  • I am tribaal (https://keybase.io/tribaal) on keybase.
  • I have a public key whose fingerprint is E78D C4FF 8B1A 2FE0 3384 AB46 8B4D D16B 2133 3BDB

To claim this, I am signing this object:

mondict = {"blah": "foo"}
def une_fonction(undict):
undict["blah"] = "bar"
une_fonction(mondict)
print mondict # C'est "{'blah': 'bar'}
# A l'invere
@chrisglass
chrisglass / todo.rst
Last active August 29, 2015 14:03
My opensource projects TODO list

Tribaal's Opensource laundry list

Because I have too many things to do and to little time to do it. Let's start a list!

  • Make a new pypi release for django-shop-paypal
  • Update dependencies to django-polymorphic and jsonfield to 1.6 compatible versions
@chrisglass
chrisglass / tribaal.asc
Created July 8, 2014 21:47
My new gpg public key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBFO8VeMBEADCj46af3zouBZ+4Hii5nyfwJHyKReE1FzxqYsbAJC7g6NGegNq
54FFDpmu2ITYbI3eN2fAy+NGv+AdZ07I/KEXaJh+h80E6C1Nxf+veu1t7TQRTWrs
SHIHIws+PjTODkt225Yzs8mVuvmqQsGN2s9Wn70ddp31BXApRST6+AkOG1C5W1Zs
J2rIFHslKwEZRn+/jgMxW8tQMktuK73rc4WeKyzekHDcWT3/Onz11IgoLEeYGa0B
4FB0X4T29ok1TgIbQqzeTOyXGfDJO/PpslEs4rTwTDYFRh8NuwTDuTLK0Yte/g0R
7MakhITb2TLDUv0+aiYSjd8I7EhaNmRj/WRV/eYd5fRvuYtFDkSVNJSCzUlTSlBG
859ffDdr9wJkOzq2LaKTPpwYHugTd7R3Br1SmQkPBZVw3NbCIrhlBj6HDG0NzGX8
@chrisglass
chrisglass / gist:632376
Created October 18, 2010 15:18
How to let dav_svn list all the directories (instead of spitting a 403 forbidden :) )
# DONT FORGET TO RUN:
# a2ensite default-ssl
# dav_svn.conf - Example Subversion/Apache configuration
#
# For details and further options see the Apache user manual and
# the Subversion book.
#
# NOTE: for a setup with multiple vhosts, you will want to do this
# configuration in /etc/apache2/sites-available/*, not here.
@chrisglass
chrisglass / gist:700180
Created November 15, 2010 08:54
Proxy conf for apt-cacher clients
We couldn’t find that file to show.
@chrisglass
chrisglass / drobo-iscsi-node.rst
Created November 29, 2010 08:30
The iscsi "default" file for a properly configured drobo

Drobo Pros tend to die and reboot if the iscsi parameters are not right on the initiator (on the client).

As such, we need to make sure the following parameters are set in the iscsi (client) configuration file for the drobo node (change this in /etc/iscsi/iscsid.conf for it to be reboot-persistent):

node.session.cmds_max = 16
node.session.queue_depth = 16
node.conn[0].tcp.window_size = 65535

A more complete article is here: http://www.thirdmartini.com/index.php/DroboPro,_iSCSI_and_Linux

@chrisglass
chrisglass / translations.rst
Created December 2, 2010 17:31
How to create translations in django (the command line!)

../../bin/django makemessages -l it -e html,xml,py,txt

@chrisglass
chrisglass / debug_toolbar_setting
Created December 21, 2010 08:45
A magic snippet to paste in your personal.py configuration, and the debug toolbar is only enabled for superusers that pass ?debug in the url!
def show_toolbar(request):
return request.user.is_superuser and 'debug' in request.GET
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': show_toolbar,
'MEDIA_URL': '/media/debug_toolbar/',
'INTERCEPT_REDIRECTS': False,
}
@chrisglass
chrisglass / autodiscover_local_memcaches
Created December 21, 2010 08:49
This makes Django settings autodiscover local memcaches! :)
import os
import socket
class IP(object):
def __init__(self):
self.base = None
def get(self, end):
if not self.base: