Skip to content

Instantly share code, notes, and snippets.

View vinyar's full-sized avatar

Mr. Pacman vinyar

  • Launch Consulting
  • Seattle
View GitHub Profile
@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'] %>/
@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
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
"[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
@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')
@jeremiahsnapp
jeremiahsnapp / 01_setup_dev-lxc.md
Last active July 19, 2016 07:52
Quick Setup dev-lxc-platform
@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.”
@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
@zuazo
zuazo / Chef-metadata-environment-pattern.rb
Last active November 17, 2016 08:58
This Chef Cookbook metadata.rb example reads the dependencies from Berksfile.lock. (Experimental)
# metadata.rb
# This metadata.rb example reads the dependencies from Berksfile.lock. This can
# be used to implement the Environment Pattern with Chef Server.
#
# The Environment Cookbook:
# http://blog.vialstudios.com/the-environment-cookbook-pattern/
name 'my_face'
# [...]
@vinyar
vinyar / README.md
Created December 13, 2016 22:28 — forked from afiune/README.md
Automate LDAP Bulking User Creation

LDAP Bulking User Creation Process

This is temporal automation to create multiple LDAP users in Chef Automate.

Prerequisites

The minimum prerequisites to be able to use this automation are: