Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!
openssl genrsa -des3 -out rootCA.key 4096
//#include <DHT.h> | |
#include <MySQL_Connection.h> | |
#include <MySQL_Cursor.h> | |
#include <ESP8266WiFi.h> | |
#include <WiFiClient.h> | |
#define sensorPin1 0 | |
//#define sensorPin2 D2 | |
//#define typeDHT DHT11 |
//REMOVE WHITESPACES FROM STRING IN ARDUINO | |
String message = "\n\tThis is one messed-up string \r\n"; | |
message.trim(); | |
/* | |
trim() | |
Description : Get a version of the String with any leading and trailing whitespace removed. | |
As of 1.0, trim() modifies the string in place rather than returning a new one. | |
Syntax : string.trim() |
/* | |
OTA update over HTTPS | |
As an example, we download and install ESP8266Basic firmware from github. | |
Requires latest git version of the core (November 17, 2015) | |
Created by Ivan Grokhotkov, 2015. | |
This example is in public domain. | |
*/ |
#include <stdio.h> | |
int movingAvg(int *ptrArrNumbers, long *ptrSum, int pos, int len, int nextNum) | |
{ | |
//Subtract the oldest number from the prev sum, add the new number | |
*ptrSum = *ptrSum - ptrArrNumbers[pos] + nextNum; | |
//Assign the nextNum to the position in the array | |
ptrArrNumbers[pos] = nextNum; | |
//return the average | |
return *ptrSum / len; |
// From http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/ | |
// Start with a temperature, in Kelvin, somewhere between 1000 and 40000. (Other values may work, | |
// but I can't make any promises about the quality of the algorithm's estimates above 40000 K.) | |
function colorTemperatureToRGB(kelvin){ | |
var temp = kelvin / 100; |
#! /usr/bin/python | |
# a simple tcp server | |
import socket,os | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.bind(('127.0.0.1', 12345)) | |
sock.listen(5) | |
while True: | |
connection,address = sock.accept() | |
buf = connection.recv(1024) | |
print buf |