Skip to content

Instantly share code, notes, and snippets.

View natcl's full-sized avatar

Nathanaël Lécaudé natcl

View GitHub Profile
@natcl
natcl / docker-compose.yaml
Created January 2, 2018 15:33
Docker Compose Syslog Example
version: '2'
services:
nodered:
image: nodered/node-red-docker:0.17.5
restart: always
environment:
- TZ=America/Montreal
logging:
driver: syslog
options:
@natcl
natcl / docker-compose.yaml
Created September 26, 2018 14:31
docker-compose static IP example
version: '3'
networks:
mynetwork:
ipam:
config:
- subnet: 172.20.0.0/24
services:
nodered1:
image: nodered/node-red-docker
ports:
@natcl
natcl / docker-compose.yaml
Last active February 1, 2024 15:02
traefik: node-red + mosquitto using letsencrypt
version: "3.3"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
command:
- "--api=true"
- "--api.dashboard=true"
@natcl
natcl / org.nodered.plist
Last active January 23, 2024 22:50
Node-Red launchd script
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.nodered.plist</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/node</string>
<string>/usr/local/bin/node-red</string>
/* OctoWS2811 BasicTest.ino - Basic RGB LED Test
Required Connections
--------------------
pin 2: LED Strip #1 OctoWS2811 drives 8 LED Strips.
pin 14: LED strip #2 All 8 are the same length.
pin 7: LED strip #3
pin 8: LED strip #4 A 100 ohm resistor should used
pin 6: LED strip #5 between each Teensy pin and the
@natcl
natcl / Node-RED_file_upload.json
Last active September 29, 2022 04:33
Node-RED file upload example with built-in http in node.
[
{
"id": "f1ffeb7e.f6451",
"type": "http in",
"z": "c29865fe.249648",
"name": "",
"url": "/upload",
"method": "get",
"upload": false,
"swaggerDoc": "",
@natcl
natcl / light_button_control.py
Last active November 16, 2021 14:59
Script to toggle my Philips Hue lights on and off using a Raspberry Pi and a button
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
This script toggles lights on and off using the phue library and a physical switch
It is started on boot in /etc/rc.local with this line:
python /home/pi/light_button_control/light_button_control.py &
'''
from time import sleep
@natcl
natcl / table
Created November 12, 2021 22:21
const dayToString = {
0: 'Sunday',
1: 'Monday',
2: 'Tuesday',
3: 'Wednesday',
4: 'Thursday',
5: 'Friday',
6: 'Saturday'
}
@natcl
natcl / ledPot.ino
Created February 12, 2021 01:39
ledPot
#include <Adafruit_NeoPixel.h>
#include <Bounce2.h>
#define LED_PIN 17
#define BUTTON_PIN 3
#define POT_PIN 14
#define NUM_LEDS 83
#define BRIGHTNESS 100
@natcl
natcl / Dockerfile
Last active January 30, 2021 21:08
Node-RED Docker ENV test
FROM ubuntu:16.04
RUN \
sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
apt-get update && \
apt-get -y upgrade && \
apt-get install -y build-essential curl && \
apt-get install -y software-properties-common && \
curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
apt-get install -y nodejs