Skip to content

Instantly share code, notes, and snippets.

View daxingplay's full-sized avatar

橘子 daxingplay

View GitHub Profile
@daxingplay
daxingplay / ros_custom_gateway.md
Last active February 16, 2023 02:06
RouterOS 转发内网客户端流量到网关

  1. 假设单独网关的 IP 为 10.20.31.1
  2. RouterOS 建立 Address List, 下文中 10.20.30.145 为内网客户端 IP
/ip firewall address-list
add address=10.20.30.145 list=gateway
  1. DNS 劫持,Address List 里的客户端解析强制使用 198.18.0.2 解析
@daxingplay
daxingplay / Domoticz.lua
Created January 3, 2018 17:01
NodeMCU 空气质量传感器
--By pufand
function initWIFI()
print("Setting up WIFI...")
wifi.setmode(wifi.STATION)
wifi.sta.config("<你无线路由器的SSID号>", "<你无线路由器的密码>")
wifi.sta.connect()
tmr.alarm(1, 1000, 1,
function()
if wifi.sta.getip()== nil then
print("IP unavailable, Waiting...")