Skip to content

Instantly share code, notes, and snippets.

View empi89's full-sized avatar
🎯
Focusing

Peter Hansen empi89

🎯
Focusing
View GitHub Profile
#include <SPI.h>
#include <PubSubClient.h>
#include <Ethernet.h>
#define DEBUG
#ifdef DEBUG
#define DEBUG_PRINT(x) Serial.println (x)
#else
#define DEBUG_PRINT(x)
#include <SPI.h>
#include <PubSubClient.h>
#include <Ethernet.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define DEBUG
#ifdef DEBUG
#define DEBUG_PRINT(x) Serial.println (x)
@empi89
empi89 / mqtt.py
Created June 12, 2016 13:34
Send 1-wire temperatures to mqtt
#!/usr/bin/env python
import time
import paho.mqtt.client as mqtt
publishing_period = 1000
mqtt_host = "XXX"
def read_temperature(device_id):
### Keybase proof
I hereby claim:
* I am empi89 on github.
* I am empi89 (https://keybase.io/empi89) on keybase.
* I have a public key whose fingerprint is C3ED D3E9 3ECB 54FD E723 5A05 DD81 7FF8 14BE 9E4F
To claim this, I am signing this object:
@empi89
empi89 / import.php
Last active February 7, 2018 22:30
FHEM filelog to dblog mysql migration
<?php
/**
* Script for migrating existing FileLog logfiles to the history database table.
*
* Howto:
* 1. Setup DbLog database tables and setup logging to database.
* 2. Wait until your devices are listed in the current-table of the database.
* 3. edit mysql username/password/database in this script
* 4. php <scriptname> <path_to_logfile>
*
@empi89
empi89 / rabbitmq.log
Created May 3, 2013 10:04
Rabbitmq logfile
=INFO REPORT==== 3-May-2013::09:56:46 ===
accepting AMQP connection <0.2649.0> (127.0.0.1:49169 -> 127.0.0.1:5672)
=ERROR REPORT==== 3-May-2013::09:56:46 ===
** Generic server <0.2653.0> terminating
** Last message in was {limit_prefetch,1,1}
** When Server state == {lim,1,<0.2654.0>,false,[],0}
** Reason for termination ==
** {{badmatch,false},
[{rabbit_limiter,handle_call,3},