This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Interface to the FreshDesk API. | |
Author: Ed Menendez (ed@menendez.com) | |
Company: Digital Haiku | |
Created: September 1, 2014 | |
Example settings: | |
FRESHDESK_URL = 'https://wpt.freshdesk.com' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup your logger | |
logger = logging.getLogger('log') | |
logFormat = logging.Formatter('%(asctime)s [%(levelname)s] %(message)s') | |
logBuffer = StringIO.StringIO() | |
logString = logging.StreamHandler(logBuffer) | |
logString.setFormatter(logFormat) | |
logger.addHandler(logString) | |
logger.setLevel(logging.WARN) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GLUSTERVERSION="3.9.1-1" ; yum install http://buildlogs.centos.org/centos/7/storage/x86_64/gluster-3.9/glusterfs-${GLUSTERVERSION}.el7.x86_64.rpm \ | |
http://buildlogs.centos.org/centos/7/storage/x86_64/gluster-3.9/glusterfs-fuse-${GLUSTERVERSION}.el7.x86_64.rpm \ | |
http://buildlogs.centos.org/centos/7/storage/x86_64/gluster-3.9/glusterfs-libs-${GLUSTERVERSION}.el7.x86_64.rpm \ | |
http://buildlogs.centos.org/centos/7/storage/x86_64/gluster-3.9/glusterfs-extra-xlators-${GLUSTERVERSION}.el7.x86_64.rpm \ | |
http://buildlogs.centos.org/centos/7/storage/x86_64/gluster-3.9/python-gluster-${GLUSTERVERSION}.el7.noarch.rpm \ | |
http://buildlogs.centos.org/centos/7/storage/x86_64/gluster-3.9/glusterfs-client-xlators-${GLUSTERVERSION}.el7.x86_64.rpm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Records": [ | |
{ | |
"EventSource": "aws:sns", | |
"EventVersion": "1.0", | |
"EventSubscriptionArn": "arn:aws:sns:xxx", | |
"Sns": { | |
"Type": "Notification", | |
"MessageId": "xxxxxx-xxx-xxxxxx-xxxxx", | |
"TopicArn": "arn:aws:sns::::slackNotifications", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var https = require('https'); | |
var util = require('util'); | |
function tryParseJSON (jsonString){ | |
try { | |
var o = JSON.parse(jsonString); | |
// Handle non-exception-throwing cases: | |
// Neither JSON.parse(false) or JSON.parse(1234) throw errors, hence the type-checking, |