Skip to content

Instantly share code, notes, and snippets.

@rikka0w0
rikka0w0 / pxe_tftp_openwrt.md
Last active September 13, 2024 17:58
PXE on OpenWrt with a different TFTP server

In this configuration, DHCP will run on the OpenWrt Box, while the TFTP server (the one serves the boot files) runs on a different computer.

1. Add to /etc/config/dhcp on OpenWrt Box

config boot linux
        option filename 'pxelinux.0'
        option serveraddress '192.168.?.?'
        option servername '?'
@mhelff
mhelff / flow.json
Last active December 14, 2020 10:07
Zigbee2mqtt Admin panel
[{"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"
@dglaude
dglaude / 1st_readme.txt
Last active September 17, 2024 13:19
Home Assistant Rainbow Loop with Ikea Tradfri RGB light
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
@GAS85
GAS85 / nextcloud_fail2ban.md
Last active September 29, 2024 10:00
Harden Nextcloud 17+ with Fail2Ban, GUI and WebDAV - Ubuntu 20.04

Fail2ban and Nextcloud

Prerequsits

  • Ubuntu 20.04
  • nextcloud, fail2ban and e.g. iptables are installed

Note

@sultanqasim
sultanqasim / zram.sh
Created June 21, 2016 02:41
ZRAM config for Raspberry Pi 3
#!/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