Skip to content

Instantly share code, notes, and snippets.

GregMefford / spandex_async.ex
Created May 24, 2019
Spandex Asynchronous Tracing Example
View spandex_async.ex
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)
GregMefford / berlin_clock.clj
Last active Aug 29, 2015
Cincy Day of Functional
View berlin_clock.clj
(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")]
(format format-string on-lights)
GregMefford / gist:9382965
Last active Aug 29, 2015
Building the Logstash Documentation
View gist:9382965
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
cd logstash/
GregMefford / gist:7347990
Created Nov 7, 2013
Processing ASA logs in LogStash after having passed through rsyslog, with thanks to PinkFreud on IRC in the #logstash channel on FreeNode
View gist:7347990
input {
tcp {
port => 5000
type => syslog
udp {
port => 5000
type => syslog
GregMefford / clock.rb
Created Apr 18, 2012 — forked from paulv/clock.rb
Berlin Clock Kata
View clock.rb
# Paul Visscher and Greg Mefford
require 'time'
class BerlinClock
def self.convert_time(time)
t = Time.parse(time)
clock = ""
if t.sec % 2 == 0
View fpm ruby 1.9.2 rpm build
# 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
# 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
GregMefford /
Last active Apr 23, 2021 — forked from collegeman/
Install Graphite and StatsD on CentOS (updated for 6.4 x86_64)
# 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
# --- Install all the packages --- #
yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached