Skip to content

Instantly share code, notes, and snippets.

@discentem
discentem / chef log
Created July 27, 2016 20:10
notifies :reload,
# Logfile created on 2016-07-27 20:05:05 +0000 by logger.rb/44203
# Logfile created on 2016-07-27 20:05:05 +0000 by logger.rb/44203
[2016-07-27T20:07:07+00:00] INFO: Auto-discovered chef repository at /home/vagrant/chef_repo/bk_chef_cookbooks
[2016-07-27T20:07:07+00:00] DEBUG: Sleeping for 0 seconds
[2016-07-27T20:07:07+00:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /home/vagrant/chef_repo/bk_chef_cookbooks
One version per cookbook
[2016-07-27T20:07:07+00:00] DEBUG: Running Ohai with the following configuration: {:log_location=>"log", :force_logger=>false, :force_formatter=>false, :profile_ruby=>false, :color=>true, :local_mode=>true, :runlist=>[#<Chef::RunList::RunListItem:0x000000040f2a68 @version=nil, @type=:recipe, @name="munki_server">], :log_level=>:debug, :config_file=>nil, :specific_recipes=>[], :chef_repo_path=>"/home/vagrant/chef_repo/bk_chef_cookbooks", :chef_server_url=>"chefzero://localhost:8889"}
[2016-07-27T20:07:07+00:00] INFO: Forking chef instance to conver
import subprocess
import json
def hashrocket_flatten_dict(input_dict):
"""Flattens the output from Facter 3"""
result_dict = {}
for fact_name, fact_value in input_dict.items():
if type(fact_value) == dict:
# Need to recurse at this point
def foo(bar):
return bar + 1
def call_foo(foo, arg):
return foo(arg)
call_foo(foo, arg)
import os
import sys
from pptx import Presentation
from pptx.util import Inches
def get_pictures(full_path):
return [f for f in os.listdir(full_path) if f.endswith('.jpg')]
driver:
name: vagrant
provisioner:
name: chef_zero
verifier:
name: inspec
sudo: true
format: doc
require 'json'
require 'mixlib/shellout'
resource_name :BK_atom
default_action :config
action :config do
manage_atom
end
Brandons-MBP:packer-windows brandon$ packer build windows_10.json
parallels-iso output will be in this color.
virtualbox-iso output will be in this color.
vmware-iso output will be in this color.
Build 'parallels-iso' errored: Failed creating Parallels driver: exec: "prlctl": executable file not found in $PATH
Build 'vmware-iso' errored: Couldn't find VMware tools for 'windows'! VMware often downloads these
tools on-demand. However, to do this, you need to create a fake VM
of the proper type then click the 'install tools' option in the
VMware GUI.
# pylint: disable=missing-docstring
# pylint: disable=E1101
# pylint: disable=W1401
import os
import json
import subprocess
import requests
@discentem
discentem / docklib.py
Last active November 16, 2017 05:19 — forked from gregneagle/docklib.py
'''Routines for manipulating the Dock'''
import os
import subprocess
from Foundation import NSURL
from Foundation import CFPreferencesAppSynchronize
from Foundation import CFPreferencesCopyAppValue
from Foundation import CFPreferencesSetAppValue