Skip to content

Instantly share code, notes, and snippets.

View chrisglass's full-sized avatar

Chris Glass chrisglass

View GitHub Profile
#!/bin/bash
#
# template script for generating ubuntu container for LXC
#
# This script consolidates and extends the existing lxc ubuntu scripts
#
# Copyright � 2011 Serge Hallyn <[email protected]>
# Copyright � 2010 Wilhelm Meier
@chrisglass
chrisglass / lxc-ubuntu-cloud
Created January 14, 2014 11:02
A patched ubuntu cloud template using the squid-deb-proxy-client pre-start hook
#!/bin/bash
# template script for generating ubuntu container for LXC based on released
# cloud images.
#
# Copyright © 2012 Serge Hallyn <[email protected]>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either

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!

Django-shop (and related)

  • 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
def run(payment=payment, **kwargs): # here the trick is to pass the payment instance as default value.
# Since we have an instance of payment in parameter now, we can inject it in the tests easily.
# Check that the client payed.
try:
contains_payment = payment.contains_payment(_price, request.headers, **kwargs)
except BadRequest as e:
return Response(e.description, BAD_REQUEST)
# Actually do stuff
run_params = request.get_json(silent=False)
# PS1 definition!
# Reset
Color_Off="\[\033[0m\]" # Text Reset
# Regular Colors
Black="\[\033[0;30m\]" # Black
Red="\[\033[0;31m\]" # Red
Green="\[\033[0;32m\]" # Green
Yellow="\[\033[0;33m\]" # Yellow
if [ $UID -ne 0 ] ; then
echo "Run me as root, baby"
fi
cat > $(git --exec-path)/git-ass << EOF
echo '(‿ˠ‿)'
EOF
chmod +x $(git --exec-path)/git-ass
@chrisglass
chrisglass / with_home_protection.txt
Created July 21, 2018 08:02
With home protection turned on:
ubuntu@web-caddy-1:/home/caddy$ ls -ali
total 26328
261382 drwxr-xr-x 3 www-data www-data 4096 Jul 21 07:55 .
1613 drwxr-xr-x 4 root root 4096 Jul 21 07:54 ..
261384 -rw-r--r-- 1 www-data www-data 220 Apr 4 18:30 .bash_logout
261385 -rw-r--r-- 1 www-data www-data 3771 Apr 4 18:30 .bashrc
261383 -rw-r--r-- 1 www-data www-data 807 Apr 4 18:30 .profile
261402 -rw-r--r-- 1 www-data 1001 22481 Jul 20 14:20 CHANGES.txt
261403 -rw-r--r-- 1 www-data 1001 16345 Jul 20 14:20 EULA.txt
261401 -rw-r--r-- 1 www-data 1001 25261 Jul 20 14:20 LICENSES.txt