Skip to content

Instantly share code, notes, and snippets.

Fletcher Nichol fnichol

Block or report user

Report or block fnichol

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fnichol
fnichol / README.md
Last active May 29, 2019
A Windows/Linux/macOS PowerShell Rustup Install Script
View README.md

A Windows/Linux/macOS PowerShell Rustup Install Script

On Windows, run

& ([scriptblock]::Create((New-Object System.Net.WebClient).DownloadString('https://gist.github.com/fnichol/699d3c2930649a9932f71bab8a315b31/raw/rustup-init.ps1')))

in a PowerShell session. This downloads and runs rustup-init.ps1, which in turn downloads and runs the correct version of the rustup-init executable on

@fnichol
fnichol / resolve-studio-teardown.sh
Last active Sep 26, 2018
A script that ensures a pre-existing Habitat Studio is safely cleaned up and captures a report on failure
View resolve-studio-teardown.sh
#!/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 Aug 12, 2018
Simple, blocking, one shot UDP client and server in Rust.
View main.rs
///! 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 Jul 19, 2018
Build an initial `hab` binary for the `x86_64-linux-kernel2` package target
View build-bootstrap-hab-x86_64-linux-kernel2.sh
# 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
View keybase.md

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 / dev-setup-minimal.sh
Created Apr 8, 2017
Minimal Development Setup
View dev-setup-minimal.sh
#!/bin/sh
# shellcheck disable=SC2039
set -eu
if [ -n "${DEBUG:-}" ]; then set -x; fi
main() {
init
ensure_root
info "Starting setup"
@fnichol
fnichol / README.md
Last active Feb 27, 2018
Building a Mac OS X Vagrant box with Bento
View README.md

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
View README.md

Docker Cookbook In Chef-Apply? It's easy!

export CHEF_DOCKER_PATH=/path/to/docker/cookbook
chef-apply docka.rb
@fnichol
fnichol / docker_talk.rs
Created Oct 23, 2015
Research/prototype code to talk to a Docker Engine with Rust and Hyper
View docker_talk.rs
extern crate hyper;
extern crate openssl;
use hyper::{Client, Url};
use hyper::client::pool::{Config, Pool};
use hyper::http::h1::Http11Protocol;
use hyper::net::{HttpsConnector, Openssl};
use openssl::ssl::{SslContext, SslMethod};
use openssl::x509::X509FileType;
use std::env;
@fnichol
fnichol / README.md
Last active Aug 29, 2015
Upgrade Test Kitchen to 1.4.0 in an existing ChefDK installation
View README.md

If you're using ChefDK and find you can't wait for the next release to come out (which will out be shortly), you might want to give the chefdk-update-app project a spin to update test-kitchen (follow the setup instructions in the README).

Upgrade test-kitchen

Upgrade test-kitchen with the following for Unix-based workstations:

sudo -E ./bin/chefdk-update-app.sh test-kitchen -r v1.4.0
You can’t perform that action at this time.