Skip to content

Instantly share code, notes, and snippets.

View kacole2's full-sized avatar

Kendrick Coleman kacole2

View GitHub Profile
@kacole2
kacole2 / aws.md
Last active August 7, 2016 12:53
REX-Ray v0.3.3 with EBS

on your EC2 instance, install REX-Ray using:

$ curl -sSL https://dl.bintray.com/emccode/rexray/install | sh -s -- stable 0.3.3

REX-Ray is installed. Create a new configuration file and add the following contents:

$ sudo vi /etc/rexray/config.yml
@kacole2
kacole2 / VirtualContactSensor.device.groovy
Created February 22, 2016 02:44
VirtualContactSensor.device.groovy for each device
/**
* Virtual Contact Sensor Device Type - VirtualContactSensor.device.groovy
*
* Copyright 2014 Daniel Ogorchock
*
* 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
*
@kacole2
kacole2 / ST_Anything_Doors_Multiplexer.smartapp.groovy
Created February 22, 2016 02:35
ST_Anything_Doors_Multiplexer.smartapp.groovy (SmartApp)
/**
* ST_Anything Doors Multiplexer - ST_Anything_Doors_Multiplexer.smartapp.groovy
*
* Copyright 2015 Daniel Ogorchock
*
* 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
*
@kacole2
kacole2 / ST_Anything_Doors.device.groovy
Last active February 22, 2016 02:13
ST_Anything_Doors.device.groovy (New Device Handler)
/**
* ST_Anything_Doors Device Type - ST_Anything_Doors.device.groovy
*
* Copyright 2015 Daniel Ogorchock
*
* 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
*
@kacole2
kacole2 / ST_Anything_Doors.ino
Created February 22, 2016 00:55
ST_Anything_Doors.ino Simple Example (Arduino Sketch Code)
//******************************************************************************************
// File: ST_Anything_Doors.ino
// Authors: Dan G Ogorchock & Daniel J Ogorchock (Father and Son)
//
// Summary: This Arduino Sketch, along with the ST_Anything library and the revised SmartThings
// library, demonstrates the ability of one Arduino + SmartThings Shield to
// implement a multi input/output custom device for integration into SmartThings.
// The ST_Anything library takes care of all of the work to schedule device updates
// as well as all communications with the SmartThings Shield.
//
@kacole2
kacole2 / ST_Anything_Doors.device.groovy
Last active February 21, 2016 20:23
ST_Anything_Door Contact Sensors
/**
* ST_Anything_Doors Device Type - ST_Anything_Doors.device.groovy
*
* Copyright 2015 Daniel Ogorchock
*
* 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
*
@kacole2
kacole2 / docker-machine_rexray_auto-install.sh
Created January 9, 2016 18:48
Install REX-Ray on Multiple Hosts Created With Docker Machine
#!/bin/bash
# Read more about REX-Ray storage persistance:
# https://github.com/emccode/rexray
# change the filter and grep to anything you want to search for.
# This example shows searching for the name of machines beginning with "dev"
# You can sort by driver or swarm instance, just change the awk column as well
ALLHOSTS=$(docker-machine ls --filter name=dev* | grep dev* | awk '{print $1}')
@kacole2
kacole2 / directions.md
Last active December 29, 2015 07:12
RackHD Docker Installation WIP

RackHD Docker Installation WIP

This assumes you have a machine available, created with Docker Machine and VirtualBox

Create the docker images

Go into each folder with the Dockerfile and create the image. ie cd on-tftp.

Create the image with the tag:

  1. docker build -t rackhd/on-tftp .
@kacole2
kacole2 / .travis.yml
Created December 10, 2015 00:39
Travis CI to update websites via FTP by thinking it's a Node.js app
language: node_js
node_js:
- "0.11"
# whitelist
branches:
only:
- master
env:
global:
- secure: h6i/QFDLprVJe7u/ZT...
@kacole2
kacole2 / beers.go
Created August 19, 2015 18:30
random number generator used to choose beers at Chuck's Hop Shop in Seattle
package main
import (
"fmt"
"math/rand"
"time"
)
func random(min, max int) int {
rand.Seed(time.Now().Unix())