Skip to content

Instantly share code, notes, and snippets.


Christopher Cooper ccooper21

View GitHub Profile
ccooper21 / Vagrantfile
Created Nov 19, 2019
This is a Vagrant virtual machine definition and corresponding provisioning script for an ESP32 development environment using the ESP-IDF.
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config| = "ubuntu/bionic64"
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--usb", "on"]
vb.customize ["modifyvm", :id, "--usbehci", "on"]
vb.customize ["modifyvm", :id, "--usbxhci", "on"]
ccooper21 /
Created Nov 10, 2017
These scripts validate the websocket client handshake functionality described in RFC6455 and provided by MicroPython's "websocket_helper".
# This script validates the websocket client handshake functionality, described in RFC6455 and provided by MicroPython's
# "websocket_helper" module, against the websocket endpoint for AWS' IoT MQTT-based service. For more information about
# this service, see Two key considerations with respect to integrating with AWS'
# service is that AWS requires the use of TLS/SSL (i.e. HTTPS) and the use of a cryptographically sound authentication
# mechanism. While AWS supports several authentication mechanisms, this script uses the AWS SigV4 digital signature
# mechanism described at and incorporates code
# based on the associated SigV4 Python-based example code.
# For this script to succeed, the changes included in pull request #3420 must be applied (see
# Further, the following keys in this script must be replaced
ccooper21 /
Created Oct 16, 2017
Example MicroPython MQTT over WebSocket script
# This example script requires the MicroPython changes in the following branches:
import usocket as socket
import utime as time
from websocket import websocket
from umqtt.simple import MQTTClient
ccooper21 /
Last active Nov 8, 2021
This is a bash shell script for bootstrapping the Hyperledger Fabric development environment on an AWS Ubuntu AMI instance. It has been tested with Ubuntu v14.04 (AMI ID ami-2d39803a). While I wrote this to enable AWS deployments, this script should be usable in any Ubuntu based environment. See the first comment below for the detailed background.
# Install "git"
sudo apt-get update
sudo apt-get -y install git
# Clone the Hyperledger Fabric base image repository. It would be preferable
# to use the "/tmp" directory as the destination, since this repository is no
# longer needed once the base image has been built. However, this is
# problematic because one of the scripts that builds the base image removes
ccooper21 / amazon-linux-omnibus.erb
Last active Dec 10, 2015
This is a Chef bootstrap script for bootstrapping the Chef client on an Amazon Linux AMI instance. It has been tested with Amazon Linux v2012.09 (AMI ID ami-1624987f). See the first comment below for the detailed background.
View amazon-linux-omnibus.erb
bash -c '
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
exists() {
if command -v $1 &>/dev/null
return 0
return 1