- Ubuntu 20.04
- nextcloud, fail2ban and e.g. iptables are installed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Raspberry Pi ZRAM script | |
# Tuned for quad core, 1 GB RAM models | |
# put me in /etc/init.d/zram.sh and make me executable | |
# then run "sudo update-rc.d zram.sh defaults" | |
modprobe zram | |
echo 3 >/sys/devices/virtual/block/zram0/max_comp_streams | |
echo lz4 >/sys/devices/virtual/block/zram0/comp_algorithm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Please find below the various piece of code that together control my RGB light to loop in Rainbow. | |
Every two seconds, it change from one colour to another based on the value of the second. | |
So it compute 30 differents RGB value in a "circle", all with the same Saturation and Brightness both forced to 1.0 | |
The transition from one colour to another is done in one seconds. | |
The name of my Tradfri RGB light bulb is "light.couleur" | |
A link to my video on Twitter: | |
https://twitter.com/DavidGlaude/status/1059596285991366657 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":"1112a3ea.54efdc","type":"tab","label":"Z2M Admin","disabled":false,"info":""},{"id":"fe321b77.50b858","type":"function","z":"1112a3ea.54efdc","name":"Format Data","func":"var groupname = msg.groupname;\nvar device = flow.get('device');\n\nif (typeof groupname !== undefined && typeof device !== undefined) {\n var action = \"Adding \";\n var what = \" to group \";\n if(msg.payload == \"remove\") {\n action = \"Removing \";\n what = \" from group \";\n }\nvar msg1 = { payload: device, topic: \"zigbee2mqtt/bridge/group/\" + groupname + \"/\" + msg.payload};\nvar msg2 = { payload: action + \" \" + device + what + groupname };\n\nreturn [msg1, msg2];\n}","outputs":2,"noerr":0,"x":770,"y":1980,"wires":[["67f130eb.efef3","f10dea4c.a81728"],["89490386.cf438"]]},{"id":"89490386.cf438","type":"ui_toast","z":"1112a3ea.54efdc","position":"top right","displayTime":"5","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"System Notification","name":"","x":920,"y":2020,"wires":[]},{"id" |