Skip to content

Instantly share code, notes, and snippets.

View openfly's full-sized avatar

Matt Joyce openfly

View GitHub Profile
import socket
import subprocess
class Coring(object):
def __init__(self, *args, **kwargs):
super(Coring, self).__init__(*args, **kwargs)
@openfly
openfly / giphy_source_image.py
Created July 26, 2018 19:21
example using http ref that works
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
giphy demo
'''
__author__ = 'Matt Joyce'
__email__ = 'matt@nycresistor.com'
__copyright__ = 'Copyright 2016-2018, BLAH'
@openfly
openfly / giphy_example.py
Last active July 26, 2018 19:03
giphy upload trouble
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
giphy demo
'''
__author__ = 'Matt Joyce'
__email__ = 'matt@nycresistor.com'
__copyright__ = 'Copyright 2016-2018, BLAH'
@openfly
openfly / this is a bad assumption.
Created June 5, 2018 19:52
AWS Lying their faces off.
Hello again, thanks for getting back in touch!
Given that there was a datapoint where the "StatusCheckFailed_System" was 1.0, please assume from this that there was an issue with the underlying host during this timeframe. Because the issue occurs at a hypervisor level, it is transparent to the instance's operating system - meaning that there would be no logs for it on the OS.
With regard to raising an alert for future occurrences, please consider the solution I have provided in my previous correspondence where you can configure CloudWatch Alarms to monitor the "StatusCheckFailure" metric and send an email notification to a desired email address if the alarm is triggered [1].
I hope this answers your query and should you have further questions regarding this matter, please do not hesitate in responding to this case and we will be happy to help you.
[1] Create Alarms to Stop, Terminate, Reboot, or Recover an Instance
- http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/UsingAlarmActions.html
@openfly
openfly / hello_read.py
Last active June 5, 2018 03:07
A test read datafeed script.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
hello world for symphony
'''
__author__ = 'Matt Joyce'
__email__ = 'matt@joyce.nyc'
__copyright__ = 'Copyright 2017, Symphony'
@openfly
openfly / gist:a6c7249dbfdb7b21fd638cdfeb0aea85
Last active May 31, 2018 17:15
test run of hello_world.py for python-symphony module
matt.joyce@prometheus  ~/SYMPHONY/OSS/test  virtualenv EXAMPLE-OSS
New python executable in /Users/matt.joyce/SYMPHONY/OSS/test/EXAMPLE-OSS/bin/python
Installing setuptools, pip, wheel...done.
matt.joyce@prometheus  ~/SYMPHONY/OSS/test  source EXAMPLE-OSS/bin/activate
(EXAMPLE-OSS) matt.joyce@prometheus  ~/SYMPHONY/OSS/test 
(EXAMPLE-OSS) matt.joyce@prometheus  ~/SYMPHONY/OSS/test  pip install --upgrade python-symphony
Collecting python-symphony
Downloading https://files.pythonhosted.org/packages/3a/4c/95a8c67cd098494690ad872b644e4a5071fbc9b6a1b4835d8b7a0ea4df78/python-symphony-0.2.6.tar.gz
Requirement not upgraded as not directly required: pip in ./EXAMPLE-OSS/lib/python2.7/site-packages (from python-symphony) (10.0.1)
Collecting requests (from python-symphony)
@openfly
openfly / hello_world.py
Created February 5, 2018 18:48
python-symphony hello world script with named logger.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
hello world for symphony w/ logger
'''
__author__ = 'Matt Joyce'
__email__ = 'matt@joyce.nyc'
__copyright__ = 'Copyright 2017, Symphony'
@openfly
openfly / example_check.py
Created January 17, 2018 22:17
Example Python Sensu Check with Unit Test Flag
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Example Unit Tests using Sensu Plugin
'''
__author__ = 'Matt Joyce'
__email__ = 'matt@surly.bike'
import argparse
@openfly
openfly / gist:7b4e1a679c3a6979d6e42333f220551c
Created September 25, 2017 18:35
feedback for GCP's firewall ruleset workflow.
Your firewall rules interface is a byzantine nightmarish hellscape. To gaze upon it is to gaze deep into an eldricth horror. One so suborned to the evil of it's UX will find themselves robbed of their sanity and fallen into a bottomless chasm of despair.
This interface has ruined me. It has stolen precious hours of my life and productivity. The person responsible for it, is truly evil incarnate and could in no way have produced a more mind destructive workflow should they have spent decades mastering their craft.
If your goal was to make your customers despise you with ever fiber of their ruined being, you have succeeded beyond your wildest expectations.
Seriously. This is god awful beyond measure. There is literally nothing good about the firewall rules workflow in GCP. NOTHING. How you managed to produce this horror show I cannot fathom. How you had the mind boggling audacity to put it into the production world will forever leave me scarred. And how in several years time you have not simply ab
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from flask import Flask, Blueprint
from flask_restplus import Api
from werkzeug.contrib.fixers import ProxyFix
# threw this in to see if there were any exceptions here. there were not.