Skip to content

Instantly share code, notes, and snippets.

View madeddie's full-sized avatar
🏠
Working from home

Edwin Hermans madeddie

🏠
Working from home
View GitHub Profile
@madeddie
madeddie / ecs_pr_cleanup.sh
Created March 30, 2016 14:43
"script" to clean up Ecs services created for closed PR's
#!/usr/bin/env bash
# retrieve list of closed github PRs, compare to running Ecs services, stop and delete services and deregister task-definitions
# settings
github_token='YOURGITHUBTOKEN' # github token with access to organization pull-requests
github_repo='SOMEORG/SOMEREPO' # org/repo from which to retrieve pullrequest status
cluster_arn='SOME_ECS_CLUSTER' # full arn or shortname of Ecs cluster
# retrieve list of closed pull-requests
closed_pulls="^($(curl -s -G -d access_token="$github_token" https://api.github.com/repos/"$github_repo"/pulls?state=closed | jq .[].number | sort -n | paste -sd'|' -))$"
@madeddie
madeddie / bash_aws_functions.sh
Last active March 23, 2016 18:26
Some useful bash functions for dealing with AWS/EC2/OpsWorks stacks and instances
# AWS functions
function instances() {
if [[ $1 == '--ip' || $1 == '--ips' ]]; then
filter='.[PrivateIpAddress]'
output='text'
shift
elif [[ $1 == '--id' || $1 == '--ids' ]]; then
filter='.[InstanceId]'
output='text'
shift
@madeddie
madeddie / awareness.lua
Created November 3, 2015 19:58
Hammerspoon Awareness replacement
-- Awareness replacement
local awareness = hs.menubar.new()
function setAwarenessDisplay(timerSecs)
local timerPercent = math.floor(timerSecs / 3600 * 100)
awareness:setTitle(tostring(timerPercent))
end
awakeTimer = hs.timer.doAfter(3600, function()
hs.alert("Have some rest", 5)
end)

Keybase proof

I hereby claim:

  • I am madeddie on github.
  • I am madeddie (https://keybase.io/madeddie) on keybase.
  • I have a public key ASDvJfxzvl2I4IiASRlRbnbGv_MaJlDyRBdW1fqOBKH9iwo

To claim this, I am signing this object: