Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ridingintraffic on github.
  • I am ridingintraffic (https://keybase.io/ridingintraffic) on keybase.
  • I have a public key whose fingerprint is B373 055B 724E C1BA 92BA D90A 4481 E6C9 4946 E550

To claim this, I am signing this object:

#include <RCSwitch.h>
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiClient.h>
#include <ESP8266HTTPClient.h>
#include <PubSubClient.h>
RCSwitch mySwitch = RCSwitch();
module.exports = function (req, res, next) {
var userName = req.body.user_name;
var words = req.body.text;
var channel = req.body.channel_name;
var trigger = req.body.trigger_word;
var mqtt = require('mqtt')
var client = mqtt.connect('mqtt:111.22.33.44')
var botPayload
var words = words.toLowerCase();
var splunkBunyan = require("../index");
Splunk Blog about arduino and http collectors:
http://blogs.splunk.com/2015/10/23/splunking-sensor-data-with-arduino-and-http-event-collector/
Splunk docker logging driver
https://docs.docker.com/engine/admin/logging/splunk/
http://blogs.splunk.com/2015/12/16/splunk-logging-driver-for-docker/
Arduino Huzzah esp8266 microcontrollers with embedded wifi
https://www.adafruit.com/products/2471
/*
RF_Sniffer
Hacked from http://code.google.com/p/rc-switch/
by @justy to provide a handy RF code sniffer
*/
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
- name: "Set up authorized_keys for the root user"
hosts: pi
user: pi
tasks:
- name: Create new ssh key-pair
local_action: command ssh-keygen -t rsa -N "" -q -f ~/test/id_rsa
@ridingintraffic
ridingintraffic / emu.py
Last active October 5, 2018 01:37
rainforest automation python script
#!/usr/bin/env python
from raven import raven
from raven import _version
import argparse
import logging as log
from splunk_hec_handler import SplunkHecHandler
#splunk hec collector info
token = "<your splunk token>"
splunkhost="<your splunk ip>"
[Unit]
Description=emu power
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/home/pi/emu.py
[Service]
WorkingDirectory=/home/pi
User=pi
{
event: {
demand: 0.882
divisor: 1000
multiplier: 1
raw_demand: 882
timestamp: 2018-10-04T23:30:49Z
}
host: gate
index: default
chmod +x /home/pi/emu.py # setting the python script to executable
cp emu.service /etc/systemd/system # copy the service template
sudo systemctl daemon-reload # systemd refresh the system folder for templates
sudo systemctl enable emu.service # install and enable the service
sudo systemctl start emu.service # start it up!
sudo systemctl status emu # did it work?