This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyApp.Tracer do | |
@moduledoc "Spandex Tracer" | |
use Spandex.Tracer, otp_app: :my_app | |
def async(func) do | |
case current_context() do | |
{:ok, tracer_ctx} -> | |
Task.async(fn -> | |
continue_trace("async", tracer_ctx, resource: "Task.async", service: :my_app_async) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clojure.string :as str]) | |
(ns berlin | |
(:require [clojure.test :refer :all])) | |
(defn render-lights [number-on total-lights] | |
(let [on-lights (apply str (repeat number-on "*")) | |
format-string (str "%-" total-lights "s")] | |
(str/replace | |
(format format-string on-lights) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setting up the Environment (on CentOS+EPEL, assuming you already have RVM installed) | |
==================================================================================== | |
rvm install ruby-1.9 | |
rvm use ruby-1.9 | |
gem install bluecloth cabin i18n stud | |
yum install asciidoc pandoc | |
git checkout https://github.com/elasticsearch/logstash.git | |
cd logstash/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
tcp { | |
port => 5000 | |
type => syslog | |
} | |
udp { | |
port => 5000 | |
type => syslog | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Paul Visscher and Greg Mefford | |
require 'time' | |
class BerlinClock | |
def self.convert_time(time) | |
t = Time.parse(time) | |
clock = "" | |
if t.sec % 2 == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Packaging ruby with fpm is a bit meta | |
# You need ruby install to use fpm | |
# I used an RVM install on a VM install fpm in a packaging gemset | |
# Install EPEL if you don't have it already | |
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm | |
# Install deps for ruby build | |
yum install rpm-build readline-devel.x86_64 libffi-devel.x86_64 libyaml-devel.x86_64 zlib-devel.x86_64 openssl-devel.x86_64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First do a fresh install of CentOS 5.7 i386, server configuration (no GUI) | |
# This should be performed as root since it's going to be installing a bunch of stuff | |
# --- Update things to make sure we have the latest patches --- | |
# Add EPEL so we can get reasonably recent packages | |
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | |
# --- Install all the packages --- # | |
yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached |