Skip to content

Instantly share code, notes, and snippets.

View seanmorrisonit's full-sized avatar

Sean Morrison seanmorrisonit

  • Perth, Australia
View GitHub Profile
"""
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'
# 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)
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
{
"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",
@seanmorrisonit
seanmorrisonit / snsToSlack.js
Last active November 15, 2017 18:06 — forked from terranware/snsToSlack.js
AWS Lambda function to Slack Channel hookup
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,