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 / knife.sh
Created August 20, 2013 22:15 — forked from nukemberg/knife.sh
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab:
# Author: Avishai Ish-Shalom <avishai@fewbytes.com>
# We need to specify GNU sed for OS X, BSDs, etc.
if [[ "$(uname -s)" == "Darwin" ]]; then
SED=gsed
else
SED=sed
fi
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 / data_bags\users\bobo.json
Last active December 23, 2015 09:39
Create a user item in the users data bag
{
"id": "bobo",
"comment": "Bobo T. Clown",
"password": "iAm@Cl0wN!!!"
}
{
"id": "frank",
"comment": "Frank Belson",
"password": "sP3nC3r4Hire!"
}
{
"id": "clowns",
"members": [ "bobo", "frank" ]
}
"[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
use_inline_resources
action :add do
log "My name is #{new_resource.name}"
registry_key "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System" do
values [{
:name => "LegalNoticeCaption",
:type => :string,
:data => "#{new_resource.title_text}"
@vinyar
vinyar / iis_demo\recipes\default.rb
Last active December 23, 2015 22:49
pre-refactor iis_demo recipe full
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
<powershell>
#https://gist.github.com/vinyar/6735863
# below two commands are known to fail for arbitrary reasons
try { winrm quickconfig -q }
catch {write-host "winrm quickconfig failed"}
try { Enable-PSRemoting -force}
catch {write-host "Enable-PSRemoting -force failed"}
write-host 'setting up WinRm';