Skip to content

Instantly share code, notes, and snippets.

View tas50's full-sized avatar
🌪️
Producting. That's a thing right?

Tim Smith tas50

🌪️
Producting. That's a thing right?
View GitHub Profile
{
"metadata": {
"compute": {
"location": "westus",
"name": "timtest",
"offer": "UbuntuServer",
"osType": "Linux",
"platformFaultDomain": "0",
"platformUpdateDomain": "0",
"publisher": "Canonical",
"metadata": {
"compute": {
"location": "westus",
"name": "timtest",
"offer": "UbuntuServer",
"osType": "Linux",
"platformFaultDomain": "0",
"platformUpdateDomain": "0",
"publisher": "Canonical",
ami-id
ami-launch-index
ami-manifest-path
block-device-mapping/
hostname
instance-action
instance-id
instance-type
local-hostname
local-ipv4
{
"compute": {
"location": "westus",
"name": "timtest",
"offer": "UbuntuServer",
"osType": "Linux",
"platformFaultDomain": "0",
"platformUpdateDomain": "0",
"publisher": "Canonical",
"sku": "17.04",
@tas50
tas50 / gist:2ea40cf95503aff28ae29d418bbdccef
Created June 19, 2017 22:28
Windows Updates in Ohai
Ohai.plugin :WindowsPatches do
provides "windowspatches"
collect_data :windows do
windowspatches Mash.new
patch_data = shell_out('powershell.exe -NoLogo -NonInteractive -NoProfile -command "Get-HotFix | ConvertTo-Json"')
parser = FFI_Yajl::Parser.new
windowspatches["updates"] = []
windowspatches["details"] = Mash.new
{
"chef_packages": {
"chef": {
"version": "13.1.31",
"chef_root": "C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib"
},
"ohai": {
"version": "13.1.0",
"ohai_root": "C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.1.0/lib/ohai"
}
\{
"chef_packages": {
"chef": {
"version": "13.1.31",
"chef_root": "C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib"
{
"chef_packages": {
"chef": {
"version": "13.1.31",
"chef_root": "C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib"
},
"ohai": {
"version": "13.1.0",
"ohai_root": "C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.1.0/lib/ohai"
}
{
"chef_packages": {
"chef": {
"version": "13.1.31",
"chef_root": "C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib"
},
"ohai": {
"version": "13.1.0",
"ohai_root": "C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.1.0/lib/ohai"
}
{  "chef_packages": {    "chef": {      "version": "13.1.31",      "chef_root": "C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib"    },    "ohai": {      "version": "13.1.0",      "ohai_root": "C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.1.0/lib/ohai"    }  },  "command": {  },  "counters": {    "network": {      "interfaces": {        "lo": {          "tx": {            "queuelen": "1",            "bytes": 0,            "packets": 0,            "errors": 0,            "drop": 0,            "carrier": 0,            "collisions": 0          },          "rx": {            "bytes": 0,            "packets": 0,            "errors": 0,            "drop": 0,            "overrun": 0          }        },        "0xe": {          "rx": {            "bytes": 0,            "packets": 0,            "errors": 0,            "drop": 0,            "overrun": 0,            "frame": 0,            "compressed": 0,            "multicast": 0          },          "tx": {