Skip to content

Instantly share code, notes, and snippets.

@davidsulpy
davidsulpy / sam.yaml
Created June 21, 2018 15:49
Code Pieces for 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:
@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:
/*
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 / 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';
@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 / 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);
// 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 / flowthings_drop.json
Last active October 30, 2015 20:10
Flowthings Drop
{
"sensor": {
"type": "map",
"value": {
"luminiscence": {
"type": "integer",
"value": 77
},
"ultraviolet": {
"type": "integer",
@davidsulpy
davidsulpy / gist:2696550
Last active October 4, 2015 20:47
Immutable Password
class Password
{
readonly string unencryptedPassword;
Password(string unencryptedPassword)
{
unencryptedPassword = unencryptedPassword;
}
}