Skip to content

Instantly share code, notes, and snippets.

View matschaffer's full-sized avatar
🧡

Mat Schaffer matschaffer

🧡
View GitHub Profile
atlas {
core {
model {
step = 1m
}
db {
class = "com.netflix.atlas.core.db.MemoryDatabase"
@matschaffer
matschaffer / logexamples.txt
Last active August 29, 2015 14:21
stumped by lpeg
info: type=query, sql=update `Transactions` set `confirmedAt` = ? where `id` = ?
error: unhandled error type name=NetworkError, stack=NetworkError: noNetwork
@matschaffer
matschaffer / cadvisor.json
Created May 28, 2015 01:52
stats examples from cadvisor
[
{
"name": "stats",
"columns": [
"time",
"sequence_number",
"tx_errors",
"memory_usage",
"rx_errors",
"container_name",
ledgerclose: &default
image: stellar/atlas-alert
restart: always
log_driver: syslog
env_file:
- ./smtp.env
- ./base.env
environment:
DESCRIPTION: "Ledger close rate has dropped < 0.1/s on the following nodes:"
QUERY: "name,ledger.ledger.close,:eq,stat,1_min_rate,:eq,:and,:sum,(,node,),:by,:dup,0.1,:le,alert: $(node),:legend,:vspan,60,:alpha"
@matschaffer
matschaffer / alert.lua
Created June 1, 2015 01:57
heka decoder harness - expects "payload" and "config.json" to be in pwd
return {
send = function(ns, message)
print("alert - " .. ns .. ": " .. message)
end
}
FROM (base)
MAINTAINER Mat Schaffer <mat@stellar.org>
ENV (foo)_VERSION 1.4.3
EXPOSE (port)
ADD install /
RUN /install
# -*- mode: toml -*-
# vi: set ft=toml :
[hekad]
base_dir = "/tmp"
[on_space]
type = "TokenSplitter"
delimiter = " "
#!/usr/bin/env bash
echo a
echo b
echo ----
echo c
echo d
echo ----
echo
~
❯ curl -v https://api.stellar.org
* Rebuilt URL to: https://api.stellar.org/
* Hostname was NOT found in DNS cache
* Trying 108.162.204.108...
* Connected to api.stellar.org (108.162.204.108) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* Server certificate: *.stellar.org
* Server certificate: COMODO RSA Domain Validation Secure Server CA
* Server certificate: COMODO RSA Certification Authority
@matschaffer
matschaffer / running_instances.sh
Created July 24, 2015 06:48
List running instances with name, cost-center, etc.
#!/bin/sh
aws ec2 describe-instances |\
jq -r '.Reservations[].Instances[] |
select(.State.Code == 16) |
[
( .Tags[] | select(.Key == "Name") | .Value ),
( .Tags[] | select(.Key == "cost-center") | .Value),
.InstanceId,
.InstanceType