Skip to content

Instantly share code, notes, and snippets.

Chris Watts devgrok

View GitHub Profile
@devgrok
devgrok / docker-add-ephemeral.sh
Created Apr 17, 2019
Add ephemera storage to Amazon ECS-optimized AMIs (v1)
View docker-add-ephemeral.sh
#!/bin/bash -exu
# find ephemeral devices using the metadata service
# note: this will block loading until the metadata service is ready
find_ephemeral_devices() {
echo "Querying metadata instance store for ephemeral volumes" >&2
local DEVICE_NOT_FOUND=0
for d in $(curl -s "http://169.254.169.254/latest/meta-data/block-device-mapping/" | grep ephemeral); do
NAME=$(curl -s "http://169.254.169.254/latest/meta-data/block-device-mapping/$d")
DEVICE_NAME="/dev/$NAME"
@devgrok
devgrok / hipchat_proxy.py
Last active Mar 21, 2019
Create a Private Microservice Using an Application Load Balancer
View hipchat_proxy.py
import json
import logging
import os
from lambdarest import lambda_handler
from slackclient import SlackClient
logger = logging.getLogger()
logger.setLevel(logging.INFO)
View ambiata-hydra-daemon.cabal
name: ambiata-hydra-daemon
version: 0.0.1
license: AllRightsReserved
author: Ambiata <info@ambiata.com>
maintainer: Ambiata <info@ambiata.com>
copyright: (c) 2015 Ambiata.
synopsis: hydra-daemon
category: System
cabal-version: >= 1.8
build-type: Custom
@devgrok
devgrok / cloud-init-cloudwatch-agent
Created Jul 2, 2018
Installs CloudWatch Agent for monitoring ECS-Agent log files
View cloud-init-cloudwatch-agent
Content-Type: multipart/mixed; boundary="==BOUNDARY=="
MIME-Version: 1.0
--==BOUNDARY==
MIME-Version: 1.0
Content-Type: text/cloud-boothook; charset="us-ascii"
#!/bin/bash +x
# optionally set ECS agent options (increase base container size)
cloud-init-per once docker_options echo 'OPTIONS="${OPTIONS} --storage-opt dm.basesize=100G"' >> /etc/sysconfig/docker
@devgrok
devgrok / otool.txt
Created Jun 18, 2018
output of otool -l /m/packages/2/x86_64-apple-darwin/8.0.2/ambiata-blizzard-cloud-0.0.1-2d3164af129d0d3c6766d5b2f9c56485cc4f4598/lib/x86_64-osx-ghc-8.0.2/libHSambiata-blizzard-cloud-0.0.1-1VoPiGGVam1hXCLhYtPOH-ghc8.0.2.dylib
View otool.txt
/m/packages/2/x86_64-apple-darwin/8.0.2/ambiata-blizzard-cloud-0.0.1-2d3164af129d0d3c6766d5b2f9c56485cc4f4598/lib/x86_64-osx-ghc-8.0.2/libHSambiata-blizzard-cloud-0.0.1-1VoPiGGVam1hXCLhYtPOH-ghc8.0.2.dylib:
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
0xfeedfacf 16777223 3 0x00 6 294 33200 0x00100085
Load command 0
cmd LC_SEGMENT_64
cmdsize 472
segname __TEXT
vmaddr 0x0000000000000000
vmsize 0x0000000000066000
View otool.txt
/m/packages/2/x86_64-apple-darwin/8.0.2/ambiata-blizzard-cloud-0.0.1-2d3164af129d0d3c6766d5b2f9c56485cc4f4598/lib/x86_64-osx-ghc-8.0.2/libHSambiata-blizzard-cloud-0.0.1-1VoPiGGVam1hXCLhYtPOH-ghc8.0.2.dylib:
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
0xfeedfacf 16777223 3 0x00 6 294 33200 0x00100085
Load command 0
cmd LC_SEGMENT_64
cmdsize 472
segname __TEXT
vmaddr 0x0000000000000000
vmsize 0x0000000000066000
You can’t perform that action at this time.