Skip to content

Instantly share code, notes, and snippets.

View markbirbeck's full-sized avatar

Mark Birbeck markbirbeck

View GitHub Profile
@markbirbeck
markbirbeck / mac-from-scratch.md
Last active February 27, 2021 18:54
Mac From Scratch

Admin Account

During installation, create a user called admin rather than one with your own name.

Apps for All Users

Then install Homebrew as per latest instructions (note that this will install the necessary CLI components for XCode):

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@markbirbeck
markbirbeck / id_rsa.pub
Created October 31, 2013 11:09
My public key.
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
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA3F2K2Yfv/qv/6zOvWncFhsoyVR+Rvdq9sYZIFNchl+c1eIAcpykTus8VFQSUSZFPzft7UcxGcZPSebU6DLK5zddnRedK/2Ktr0X1lYxrBMFjw1DZQgx9TU2sSNZmM/K7yfb1rRmXsD+oWvACWbhdQUV9hkboFCadN2dVkqc7ALSs41jcKiCALCKUrqvASH3KSCztOznERIokn3ZkCH7qvuCekMr/MBTsHl4N9XfLVJVvCrf7Gi5iCwIxPfUwyLV26cVFe47eR5wcoQ5vpdDBRgqpJhJKlRktDXrrbtF9Zs56ZlqmAHz9BxuM1apUKylLGSmjlW5jZuxuClCt6se2LQ== markbirbeck@Mark-Birbecks-iMac.local
@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:

================================================================================
@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: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 / 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: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: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": {