Skip to content

Instantly share code, notes, and snippets.

View markbirbeck's full-sized avatar

Mark Birbeck markbirbeck

View GitHub Profile
@markbirbeck
markbirbeck / gist:1408747
Created November 30, 2011 11:22
Bootstrapping Chef on CentOS
#!/bin/bash
#
# Get the EPEL repo.
#
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
#
# Install Chef.
#
rpm -Uvh http://download.elff.bravenet.com/5/i386/elff-release-5-3.noarch.rpm
yum -y --disablerepo=rightscale-epel install chef
@markbirbeck
markbirbeck / gist:1409692
Created November 30, 2011 16:28
Installing Virtuoso
h1. 4store
h1. Virtuoso OpenSource
h2. Check dependencies
A CentOS image from RightScale will have the following versions:
|autoconf|2.59|
|automake|1.9.6|
@markbirbeck
markbirbeck / gist:1433393
Created December 5, 2011 12:09
[ElasticSearch] Using facets when querying parent/child documents
# Create an index:
#
curl -XDELETE 'http://127.0.0.1:9200/articles'
curl -XPUT 'http://127.0.0.1:9200/articles'
# Insert the action mapping, so that actions are children of articles:
#
curl -XPUT 'http://127.0.0.1:9200/articles/action/_mapping' -d '
{
"action": {
@markbirbeck
markbirbeck / gist:1451167
Created December 9, 2011 11:24
Upgrade a Chef client
# Upgrade a Chef client using the steps described here:
#
# http://wiki.opscode.com/display/chef/Upgrading+Chef+0.9.x+to+Chef+0.10.x
#
# This script can be invoked with:
#
# ssh <server> 'curl https://raw.github.com/gist/1451167/<gist-guid>/gistfile1.sh | sh'
# Point to opscode repos:
#
@markbirbeck
markbirbeck / gist:1684494
Created January 26, 2012 19:19
[ElasticSearch] Insert 5 records and query for a single record, with facets: Successfully returns a count of 1 in the facets
# Create an index:
#
curl -XDELETE 'http://127.0.0.1:9200/articles'
curl -XPUT 'http://127.0.0.1:9200/articles'
# Insert the action mapping, as a child of articles:
#
curl -XPUT 'http://127.0.0.1:9200/articles/article/_mapping' -d '
{
"article": {
@markbirbeck
markbirbeck / gist:1684506
Created January 26, 2012 19:20
[ElasticSearch] Insert 6 records and query for a single record with facets: Failure when the number of records is greater than the shard size
# Create an index:
#
curl -XDELETE 'http://127.0.0.1:9200/articles'
curl -XPUT 'http://127.0.0.1:9200/articles'
# Insert the action mapping, as a child of articles:
#
curl -XPUT 'http://127.0.0.1:9200/articles/article/_mapping' -d '
{
"article": {
@markbirbeck
markbirbeck / ec2_server_create.rb
Created March 16, 2012 13:02
A patch for the 'knife ec2 server create' command to enable use with chef-solo
#
# Author:: Adam Jacob (<adam@opscode.com>)
# Author:: Seth Chisamore (<schisamo@opscode.com>)
# Copyright:: Copyright (c) 2010-2011 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@markbirbeck
markbirbeck / gist:5635086
Created May 23, 2013 10:12
Upgrading Chef on a server

Some notes on the problems I've had upgrading Chef on jenkins.ed and cronalicious.ed.

Why upgrade?

First...why do we need to upgrade?

You might not need to for other cookbooks, but for Apollo there's a problem with the mongo cookbook when using Chef < 10.26.0, which looks like this:

================================================================================
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA3F2K2Yfv/qv/6zOvWncFhsoyVR+Rvdq9sYZIFNchl+c1eIAcpykTus8VFQSUSZFPzft7UcxGcZPSebU6DLK5zddnRedK/2Ktr0X1lYxrBMFjw1DZQgx9TU2sSNZmM/K7yfb1rRmXsD+oWvACWbhdQUV9hkboFCadN2dVkqc7ALSs41jcKiCALCKUrqvASH3KSCztOznERIokn3ZkCH7qvuCekMr/MBTsHl4N9XfLVJVvCrf7Gi5iCwIxPfUwyLV26cVFe47eR5wcoQ5vpdDBRgqpJhJKlRktDXrrbtF9Zs56ZlqmAHz9BxuM1apUKylLGSmjlW5jZuxuClCt6se2LQ== markbirbeck@Mark-Birbecks-iMac.local
@markbirbeck
markbirbeck / gist:6730375
Created September 27, 2013 15:26
Grab all used categories from mappings files.
cut -d, -f1 thoth/corpus/garment/*.csv | sed -e 's/^"//' -e 's/"$//' | sort | uniq