Skip to content

Instantly share code, notes, and snippets.

@namoopsoo
namoopsoo / myprocess.py
Created May 29, 2014 16:38
Here is a straightforward way to capture the standard and error outputs from a custom process you are running. Back-linking to http://stackoverflow.com/a/23937468/472876
from multiprocessing import Process
import os
import sys
class MyProc(Process):
def run(self):
# Define the logging in run(), MyProc's entry function when it is .start()-ed
# p = MyProc()
# p.start()
self.initialize_logging()
@namoopsoo
namoopsoo / redis_wrapper.py
Created June 17, 2014 17:21
wrapping python redis calls with exception handling
'''
Call a redis function several times with this wrapper if it has been observed that
there are intermittent ResponseError exceptions and/or otherwise illegal return values.
Collect the good output and return that if it exists in some of the calls.
Example Usage:
rdb_cnxn = redis.ConnectionPool(host='localhost', port=6379, db=1)
rdb = redis.StrictRedis(connection_pool=rdb_cnxn)
@namoopsoo
namoopsoo / strange_hgetall_snippet.py
Created June 17, 2014 18:08
A snippet of very strange output from hgetall()
'''
This is a brief output snippet associated with https://github.com/andymccurdy/redis-py/issues/496
'''
rdb_cnxn = redis.ConnectionPool(host='localhost', port=6379, db=1)
rdb = redis.StrictRedis(connection_pool=rdb_cnxn)
output = rdb.hgetall('my_classes')

What is the meaning of yachts.

This use case is an example of the use of a back end ioq service to integrate data sources. It has the goal to be able to combine ps command and lsof command outputs, to have fuller access to the data describing running system and user processes. Specifically, there is a limitation where the lsof command does not allow someone to see more than 15 characters for the command name on many systems.

Basic Steps

  • Define a use case using the ioq service RESTful web API.
    • What are the sources?
    • What is the desired end ontology?
  • Create a basic application that queries against the ioq service using its RESTful web API.
@namoopsoo
namoopsoo / pandas manip.md
Created June 18, 2017 21:43
pandas manip
@namoopsoo
namoopsoo / clojure hmms.md
Created July 12, 2017 15:08
clojure hmms..

this is weird...

app.core=> (make-auth-options)
{"client_id" "xxxxxblah", "secret" "xxxxblah"}
app.core=> (type (make-auth-options) )

CompilerException java.lang.RuntimeException: Unable to resolve symbol:  in this context, compiling:(/private/var/folders/mj/7bwn1wld4pscycn91fpjn1h40000gn/T/form-init1933255439273248076.clj:1:1) 
app.core=> (def a (make-auth-options))
#'app.core/a
app.core=> (type a)
@namoopsoo
namoopsoo / mongodb.md
Last active December 16, 2017 00:56
more cloj notes

...

@namoopsoo
namoopsoo / conda notes.md
Last active December 28, 2017 18:36
conda notes

miniconda notes cheat sheet

  • list environments
conda env list
  • new env
conda create --name myenv