Skip to content

Instantly share code, notes, and snippets.

Module

# == Class: sdiff
#
# This class adds a wrapper for the diff command puppet uses.
# It introduces the ability to suppress diff output, useful for encrypted data.
#
# This module requires changes to the puppet.conf file that is on the agents,
# suggest under the [main] section.
input {
stdin { type => "stdin-type"}
generator { type => "generator-type" message => "generated event" }
}
output {
librato {
type => "generator-type"
account_id => "foo@foo.com"
api_token => "1231231231231231231231"
gauge => ["value", "%{sequence}","source","%{@source_host}", "name", "bar_bytes"]
filter {
# strip the syslog PRI part and create facility and severity fields.
# the original syslog message is saved in field %{syslog_raw_message}.
# the extracted PRI is available in the %{syslog_pri} field.
#
# You get %{syslog_facility_code} and %{syslog_severity_code} fields.
# You also get %{syslog_facility} and %{syslog_severity} fields if the
# use_labels option is set True (the default) on syslog_pri filter.
grok {
type => "syslog-relay"
@justinhennessy
justinhennessy / queue_fix.rb
Last active December 19, 2015 22:28 — forked from stuart/queue_fix.rb
De dup RabbitMQ queue
!#/usr/env ruby
require 'json'
require 'uri'
# Removes repeated USER records from one of the AMQP queues.
#
# USAGE: ruby queue_fix.rb "queue_name" "email_address"
#
# This will dump the whole queue to a temp file. (In case anything goes wrong)
# it will strip out the user messages containing the email provided then

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods

Capybara

save_and_open_page

Matchers

have_button(locator)