Skip to content

Instantly share code, notes, and snippets.

View kylejohnson's full-sized avatar

Kyle Johnson kylejohnson

View GitHub Profile
@kylejohnson
kylejohnson / arduino_influx_udp.ino
Created February 6, 2021 02:27
Sending data to influxdb over UDP on an arduino
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
const char ssid[] = "fubaz";
const char pass[] = "fubar";
WiFiUDP udp;
void setup(){
Serial.begin(115200);
WiFi.begin(ssid, pass);
@kylejohnson
kylejohnson / pulse.ino
Last active February 15, 2021 16:56
Code for my pulse monitor
#include <SparkFun_Bio_Sensor_Hub_Library.h>
#include <Wire.h>
#include <SPI.h>
#if defined(ESP32)
#include <WiFi.h>
#elif defined(ESP8266)
#include <ESP8266WiFi.h>
#else
#error "Only ESP32 and ESP8266 are supported!"
#endif
server {
listen 80 default_server;
server_name _;
location = /health-check {
return 200;
access_log off;
}
location / {
#!/usr/bin/python3
import requests
import json
import re
import paho.mqtt.client as mqtt
import paho.mqtt.publish as publish
# Regex to match the hidden input on the initial log in page
#include <WiFi.h>
#include <ESPmDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include "DHT.h"
#include <PubSubClient.h>
#include <SimpleTimer.h> //https://github.com/jfturcot/SimpleTimer
//USER CONFIGURED SECTION START//
const char* ssid = "skynet_iot";
@kylejohnson
kylejohnson / hass.rb
Last active September 15, 2019 22:22
Ruby script utilizing bwa gem to communicat with Balboa spas. Sends results to influxdb.
#!/usr/bin/env ruby
require 'bwa/client'
require 'bwa/discovery'
require 'influxdb'
database = "udp"
name = 'environment'
time = (Time.now.to_r * 1000).to_i
time_precision = 'ms'
dmesg | tail -n6
[72625.588687] Fusion MPT base driver 3.04.20
[72625.588689] Copyright (c) 1999-2008 LSI Corporation
[72625.590276] Fusion MPT misc device (ioctl) driver 3.04.20
[72625.590319] mptctl: Registered with Fusion MPT base driver
[72625.590320] mptctl: /dev/mptctl @ (major,minor=10,220)
[72782.663520] Fusion MPT SAS Host driver 3.04.20
lspci -nn|grep -i scsi
1b:00.0 Serial Attached SCSI controller [0107]: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] [1000:0072] (rev 02)
dmesg|grep -i lsi
@kylejohnson
kylejohnson / process.md
Last active April 30, 2018 15:27
aptly staging -> production mirror promotion process

Initial Creation

  1. Create the xenial mirror, with all 4 comonents aptly -architectures="i386,amd64" mirror create xenial http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
  2. Update the repo to pull in the current package list aptly mirror update xenial
  3. Snapshot the current state of the xenial repo aptly snapshot create xenial-20180427 from mirror xenial
  4. Publish the 20180427 snapshot as staging aptly publish snapshot xenial-20180427 staging
  5. apt-get update &amp;&amp; apt-get upgrade the staging servers, and have QA test staging.
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
int val = 0; // moisture value
int soilPin = A0;
byte host[] = {192, 168, 11, 17}; //influxdb host
int port = 8089; //influxdb port
int soilPower = 5;//Variable for Soil moisture Power
int sleepTime = 1800;//seconds
#define WLAN_SSID "fu"
root@mail01:/var/solr/data/dovecot/conf# service solr stop
Jan 22 23:22:04 mail01.gnulnx.net solr[13975]: Sending stop command to Solr running on port 8983 ... waiting up to 180 seconds to allow Jetty process 32279 to stop gracefully.
Jan 22 23:24:14 mail01.gnulnx.net solr[13975]: java.net.ConnectException: Connection timed out (Connection timed out)
Jan 22 23:24:14 mail01.gnulnx.net solr[13975]: at java.net.PlainSocketImpl.socketConnect(Native Method)
Jan 22 23:24:14 mail01.gnulnx.net solr[13975]: at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
Jan 22 23:24:14 mail01.gnulnx.net solr[13975]: at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
Jan 22 23:24:14 mail01.gnulnx.net solr[13975]: at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
Jan 22 23:24:14 mail01.gnulnx.net solr[13975]: at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
Jan 22 23:24:14 mail01.gnulnx.n