Skip to content

Instantly share code, notes, and snippets.

Verifying that "moreno.id" is my Blockstack ID. https://onename.com/moreno
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQENBFgTbTQBCAC9KTlG/672+PwRoa7yJPTVCEAaaTlIssGPIGl8oqdlG3K/oQsg
b+GbdW87N8NsciPtFv8290DtzDuwcM4FSlQPnVRU+v+rkxh9KCWFjKc0Nu3wOcTH
cD5h60vsvwikd4AIrhkEEe+P7RNLdxXBCckolWsxC4G53zJyq0nphSZvdUz8Z2mQ
IrEDceEdqr/6J0S0h3rNCZjGFcCbOhmQV4IzF7SVQzyKfo34uogfSrdTjmI8weUg
nC75zERY8q2MVY7Opvi1Q16OTYopPqpT4p7iI/LBe05eFc/MJslLTFRzikmp1M2o
Qad+UtcZNtXYBSTiteT3LQa4CJYhmQDEKBHHABEBAAG0VE1vcmVubyBQaW5oZWly
byBDdW5oYSAoTW9yZW5vIEN1bmhhIGZyb20gQnJhemlsIFBHUCBrZXkpIDxtb3Jl
Verifying that "moreno.id" is my Blockstack ID. https://onename.com/moreno
@morenopc
morenopc / eso-server.log
Created July 18, 2014 21:33
i4x://UCL/UCLX02/combinedopenended/Humanities_SA_ML, error_message: unexpected HTTP status code [500]
sudo tail -f /edx/var/log/*/*log | grep "19:01"
Jul 18 19:01:08 ip-10-252-144-131 [service_variant=cms][codejail.safe_exec][env:sandbox] WARNING [ip-10-252-144-131 6015] [safe_exec.py:228] - Using codejail/safe_exec.py:not_safe_exec for i4x-UCL-10775-E3-problem-5a227239bff34b09b05520d129516773
Jul 18 19:01:09 ip-10-252-144-131 [service_variant=cms][edxmako.shortcuts][env:sandbox] WARNING [ip-10-252-144-131 6003] [shortcuts.py:56] - Cannot find corresponding link for name: TOS
Jul 18 19:01:09 ip-10-252-144-131 [service_variant=cms][edxmako.shortcuts][env:sandbox] WARNING [ip-10-252-144-131 6003] [shortcuts.py:56] - Cannot find corresponding link for name: PRIVACY
Jul 18 19:01:15 ip-10-252-144-131 [service_variant=cms][codejail.safe_exec][env:sandbox] WARNING [ip-10-252-144-131 6011] [safe_exec.py:228] - Using codejail/safe_exec.py:not_safe_exec for i4x-UCL-10775-E3-problem-c3b65d544bf14bd89321ff15817ebcdc
Jul 18 19:01:16 ip-10-252-144-131 [service_variant=cms][codejail.safe_exec][env:sandbox] WARNING [ip-1
@morenopc
morenopc / django_shell_log.py
Created April 21, 2014 15:12
VariableDoesNotExist: Failed lookup for key [request] in u'[{}]'
onlinebr-project$ bin/django shell
File not found: /etc/onlinebr/config.cfg
Execute: $ fab sendsmsconfig : url = http://send.sms.com, user = test, password = S3cr3t3
INFO 2014-04-21 17:10:21,531 base 21357 140377689782016 Raven is not configured (logging is disabled). Please see the documentation for more information.
Python 2.7.3 (default, Feb 27 2014, 19:58:35)
Type "copyright", "credits" or "license" for more information.
IPython 0.12 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
@morenopc
morenopc / timeit_diff.py
Created April 14, 2014 14:13
Python, compute list difference
def diff(a, b):
b = set(b)
return [aa for aa in a if aa not in b]
def set_diff(a, b):
return list(set(a) - set(b))
diff_lamb_hension = lambda l1,l2: [x for x in l1 if x not in l2]
diff_lamb_filter = lambda l1,l2: filter(lambda x: x not in l2, l1)
from celery.registry import tasks
from celery.signals import task_sent, task_prerun, task_postrun
def on_task_postrun(**kwargs):
print "on_task_postrun"
def on_task_sent(**kwargs):
print "on_task_sent"
task_sent.connect(on_task_sent, tasks['documents.tasks.CreateBoardbook'])
@morenopc
morenopc / gist:9766934
Last active August 29, 2015 13:57
$ python src/manage.py celeryd -l DEBUG worker -Q documents
[2014-03-25 15:33:23,188: DEBUG/MainProcess] Consumer: Ready to accept tasks!
[2014-03-25 15:34:04,095: INFO/MainProcess] Got task from broker: documents.tasks.CreateProcessedPdfTask[966c69a8-8018-4e0b-903d-c138e7a48483]
[2014-03-25 15:34:04,130: INFO/MainProcess] Got task from broker: documents.tasks.CreateProcessedPdfTask[98d65a88-b801-4dc8-ae91-e2f0e8adc54e]
[2014-03-25 15:34:04,144: DEBUG/MainProcess] Mediator: Running callback for task: documents.tasks.CreateProcessedPdfTask[966c69a8-8018-4e0b-903d-c138e7a48483]
[2014-03-25 15:34:04,144: DEBUG/MainProcess] TaskPool: Apply <function execute_and_trace at 0x4b6aaa0> (args:('documents.tasks.CreateProcessedPdfTask', '966c69a8-8018-4e0b-903d-c138e7a48483', (<Document: django10-cheat-sheet (application/pdf)>, <BRUser: [email protected]>, 2), {}) kwargs:{'hostname': 'ubuntu-server-10044-x64-vbox4210', 'request': {'retries': 0, 'task': 'documents.tasks.CreateProcessedPdfTask', 'utc': False, 'loglevel': 10, 'delivery_info': {'routing_key': u'documents', 'ex
@morenopc
morenopc / gist:9748048
Created March 24, 2014 20:10
OSError: [Errno 13] Permission denied
In [19]: subprocess.call(["/tmp"])
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (20, 0))
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
/vagrant/sherpany/onlinebr/venv/local/lib/python2.7/site-packages/django/core/management/commands/shell.pyc in <module>()
----> 1 subprocess.call(["/tmp"])
/usr/lib/python2.7/subprocess.pyc in call(*popenargs, **kwargs)
@morenopc
morenopc / gist:9743572
Created March 24, 2014 16:18
$ python src/manage.py celeryd -l DEBUG worker -Q documents (Boardbook is not available)
$ python src/manage.py celeryd -l DEBUG worker -Q documents
INFO 2014-03-24 17:14:01,628 base 2336 139880823154432 Raven is not configured (logging is disabled). Please see the documentation for more information.
UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments! [loaders.py:108]
[2014-03-24 17:14:03,849: WARNING/MainProcess]
-------------- celery@ubuntu-server-10044-x64-vbox4210 v2.5.5
---- **** -----
--- * *** * -- [Configuration]
-- * - **** --- . broker: amqp://guest@localhost:5672//
- ** ---------- . loader: djcelery.loaders.DjangoLoader