Skip to content

Instantly share code, notes, and snippets.

@morhekil
morhekil / 0001-fix-lighttpd15-build-on-mac-os-x.patch
Created June 20, 2010 12:34
Patch for lighttpd web server to build 1.5 head on Mac OS X
From 89c418f2734e89e902aca2111ad7e3e6186db907 Mon Sep 17 00:00:00 2001
From: Robin Lu <iamawalrus@gmail.com>
Date: Tue, 8 Jul 2008 16:06:33 +0800
Subject: [PATCH] fix build on mac os x
---
src/Makefile.am | 2 +-
src/network.c | 167 -----------------------------------------------
src/network_backends.c | 169 ++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 170 insertions(+), 168 deletions(-)
@igrigorik
igrigorik / ruby-1.9-tips.rb
Created February 3, 2011 17:19
Ruby 1.9 features, tips & tricks you may not know about...
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript
powered JS and SASS powered CSS with YUI compression all via the magic of rack.
This stuff will be native in Rails 3.1 and the layout of the files on the
filesystem will be different but this guide will get you working with it
while we wait for all that to finalize.
Ignore the number prefixes on each file. This is just to ensure proper order in the Gist.
It's based on eric1234 gist https://gist.github.com/911003. ijust made it 3.1 compliant in terms of convention
@jippi
jippi / rc.d
Created July 5, 2011 19:58 — forked from vvuksan/gist:988765
Logstash Init script
update-rc.d logstash-shipper defaults
update-rc.d logstash-reader defaults
@ahpook
ahpook / gist:1182243
Created August 30, 2011 22:14
Use a generic client certificate with puppet

The problem

There's enough trouble with puppet's ssl model (mandatory client certs) that people go and do odd things to get around it. The primary problem is that for lab/preproduction environments, if you reinstall machines frequently, you lose access to the private key that generated the original cert but (absent some puppet cert --clean [node] operation) the cert still exists, leading to the dreaded Retrieved certificate doesn't match private key error.

A solution

Generate a single client certificate which all your nodes use, and have the master determine node names from facter rather than the SSL DN. This way you can re-install nodes with impunity and as long as your bootstrap plops down the correct config and the cert+key, you don't have any more SSL issues.

The caveats

If you have autosign turned on, this change represents a shift in security tradeoffs: you can turn off autosign and therefore more tightly control which clients can talk to your server because they need to have your clie

@ryanb
ryanb / spec_helper.rb
Created September 12, 2011 21:29
Focus on specific specs in RSpec
# add this to your spec helper
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.filter_run :focus => true
config.run_all_when_everything_filtered = true
end
# and then use the :focus tag in your specs
it "does something awesome", :focus do
@jayjanssen
jayjanssen / gist:3453904
Last active January 30, 2019 03:44
Percona Server live query capture settings
set global slow_query_log = OFF;
set global long_query_time = 0;
set global log_slow_verbosity = full;
set global slow_query_log_timestamp_always = ON;
set global slow_query_log_timestamp_precision=microsecond;
set global slow_query_log_use_global_control="log_slow_filter,log_slow_rate_limit,log_slow_verbosity,long_query_time";
@morhekil
morhekil / mysql_grants_dump.sh
Created January 6, 2013 08:06
shell script to dump existing MySQL privileges as GRANT commands
#!/usr/bin/bash
mysql -B -N $@ -e "SELECT DISTINCT CONCAT(
'SHOW GRANTS FOR ''', user, '''@''', host, ''';'
) AS query FROM mysql.user" | \
mysql $@ | \
sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/## \1 ##/;/##/{x;p;x;}'
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.