Skip to content

Instantly share code, notes, and snippets.

Avatar
🔎
Investigating

David J. Felix DavidJFelix

🔎
Investigating
View GitHub Profile
@DavidJFelix
DavidJFelix / README.md
Last active January 15, 2021 14:01
Debug Scratch Docker Containers
View README.md

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

@DavidJFelix
DavidJFelix / VPC Cloudformation.yml
Created February 11, 2020 19:53
How I setup my VPC
View VPC Cloudformation.yml
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
@DavidJFelix
DavidJFelix / keybase.md
Created February 13, 2018 16:13
keybase.md
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:

@DavidJFelix
DavidJFelix / install.sh
Created July 31, 2017 13:47
OSX setup notes
View install.sh
#!/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)"
@DavidJFelix
DavidJFelix / java.pp
Last active August 29, 2015 14:17 — forked from hameno/java.pp
View java.pp
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'],
@DavidJFelix
DavidJFelix / HyperLogLogs_lab.md
Last active December 23, 2020 11:28
A lab for HyperLogLogs using Redis & Python, created with Ipython notebook
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.

@DavidJFelix
DavidJFelix / 4equals5.py
Created July 26, 2014 18:32
Modify python behavior
View 4equals5.py
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')