Skip to content

Instantly share code, notes, and snippets.

View StevenACoffman's full-sized avatar

Steve Coffman StevenACoffman

View GitHub Profile
@StevenACoffman
StevenACoffman / slackWebhook.md
Created January 2, 2019 14:14 — forked from lakshmantgld/slackWebhook.md
Configuring slack webhook

A Webhook, in simple terms, is a user-defined HTTP callback. It is a mechanism for the system to notify you about an event. In our case, we need to send messages to a particular channel in slack. Slack calls in Incoming Webhook. It is a mechanism to send messages to your Slack Channel from external sources. These external sources could be any application or service that is capable of sending a JSON payload over HTTP into a Slack Channel. Each Channel will be identified by a unique Incoming Webhook URL to which you can post the message from outside. This configuration is done via the Integrations for your channel.

Steps to create a incoming webhook in Slack:

  1. Naviagte to the Incoming Webhook URL. Click the hyper link incoming webhook integration below the heading Incoming Webhooks.
  2. You will be asked to enter your team URL, followed by your slack credentials.
  3. Once you have completed the above step, you will see the wizard kind of webpage to
@StevenACoffman
StevenACoffman / Rename.js
Last active December 14, 2018 02:25
Rename object
renameProp = (oldProp, newProp, {[oldProp]:old, ...others}) => ({ [newProp]: old, ...others })
#!/bin/bash
# AWS CodePipeline execution status
#
# by Darren Hodges (http://github.com/hodglim)
#
# <bitbar.title>AWS CodePipeline execution status</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Darren Hodges</bitbar.author>
# <bitbar.author.github>hodglim</bitbar.author.github>
@StevenACoffman
StevenACoffman / rotate-github-personal-access-keys.sh
Created September 27, 2018 21:48
Rotate Github Personal Access Keys
#!/bin/bash
TOKEN_UUID=$(uuidgen)
if [ -z ${GITHUB_USERID+x} ]; then
echo "GITHUB_USERID is unset, exitting";
exit 1
else
echo "GITHUB_USERID is set to '$GITHUB_USERID'"
fi
@StevenACoffman
StevenACoffman / codedeploy-to-slack.js
Created September 11, 2018 14:06 — forked from teeli/codedeploy-to-slack.js
CodeDeploy notifications to Slack (AWS Lambda via SNS)
var https = require('https');
var util = require('util');
exports.handler = function (event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var severity = "good";
var message = event.Records[0].Sns.Message;
var messageJSON = JSON.parse(message);
@StevenACoffman
StevenACoffman / notify_slack.py
Created September 11, 2018 14:06 — forked from richardnbanks/notify_slack.py
AWS Lambda function to send notifications from CodeDeploy to Slack
from __future__ import print_function
import json, urllib, urllib2
def send_slack(message):
"""
Send Slack Message to Deployments Channel
"""
slack_token = ''
slack_channel = ''
slack_user = 'Deployment Bot'
@StevenACoffman
StevenACoffman / cloudformationVSTerraform.md
Created September 6, 2018 10:23
CloudFormation vs. Terraform

You want to avoid CloudFormation because it’s slow, you don’t have much insight to what it’s doing while it’s running (the interface really sucks), it’s hard to stop it, and there are cases where it will get stuck for 4 hours (if certain internal components hang, it will retry twice with a 2 hr timeout and not even AWS premium support can unblock you). Terraform puts all of the control about what’s going on in your hands, the syntax is much simpler (CF’s json format is way too much syntax), and the “modules” feature allows for way simpler reusability.

From https://medium.com/@blockjon/scaling-jenkins-bad7a4ea046f