Skip to content

Instantly share code, notes, and snippets.

View bernd's full-sized avatar

Bernd Ahlers bernd

  • Graylog, Inc.
  • Hamburg/Germany
View GitHub Profile
@felixge
felixge / postverzollung.txt
Created May 4, 2012 13:33
Example for not wasting your time at the customs office
TO: [email protected] (usually provided on the card you get)
Sehr geehrtes Zollamt,
am DD.MM.YYYY erhielt ich ein Schreiben über den Eingang einer Sendung bei der keine Rechnung angebracht war.
lfd. Nr: <NR>
Empfänger: <Name>, <Adresse>, <PLZ> <Ort>
Bei dem Paket handelt es sich um ein T-Shirt das mir geschenkt wurde da ich in meiner Freizeit kostenlose Software für die Integration mit einem Datenanalyse Dienst geschrieben habe (siehe http://support.metrics.librato.com/knowledgebase/articles/53548). Das T-Shirt ist vermutlich mit dem Logo des Dienstes bedruckt / hat keinen offiziellen Marktwert. Die Materialkosten sind wahrscheinlich ~20 EUR.
require 'thread'
class Worker
def initialize(count = 1)
@queue, @closing, @threads, @mutex = Queue.new, false, [], Mutex.new
add_worker(count)
end
def add_worker(count = 1)
@mutex.synchronize do
@frimik
frimik / drac.rb
Created March 12, 2012 12:52
Dell iDRAC facter plugin
# Fact: racadm
#
# Purpose: Return the racadm information from Dell hardware
#
# Resolution:
# On Linux, queries racadm getconfig -g for each group in the query hash
#
# Author: Mikael Fridh <[email protected]>
#
# TODO Instead of sweeping output once per key, sweep once and
@codahale
codahale / pom.xml
Last active October 26, 2024 07:45
Take this and save it as pom.xml in your project directory.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!-- none yet -->
require 'fnordmetric'
require 'fnordmetric/logger'
# This is a quickie ruby script to set up some base data for the dashboard
income_billing_keys = [:weekly_billing_external, :weekly_income_quickbooks, :weekly_break_even]
bank_account_keys = [:bank_account_checking, :bank_account_money_market, :bank_account_bonus_employee, :bank_account_bonus_boardmembers, :quickbooks_receivables, :quickbooks_payables]
website_traffic_keys = [:visitors_daily]
jenkins_keys = [:jenkins_build_success_daily, :jenkins_build_failure_daily]
demo_data = {
# Emulates the QuickCheck ?SOMETIMES macro.
module Sometimes
def run_with_retries(example_to_run, retries)
self.example.metadata[:retries] ||= retries
retries.times do |t|
self.example.metadata[:retried] = t + 1
self.example.instance_variable_set(:@exception, nil)
example_to_run.run
break unless self.example.exception
@jbraeuer
jbraeuer / package-graphite.sh
Created February 1, 2012 08:43
Install graphite 0.9.9 on Ubuntu 11.10 using PACKAGES
#! /bin/bash
#
# This script needs "fpm". If you dont have it,
# run "gem install fpm"
#
# You also need to "apt-get install python-setuptools" (otherwise fpm fails)
clean() {
rm -rf whisper-0.9.9 carbon-0.9.9 graphite-web-0.9.9
@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@joakimk
joakimk / graphite.rb
Created January 25, 2012 20:14
Graphite client for ruby with specs
require 'socket'
class Graphite
def initialize(host)
@host = host
end
def socket
return @socket if @socket && [email protected]?
@socket = TCPSocket.new(@host, 2003)
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
sudo apt-get update
sudo apt-get upgrade