Skip to content

Instantly share code, notes, and snippets.

View binarybucks's full-sized avatar

Alexander Klautke binarybucks

View GitHub Profile
#include <Homie.h>
#include "RCSwitch.h"
#define MAX_STRING_LEN 25
RCSwitch mySwitch = RCSwitch();
int transmitPort = D0;
String pad(String input, int len)
object Host "me.owntracks.alr.st" {
import "owntracks-host"
}
object Host "5s.owntracks.alr.st" {
import "owntracks-host"
}
object Host "sm.owntracks.alr.st" {
import "owntracks-host"
@binarybucks
binarybucks / gist:fa32b0988aa7e209a9ee
Last active April 9, 2016 15:54
Particle Photon HTU21D temperature/humidity sensor readings to MQTT
// This #include statement was automatically added by the Particle IDE.
#include "MQTT/MQTT.h"
#include "HTU21D/HTU21D.h"
int mqtt_port = 1883;
byte mqtt_host[] = { 192,168,1,4 };
String device_id = System.deviceID();
String mqtt_topic_temp = "sensors/"+ device_id + "/temp";
String mqtt_topic_humidty = "sensors/" + device_id + "/humidity";
@binarybucks
binarybucks / gist:e6c7d42ecbeecbcc1a25
Created June 13, 2015 14:39
Nginx TLS vHost config
server {
listen 443 default_server ssl;
server_name CHANGEME
server_tokens off;
ssl_certificate CHANGEME.crt;
ssl_certificate_key CHANGEME.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:ssl_session_cache:10m;
@binarybucks
binarybucks / gist:3e30b0a487a5f1efbedf
Created September 14, 2014 16:24
little page to return current ip and user agent
<?php
if ($_SERVER["HTTP_X_FORWARDED_FOR"] != "") {
$IP = $_SERVER["HTTP_X_FORWARDED_FOR"];
$host = @gethostbyaddr($_SERVER["HTTP_X_FORWARDED_FOR"]);
} else {
$IP = $_SERVER["REMOTE_ADDR"];
$host = @gethostbyaddr($_SERVER["REMOTE_ADDR"]);
}
header('Content-Type: application/json');
@binarybucks
binarybucks / gist:11408227
Last active August 29, 2015 14:00
Owntracks remote commands

Dump command

alexander@newton ~ > mosquitto_pub -h localhost -t "owntracks/bucks/nexus" -m '{"_type":"cmd", "action":"dump"}'
alexander@newton ~ > mosquitto_sub -h localhost -t "#" | json -ga
{
  "_type": "cmd",
  "action": "dump"
}

Keybase proof

I hereby claim:

  • I am binarybucks on github.
  • I am binarybucks (https://keybase.io/binarybucks) on keybase.
  • I have a public key whose fingerprint is 5D27 1E8D B52A D2C1 7025 F888 8602 3E39 E680 F5BC

To claim this, I am signing this object:

@binarybucks
binarybucks / gist:5712220
Last active December 18, 2015 02:39
Mosquitto PKGBUILD
# This is the PKGBUILD for mosquitto, an MQTT broker and example clients
# Maintainer: Alexander Rust <mail at alr dot st>
# Contributor: Dan Anderson <dan-anderson at cox dptnet>
pkgname=mosquitto
pkgver=1.1.3
pkgrel=3
pkgdesc="An Open Source MQTT v3.1 Broker"
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h')
url="http://mosquitto.org/"
define Timer {
tag : '',
date: undefined,
constructor : function(tag, date){
this.tag = tag;
this.date = date;
}
}
rule rulename {
Process: Osfoora [11072]
Path: /Applications/Osfoora.app/Contents/MacOS/Osfoora
Identifier: osfoora.osfooramac
Version: 1.3 (06)
App Item ID: 502401238
App External ID: 11808934
Code Type: X86-64 (Native)
Parent Process: launchd [144]
User ID: 501