Skip to content

Instantly share code, notes, and snippets.

View cdenneen's full-sized avatar

Chris Denneen cdenneen

  • New York
View GitHub Profile
@cdenneen
cdenneen / gist:5062070
Created March 1, 2013 02:34
Puppetfile
# This file manages Puppet module dependencies.
#
# It works a lot like Bundler. We provide some core modules by
# default. This ensures at least the ability to construct a basic
# environment.
def github(name, version, options = nil)
options ||= {}
options[:repo] ||= "boxen/puppet-#{name}"
mod name, version, :github_tarball => options[:repo]
@cdenneen
cdenneen / gist:5062081
Created March 1, 2013 02:36
Boxen run
~/src/boxen[master*]% script/boxen --debug
Boxen has a dirty tree, won't auto-update!
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1414:in `fu_each_src_dest0': undefined method `to_str' for nil:NilClass (NoMethodError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1400:in `fu_each_src_dest'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:423:in `cp_r'
from /Users/chris/src/boxen/.bundle/ruby/1.8/gems/librarian-puppet-0.9.8/lib/librarian/puppet/source/githubtarball.rb:58:in `install_version!'
from /Users/chris/src/boxen/.bundle/ruby/1.8/gems/librarian-puppet-0.9.8/lib/librarian/puppet/source/githubtarball.rb:202:in `install!'
from /Users/chris/src/boxen/.bundle/ruby/1.8/gems/librarian-puppet-0.9.8/vendor/librarian/lib/librarian/manifest.rb:89:in `install!'
from /Users/chris/src/boxen/.bundle/ruby/1.8/gems/librarian-puppet-0.9.8/vendor/librarian/lib/librarian/action/install.rb:49:
/opt/boxen/repo[master]% script/boxen --debug
Boxen is up-to-date.
--> Hey, I need your current GitHub credentials to continue.
GitHub login: |chris| cdenneen
GitHub password: ***********
Could not resolve the dependencies.
Can't run Puppet, fetching dependencies with librarian failed.
/opt/boxen/repo[master*]% script/boxen --debug
Boxen has a dirty tree, won't auto-update!
/opt/boxen/repo[master*]% script/boxen --debug
Boxen has a dirty tree, won't auto-update!
Could not resolve the dependencies.
Can't run Puppet, fetching dependencies with librarian failed.
/opt/boxen/repo[master*]% rm .projects
/opt/boxen/repo[master]% script/boxen --debug
Boxen is up-to-date.
Could not resolve the dependencies.
@cdenneen
cdenneen / gist:5110008
Created March 7, 2013 17:37
Fresh install of boxen then adding more modules breaks
/opt/boxen% rm -rf repo
/opt/boxen% mkdir repo
/opt/boxen% sudo chown chris:admin repo
/opt/boxen% git clone https://github.com/boxen/our-boxen repo
Cloning into 'repo'...
remote: Counting objects: 1019, done.
remote: Compressing objects: 100% (493/493), done.
remote: Total 1019 (delta 458), reused 993 (delta 439)
Receiving objects: 100% (1019/1019), 22.71 MiB | 2.12 MiB/s, done.
@cdenneen
cdenneen / gist:5251221
Created March 27, 2013 02:55
Versioning compressed_app
~/src/our-boxen[master*]% boxen --debug
Boxen's master branch is out of sync, won't auto-update!
/opt/boxen/repo/bin/puppet apply --group admin --confdir /tmp/boxen/puppet/conf --vardir /tmp/boxen/puppet/var --libdir /opt/boxen/repo/lib --libdir /opt/boxen/repo/.bundle/ruby/1.8/gems/boxen-1.0.1/lib --manifestdir /opt/boxen/repo/manifests --modulepath /opt/boxen/repo/modules:/opt/boxen/repo/shared --logdest /opt/boxen/repo/log/boxen.log --logdest console --no-report --detailed-exitcodes --show_diff --debug /opt/boxen/repo/manifests/site.pp
...
Debug: Prefetching compressed_app resources for package
Debug: Executing 'curl 'http://cyberduck.ch/Cyberduck-4.1.3.zip' -L -q -o '/opt/boxen/cache/Cyberduck-4.1.3.app.zip''
Debug: Executing 'rm -rf '/Applications/Cyberduck-4.1.3.app''
Debug: Executing '/usr/bin/unzip -o '/opt/boxen/cache/Cyberduck-4.1.3.app.zip' -d /Applications'
Debug: Executing '/usr/sbin/chown -R chris:admin /Applications/Cyberduck-4.1.3.app'
Notice: /Stage[main]/Cyberduck/Package[Cyberduck-4.1.3]/en
@cdenneen
cdenneen / nodes.pp
Created March 29, 2013 20:00
Example of node definition inheritance
node base_node {
include ntp
include ap_ssh
include ap_fw
include sudo
}
node mongo_videohub_default inherits base_node {
include mongodb
firewall { '100 allow MongoDB access':
@cdenneen
cdenneen / newrun
Last active December 15, 2015 16:19
testing NFS remount
[root@rndeapvhmdb1 ~]# df -F nfs
Filesystem 1K-blocks Used Available Use% Mounted on
10.1.60.80:/sysadmin/share/backup
75628000 40365184 35262816 54% /mnt/backup
[root@rndeapvhmdb1 ~]# grep nfs /etc/fstab
10.1.60.80:/sysadmin/share/backup /mnt/backup nfs defaults 0 0
~% netstat -rn -f inet
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.3.1 UGSc 74 144 en1
10.8/24 10.8.0.5 UGSc 1 0 tun0
10.8.0.5 10.8.0.6 UH 5 0 tun0
25 link#10 UC 2 0 ham0
25.255.255.255 ff:ff:ff:ff:ff:ff UHLWbI 0 4 ham0
open(cached_source) do |dmg|
xml_str = hdiutil "mount", "-plist", "-nobrowse", "-readonly", "-mountrandom", "/tmp", dmg.path
ptable = Plist::parse_xml xml_str
# JJM Filter out all mount-paths into a single array, discard the rest.
mounts = ptable['system-entities'].collect { |entity|
entity['mount-point']
}.select { |mountloc|; mountloc }
begin
mounts.each do |fspath|
Dir.entries(fspath).select { |f|