Skip to content

Instantly share code, notes, and snippets.

View arioch's full-sized avatar

Tom De Vylder arioch

View GitHub Profile

The best way to use this tool is to hook apt's use of dpkg to run it before doing any package installs.

In your apt.conf, put this:

DPkg::Pre-Install-Pkgs {"xargs -rL1 bash /path/to/stripdeb.sh 2>&1 | logger -t stripdeb"}

Then, a demo:

% sudo apt-get install mysql-server-5.1

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

#!/bin/bash
#
# elasticsearch-backup-index.sh
#
# Push logstash index from yesterday to s3 with an accompanying restore script.
# http://logstash.net
# http://www.elasticsearch.org
# https://github.com/s3tools/s3cmd | http://s3tools.org/s3cmd
#
# Inspiration:
@arioch
arioch / pr.md
Created June 11, 2013 11:19 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

Overview

The intention is to get a clean build of MRI 1.8.7 and 1.9.3.

MRI 1.8.7 doesn't play nicely with LLVM based GCC compilers. In Mountain Lion, the only way to get a non-LLVM gcc is to build one yourself. The command line tools package in Xcode 4.4 does not contain a non-llvm based GCC.

Checklist

  1. Upgrade to Mountain Lion
  2. Remove all previous copies of Xcode
@arioch
arioch / quicky.rb
Created April 17, 2013 08:27 — forked from barn/quicky.rb
#!/usr/bin/env ruby
#
# Put something god awful in your muttrc like:
# macro attach <space> "<enter-command>unset wait_key<enter><shell-escape>rm -f $HOME/.quicky<enter><save-entry><kill-line>$HOME/.quicky<enter><shell-escape>quicky.rb $HOME/.quicky<enter><enter-command>set wait_key<enter>" "Open with quicklook"
#
require 'tmpdir'
if ARGV.empty?
puts "need a filename"
#! /bin/sh
#
## Tested on Linux Debian 5.0 (Lenny)
#
# OK I know this is nothing new/special.
# If you've always configured your LBs a certain way, you might have to use this method instead.
#
# Scenario: High-availability setup with 2 HAProxy/Keepalived load-balancers on IPv6
#
# Problem: HAProxy won't start (cannot bind socket) because the virtual IPv6 address is not assigned
@arioch
arioch / pr.md
Created March 28, 2013 10:09 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11
PassengerRuby /usr/bin/ruby
<VirtualHost *:80>
ServerName logs.example.com
ServerAlias logs.example.com
DocumentRoot /home/httpd/Kibana/static
define timeperiod{
name be-holidays
timeperiod_name be-holidays
alias Belgian holidays
january 1 00:00-00:00 ; New Year
may 1 00:00-00:00 ; Labour Day
july 21 00:00-00:00 ; National holiday
august 15 00:00-00:00 ; Assumption of Mary
november 1 00:00-00:00 ; All Saints