Skip to content

Instantly share code, notes, and snippets.

@jpmens
jpmens / gist:2145573
Created March 21, 2012 08:20 — forked from mkyed/gist:1694240
Installing PowerDNS 3.0.1 on Mac OS X Lion
1) Install MySQL <http://dev.mysql.com/>
2) Install Homebrew <http://mxcl.github.com/homebrew/>
3) $ brew install boost boost-jam lua pkg-config wget
4) $ wget http://downloads.powerdns.com/releases/pdns-3.0.1.tar.gz && tar xzf pdns-3.0.1.tar.gz
5) $ cd pdns-3.0.1 && ./configure --with-mysql-includes=/usr/local/mysql/include && make && make install
6) Adjust /usr/local/etc/pdns.conf to your mysql setup
7) cat /System/Library/LaunchDaemons/pdns_server.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@jpmens
jpmens / .gitignore
Created April 13, 2012 10:02 — forked from eatnumber1/.gitignore
NSD OpenDNSSEC Notifier
nsd-notify
@jpmens
jpmens / dhcp-event.py
Created June 14, 2012 09:59 — forked from darac/dhcp-event.py
Thingy for updating powerdns backend when stuff changes
#!/usr/bin/env python
import MySQLdb
import syslog
import sys
import pprint
pp = pprint.PrettyPrinter()
mysql_host = "localhost"
mysql_user = "dbusername"
mysql_pass = "dbpassword"
@jpmens
jpmens / tmp_files
Created June 14, 2012 10:01 — forked from tomoconnor/tmp_files
Very simple example munin plugin
#!/usr/bin/env python
import os
from munin import MuninPlugin
class TmpFileCount(MuninPlugin):
title = "Number of Files in /tmp"
args = "--base 1000 -l 0"
vlabel = "files"
scaled = False
@jpmens
jpmens / pedantically_commented_playbook.yml
Created June 19, 2012 15:16 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@jpmens
jpmens / ds-babble.pl
Created June 29, 2012 12:30
Can you pronounce your DNSSEC DS record? ;-)
#!/usr/bin/perl
# by Jan-Piet Mens <jpmens@gmail.com> June 2012
# inspired by a conversation on #powerdns
# Prints DNSSEC DS record of specified domain as well as 'babble' of it
# and PGP wordlist representation of the digest [1].
#
# Digest:
# 0ADC090C30B862FA2BC194FB73A632F4D0B7A39C
#Babble:
# xedit-sedib-sisar-momaz-pupas-cahuz-rasap-kasoz-gogir-lomun-saxax
@jpmens
jpmens / gist:3276101
Created August 6, 2012 16:19
Logstash input config for Beaver/Redis

On the command line:

REDIS_NAMESPACE='logstash:app:unmappable' REDIS_URL='redis://redis-internal:6379/0' beaver -f /apps/production/current/log/unmappable.log -t redis

My logstash input:

redis {
  host => 'redis-internal' # this is in dns for work

data_type => 'list'

@jpmens
jpmens / graphite_pip_uwsgi_recipe.sh
Created August 10, 2012 11:36 — forked from bfritz/graphite_pip_uwsgi_recipe.sh
installing graphite-web with pip and running under uwsgi
# graphite-web install is hardcoded in setup.cfg to /opt/graphite
sudo mkdir /opt/graphite
sudo chown brad.users /opt/graphite
# run under python2.7 virtualenv
virtualenv --python=python2.7 ~/ve/graphite
source ~/ve/graphite/bin/activate
# install the necessary python packages (simplejson is for flot graphs)
pip install graphite-web carbon whisper django django-tagging uwsgi simplejson
@jpmens
jpmens / krblogin.sh
Created September 13, 2012 17:32
Kerberos kinit profile
#!/bin/sh
# /etc/profile.d/krblogin.sh
# jpm 2012-08-30
set -e
LDAPURIS="ldap://kdc.mens.de,ldap://kdc2.mens.de"
LDAPBASE="dc=mens,dc=de"
# PS1 is not set for SCP
@jpmens
jpmens / RESULTS.md
Created September 21, 2012 07:54 — forked from jordansissel/RESULTS.md
screenshot + code showing how to query logstash/elasticsearch with a graphite function.

logstash queries graphed with graphite.

Operation: Decouple whisper from graphite.

Method: Create a graphite function that does a date histogram facet query against elasticsearch for a given query string for the time period viewed in the current graph.

Reason: graphite has some awesome math functions. Wouldn't it be cool if we could use those on logstash results?

The screenshot below is using logstash to watch the twitter stream of keywords "iphone" "apple" and "samsung" - then I graph them each, so we get an idea of popularity. As a bonus, I also do a movingAverage() on the iphone curve to show you why this is awesome.