Skip to content

Instantly share code, notes, and snippets.

View ryanmoon's full-sized avatar

Ryan Moon ryanmoon

View GitHub Profile
@ryanmoon
ryanmoon / Gemfile
Created June 15, 2016 19:55
Gemfile for use with Chef Cookbooks
source 'https://rubygems.org'
group :development do
gem 'guard'
gem 'rb-readline'
gem 'foodcritic', '~> 6.2'
gem 'guard-foodcritic'
gem 'guard-rubocop'
gem 'terminal-notifier-guard'
gem 'guard-rspec'
@ryanmoon
ryanmoon / Rakefile
Created June 15, 2016 19:55
Rakefile for use with Chef Cookbooks
# Cookbook Rakefile
# 06/03/2016
# Created by Ryan Moon
##
# Requires
##
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
@ryanmoon
ryanmoon / com.nheinric.hubot.plist
Created April 19, 2016 18:59 — forked from nheinric/com.nheinric.hubot.plist
Hubot .plist for running via launchctl on OSX
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.nheinric.hubot</string>
<!-- LSEnvironment does not work for PATH. I don't know why.
https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/20001431-106825
@ryanmoon
ryanmoon / pro_tools_11_munki.sh
Created March 25, 2016 00:14 — forked from rickychilcott/pro_tools_11_munki.sh
My (working) attempt to get PT 11 to install successfully
#!/bin/bash
# Copy the com.avid.bsd.DigiShoeTool Helper Tool
PHT_DIGISHOETOOL="/Library/PrivilegedHelperTools/com.avid.bsd.DigiShoeTool"
/bin/cp "/Applications/Pro Tools.app/Contents/Library/LaunchServices/com.avid.bsd.DigiShoeTool" $PHT_DIGISHOETOOL
/usr/sbin/chown root:wheel $PHT_DIGISHOETOOL
/bin/chmod 544 $PHT_DIGISHOETOOL
# Create the Launch Deamon Plist for com.avid.bsd.DigiShoeTool
@ryanmoon
ryanmoon / Issue with attribute creation in recipe
Created March 21, 2016 21:11
In this, I'm trying to set the owner of a file to be the node attribute i created, which is the User ID of 501. The template message_test correct displays the value base_config admin_user, however setting the owner value to the attribute fails.
admin_user = `dscl . -list /Users UniqueID | grep "501" | awk '{print $1}'`
node.default['base_config']['admin_user'] = admin_user.to_s
log admin_user.to_s
template '/tmp/message_test' do
source 'message_test.erb'
owner node['base_config']['admin_user']
mode '0644'
end
@ryanmoon
ryanmoon / Outset Xsan Mount Script
Created March 18, 2016 19:08
In El Capitan, I ran into an issue with SAN automounts. This is a workaround. Set the values you want, per the description then place the script with the .sh extension in /usr/local/outset/everyboot-scripts
#!/bin/bash
#########################################
# Outset Xsan Mount
# Ryan Moon
# Created on 02/18/2016
# Version 0.3.0 on 02/20/2016
#########################################
# Ran into an issue with ATTO Drivers and El Capitan
# Created this script as a workaround.
# Outset script to run at everyboot-scripts and mount the
@ryanmoon
ryanmoon / encode.sh
Created February 7, 2016 06:48 — forked from lisamelton/encode.sh
This is the shell script I use to drive HandBrakeCLI to re-encode video files in a format suitable for playback on Apple TV, Roku 3, iOS, OS X, etc.
#!/bin/bash
# encode.sh
#
# Copyright (c) 2013 Don Melton
#
# This version published on June 7, 2013.
#
# Re-encode video files in a format suitable for playback on Apple TV, Roku 3,
# iOS, OS X, etc.
@ryanmoon
ryanmoon / Adobe Version Finder
Created February 4, 2016 23:52
Adobe Version Finder, finds current version of installed Adobe CC 2015 Applications
#!/bin/bash
#########################################
# Adobe CC 2015 Version Finder
# Ryan Moon
# Created on 2016-02-04
# Version 1.0.0 on 2016-02-04
#########################################
# This script gets the CFBundleShortVersionString
# of the Adobe CC 2015 Applications.
# Handy for reference when looking at multiple
@ryanmoon
ryanmoon / Fix for Older Ruby Symbols or Strings to Newer Approach
Last active January 26, 2016 23:24
Fix for Older Ruby Symbols/Strings to Newer Approach
find . -name \*.rb -exec perl -p -i -e 's/([^:]):(\w+)\s*=>/\1\2:/g' {} \;
@ryanmoon
ryanmoon / test-kitchen-fail
Created January 26, 2016 18:00
Test Kitchen Fail
httpd::default
Command "curl http://localhost"
stdout
should match /WARNING/ (FAILED - 1)
Failures:
1) httpd::default Command "curl http://localhost" stdout should match /WARNING/
Failure/Error: its(:stdout) { should match (/WARNING/) }
ttp://www.centos.org/\"><img src=\"/icons/poweredby.png\" alt=\"[ Powered by CentOS Linux ]\" width=\"88\" height=\"31\" /></a></p>\n\t\t\t\t</div>\n\t\t\t</div>\n </div>\n <div class=\"content\">\n<div class=\"content-middle\"><h2>About CentOS:</h2><b>The Community ENTerprise Operating System</b> (CentOS) Linux is a community-supported enterprise distribution derived from sources freely provided to the public by Red Hat. As such, CentOS Linux aims to be functionally compatible with Red Hat Enterprise Linux. The CentOS Project is the organization that builds CentOS. We mainly change packages to remove upstream vendor branding and artwork.</p> <p>For information on CentOS please