Skip to content

Instantly share code, notes, and snippets.

@beddari
beddari / gist:1099289
Created July 22, 2011 11:41
Homebrew Packaging Guide
Homebrew Packaging Guide
From OS X Deployment and Management
Jump to:navigation, search
This guide is for setting up homebrew to build individual packages that can be deployed with munki or ARD.
Scripts
/opt/homebrew/bin/rebuild-homebrew-pkgs
@beddari
beddari / install_vagrant_sudoers.sh
Created December 13, 2011 12:47
Allow Vagrant sudo-access without password for NFS-setup
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
if [ -z "$1" ]; then
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp)
cat > $TMP <<EOF
Cmnd_Alias VAGRANT_EXPORTS_ADD = /bin/su root -c echo '*' >> /etc/exports
Cmnd_Alias VAGRANT_NFSD = /etc/init.d/nfs-kernel-server restart
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -e /*/ d -ibak /etc/exports
#!/bin/bash
# post-receive gitolite hook to produce archives
# Debug mode
DEBUG=1
# Where to put archives
ARCHIVE_DIR=/srv/archives/
# When to allow archiving (regex)
hiera:
---
:hierarchy:
- %{env}/%{variant}_%{role}_%{group}_%{location}
- %{env}/%{variant}_%{role}_%{group}
- %{env}/%{variant}_%{role}
- %{env}/%{variant}
- %{env}
:backends:
@beddari
beddari / gist:2358533
Created April 11, 2012 10:34
Mapping dev,test,qa,prod with hiera?
# Idea being that %{env} is set to one of {dev, qa, test} but not set in prod.
# Prod values will be used where no env-specific data is set.
# Any ideas of different or better ways to do this? Is this tree too deep?
---
:hierarchy:
- %{env}/%{variant}_%{role}_%{group}_%{location}
- %{variant}_%{role}_%{group}_%{location}
- %{env}/%{variant}_%{role}_%{group}
- %{variant}_%{role}_%{group}
cat ~/.bash_profile
source ~/.git-completion.bash
source ~/.git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWUPSTREAM=auto
PS1='\u@\h:\w$(__git_ps1 " (%s)") \$ '
@beddari
beddari / install_puppet_mac.sh
Created November 2, 2012 09:26 — forked from stevedomin/install_puppet_mac.sh
Installing Puppet on Mac OS X
#!/usr/bin/env bash
set -o errtrace
set -o errexit
facter_version=$1
puppet_version=$2
target_volume=$3
git modules
Usage: git modules [options] <command>
Options:
-h, --help show this help message and exit
-v, --version show version and exit
Commands:
init
update
Facter.add(:environment) do
setcode do
if defined? Puppet and Puppet.application_name == :agent
Puppet[:environment]
else
Facter::Util::Resolution.exec('puppet agent --configprint environment')
end
end
end
@beddari
beddari / gist:7100009
Last active December 26, 2015 05:19
How to fork and edit a Homebrew formula

Originally posted at https://alpha.app.net/samueljohn/post/8909897

  1. Fork homebrew on Github
  2. git remote add my https://github.com/username/homebrew.git
  3. Make a branch: git checkout -b vim_option
  4. brew edit vim
  5. brew audit
  6. git commit
  7. git push --set-upstream my vim_options