Skip to content

Instantly share code, notes, and snippets.

@dalen
dalen / mem_cache.conf
Created September 23, 2013 15:28
puppet apache file metadata caching
<IfModule mod_mem_cache.c>
CacheEnable mem /production/file_metadata
CacheEnable mem /production/file_content
CacheDefaultExpire 300
MCacheSize 1024000
MCacheMaxObjectCount 10000
MCacheMinObjectSize 1
MCacheMaxObjectSize 2048000
CacheIgnoreNoLastMod On
</IfModule>
diff -urN '--exclude=CVS' '--exclude=.svn' '--exclude=.git*' '--exclude=*.swp' znc-1.0/src/Client.cpp znc-1.0-query-buffer/src/Client.cpp
--- znc-1.0/src/Client.cpp 2012-11-06 08:02:20.000000000 -0800
+++ znc-1.0-query-buffer/src/Client.cpp 2013-02-04 14:30:49.240504205 -0800
@@ -306,17 +306,29 @@
}
// Relay to the rest of the clients that may be connected to this user
- if (m_pNetwork->IsChan(sTarget)) {
+ //if (m_pNetwork->IsChan(sTarget)) {
vector<CClient*>& vClients = GetClients();
@sroegner
sroegner / gist:4198268
Created December 3, 2012 21:31
reproducing rspec-hiera-puppet example
>>> ./modules/example/spec/classes/example_spec.rb
describe "example" do
let(:hiera_data) { { :foo_message => "bar" } }
it { should contain_notify("foo").with_message("bar") }
end
>>> ./modules/example/spec/manifests/site.pp #this just exists because rspec-puppet appears to insist on it?)
@kwilczynski
kwilczynski / block_device_type.rb
Created April 16, 2012 13:27
Check if given block device is SSD or not ...
#!/usr/bin/env ruby
rotating = []
solid_state = []
unknown = []
block_devices = '/sys/block'
exclude = %w(loop.* ram.* sr.*)
exclude = Regexp.union(*exclude.collect { |i| Regexp.new(i) })
@rcrowley
rcrowley / graphite-deb.sh
Created April 5, 2012 14:34
Graphite Debian packaging
VERSION="0.9.9"
BUILD="betable1"
set -e -x
# Keep track of the original working directory.
OLDESTPWD="$PWD"
# Work in a temporary directory.
cd "$(mktemp -d)"
define iterator {
if $name =~ /test/ {
notice "found"
}
}
$a = ['abc', 'deftestghi', 'xyz']
iterator { $a: }
@vvuksan
vvuksan / README
Created August 16, 2011 22:01
LXC (Linux Containers Installation)
This works under Ubuntu 10.10. I tried under 10.04 LTS but the Ubuntu templates are not there. Investigating.
[ Leaving this link here for reference in case I need to do apt-get upgrade. @ohloh recommends it
http://sourceforge.net/mailarchive/message.php?msg_id=26885493 ]
To make things easy have libvirt installed ie.
sudo apt-get install libvirt-bin
Otherwise you will need to set up bridges, iptables, dnsmasq.
@vvuksan
vvuksan / gist:992206
Created May 25, 2011 23:03
URL Metrics
# Based on https://github.com/ripienaar/mcollective-plugins/blob/master/agent/urltest/urltest.rb
require 'net/http'
require 'socket'
req_url = "http://www.google.com"
url = URI.parse(req_url)
@bwmcadams
bwmcadams / tail_profile.py
Created February 26, 2011 14:32
Tail the Slow Query Log on MongoDB
#!/usr/bin/python
# Connects to localhost, 27017 by default
import sys
import pymongo
import time
if len(sys.argv) < 2:
print >> sys.stderr, "Usage: ./tail_profile.py <dbName> [hostname] [port]"
sys.exit(-1)
@tobert
tobert / cluster_netstat.pl
Created January 10, 2011 22:39
Cluster Netstat
#!/usr/bin/perl
###########################################################################
# #
# Cluster Tools: cluster_netstat.pl #
# Copyright 2007-2010, Albert P. Tobey <tobert@gmail.com> #
# #
###########################################################################
=head1 NAME