Skip to content

Instantly share code, notes, and snippets.

View gist:9497a038d7c7a8f77a226d164bcd2ee9
[chef@ip-172-31-58-233 ~]$ chef generate repo chef-repo
Generating Chef Infra repo chef-repo
- Ensuring correct Chef Infra repo file content
[2019-07-22T09:22:01+00:00] WARN: Found a directory chef-repo in the cookbook path, but it contains no cookbook files. skipping.
================================================================================
Error executing action `create_if_missing` on resource 'template[/home/chef/chef-repo/LICENSE]'
================================================================================
NoMethodError
@drrk
drrk / gist:aa762f3b12deec72d2ac8dd757382b04
Last active Jun 13, 2019
Chef Jumpstart Quick Reference
View gist:aa762f3b12deec72d2ac8dd757382b04
chef-run chef@node1 file '/etc/motd'
content='Welcome to Chef’ --password Cod3Can!
chef-run chef@node1 motd.rb --password Cod3Can!
chef-run winrm://Administrator@winnode1 file_experiment.rb --password Cod3Can!
chef generate cookbook -P setup
chef generate template motd
kitchen converge
kitchen verify
kitchen destroy
chef generate cookbook -P mycorp_resources
@drrk
drrk / fixsudo.rb
Last active Mar 29, 2017
Fix Sudo Hack
View fixsudo.rb
delete_lines 'remove requiretty from sudoers' do
path '/etc/sudoers'
pattern '^.*requiretty'
end
@drrk
drrk / .kitchen.yml
Last active Mar 29, 2017
Chef TTD Azure Workshop Test Kitchen Config
View .kitchen.yml
---
driver:
name: azurerm
driver_config:
subscription_id: '4801fa9d-YOUR-GUID-HERE-b265ff49ce21'
location: 'West Europe'
machine_size: 'Standard_D1'
transport:
@drrk
drrk / README
Created Sep 6, 2016
remote_file error test recipe
View README
The host 192.168.0.9 in the test above does not exist,
and bowerham.net does not respond on port 5678,
but is dropped by the firewall completly,
not even returning a port closed response.
View gist:e48600c2b460cdad8e8c2766d420e4d6
lhrkjohnson001:test_remote_file kjohnson$ kitchen converge
-----> Starting Kitchen (v1.10.2)
-----> Creating <default-windows2012>...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'windows-2012r2'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: kitchen-test_remote_file-default-windows2012_default_1473181164709_29566
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
View keybase.md

Keybase proof

I hereby claim:

  • I am drrk on github.
  • I am drrk (https://keybase.io/drrk) on keybase.
  • I have a public key ASCfVkUm2sx6vDihokODR-Vt7n1nj_vLTtFMcU86SV7g3wo

To claim this, I am signing this object:

View gist:4a17c4394f93d0f9123560af056f6f30
# borrowed from https://github.com/micropython/micropython/blob/master/esp8266/scripts/ntptime.py
import socket
import pyb
import network
import utime
import socket
# (date(2000, 1, 1) - date(1900, 1, 1)).days * 24*60*60
NTP_DELTA = 3155673600
View iis_demo\recipes\default.rb
powershell_script "Install IIS" do
code "add-windowsfeature Web-Server"
action :run
end
service "w3svc" do
action [:enable, :start ]
end
#node.default["iis_demo"]["indexfile"] = "Default2.htm"