Skip to content

Instantly share code, notes, and snippets.

@zachfi
zachfi / gist:967100
Created May 11, 2011 19:17
Puppet Module to install Graphite.
class graphite {
# TODO:
# /opt/graphite/conf/carbon.conf
# /opt/graphite/conf/storage-schemas.conf
# /etc/apache2/sites-available/graphite.conf
include apache::mod::wsgi
include apache::mod::python
# This is our main way of managing processes right now.
#
# a service is distinct from a process in that services
# can only be managed through the interface of an init script
# which is why they have a search path for initscripts and such
module Puppet
newtype(:service) do
@zachfi
zachfi / gist:8543332
Last active January 4, 2016 00:39
OpenBSD service provider for Puppet
Puppet::Type.type(:service).provide :openbsd, :parent => :init do
desc "Provider for OpenBSD's rc.d daemon control scripts"
confine :operatingsystem => :openbsd
defaultfor :operatingsystem => :openbsd
has_feature :flaggable
def self.rcconf() '/etc/rc.conf' end
def self.rcconf_local() '/etc/rc.conf.local' end
@zachfi
zachfi / gist:8544234
Last active January 4, 2016 00:49
Updated service type to work with OpenBSD
# This is our main way of managing processes right now.
#
# a service is distinct from a process in that services
# can only be managed through the interface of an init script
# which is why they have a search path for initscripts and such
module Puppet
newtype(:service) do
@zachfi
zachfi / gist:8565148
Created January 22, 2014 19:03
vagrant stuff
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@zachfi
zachfi / gist:8906497
Created February 9, 2014 21:48
Fact: processor_mfg
# Determine the processor manufacture
Facter.add(:processor_mfg) do
confine :virtual => "physical"
setcode do
line = Facter::Util::Resolution.exec('dmidecode -s processor-version')
if line =~ /^AMD/
'amd'
elsif line =~ /^Intel/
'intel'
end
@zachfi
zachfi / gist:8966079
Last active February 28, 2018 20:54
git-split: Break off a sub directory into its own repo, keeping history.
#! /usr/bin/env ruby
require 'tmpdir'
require 'fileutils'
require 'pp'
def main()
directory = ARGV.shift
input {
udp {
port => 9995
codec => netflow
}
}
filter {
geoip {
source => "[netflow][ipv4_src_addr]"
target => geoip
@zachfi
zachfi / .gitignore
Last active August 29, 2015 13:58
Upgrade OpenSSL
good.yaml
bad.yaml
list.txt
@zachfi
zachfi / fabfile.py
Created June 8, 2014 05:02
Ceph fabfile.py
#! /usr/bin/env
from fabric.api import *
env.key_filename = '~/.ssh/id_rsa'
osd = {
'node1.l.n3kl.cx': [
'/var/local/osd00',
'/var/local/osd01',