Step 1: Start Heka with DockerLogInput
$ hekad -config docker.toml
Step 2: Start a container
$ docker run -d busybox /bin/sh -c 'while true; do echo Hello world; sleep 1; done'
/** | |
* Fancy ID generator that creates 20-character string identifiers with the following properties: | |
* | |
* 1. They're based on timestamp so that they sort *after* any existing ids. | |
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
* latter ones will sort after the former ones. We do this by using the previous random bits | |
* but "incrementing" them by 1 (only in the case of a timestamp collision). | |
*/ |
Step 1: Start Heka with DockerLogInput
$ hekad -config docker.toml
Step 2: Start a container
$ docker run -d busybox /bin/sh -c 'while true; do echo Hello world; sleep 1; done'
require "string" | |
require "math" | |
require "table" | |
require "cjson" | |
local status_codes = {} | |
local request_times = {} | |
local ticker_interval = read_config("ticker_interval") or error("must provide ticker_interval") | |
local percent_thresh = read_config("percent_threshold") or 90 |
#!/usr/bin/env bash | |
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/ | |
### | |
# Label definitions | |
### | |
declare -A LABELS | |
# Platform |
local dt = require "date_time" | |
local ip = require "ip_address" | |
local l = require 'lpeg' | |
local syslog = require "syslog" | |
l.locale(l) | |
local msg = { | |
Timestamp = nil, | |
Hostname = nil, | |
Payload = nil, |
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
[ssh_connection] | |
ssh_args = -F ssh.cfg | |
control_path = ~/.ssh/mux-%r@%h:%p |
user = "xavierlange" | |
heka_dir = "#{Chef::Config[:file_cache_path]}/heka" | |
%w(cmake mercurial fakeroot debhelper libgeoip-dev).each do |pkg| | |
package pkg | |
end | |
directory heka_dir do | |
owner user | |
group user |
CREATE TABLE books ( | |
isbn char(14) NOT NULL, | |
title varchar(255), | |
author varchar(255), | |
price decimal(5,2) | |
); | |
INSERT INTO books (isbn, title, author, price) VALUES | |
('978-1503261969', 'Emma', 'Jayne Austen', 9.44), | |
('978-1514274873', 'Journal of a Soldier', NULL, 5.49), |