Skip to content

Instantly share code, notes, and snippets.

View JDFagan's full-sized avatar
:electron:
Building AI driven innovation

J.D. Fagan JDFagan

:electron:
Building AI driven innovation
  • Doma
  • San Francisco, CA
View GitHub Profile

Git DMZ Flow

TL;DR: To avoid breaking the build when merging independent PRs to master, introduce a "demilitarized zone" branch, merge PRs to it and merge it to master automatically on successful builds.

I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.

  • Two developers working on independent features must never be blocked by each other
    • No code freeze! Ever! For any reason!
  • A developer must be able to base derivative work on another developer's work, without waiting for any third party
  • Two developers working on inter-dependent features (

How to allow AWS across machine commands

To allow for diffing filesystems via rsync or running diff commands local vs remote. To make this work, easiest to allow root user to ssh into AWS instance.

How to enable security

For each machine you want to issue distributed compare like rsync or run diff remotely to any file:

sudo su
cd ~/.ssh
mv authorized_keys authorized_keys.orig
ssh-keygen -y -f somekey.pem > somekey.pub
@JDFagan
JDFagan / aws-ebs-volume-resize.md
Last active April 13, 2023 06:06
Amazon EBS (Elastic Block Store) storage is not easy to lower volume sizes. They seem to be easy to expand though. This is especially problematic when the EBS volume is mounted on root. This gist describes steps one can take to re-size an EBS volume on an instance whether its to lower or raise the volume size.

Warning - Steps to lower Root EBS Volume still a work in progress and being tested

Steps to Lower Root EBS Volume Size on an Instance

  1. Create new Ubuntu Micro instance (e.g., Name = Tools)
  2. Stop instance you want to lower EBS volume.
  3. Create AMI image as backup of your instance.
  4. Create an empty X GB Amazon EBS volume in the same availability zone where X is smaller size you desire.
  5. Detach the volume you wish to resize from the stopped instance from step 2 above.
  6. Attach the original volume to the Tools instance (e.g., as /dev/xvdf)
  7. Attach new downsized volume to the Tools instance (e.g., as /dev/xvdg)
@JDFagan
JDFagan / snapshots.py
Created November 18, 2016 20:15 — forked from Eyjafjallajokull/README.md
AWS EBS - Find unused snapshots - this script generates csv raport about snapshot usage
import re
import boto3
import csv
from botocore.exceptions import ClientError
ec2 = boto3.client('ec2')
def get_snapshots():
return ec2.describe_snapshots(OwnerIds=['self'])['Snapshots']
@JDFagan
JDFagan / gistFreeTds+iOdbc.txt
Last active April 6, 2016 12:50
Install FreeTDS, iODBC
Install ODBC Manager:
http://www.odbcmanager.net/
?? Not sure if below is needed
$ brew install libiodbc
Install the following libraries: