Skip to content

Instantly share code, notes, and snippets.

View mweiden's full-sized avatar
🤖
Robot cars

Matt Weiden mweiden

🤖
Robot cars
View GitHub Profile
@mweiden
mweiden / gist:2151974
Created March 21, 2012 19:46
bill links
dsf
@mweiden
mweiden / keybase.md
Created April 1, 2014 11:43
keybase.md

Keybase proof

I hereby claim:

  • I am mweiden on github.
  • I am weiden (https://keybase.io/weiden) on keybase.
  • I have a public key whose fingerprint is E85D 0953 1212 7854 3338 D606 5178 6846 2377 D9BB

To claim this, I am signing this object:

@mweiden
mweiden / CustomInjectionSource.properties
Created October 15, 2015 09:14
Command injection filters
INVOKEVIRTUAL|scala/sys/process/Process$|apply|(Ljava/lang/String;)Lscala/sys/process/ProcessBuilder;=0|CUSTOM_INJECTION
INVOKEVIRTUAL|scala/sys/process/Process$|apply|(Lscala/collection/Seq;)Lscala/sys/process/ProcessBuilder;=0|CUSTOM_INJECTION
INVOKEVIRTUAL|scala/sys/process/Process$|apply|(Ljava/lang/String;Lscala/collection/Seq;)Lscala/sys/process/ProcessBuilder;=0|CUSTOM_INJECTION
INVOKEVIRTUAL|scala/sys/process/Process$|apply|(Ljava/lang/String;Lscala/collection/Seq;)Lscala/sys/process/ProcessBuilder;=1|CUSTOM_INJECTION
INVOKEVIRTUAL|scala/sys/process/Process$|apply|(Ljava/lang/String;Ljava/io/File;Lscala/collection/Seq;)Lscala/sys/process/ProcessBuilder;=0|CUSTOM_INJECTION
INVOKEVIRTUAL|scala/sys/process/Process$|apply|(Ljava/lang/String;Ljava/io/File;Lscala/collection/Seq;)Lscala/sys/process/ProcessBuilder;=1|CUSTOM_INJECTION
INVOKEVIRTUAL|scala/sys/process/Process$|apply|(Ljava/lang/String;Ljava/io/File;Lscala/collection/Seq;)Lscala/sys/process/ProcessBuilder;=2|CUSTOM_INJECTION
INVOKEVIRTUAL|scala/s
@mweiden
mweiden / transform_record_sets.py
Last active April 12, 2018 16:59
Transfer record sets from one AWS Route53 zone to another
#!/usr/bin/env python3
import json
import sys
import re
# 1. aws route53 list-resource-record-sets --hosted-zone-id $ZONE_ID > /tmp/record_sets
# 2. ./[this_script] /tmp/record_sets 'some_regex' > /tmp/updates
# 3. inspect the file closely -> vim /tmp/updates
# 4. aws route53 change-resource-record-sets --hosted-zone-id $NEW_ZONE_ID --change-batch file:///tmp/updates
@mweiden
mweiden / README.md
Last active April 25, 2018 21:11
Generate direct urls for HCA DCP data given a bundle uuid

Direct links for DCP data

The command below takes a set of bundle UUIDs, fetches direct s3 urls for the files of each and writes it to a CSV file.

tail -n +2 melanoma_bundle_uuids.txt | ./gen_direct_url.sh > direct_urls.csv

The format of the CSV is bundle_uuid, file_name, file_url.

Prerequisites

@mweiden
mweiden / prompt.sh
Created April 27, 2018 05:47
Prompt
function return_value() {
RETVAL=$?
[ $RETVAL -ne 0 ] && echo "\[\e[31m\]${RETVAL}\[\e[m\]" || echo "\[\e[32m\]${RETVAL}\[\e[m\]"
}
export PS1="`return_value` \[\e[34m\]\W\[\e[m\]> "
iters = [iter(t) for t in [(1, 2), (0, 2), (0, 2, 3)]]
def get(itr):
try:
return next(itr)
except StopIteration:
return None
@mweiden
mweiden / RUNBOOK_TEMPLATE.md
Last active August 15, 2018 21:15
A runbook template for HCA DCP

[System Name]: Run Book / System Operation Manual

Service or system overview

README.md link:

Service owner

Production checklist

Design

  • System blueprint (boxes and arrows)
  • Capacity planning

Administrative

@mweiden
mweiden / build_status.md
Last active September 8, 2018 00:22
HCA Build Status

HCA Data Coordination Platform: Build Status

System Stage Status
DCP integration
DCP staging
Upload dev
Upload integration
Upload staging
Data Storage dev
Data Storage integration