Skip to content

Instantly share code, notes, and snippets.

View whiteley's full-sized avatar

Matt Whiteley whiteley

View GitHub Profile
#!/bin/bash
LOGFILE=$(mktemp "/tmp/$(basename "${BASH_SOURCE}")_XXXXXXXXXX.log")
exec {BASH_XTRACEFD}>>"${LOGFILE}"
date >> "$LOGFILE"
set -o xtrace
set -o errexit
set -o nounset
$ perl -V
Summary of my perl5 (revision 5 version 22 subversion 1) configuration:
Platform:
osname=linux, osvers=3.16.0, archname=x86_64-linux-gnu-thread-multi
uname='linux localhost 3.16.0 #1 smp debian 3.16.0 x86_64 gnulinux '
config_args='-Dusethreads -Duselargefiles -Dcc=x86_64-linux-gnu-gcc -Dcpp=x86_64-linux-gnu-cpp -Dld=x86_64-linux-gnu-gcc -Dccflags=-DDEBIAN -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Dldflags= -Wl,-Bsymbolic-functions -Wl,-z,relro -Dlddlflags=-shared -Wl,-Bsymbolic-functions -Wl,-z,relro -Dcccdlflags=-fPIC -Darchname=x86_64-linux-gnu -Dprefix=/usr -Dprivlib=/usr/share/perl/5.22 -Darchlib=/usr/lib/x86_64-linux-gnu/perl/5.22 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/x86_64-linux-gnu/perl5/5.22 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.22.1 -Dsitearch=/usr/local/lib/x86_64-linux-gnu/perl/5.22.1 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
umask 077
readonly checksum="sha1sum"
remote_file "/Applications/VMware Fusion.app/Contents/Library/vmnet-natd" do
source "http://www.vmware.com/go/dl_vmnet-natd"
checksum "98228060fcb10b42f42d44d2d81678ddf8fc4e14b1071e20a3ae2add01ef09ae"
notifies :run, "execute[stop-vmware-natd]", :immediately
notifies :run, "execute[start-vmware-natd]", :immediately
end
execute "stop-vmware-natd" do
action :nothing
command ["/Applications/VMware Fusion.app/Contents/Library/vmnet-cli", "--stop"]
@whiteley
whiteley / -
Created December 23, 2015 02:27
diff --git a/lib/ohai/plugins/linux/network.rb b/lib/ohai/plugins/linux/network.rb
index 689001d..36898b9 100644
--- a/lib/ohai/plugins/linux/network.rb
+++ b/lib/ohai/plugins/linux/network.rb
@@ -77,7 +77,7 @@ Ohai.plugin(:Network) do
# 3) and since we're at it, let's populate some :routes attributes
# (going to do that for both inet and inet6 addresses)
def check_routing_table(family, iface)
- so = shell_out("ip -o -f #{family[:name]} route show")
+ so = shell_out("ip -o -f #{family[:name]} route show table default")
630239CC130E1A7FD81A27B140976EAF437D05B5|0X1C4CBDCDCD2EFD2A|false
C5986B4F1257FFA86632CBA746181433FBB75451|0X1C4CBDCDCD2EFD2A|false
790BC7277767219C42C86F933B4FE6ACC0B21F32|0X1C4CBDCDCD2EFD2A|false
843938DF228D22F7B3742BC0D94AA3F0EFE21092|0X1C4CBDCDCD2EFD2A|false
7B0FAB3A13B907435925D9C954422A4B98AB5139|0X1C4CBDCDCD2EFD2A|false
430BDF5C56E7C94E848EE60C1C4CBDCDCD2EFD2A|0X1C4CBDCDCD2EFD2A|false
126C0D24BD8A2942CC7DF8AC7638D0442B90D010|0X1C4CBDCDCD2EFD2A|false
D21169141CECD440F2EB8DDA9D6D8F6BC857C906|0X1C4CBDCDCD2EFD2A|false
75DDC3C4A499F1A18CB5F3C8CBF8D6FD518E17E1|0X1C4CBDCDCD2EFD2A|false
9FED2BCBDCD29CDF762678CBAED4B06F473041FA|0X1C4CBDCDCD2EFD2A|false
@whiteley
whiteley / etc_default_lxc
Created May 31, 2015 13:52
precise lxc defaults
# MIRROR to be used by ubuntu template at container creation:
# Leaving it undefined is fine
#MIRROR="http://archive.ubuntu.com/ubuntu"
# or
#MIRROR="http://<host-ip-addr>:3142/archive.ubuntu.com/ubuntu"
# LXC_AUTO - whether or not to start containers symlinked under
# /etc/lxc/auto
LXC_AUTO="true"
@whiteley
whiteley / etc_default_lxc
Created May 31, 2015 13:36
trusty lxc defaults
# MIRROR to be used by ubuntu template at container creation:
# Leaving it undefined is fine
#MIRROR="http://archive.ubuntu.com/ubuntu"
# or
#MIRROR="http://<host-ip-addr>:3142/archive.ubuntu.com/ubuntu"
# LXC_AUTO - whether or not to start containers symlinked under
# /etc/lxc/auto
LXC_AUTO="true"
I/O warning : failed to load external entity "/etc/vmware/hostd/proxy.xml"
2015-05-24T09:45:46.040| ServiceImpl_Opener: PID 54132
2015-05-24 09:46:02.659 VMware Fusion[54093:11291857] Unable to simultaneously satisfy constraints:
(
"<NSLayoutConstraint:0x7fa1936795c0 V:[VMIconPopUpButton:0x7fa1937dc230]-(21)-| (Names: '|':NSView:0x7fa193678de0 )>",
"<NSLayoutConstraint:0x7fa1937debf0 VMIconPopUpButton:0x7fa1937dc230.lastBaseline == NSButton:0x7fa1937dc700'Restore Defaults'.lastBaseline>",
"<NSLayoutConstraint:0x7fa193679780 V:[NSButton:0x7fa1937dc700'Restore Defaults']-(NSSpace(20))-| (Names: '|':NSView:0x7fa193678de0 )>"
)
Will attempt to recover by breaking constraint
#!/usr/bin/env knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it: