Skip to content

Instantly share code, notes, and snippets.

View openfly's full-sized avatar

Matt Joyce openfly

View GitHub Profile
import requests
import multiprocessing
import sys
class EventHook(object):
def __init__(self):
self.__handlers = []
def __iadd__(self, handler):
@openfly
openfly / gist:6f9dc216f375bed6720141cbc6552544
Created December 20, 2016 22:05
testing multiprocessing
import listener
import requests
import multiprocessing
from multiprocessing import Pool
import sys
# from multiprocessing.dummy import Pool as ThreadPool
def test_print():
print "test_print called."
@openfly
openfly / gist:a43cf7c139b46cc7b056884846b5be7a
Created December 12, 2016 18:58
bandit test on python-symphony module
(bandit) ➜ python-symphony git:(master) bandit -r symphony
[main] INFO profile include tests: None
[main] INFO profile exclude tests: None
[main] INFO cli include tests: None
[main] INFO cli exclude tests: None
[main] INFO running on Python 2.7.5
Run started:2016-12-12 18:57:31.838606
Test results:
>> Issue: [B108:hardcoded_tmp_directory] Probable insecure usage of temp file/directory.
@openfly
openfly / txt
Created October 4, 2016 18:33
subway robbery
so I was on an uptown A train one day in like 2003-4. It was early.. I was using a cd-mp3 player ( lol olde )
and this dude comes up to me and very angrily gets up in my face and points at my cd-mp3 player.
Angry Dude : That have batteries!? ( pointing at cd-mp3 player )
Me: Yes.
Angry Dude : Can I have em !?!
Me: Well, noooo.. as you can see I am using them.
Angry Dude : Well can I have the cd player!?!
Me: ... No?
Angry Dude ( now cheerful ): Okay. ( Turns to Leave )
@openfly
openfly / example.py
Created June 29, 2016 21:47
this is an example.py to demo what may be a bug in pylint
#!/usr/bin/env python
''' example script
with some text
'''
__author__ = 'some author'
__email__ = 'some.author@generic.tld'
__copyright__ = 'Copyright 2016, Mericka Industries LLC'
import sys
@openfly
openfly / Makefile
Created June 21, 2016 20:02
The illest of python superbuild processes. Also.. BUWAHAHA make all the eggs!
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PYTHON='$(ROOT_DIR)/venv/bin/python'
SUBDIRS = pod-diagnostics pod-dir-passwd
.PHONY: subdirs $(SUBDIRS)
subdirs: $(SUBDIRS)
@openfly
openfly / setup.py
Created June 21, 2016 17:43
setup.py weirdness ( in venv )
#!/usr/bin/env python
from setuptools import setup, find_packages
from pip.req import parse_requirements
# parse_requirements() returns generator of
# pip.req.InstallRequirement objects
install_reqs = parse_requirements('requirements.txt',
session=False)
java-1.7.0-openjdk:
pkg:
- installed
@openfly
openfly / gist:a83486cd56acc45b6dbc
Created September 18, 2015 16:10
example of dict iteration in salt
dict.sls
{
plugin: "http://url/path/plugin.jpi"
}
state.sls
{%- import_yaml "dict.sls" as custom_plugins %}
@openfly
openfly / waht.sls
Created September 17, 2015 20:17
no op in salt.
include:
- some.awesome.state
{% some for shit here -%}
state:
cmd.run:
- name: doing some awesome shit iteratively
{% end loopy doop -%}