Skip to content

Instantly share code, notes, and snippets.

View jschnare's full-sized avatar

John Schnare jschnare

  • Kano/Apps
  • Victoria, BC
View GitHub Profile
@blackjid
blackjid / README.md
Last active June 11, 2023 15:15
How configure your raspberry pi with dashing to have a awesome dashboard

Raspberry pi dashboard

This is what we did to setup a few dashboards at platanus

You'll need

  • Raspberry Pi
  • Dashing Service
  • Wifi stick (optional)
@karmi
karmi / .gitignore
Created March 16, 2012 16:09
Bootstrap, install and configure ElasticSearch with Chef Solo
.DS_Store
Gemfile.lock
*.pem
node.json
tmp/*
!tmp/.gitignore
@lusis
lusis / log4j.xml
Created November 23, 2011 07:11
Ruby logstash cli application - allows searching historical data in ElasticSearch or live tailing from AMQP topic exchange
<!-- the env variables are controlled by Chef and passed in via -D on the java command-line -->
<!-- This is using the appender here: https://github.com/t0xa/gelfj -->
<appender name="graylog2" class="org.graylog2.log.GelfAppender">
<param name="graylogHost" value="${graylog.server}"/>
<param name="originHost" value="${graylog.origin}"/>
<param name="extractStacktrace" value="true"/>
<param name="addExtendedInformation" value="true"/>
<!-- The _web part is because a given app has multiple components -->
<!-- This app might have a _web as well as an _batch component -->
<param name="facility" value="${graylog.facility}_web"/>
@evandhoffman
evandhoffman / aws-header-filter.pl
Created July 6, 2011 20:58
aws-header-filter.pl
#!/usr/bin/perl
use strict;
use warnings;
my @legal_headers = qw( Accept-Language Bcc Cc Comments Content-Type Content-Transfer-Encoding Content-ID Content-Description Content-Disposition Content-Language Date DKIM-Signature DomainKey-Signature From In-Reply-To Keywords List-Archive List-Help List-Id List-Owner List-Post List-Subscribe List-Unsubscribe Message-Id MIME-Version Received References Reply-To Return-Path Sender Subject Thread-Index Thread-Topic To User-Agent );
my %legal_headers;
@legal_headers{@legal_headers} = (1) x @legal_headers;
@wilmoore
wilmoore / knife.rb
Created June 22, 2011 07:56
Base "knife" configuration for a standard chef-solo setup
# .chef/knife.rb
# SEE: http://wiki.opscode.com/display/chef/Troubleshooting+and+Technical+FAQ
# set some sensible defaults
current_dir = File.dirname(__FILE__)
user = ENV['OPSCODE_USER'] || ENV['USER']
log_level :debug
log_location STDOUT
node_name `hostname`
client_key ''
@rklemme
rklemme / dfs-convert.rb
Created March 9, 2010 13:25
DFS in nested Hashes
#! ruby19
require 'pp'
Converter = Struct.new :root, :converted do
def convert
@stack = []
self.converted = {}
dfs(root)
@henrik
henrik / hash_deep_diff.rb
Created July 14, 2009 08:38
Recursively diff two Ruby hashes.
# Recursively diff two hashes, showing only the differing values.
# By Henrik Nyh <http://henrik.nyh.se> 2009-07-14 under the MIT license.
#
# Example:
#
# a = {
# "same" => "same",
# "diff" => "a",
# "only a" => "a",
# "nest" => {
@dysinger
dysinger / convert.rb
Created March 24, 2009 15:13
Convert Chef Cookbooks to Headless Branches
#!/usr/bin/env ruby
# -*- ruby -*-
`git checkout opscode/master`
Dir.glob("*").select {|x| FileTest.directory?(x) }.each do |path|
`git br -D #{path}`
`git checkout -b #{path} opscode/master`
`git filter-branch --tree-filter \
'rm -rf #{Dir.glob("*").reject {|x| x == path }.join(" ")}' --prune-empty HEAD`
`rm -rf .git/refs/original`