Containers are great for shipping software, but sometimes you can go too far when stripping down your container to make it as small as possible. There’s a fine balance between a “no-frills” image and something impossible to debug (I’m looking at you, single binary go containers). The normal way I see people debug a running container is to docker exec -it $CONTAINER sh and install their debug tools on demand in the container. But what if your container doesn’t have /bin/sh? What if it doesn’t have a package manager? You could copy utilities into the container with docker cp and then exec into the running container but that’s also a hassle. So instead of trying to debug from within the container, a friend recently asked how you could debug from a different container. I’m not that smart so I asked much smarter people online and got a good answer back. Thanks again Justin Cormack for the reply. Let’s create a stripped down container with only caddy. First download/extract the caddy binary `$: curl https://getcad
View VPC Cloudformation.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: '2010-09-09' | |
Metadata: | |
License: Apache-2.0 | |
Parameters: | |
CidrBlocks: | |
Description: FIXME Remove. The CIDR blocks to use for the subnets in the services VPC. | |
Default: '10.0.0.0/24,10.0.1.0/24,10.0.2.0/24,10.0.3.0/24,10.0.4.0/24,10.0.5.0/24' | |
Type: CommaDelimitedList |
View keybase.md
Keybase proof
I hereby claim:
- I am davidjfelix on github.
- I am davidjfelix (https://keybase.io/davidjfelix) on keybase.
- I have a public key ASBXhkpcdJ6o4vmyZRI1p7PDZK1XXL82RZB2iks6U7RNqQo
To claim this, I am signing this object:
View install.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euvxo pipefail | |
# Get commande line tools | |
xcode-select --install | |
# Get homebrew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
View java.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class java { | |
class { 'apt': } | |
# Add PPA | |
apt::ppa { 'ppa:webupd8team/java': } -> | |
# Install Java | |
package { 'oracle-java7-installer': | |
ensure => latest, | |
require => [ | |
Apt::Ppa['ppa:webupd8team/java'], | |
Exec['accept_java7_license'], |
View HyperLogLogs_lab.md
Redis is an in-memory network key/value store and nltk is the python natural language toolkit. We'll be using these libraries later for the lab.
import redis
import nltk
Setup our redis connection. It's on the VM, so local is fine.
View 4equals5.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ctypes import c_int8 | |
from struct import calcsize | |
# Make 4 = 5 | |
c_int8.from_address(id(4) + calcsize('PP')).value = 5 | |
# A little more readable | |
address = id(4) | |
offset = calcsize('PP') |