Skip to content

Instantly share code, notes, and snippets.

View glarizza's full-sized avatar

Gary Larizza glarizza

  • Open Infrastructure Services
  • Portland, Oregon
View GitHub Profile
@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

#!/usr/bin/env ruby
require 'rubygems'
require 'digest/sha2'
require 'cfpropertylist'
def salted_sha512(password)
seedint = rand(((2**31 - 1)-1+1))
seedhex = ("%x" % seedint).upcase.rjust(8, '0')
seedstring = seedint.to_a.pack("L")
@nanliu
nanliu / gist:1353458
Created November 9, 2011 23:01
Puppet Manifest Cleanup
#!/usr/bin/ruby
require 'parser-emit'
class Puppet::Parser::AST::Definition
attr_accessor :name
end
class Manifest
class << self
#include Enumerable
vhost { 'dashboard': ensure => present }
Package <| name == 'passenger' |> -> Vhost['dashboard']
# Apple Binary Property List serializer for Ruby 1.8.
require 'iconv'
module AppleBinaryPropertyList
MIME_TYPE = 'application/octet-stream' # Don't know what to use, so use a very generic type for now
CFData = Struct.new(:data) # For marking strings as binary data which will be decoded as a CFData object