Skip to content

Instantly share code, notes, and snippets.

View macarthy's full-sized avatar
💭
Looking for work

Justin MacCarthy macarthy

💭
Looking for work
View GitHub Profile
@webstandardcss
webstandardcss / pedantically_commented_playbook.yml
Last active April 23, 2019 06:03 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options.
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@wolfiestyle
wolfiestyle / Makefile
Created March 28, 2012 00:15
basic makefile for D language
# basic makefile for D language - made by darkstalker
DCC = dmd
DFLAGS = -w
LIBS =
SRC = $(wildcard *.d)
OBJ = $(SRC:.d=.o)
OUT = $(shell basename `pwd`)
.PHONY: all debug release profile clean
@tedsparc
tedsparc / bson2json.rb
Created February 8, 2012 00:21
Easily convert a MongoDB BSON file to JSON with Ruby
#!/usr/bin/ruby
# This script acts as a command-line filter to convert a BSON file (such as from mongodump) to an equivalent JSON file
# The resulting JSON file will be an array of hashes
# Any binary values from the BSON file are converted to base64 (such as Mongo's _id fields)
# I originally wrote this script so that Mongo files can be easily used with jsawk for
# offline data processing -- https://github.com/micha/jsawk
#
# To invoke, assuming mycollection.bson is a file from mongodump:
# ruby bson2json.rb < mycollection.bson > mycollection.json
@doitian
doitian / knife.rb
Created December 20, 2011 11:47
Configuration files for chef-solo and knife, so they all use directories inside the chef repo, instead of default global pathes such as /etc, /var
log_level :info
log_location STDOUT
node_name 'solo'
client_key File.expand_path('../solo.pem', __FILE__)
cache_type 'BasicFile'
cache_options( :path => File.expand_path('../checksums', __FILE__))
cookbook_path [ File.expand_path('../../cookbooks', __FILE__) ]
@vi
vi / git-extract-submodule
Created December 24, 2010 02:31
Script to extract submodules from git repositories. Depends on --split-submodule filter.
#!/bin/bash
# Extract subdirectory into a submodule.
if [ -z "$1" ]; then
echo "Usage: extract-submodule subdirectory"
echo "No trailing slash"
echo "Should be run from the root directory of repository"
echo "Everything should be clean prior to running this script"
echo "You need to manually copy submodule somewhere and update .gitmodules file appropriately"
exit 1;