Skip to content

Instantly share code, notes, and snippets.

View fnichol's full-sized avatar

Fletcher Nichol fnichol

View GitHub Profile
@fnichol
fnichol / Manifest.html
Last active July 1, 2020 22:34
SmartOS Node (no disks)
<table width="100%" cellspacing="1" cellpadding="0" border="1">
<thead>
<th class="qty">Qty.</th>
<th class="image">Image</th>
<th class="product">Product Description</th>
<th class="unitPrice">Unit Price</th>
<th class="savings">Savings </th>
<th class="totalPrice">Total Price</th>
</thead>
@fnichol
fnichol / README.md
Last active December 30, 2019 08:23
Building a Mac OS X Vagrant box with Bento

The Mac/Bento templates use Tim Sutton's amazingly awesome os-vm-templates project to prepare a .dmg that can perform an unattended install of Mac OS X 10.7 through to 10.11. You'll need a copy of the Mac OS X .app on locally on disk, so we'll assume that it's installed under /Applications from the App Store.

Clone the os-vm-templates project and run the prepare_iso.sh program to produce the disk image.

git clone https://github.com/timsutton/osx-vm-templates.git
cd osx-vm-templates
sudo prepare_iso/prepare_iso.sh "/Applications/Install OS X El Capitan.app" out
@fnichol
fnichol / shell.sh
Created April 23, 2013 16:41
Test Kitchen with bats - A Lightning Guide
SUITE_NAME=default
# create a bats subdirectory under your desired suite
mkdir -p test/integration/$SUITE_NAME/bats
# create an initial "canary" bats test file
# more examples at:
# * https://github.com/fnichol/chef-rvm/tree/master/test/integration/rubies/bats
# * https://github.com/fnichol/chef-ruby_build/tree/master/test/integration/alltherubies/bats
# * https://github.com/sstephenson/bats
@fnichol
fnichol / kitchen.yml
Last active June 26, 2019 02:29
Testing multiple versions of Chef with Test Kitchen
---
driver:
name: vagrant
provisioner:
name: chef_zero
platforms:
- name: ubuntu-12.04-chef-11
driver:
@fnichol
fnichol / README.md
Last active January 20, 2019 13:32
(Excellent?) Format Changes to Test Kitchen's kitchen.yml

Format Changes to Test Kitchen's kitchen.yml File

This is happening thanks to a refactoring of the data manipulation code formerly in Kitchen::Config.

There are now 3 main configuration blocks that can be placed in the various levels:

  • driver: Configurtation relavent to Kitchen drivers. This is a combination of what was driver_plugin and driver_config. Backwards compatability is guarenteed with the legacy formats for a time, then will be deprecated (with a warning when encountered), then will be removed in a future release.
  • provisioner: Configuration relating to the automation tool being used. Currently supporting "chef_solo" and "chef_zero". Previously several Chef-related config paths were dumped in a Suite block, namely data_path, data_bags_path, environments_path, nodes_path, roles_path, etc. These will be supported for backwards compatability, then will be deprecated (with a warning when encountered), then will be removed in a future release.
  • busser: Configuration rela
@fnichol
fnichol / resolve-studio-teardown.sh
Last active September 26, 2018 18:28
A script that ensures a pre-existing Habitat Studio is safely cleaned up and captures a report on failure
#!/usr/bin/env bash
#
# Copyright (c) 2018 Chef Software, Inc. and/or applicable contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@fnichol
fnichol / main.rs
Created August 12, 2018 02:52
Simple, blocking, one shot UDP client and server in Rust.
///! Simple, blocking, one shot UDP client and server.
///
/// This shows a server that recieves one UDP datagram and returns the reversed contents of the
/// source datagram back to the client. There is a short pause on the server side which simulates
/// some expensive work.
///
/// # Example
///
/// Create a Cargo project with:
///
@fnichol
fnichol / build-bootstrap-hab-x86_64-linux-kernel2.sh
Created July 19, 2018 19:26
Build an initial `hab` binary for the `x86_64-linux-kernel2` package target
# Change directory to the root of your `habitat-sh/habitat` repo checkout
# cd /path/to/habiatat-sh/habitat
# Cleanup any existing Studio instances--keep it clean to be safe!
hab studio rm
# Enter the studio with the `core` key and prevent a Supervisor from starting
env HAB_ORIGIN=core HAB_STUDIO_SUP=false hab studio enter
# Build a static `hab` CLI for the `x86_64-linux-kernel2` target

Keybase proof

I hereby claim:

  • I am fnichol on github.
  • I am fnichol (https://keybase.io/fnichol) on keybase.
  • I have a public key ASA2PW1FW2eqANMPo6CweZrD7BL4Quf2hR1ypMcblTODlwo

To claim this, I am signing this object:

@fnichol
fnichol / .kitchen.yml
Last active February 14, 2018 21:03
Test Kitchen Encrypted Data Bags
---
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true
platforms:
- name: ubuntu-12.04-solo
driver_config:
box: opscode-ubuntu-12.04
provisioner: chef_solo