Skip to content

Instantly share code, notes, and snippets.

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.

What is the meaning of yachts.

@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')
@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 / 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()