Skip to content

Instantly share code, notes, and snippets.

<?php
include 'functions.php';
include platformSlashes("lib/ccxt.php");
$allcoins = file_get_contents(platformSlashes('lib/data/coinlist.json'));
$coinList = json_decode($allcoins, true);
echo "debug...";
echo sizeof($config['api']). " keys found.<br/><br/>";
if(isset($config['api']) && sizeof($config['api'])>0){
foreach ($config['api'] as $key => $value) {
@bakman2
bakman2 / Dockerfile
Last active March 19, 2019 10:38
Node-RED docker with avahi
FROM nodered/node-red-docker:0.20.2
USER root
RUN apt-get update
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get -y install git python make g++ libavahi-compat-libdnssd-dev libnss-mdns dbus
RUN npm install node-red-node-discovery
COPY start.sh /
@bakman2
bakman2 / characteristics.json
Created July 28, 2019 10:46
Homekit characteristics object for reuse in Node-red
{
"homekit_services": [
{
"Name": "Name",
"service": "AirPurifier",
"characteristics": {
"Active": "0, 1 (active, inactive)",
"TargetAirPurifierState": "0,1 (manual, auto)",
"CurrentAirPurifierState": "0,1,2 (inactive, idle, purify air)",
"LockPhysicalControls": "0,1 (lock disabled, lock enabled)",
// Set ip address
ipaddress1 <ip>
ipaddress2 <gateway>
ipaddress3 <subnet>
ipaddress4 <dns>
// RF bridge Portisch with unknown but supported devices
rfraw 166
#!/bin/sh
. /etc.defaults/rc.subr
case $1 in
start)
/var/packages/debian-chroot/scripts/start-stop-status start
chroot /volume1/@appstore/debian-chroot/var/chroottarget service cron start
chroot /volume1/@appstore/debian-chroot/var/chroottarget service dnsmasq start
chroot /volume1/@appstore/debian-chroot/var/chroottarget service lighttpd start
@bakman2
bakman2 / README.md
Last active April 29, 2020 06:41
uibuilder - scaffolding

node-RED uibuilder - barebone examples

Create custom dashboard or web interfaces.

ref.: node-red-contrib-uibuilder

Examples include receive and send from/to node-RED.

  • Vanilla javascript version

Count distinct aggregate multiple repeating elements

{"payload":[
  {
    "count": "13",
    "name": "joep",
    "total": 1
  },
  {
@bakman2
bakman2 / octoprint.md
Last active December 29, 2023 19:31
Octoprint IP Camera

How to use Octoprint with an IP camera that has an RTSP stream available

Optional: For Wyze cam only

Install Dafang Hacks on the Wyze Cam.

Once running and all is functional, continue. Set video bitrate to 1500, VBR, 30fps.

Installation

PWM fan control in Linux with a Gigabyte Aorus motherboard

  • install lm-sensors with your package manager

sensors

If it won't show any fan/speed, continue

sensor-detect