Skip to content

Instantly share code, notes, and snippets.

@grobie
grobie / dns-split.go
Last active February 2, 2016 09:24
small experiment to split internal/public DNS requests
package main
import (
"flag"
"fmt"
"log"
"net"
"strings"
"github.com/miekg/dns"
@grobie
grobie / instrumentation.go
Created January 2, 2015 17:34
consul metrics exporter
// consulCollector implements the prometheus.Collector interface.
type consulCollector struct {
bin string
errc chan error
metrics map[string]prometheus.Gauge
}
func newConsulCollector(bin string, errc chan error) prometheus.Collector {
return &consulCollector{
bin: bin,
@grobie
grobie / golink.zsh
Last active August 29, 2015 14:10
golink
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBFHRs6cBEADlTJqKvIsnfwm0GTyuVwrl5fAcrZXMBjlvN9JvGn2R+Pjn5rkt
Og/PiYpIB0EQaB2DRD87Tt4Wh9Zhdrm6851K1LnBVHTRZr2B0Ta/qUaqxauZHL1Q
oWF9XJ5d38GqkKCZM6imzIliXO2x75lAMpLdYetRABSCltT1f2rsFyJlZjKUtgwJ
rFBFL2umzK1OsCapA87LA2zE75Zo0sl04lQFDN1IK+6tzfTvxr6xigLrJ0sGUBz0
VVl1r8YwsejMFr83zdWpYOuj9XjpsyfACrtYHZk6GzdrgKxCf+GuxIt+mZK/c/Hw
3DAj/a8I27Bwhdp33fJvva/oNeV++LNydnOpj3osohJp5/e/jaXb1K73MI/R15b1
Wz2ZY8LGFs3xLHBIecV7n2oR+c8pxEEqc179YvxsUHNH9dUYCanVnlxmChzYd0aQ
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBFHxVdwBEADWHq7XLAyWZoKX+y92xBECxgzzFSJ6M6KlrT4iMvTxvqtlbs6/
eMROvWvmQqnXnVZaR/TX0/nABcbkKXTxeJO1ErlXhGbIdq2teOrzTOntAqhlwRiw
4jtY5EZxZD/42BoWFaoQYRyjEqs1gK1xHHbbljoQFbaT+2dQxhblTmkXdSXMHDUQ
AydWBrXjwndkEQJkhifDTDa5W4lVxu7HN+wsR5BKh8SmN+SKblkrDjL+Tbfpfomk
RTCDqg7VU+PUIbCJhgDIKBgFDfPeNDPCFwesuy7FNULBVJKOLoBeyhbiVAFQqHAd
14nhi3eTRlQKNb/XVcrY6nRk9Un9BrtriJrXaOe8r5usuN7ojLFSM70/7PQpFMdX
4ee2pK3vaBia8ojP3cMRRqiED/ohi973lBQHICUP3///6br+kPRa0aoJJU+ONvnP

You already have a proved you are grobie at github; overwrite? [y/N] Please �[1mpublicly�[22m post the following Gist, and name it �[1m�[31mkeybase.md�[39m�[22m:

Keybase proof

I hereby claim:

  • I am grobie on github.
  • I am grobie (https://keybase.io/grobie) on keybase.
  • I have a public key whose fingerprint is DEA7 8E64 C8A5 9767 D9B5 BC17 32C1 A2E1 8527 BC46
@grobie
grobie / production.rb
Created February 25, 2014 16:52
config/environments/production.rb
$stdout.sync = true
config.logger = Logger.new($stdout).tap do |logger|
logger.level = ENV['DEBUG'] ? Logger::DEBUG : Logger::INFO
end
@grobie
grobie / metrics.json
Created November 6, 2013 05:46
Test run of tsenart/vegeta against the prometheus/client_ruby rack example app.
[{
"baseLabels": {
"name": "http_requests_total"
},
"docstring": "A counter of the total number of HTTP requests made",
"metric": {
"type": "counter",
"value": [{
"labels": {
"method": "GET"

Ubuntu on MBP Retina

This is very short and incomplete. Just a few Do's and Dont's

  • Follow the first install instructions of any of the available tutorials ([one example][1])
  • Instead of installing wifi packages manually (I ran into lot's of dependency problems), just use bluetooth tethering and install everything with apt-get/aptitude)
  • no need to decrypt the OSX partition, I was able to enter a new number in the disk manager and resize it without problems
  • To detect encrypted HFS+ partitions you need to change the rEFInd settings: TODO
  • sound was working out of the box
  • I had lot's of problems with the nvidia graphic card and eventually "fixed" them by disabling the card altogether and only using the integrated intel chip. Use gfxCardStatus (version MUST be <= 2.2.1 I think) on osx, configure "integrated only"). later on, you can disable the card in linux with echo OFF &gt; /sys/kernel/debug/vgaswitcheroo/switch as root.
#
# Author:: Tobias Schmidt (<ts@soundcloud.com>)
# Copyright:: Copyright (c) 2013 SoundCloud, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0