Skip to content

Instantly share code, notes, and snippets.

View vinyar's full-sized avatar

Mr. Pacman vinyar

  • Launch Consulting
  • Seattle
View GitHub Profile
@vinyar
vinyar / aws_automation.ps1
Created October 4, 2013 19:20
Windows automation
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
@echohack
echohack / chef_windows_upgrade.ps1
Last active August 23, 2016 20:38
chef_windows_upgrade.ps1
# Execute this script in order to upgrade all the windows nodes in your fleet of servers to the desired version of chef-client.
# This script will requires the ChefDK to be installed and configured on your Windows machine.
$windows_nodes = knife search node 'platform:windows' -i
invoke-command -ComputerName $windows_nodes -filepath C:\Users\MyUser\invoke_upgrade.ps1 -Credential domain\user
Read-Host -Prompt “Upgrade complete. Press Enter to exit.”
@jeremiahsnapp
jeremiahsnapp / 01_setup_dev-lxc.md
Last active July 19, 2016 07:52
Quick Setup dev-lxc-platform
@charlesjohnson
charlesjohnson / Vagrantfile
Last active December 26, 2015 08:19
Vagrant.has_plugin? example
# Plugin-specific configurations
if Vagrant.has_plugin?('vagrant-cachier')
puts 'INFO: Vagrant-cachier plugin detected. Optimizing caches.'
config.cache.enable :chef
config.cache.enable :apt
else
puts 'WARN: Vagrant-cachier plugin not detected. Continuing unoptimized.'
end
if Vagrant.has_plugin?('Omnibus')
"[System Access]" | out-file c:\delete.cfg
"PasswordComplexity = 0" | out-file c:\delete.cfg -append
"[Version]" | out-file c:\delete.cfg -append
'signature="$CHICAGO$"' | out-file c:\delete.cfg -append
secedit /configure /db C:\Windows\security\new.sdb /cfg c:\delete.cfg /areas SECURITYPOLICY
powershell_script "Install IIS" do
code "add-windowsfeature Web-Server"
action :run
end
service "w3svc" do
action [:enable, :start ]
end
# cookbook_file "c:\\inetpub\\wwwroot\\Default.htm" do
@vinyar
vinyar / apache.rb
Last active August 29, 2015 14:06 — forked from mcquin/apache.rb
# plugins/apache/modules.rb
# :ApacheModules good, you might have some other plugin providing modules
# and you wouldn't want to overlap on the :Modules namespace.
Ohai.plugin(:ApacheModules) do
require 'mixlib/shellout'
provides "apache/modules"
collect_data(:default) do
string = Mixlib::ShellOut.new("apachectl -t -D DUMP_MODULES")
string.run_command
@charlesjohnson
charlesjohnson / gemrc.erb
Last active August 29, 2015 14:05
Use a .gemrc file with Omnibus chef-client
:sources:
- http://<%= node['gem_file']['host'] %>:<%= node['gem_file']['port'] %>/