Skip to content

Instantly share code, notes, and snippets.

View jmaziarz's full-sized avatar

Jeremy Maziarz jmaziarz

  • White Mountains of New Hampshire, USA
View GitHub Profile
## Our nsswitch.conf from our production configuration
$ cat /etc/nsswitch.conf
passwd: compat [NOTFOUND=continue] pgsql
shadow: files
group: files pgsql
hosts: files dns
bootparams: files
ethers: files
netmasks: files
@jmaziarz
jmaziarz / chef-array-attributes.rb
Last active June 24, 2016 20:15
Chef's "deep merging" of array attributes doesn't work as expected...
# test-attributes-1/attributes/default.rb
default['test-attributes']['exclude'] = [ 'one', 'two', 'three' ]
# test-attributes-2/attributes/default.rb
default['test-attributes']['exclude'] = [ 'three', 'four', 'five' ]
# test-attributes-1/recipes/default.rb
include_recipe 'test-attributes-2'
Chef::Log.info(node['test-attributes']['exclude'].join(' '))
@jmaziarz
jmaziarz / application.controller.js
Last active December 31, 2015 02:01
Breakdown Component
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@jmaziarz
jmaziarz / gitlab_production_workflow
Last active August 29, 2015 14:03
Gitlab customized production workflow
Given:
$ git branch -a
production
* master
remotes/origin/5-4-stable
remotes/origin/6-0-stable
remotes/origin/6-1-stable
remotes/origin/6-2-stable
remotes/origin/6-3-stable
@jmaziarz
jmaziarz / gist:7491029
Created November 15, 2013 20:28
Creating multiple isolated pull requests
1. Fork repo from https://github.com/someuser/somerepo.git
2. Clone forked repo
$ git clone https://github.com/your_username/somerepo.git
$ cd somerepo
3. Setup upstream to someuser's repo
$ git remote add upstream https://github.com/someuser/somerepo.git
@jmaziarz
jmaziarz / ios7checker-install
Last active December 23, 2015 08:59
iOS7 checker with support for Notification Center on Mountain Lion
1. Download and install terminal-notifier from https://github.com/alloy/terminal-notifier/downloads
2. Put the iOS7 checker script somewhere in your home directory
3. Activate cron on MacOS
$ [sudo] touch /etc/crontab
4. Install the crontab
@jmaziarz
jmaziarz / Jer's Honey BBQ Sauce
Last active December 20, 2015 01:39
Home made honey BBQ sauce.
Jer's Honey BBQ Sauce
Ingredients:
* 1-1/4 cups ketchup
* 1/3 cup white vinegar
* 1/4 cup molasses
* 1/4 cup honey
* 1 teaspoon liquid smoke flavoring
* 1/2 teaspoon salt
@jmaziarz
jmaziarz / rspace
Created September 1, 2011 00:05
Working clamp script
#!/usr/bin/env ruby
require "clamp"
class ProjectSpace < Clamp::Command
#PROJECT_SPACE_ROOT = "/afs/rcf/project/"
PROJECT_SPACE_ROOT = "/Users/jmaziarz/"
option ["-v", "--version"], :flag, "Print version" do
puts "Version 0.1"
@jmaziarz
jmaziarz / gist:943256
Created April 26, 2011 21:47
Map a subnet using dig - quick and dirty
#!/bin/bash
# Usage: ./map-subnet.sh 129.38.11
#
SUBNET=$1
for n in {1..254}; do
ADDR=${SUBNET}.${n}
echo -e "${ADDR}\t$(dig -x ${ADDR} +short)"
done