This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| property_list_key { 'Auto Timezone': | |
| ensure => present, | |
| path => '/Library/Preferences/com.apple.timezone.auto.plist', | |
| key => 'Active', | |
| value => true, | |
| value_type => 'boolean', | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # http://github.com/glarizza/puppet-property_list_key | |
| property_list_key { 'Disable Ducking Autocorrect': | |
| ensure => present, | |
| path => "${my_homedir}/Library/Preferences/.GlobalPreferences.plist", | |
| key => 'NSAutomaticSpellingCorrectionEnabled', | |
| value => false, | |
| value_type => 'boolean', | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Now....Make A wish!! I hope you made your wish! | |
| Now then, if you send to: | |
| 1 person --- your wish will be granted in 1 year | |
| 3 people --- 6 months | |
| 5 people --- 3 months | |
| 6 people --- 1 month | |
| 7 people --- 2 weeks | |
| 8 people --- 1 week |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def world_writable?(write_bit) | |
| if write_bit > 3 | |
| write_bit -= 4 | |
| return false if write_bit == 0 | |
| write_bit % 2 == 0 ? true : false | |
| elsif write_bit < 4 | |
| return false if write_bit == 0 | |
| write_bit % 2 == 0 ? true : false | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class osx_management::macauth_datetime { | |
| require osx_management::macauth_sysprefs | |
| macauthorization { 'system.preferences.datetime': | |
| ensure => 'present', | |
| allow_root => 'true', | |
| auth_class => 'user', | |
| auth_type => 'right', | |
| comment => 'Changed by Puppet', | |
| group => 'staff', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Simple Shell Fact | |
| Facter.add('role') do | |
| setcode('cat /etc/role') | |
| end | |
| ## More complex Ruby fact | |
| Facter.add('ruby_stuff') do | |
| setcode do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'puppet' | |
| require 'facter/util/plist' | |
| require 'stringio' | |
| require 'base64' | |
| def convert_xml_to_binary(plist_data) | |
| # This method will accept a hash that has been returned from Plist::parse_xml | |
| # and convert it to a binary plist (string value). | |
| Puppet.debug('Converting XML plist to binary') | |
| Puppet.debug('Executing: \'plutil -convert binary1 -o - -\'') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'puppet' | |
| require 'facter/util/plist' | |
| require 'stringio' | |
| require 'base64' | |
| def convert_xml_to_binary(plist_data) | |
| # This method will accept a hash that has been returned from Plist::parse_xml | |
| # and convert it to a binary plist (string value). | |
| Puppet.debug('Converting XML plist to binary') | |
| Puppet.debug('Executing: \'plutil -convert binary1 -o - -\'') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # I apologize to The Baby Jesus for the atrocities I'm about to commit | |
| require 'net/http' | |
| require 'net/https' | |
| require 'uri' | |
| # Contact Apple | |
| uri = URI.parse('https://selfsolve.apple.com/wcResults.do') | |
| http = Net::HTTP.new(uri.host, uri.port) | |
| http.use_ssl = true | |
| http.verify_mode = OpenSSL::SSL::VERIFY_NONE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >> hash = { 'key' => 'value' } | |
| => {"key"=>"value"} | |
| >> hash.to_yaml | |
| => "--- \nkey: value\n" | |
| >> Plist::Emit.dump(hash) | |
| => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>key</key>\n\t<string>value</string>\n</dict>\n</plist>\n" | |
| ## Here's YAML: | |
| --- |