This file contains 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
function Disable-InternetExplorerESC { | |
$AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" | |
$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" | |
Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0 | |
Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0 | |
Stop-Process -Name Explorer | |
Write-Host "IE Enhanced Security Configuration (ESC) has been disabled." -ForegroundColor Green | |
} | |
Disable-InternetExplorerESC |
This file contains 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
# -original- class PendingReboot # < Chef::Handler | |
class Chef | |
class Resource | |
# include Chef::Mixin::ShellOut | |
def reboot_pending? | |
# Any files listed here means reboot needed | |
(Registry.key_exists?('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations') && | |
Registry.get_value('HKLM\SYSTEM\CurrentControlSet\Control\Session Manager','PendingFileRenameOperations').any?) || |
This file contains 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
winrm get winrm/config | |
winrm get winrm/config/winrs | |
winrm get winrm/config/service | |
winrm get winrm/config/service/auth | |
winrm get winrm/config/service/auth | |
---- you want to confirm that the values you have match these: | |
winrm set winrm/config '@{MaxTimeoutms="1800000"}'; | |
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}'; |
This file contains 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
PS C:\chef> gem install pry | |
Successfully installed pry-0.9.12.6-x86-mingw32 | |
1 gem installed | |
Installing ri documentation for pry-0.9.12.6-x86-mingw32... | |
RDoc::Parser::Ruby failure around line 25 of | |
lib/pry/commands/ls.rb | |
Before reporting this, could you check that the file you're documenting | |
has proper syntax: |
This file contains 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
# | |
# Cookbook Name:: iis_demo | |
# Recipe:: default | |
# | |
# Copyright 2014, YOUR_COMPANY_NAME | |
# | |
# All rights reserved - Do Not Redistribute | |
# | |
powershell_script "Install IIS" do |
This file contains 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
<html> | |
<body> | |
<h1>Hello, <%= node['iis_demo']['greeting'] %>!</h1> | |
<h2>This is server <%= node['hostname']%></h2> | |
<h3>Do you know the capitals of the following countries?</h3> | |
<% @country.each do |item| -%> | |
<p><a href=<%="#{item}"%>.htm><%="#{item}"%></a></p> | |
<% end -%> | |
</body> | |
</html> |
This file contains 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 'spec_helper' | |
describe 'mysql::server' do | |
let(:centos5_run) { ChefSpec::Runner.new(platform: 'centos', version: '5.9').converge(described_recipe) } | |
let(:centos6_run) { ChefSpec::Runner.new(platform: 'centos', version: '6.4').converge(described_recipe) } | |
let(:ubuntu_1004_run) { ChefSpec::Runner.new(platform: 'ubuntu', version: '10.04').converge(described_recipe) } | |
let(:ubuntu_1204_run) { ChefSpec::Runner.new(platform: 'ubuntu', version: '10.04').converge(described_recipe) } | |
let(:ubuntu_1304_run) { ChefSpec::Runner.new(platform: 'ubuntu', version: '13.04').converge(described_recipe) } | |
it 'includes _server_rhel on centos5' do |
This file contains 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
# Get the instance ready for our bootstrapper, commands courtesy of Julian Dunn | |
winrm quickconfig -q; | |
Enable-PSRemoting -force; | |
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}'; | |
winrm set winrm/config '@{MaxTimeoutms="1800000"}'; | |
winrm set winrm/config/service '@{AllowUnencrypted="true"}'; | |
winrm set winrm/config/service/auth '@{Basic="true"}'; | |
netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" profile=public protocol=tcp localport=5985 new remoteip=any; |
This file contains 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
Attribute file: | |
default['winsecureos']['registry']['eventlog']['HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application'] = | |
[ | |
{:name => 'MaxSize', :type => :dword, :data => '20971520'}, | |
{:name => 'RestrictGuestAccess', :type => :dword, :data => '1'}, | |
{:name => 'Retention', :type => :dword, :data => '1'}, | |
{:name => 'AutoBackupLogFiles', :type => :dword, :data => '1'} | |
] | |
Recipe: |
This file contains 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 root_owner | |
if ['windows'].include?(node['platform']) | |
adminAccount = WMI::Win32_UserAccount.find(:first,:conditions => "SID like 'S-1-5-21-%-500' AND LocalAccount=True") | |
adminAccount.Name | |
else | |
'root' | |
end | |
end | |
def dir_owner |