Skip to content

Instantly share code, notes, and snippets.

View kylejohnson's full-sized avatar

Kyle Johnson kylejohnson

View GitHub Profile
#!/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
@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
@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);
server {
listen 80 default_server;
server_name _;
location = /health-check {
return 200;
access_log off;
}
location / {
#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'
@kylejohnson
kylejohnson / default
Last active September 12, 2019 22:59
Ubuntu 16.04.1 ZoneMinder Source Install
server {
listen 80 default_server;
server_name _;
root /var/www/zm;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
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 / README.md
Last active December 6, 2018 21:22
pianobar widget for Dashing.

Preview

Pianobar Widget Preview

Description

Displays the currently playing song from pianobar, a CLI client for pandora.com

Dependencies

Your system ruby must have the following gems installed: net/http, json and uri.

@kylejohnson
kylejohnson / freebsd_bhyve.md
Last active July 7, 2018 21:16
Quick instructions for setting up an Ubuntu VM on a FreeBSD host with the bhyve hypervisor using the vm-bhyve tool.
  1. Edit /etc/rc.conf
cloned_interfaces="bridge0 tap0 tap1 tap2 lagg0"
ifconfig_bridge0="addm lagg0 addm tap0 addm tap1 addm tap2"
vm_list="unifi zm1 grafana"
  1. Create a tap for grafana, and add it to the bridge.
ifconfig tap2 create