Skip to content

Instantly share code, notes, and snippets.

View SeanOC's full-sized avatar

Sean O'Connor SeanOC

View GitHub Profile
[program:focuslab_worker]
command=/srv/charlotte/current/env/bin/python /srv/charlotte/current/src/manage.py celeryd -Q core,focuslab -E --settings=focuslab_settings
directory=/srv/charlotte/current/src
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/celery/supervisord-celeryd-focuslab.log
user=www-data
stopwaitsecs=10
soconnor@ip-10-124-91-129:~$ free -m
total used free shared buffers cached
Mem: 15360 10010 5349 0 117 8929
-/+ buffers/cache: 962 14397
Swap: 0 0 0
(vagrant@127.0.0.1)1> {ok, Client} = riak:client_connect('riak@10.0.2.15').
{ok,{riak_client,'riak@10.0.2.15',<<3,172,224,28>>}}
(vagrant@127.0.0.1)2> {ok, [R]} = Client:mapred([{<<"groceries">>, <<"mine">>},
(vagrant@127.0.0.1)2> {<<"groceries">>, <<"yours">>}],
(vagrant@127.0.0.1)2> [{'map', {modfun, triggers, count}, 'none', false},
(vagrant@127.0.0.1)2> {'reduce', {modfun, triggers, merge}, 'none', true}]).
** exception error: no match of right hand side value {error,{error,undef,
[{triggers,count,
[{r_object,<<"groceries">>,<<"mine">>,
[{r_content,{dict,2,16,16,8,80,48,
@SeanOC
SeanOC / gist:1129040
Created August 6, 2011 05:12
riaksearch trigger error
=CRASH REPORT==== 6-Aug-2011::05:12:41 ===
crasher:
initial call: mi_server:init/1
pid: <0.3488.0>
registered_name: []
exception exit: {{badmatch,{error,enoent}},[{mi_buffer,new,1},{mi_server,read_buffers,4},{mi_server,read_buf_and_seg,1},{mi_server,init,1},{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}
in function gen_server:init_it/6
in call from proc_lib:init_p_do_apply/3
ancestors: [<0.3487.0>,riak_core_vnode_sup,riak_core_sup,<0.102.0>]
messages: []
@SeanOC
SeanOC / fails.py
Created August 17, 2011 14:47
Riak enable_search() problem
>>> import riak
>>> from riak.test_server import TestServer
>>>
>>> riak_bin_path = '/usr/local/Cellar/riak/HEAD/bin/'
>>>
>>> server = TestServer(bin_dir=riak_bin_path)
>>> server.prepare()
>>> server.start()
>>>
>>> client = riak.RiakClient(
@SeanOC
SeanOC / gist:1174275
Created August 26, 2011 19:54
Shapry Charges Example
from sharpy.product import CheddarProduct
product = CheddarProduct(
username = 'NAME',
password = 'PASS',
product_code = 'PRODUCT',
)
customer = product.get_customer(code='MY-CUSTOMER')
class NoAuthS3Storage(S3BotoStorage):
def __init__(self, *args, **kwargs):
kwargs['querystring_auth'] = False
super(NoAuthS3Storage, self).__init__(*args, **kwargs)
Traceback (most recent call last):
File "/srv/quimby/shared/env/local/lib/python2.7/site-packages/celery/execute/trace.py", line 192, in trace_task
R = I.handle_error_state(task, eager=eager)
File "/srv/quimby/shared/env/local/lib/python2.7/site-packages/celery/execute/trace.py", line 91, in handle_error_state
}[self.state](task, store_errors=store_errors)
File "/srv/quimby/shared/env/local/lib/python2.7/site-packages/celery/execute/trace.py", line 114, in handle_failure
task.backend.mark_as_failure(req.id, exc, self.strtb)
File "/srv/quimby/shared/env/local/lib/python2.7/site-packages/celery/backends/base.py", line 96, in mark_as_failure
traceback=traceback)
File "/srv/quimby/shared/env/local/lib/python2.7/site-packages/celery/backends/base.py", line 229, in store_result
{
"parameters": [
{
"name": "GIT_BASE_REPO",
"value": "SeanOC/thing"
},
{
"name": "GIT_HEAD_REPO",
"value": "SeanOC/otherThing"
}
/*
Udp NTP Client
Get the time from a Network Time Protocol (NTP) time server
Demonstrates use of UDP sendPacket and ReceivePacket
For more on NTP time servers and the messages needed to communicate with them,
see http://en.wikipedia.org/wiki/Network_Time_Protocol
created 4 Sep 2010