This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var r = require("rethinkdb"); | |
var Promise = require("bluebird"); | |
var fs = require("fs"); | |
var PushBullet = require('pushbullet'); | |
Promise.promisifyAll(fs); | |
fs.readFileAsync("token").then(function(val) { | |
PUSHER = new PushBullet(val.toString().trim()); | |
}) | |
.then(function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import rethinkdb as r | |
import time | |
import Adafruit_DHT | |
import datetime | |
import logging | |
import sys | |
logging.basicConfig( | |
level=logging.INFO, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install g++ protobuf-compiler libprotobuf-dev libboost-dev curl m4 wget | |
#At this point make sure you check to see that 2.0.4 is still the most recent version of RethinkDB! http://rethinkdb.com | |
wget http://download.rethinkdb.com/dist/rethinkdb-latest.tgz | |
tar xf rethinkdb-latest.tgz | |
rm rethinkdb-latest.tgz | |
cd rethinkdb-* | |
./configure --with-system-malloc --allow-fetch | |
#Export the proper C++ flags for Raspberry Pi 1/2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import rethinkdb as r | |
from datetime import datetime, timedelta | |
conn = r.connect("localhost", 28015, db="telemetry_pi") | |
## | |
#Finding the average temperature & humidity for the past 24 hours | |
## | |
day_ago = datetime.now() - timedelta(hours=24) | |
cursor = r.table("observations")\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
#Finding the hottest observations per day (or a _single_ maxima for each day) | |
## | |
r.db("telemetry_pi").table("observations").create_index | |
r.db('telemetry_pi').table("observations").group({index: "datetime"}).max("temp").ungroup()("reduction") | |
## | |
#Finding some basic statistics and calculating a simple linear regression (y_humidity = alpha + beta_temp * temp) | |
## | |
# https://en.wikipedia.org/wiki/Simple_linear_regression |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> | |
<channel> | |
<title>RethinkDB: the open-source database for the realtime web</title> | |
<description>News and updates from the RethinkDB team.</description> | |
<link>http://rethinkdb.com</link> | |
<atom:link href="http://rethinkdb.com/feed.xml" rel="self" type="application/rss+xml" /> | |
<item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:latest | |
RUN mkdir /root/.ssh/ | |
RUN touch /root/.ssh/known_hosts | |
RUN ssh-keyscan -T 60 github.com >> /root/.ssh/known_hosts | |
COPY autodeploy /root/.ssh/ | |
RUN curl -sL https://deb.nodesource.com/setup_5.x | bash - | |
RUN apt-get install --yes nodejs git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo echo deb http://repo.netbeez.net wheezy main >> /etc/apt/sources.list | |
sudo wget -O - http://repo.netbeez.net/netbeez_pub.key | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get install netbeez-agent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rethinkdb as r | |
import asyncio | |
r.set_loop_type("asyncio") | |
async def get_connection(): | |
return await r.connect("localhost", 28015) | |
async def changefeed_old(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that +dalanmiller is my blockchain ID. https://onename.com/dalanmiller |