Skip to content

Instantly share code, notes, and snippets.

(let [hosts (atom {})]
(fn [event]
(let [tag-str (keyword (clojure.string/join "-" (:tags event)))]
(swap! hosts assoc tag-str (conj (tag-str @hosts #{}) (:host event)))
(index {:service (str (name tag-str) "-count")
:time (unix-time)
:metric (count (tag-str @hosts))}))))

Intro:

http://punchcard.io

Currently a developer's professional profile is made up two components:

  • LinkedIn
  • Github

LinkedIn shows your work history, and Github shows your craft. There is a missing gap between LinkedIn and Github. Punchcard.io is designed to bridge that gap.

@aaronfeng
aaronfeng / ec2-libswarm-readme.md
Last active December 6, 2015 10:00
README for libswarm EC2 Service

https://github.com/docker/libswarm

EC2 Libswarm Service

This service will deploy Docker container onto EC2 instance. It will do all of the work spinning up the instance if it doesn't exist already.

Usage:

export AWS_ACCESS_KEY_ID=XXXX

@aaronfeng
aaronfeng / config
Created October 29, 2012 15:12
ssh config for ec2 - no more annoying host checking by defaut
Host *.compute.amazonaws.com
IdentityFile ~/.ec2/your-key.pem
User root
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
@aaronfeng
aaronfeng / gist:3379083
Created August 17, 2012 14:23
PhillyAWS - 8/28/12

I can't decided on the title. Maybe you can help me. 3 - 7 is courtesy of @codeslinger.

title

  1. "BigData: Data Crunch on a Budget"
  2. "BI in the Cloud"
  3. "You're using Oracle for that? Big Data and you"
  4. "Better Answers from More Data: Today's Business Intelligence Architecture"
  5. "How Did They Know That? Getting Smart Answers like Google"
@aaronfeng
aaronfeng / gist:3370486
Created August 16, 2012 14:25
edit last modified file
$EDITOR `find . \( ! -regex '.*/\..*' \) -type f | xargs ls -rt | tail -n 1`
@aaronfeng
aaronfeng / gist:3236613
Created August 2, 2012 12:13
chef attributes quiz
# cookbook/attributes/default.rb
default[:foo][:bar][:size] = 42
# cookbook/recipes/default.rb
node.foo.bar.size
# what will above return?
> tree
.
├── ext
│   ├── cli.sh
│   ├── debug.sh
│   ├── help.sh
│   ├── hiveserver.sh
│   ├── hwi.sh
│   ├── jar.sh
│   ├── lineage.sh
@aaronfeng
aaronfeng / gist:2882234
Created June 6, 2012 14:30
hive insert overwrite directory
INSERT OVERWRITE DIRECTORY '${OUTPUT_BUCKET}/results/report/region=${REGION}/dt=${DATE}'
SELECT
dt,
col1,
col2,
col3,
col4,
col5,
col6,
avg(col7) col7,
@aaronfeng
aaronfeng / gist:2314705
Created April 5, 2012 22:32
first cloud foundry app
Would you like to deploy from the current directory? [Yn]: Y
Application Name: testapp
Detected a Rails Application, is this correct? [Yn]: Y
Memory Reservation (64M, 128M, 256M, 512M, 1G, 2G) [256M]: 64M
Creating Application: OK
Would you like to bind any services to 'testapp'? [yN]: y
The following system services are available
1: mysql
Please select one you wish to provision: 1
Specify the name of the service [mysql-4f8ad]: