Skip to content

Instantly share code, notes, and snippets.

View davidsulpy's full-sized avatar

David Sulpy davidsulpy

View GitHub Profile
@davidsulpy
davidsulpy / gist:2696550
Last active October 4, 2015 20:47
Immutable Password
class Password
{
readonly string unencryptedPassword;
Password(string unencryptedPassword)
{
unencryptedPassword = unencryptedPassword;
}
}
@davidsulpy
davidsulpy / packer debug output
Created June 5, 2014 19:02
Packer waits eternally on creating temporary keypair
packer build example-pack.json
2014/06/04 16:42:36 Packer Version: 0.6.0 12e28f257f66299e3bb13a053bf06ccd236e7efd
2014/06/04 16:42:36 Packer Target OS/Arch: darwin amd64
2014/06/04 16:42:36 Built with Go Version: go1.2
2014/06/04 16:42:36 Detected home directory from env var: /Users/redact
2014/06/04 16:42:36 Attempting to open config file: /Users/redact/.packerconfig
2014/06/04 16:42:36 File doesn't exist, but doesn't need to. Ignoring.
2014/06/04 16:42:36 Packer config: &{PluginMinPort:0 PluginMaxPort:0 Builders:map[docker:packer-builder-docker openstack:packer-builder-openstack virtualbox-iso:packer-builder-virtualbox-iso googlecompute:packer-builder-googlecompute qemu:packer-builder-qemu vmware-vmx:packer-builder-vmware-vmx parallels-iso:packer-builder-parallels-iso null:packer-builder-null amazon-ebs:packer-builder-amazon-ebs amazon-chroot:packer-builder-amazon-chroot virtualbox-ovf:packer-builder-virtualbox-ovf vmware-iso:packer-builder-vmware-iso amazon-instance:packer-builder-amazon-instance digitalo
@davidsulpy
davidsulpy / flowthings_drop.json
Last active October 30, 2015 20:10
Flowthings Drop
{
"sensor": {
"type": "map",
"value": {
"luminiscence": {
"type": "integer",
"value": 77
},
"ultraviolet": {
"type": "integer",
// Copyright (c) 2015 Initial State Technologies, Inc.
// This file is licensed under the MIT License
// http://opensource.org/licenses/MIT
class InitialState {
static _baseUrl = "https://groker.initialstate.com/api/";
static _apiVersion = "~0";
_bucketKey = null;
_accessKey = null;
_bucketName = null;
isstreamer.ini
@davidsulpy
davidsulpy / postBucket Function.ino
Last active July 19, 2016 15:56
postBucket() function for >4 sensors
void postBucket()
{
Process isstreamer;
String newjson;
newjson="https://groker.initialstate.com/api/events?accessKey="+accessKey+"&bucketKey="+bucketKey;
newjson+= "&Sensor 1="+sensor_data[0];
newjson+= "&Sensor 2="+sensor_data[1];
isstreamer.begin("curl");
isstreamer.addParameter(newjson);
@davidsulpy
davidsulpy / parameterized sensor values curl example
Created July 19, 2016 15:57
Example of using url parameters to send sensor values to Initial State through curl command
curl https://groker.initialstate.com/api/events?accessKey=SOME_ACCESS_KEY&bucketKey=SOME_BUCKET_KEY&sensor1=1&sensor2=2&sensor3=3
@davidsulpy
davidsulpy / weather-forecaster.js
Created July 22, 2016 14:23
An AWS Lambda function for getting data from the Wunderground API and sending it to an Initial State bucket
'use strict';
let https = require('https'),
http = require('http');
const ISAccessKey = 'INITIALSTATE_ACCESS_KEY',
ISBucketKey = 'INITIALSTATE_BUCKET_KEY',
WundergroundApiKey = 'WUNDERGROUND_API_KEY',
WundergroundCity = 'Nashville',
WundergroundState = 'TN';
/*
Web client
This sketch sends an event to Initial State (http://insecure-groker.initialstate.com)
using an Arduino Wiznet Ethernet shield.
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
created 18 Dec 2009
@davidsulpy
davidsulpy / sam.yaml
Last active May 10, 2017 13:03
SAM template for a Mining Monitoring
# # # # # # # # # # # # # # # # # # # # # # # # # #
# Leagl stuff. Because, lawyers.
#
# Copyright (c) 2017 David Sulpy
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: