Skip to content

Instantly share code, notes, and snippets.

View obiltschnig's full-sized avatar
👨‍💻
I may be slow to respond.

Günter Obiltschnig obiltschnig

👨‍💻
I may be slow to respond.
View GitHub Profile
@obiltschnig
obiltschnig / DocumentDB.cpp
Last active February 13, 2017 19:59
Connecting to an Azure DocumentDB instance with Poco::MongoDB (requires POCO release 1.7.8 or newer)
#include "Poco/MongoDB/Connection.h"
#include "Poco/MongoDB/Database.h"
#include "Poco/Net/SecureStreamSocket.h"
#include "Poco/Net/Context.h"
#include "Poco/Net/PrivateKeyPassphraseHandler.h"
#include "Poco/Net/AcceptCertificateHandler.h"
#include "Poco/Net/SSLManager.h"
#include "Poco/SharedPtr.h"
// ...

Individual Contributor License Agreement ("Agreement")

Thank you for your interest in tha macchina.io Open Source Project (the "Project"). In order to clarify the intellectual property license granted with Contributions from any person or entity, Applied Informatics Software Engineering GmbH, the "Project Owner", must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the Project, its users and the Project Owner; it does not

Keybase proof

I hereby claim:

  • I am obiltschnig on github.
  • I am obiltschnig (https://keybase.io/obiltschnig) on keybase.
  • I have a public key ASBdqdjouyNkhCEhVUj3587fwAYxRkumrYwzfqhfWQDoDgo

To claim this, I am signing this object:

@obiltschnig
obiltschnig / MacchinaSensorsToThingSpeak.js
Last active March 8, 2019 11:28
Sending sensor data to ThingSpeak from macchina.io (now with outlier detection).
var net = require('net');
var sensors = [
{
name: 'temperature',
id: 'io.macchina.bluePillar.temperature#lamp1',
sensor: null,
validRange: { min: -40, max: 50 }
},
{
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char* argv[])
#include <memory>
#include <iostream>
struct Acceleration
{
float x;
float y;
float z;
};
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char* argv[])
#include <Poco/Net/HTTPRequest.h>
#include <Poco/Net/HTTPResponse.h>
#include <Poco/Net/HTTPClientSession.h>
#include <Poco/StreamCopier.h>
#include <Poco/Net/HTTPCredentials.h>
#include <sstream>
#include <iostream>
using namespace Poco::Net;
@obiltschnig
obiltschnig / mijia.js
Created July 16, 2020 16:03
Access Xiaomi Mijia Temperature/Humidity Sensor via Bluetooth LE (macchina.io)
var sensorRef = serviceRegistry.findByName('io.macchina.btle.peripheral.58:2D:34:35:D7:1D');
var sensor = sensorRef.instance();
const CHAR_BATTERY_LEVEL = 0x0018; // characteristic for reading battery level (0-99)
const CHAR_NOTIFICATION = 0x0010; // characteristic for enabling temperature/humidity notifications
console.log('connecting...');
function parseValue(str)
{
//
// SAXParser.cpp
//
// This sample demonstrates the SAXParser class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//