Skip to content

Instantly share code, notes, and snippets.

package main
// Here's a half-assed "jepsen" test for nsq_to_file that exercises its
// management of files in -work-dir and -output-dir in the face of multiple
// processes sharing those directories.
//
// Usage:
//
// 1. Ensure that the versions of nsqd & nsq_to_file you intend to test are on
// your $PATH:
#!/usr/bin/env python
import subprocess
import sys
def get_current_branch():
cmd = 'git name-rev --name-only HEAD'.split()
return subprocess.check_output(cmd).strip()
@mccutchen
mccutchen / fillcache.md
Last active June 17, 2018 23:42
fillcache: a poor man's in-process groupcache
commit 3ebbd2f39d4a3b356d3b5c005caef368eaca4529
Author: Will McCutchen <will@mccutch.org>
Date: Sat Mar 3 14:08:05 2018 -0800
ansible: upgrade to datadog agent 6
diff --git a/ansible/group_vars/all b/ansible/group_vars/all
index dce89d4..c5dd911 100644
--- a/ansible/group_vars/all
+++ b/ansible/group_vars/all
@mccutchen
mccutchen / Dockerfile
Created May 16, 2017 22:01
example volume_tester rig service
FROM python:2.7.11-slim
RUN pip install datadog==0.16.0
COPY . /app
CMD ["/app/volume_tester.py"]
#!/bin/bash
echo "copying ~/.aws/config onto rig.dev vm ..."
scp ~/.aws/config rig.dev:~/.aws/config
echo
echo "adding ~/.aws/credentials to existing credentials on rig.dev vm ..."
cat ~/.aws/credentials | ssh rig.dev sh -c 'cat >> ~/.aws/credentials'
#!/usr/bin/env python
import subprocess
import sys
def get_current_branch():
cmd = 'git name-rev --name-only HEAD'.split()
return subprocess.check_output(cmd).strip()

Some engineering-related interview questions to ask a data scientist candidate.

  • How comfortable are you at a Linux or OS X command line?
    • Can you navigate around?
    • What are pipes?
  • Do you use source control?
    • How comfortable are you with git in particular?
    • Are you familiar with pull requests and code review?
    • Do you know to avoid common mistakes like checking large input or result data sets into the source code repo?
  • How do you ensure that your results are repeatable? How do you make sure other people can run your code reliably and easily?
#!/usr/bin/env python
"""
Once you've used `terraforming` to generate both HCL resource defintions and a
`terraform.tfstate` file to import your existing AWS resources into terraform,
your new resources will be littered with references to specific AWS resource
IDs rather than symbolic references to terraform-level resources.
This script will attempt to rewrite those IDs with symbolic references, so that
terrafrom can properly manage the resources and build a dependency graph

heheheh

y'all are gonna love this

I figured out why logentries keeps sending log files

it's a doozy

so I straced multilog for /service/auth_api-1/log/current