Skip to content

Instantly share code, notes, and snippets.

from __future__ import print_function
import json, httplib, boto3
def get_slack_msg(msg):
return get_deploy_msg(msg) if 'status' in msg else get_deploy_instance_msg(msg)
def get_deploy_msg(msg):
success = msg['status'] == 'SUCCEEDED'
deployment_group = msg['deploymentGroupName']
deployment_id = msg['deploymentId']
@lukehutton
lukehutton / install_aws_codedeploy_agent.sh
Created May 13, 2015 23:35
Install AWS CodeDeploy agent on Ubuntu 12.04 Precise - Officially supported on Ubuntu Server 14.04 LTS only, see http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-run-agent.html#how-to-run-agent-supported-oses
#!/usr/bin/env bash
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install python-pip
sudo pip install awscli
sudo apt-get install ruby2.0
cd /home/ubuntu
sudo aws s3 cp s3://aws-codedeploy-us-east-1/latest/install . --region us-east-1
@lukehutton
lukehutton / EnableSchUseStrongCrypto.ps1
Last active August 29, 2015 14:15
http://msdn.microsoft.com/en-us/library/windows/desktop/aa379810(v=vs.85).aspx HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SchUseStrongCrypto Instructs Schannel to disable known weak cryptographic algorithms, cipher suites, and SSL/TLS protocol versions that may be otherwise enabled for better interoperability.
New-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319' -name 'SchUseStrongCrypto' -value 1 -PropertyType 'DWord' -Force | Out-Null
@lukehutton
lukehutton / TeamCityBuildAgentStartScript.sh
Created March 11, 2014 00:22
TeamCity Build Agent Start Script
#! /bin/sh
# /etc/init.d/teamcity-agent
# Common parameters, do not edit:
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="TeamCity Agent"
NAME=teamcity-agent
SCRIPTNAME=/etc/init.d/$NAME
#
@lukehutton
lukehutton / InstallTeamCityBuildAgentUbuntu.sh
Last active August 29, 2015 13:57
Install TeamCity Build Agent on Ubunutu 12.04
# install dependencies
$ sudo apt-get update
# jre headless (no gui)
$ sudo apt-get -y install openjdk-7-jre-headless
# download TeamCity agent
$ wget http://myteamcityserver/update/buildAgent.zip
$ unzip buildAgent.zip -d buildAgent
$ cp buildAgent/conf/buildAgent.dist.properties buildAgent/conf/buildAgent.properties
$ chmod +x buildAgent/bin/agent.sh