kevin

kevin

18 posts published

OpenWrt在场侦测

OpenWrt: 192.168.1.1Clients: A, B, C ……首先安装必要的软件包,并且允许匿名访问API ubus call hostapd.wlan0 get_clients opkg install uhttpd-mod-ubus jq vi /usr/share/rpcd/acl.d/unauthenticated.json service rpcd restart service uhttpd restart{ "unauthenticated": { "description": "Access controls for unauthenticated requests", "read": { "ubus": { "session": [ "access", "login" ], "hostapd.*": [ "get_clients" ] } } } }用下面的命令侦测某个设备是否在场

frp反向代理

近日,在网上找到了免费的frp服务,可以把家里的树莓派挂到网上。 首先,解释一下这两个名词: 正向代理: Client -> Proxy -> Server      你在监狱里服刑,没办法直接去厂家买东西,需要有关系的狱友带货       (狱友就是你的“正向代理“) 反向代理: Client -> Proxy <- Server      监狱里开个小卖部,厂家发货到小卖部,你直接去买即可      (小卖部就是厂家的“反向代理“) 从frp项目的releases页面下载并解压获取到frpc二进制程序,然后再写2个配置文件: /usr/local/bin └── frpc (解压缩后去获取) /etc/frp └── us.ini (见下面) /etc/systemd/system └── frpc@.service (见下面)# /etc/

Linksys在场侦测

如果你家里刚好使用了Linksys的路由器,那么就可以使用下面的方法获取在线设备了。娃哈哈哈! #/bin/bash IPADDR=192.168.1.1 PASSWD=secret ACTION=devicelist/GetDevices curl -s -H 'Content-Type: application/json' -H "X-JNAP-Authorization: Basic $(echo -n "admin:$PASSWD" | base64)" -H "X-JNAP-Action: http://linksys.com/jnap/$ACTION" http://$IPADDR/JNAP/ -d '{}' | jq -r '.output.devices[]|select(.connections!=[]).friendlyName'

热搜爬虫

准备工作$ npm install puppeteer-core两种使用方式: 本地: puppeteer.launch()远程: puppeteer.connct()微博爬虫const fs = require('fs/promises'); const puppeteer = require('puppeteer-core'); (async () => { const browser = await puppeteer.launch({ headless: true, executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', args: ['--disable-notifications'] }); const [page] = await browser.pages(); const [textbox] = await Promise.all(

如何端口转发

iptablerinetdsocat假设有个第三方服务端(server)/客服端(client),它们只支持本地(127.0.0.1:10011)连接。通过socat就可以实现物理上的分离,如下所示: BEFORE ====== IP:x.x.x.x +--------+ | server | | | | | client | +--------+ AFTER ===== IP:x.x.x.x IP:y.y.y.y +--------+ +--------+ | server | +---|---+ | | | | | | | | | +----|---+ | client | +--------+ +--------+暴露本地端口: [Unit] Description=Socat Service Documentation=