2022年4月

nginx自动屏蔽不友好的ip

查看nginx日志的时候发现大量的404302尝试访问不存在的资源,大概率是使用工具扫描。

{"connection": "2572288","pid": "176228","request_id": "7d5dcaac3e4be47a536a4a0d1b5c7abb","request_length": "157","remote_addr": "52.170.115.255","time_local": "08/Apr/2022:17:44:50 +0800","status":"302","host":"fengqi.me","uri":"/Panels.txt","server":"fengqi.me","port":"443","protocol":"HTTP/1.1","request_uri":"/Panels.txt","args": "","scheme": "https","request_time": "0.000","request_method":"GET","http_referrer":"","body_bytes_sent":"138","http_x_forwarded_for":"","http_user_agent":"python-requests/2.27.1","upstream_response_time":""}
{"connection": "2572337","pid": "176261","request_id": "cf56fa6708c4b68d1b8e3b4d7871103c","request_length": "150","remote_addr": "52.170.115.255","time_local": "08/Apr/2022:17:45:09 +0800","status":"302","host":"fengqi.me","uri":"/Panels.txt","server":"fengqi.me","port":"443","protocol":"HTTP/1.1","request_uri":"/Panels.txt","args": "","scheme": "https","request_time": "0.000","request_method":"GET","http_referrer":"","body_bytes_sent":"146","http_x_forwarded_for":"","http_user_agent":"python-requests/2.27.1","upstream_response_time":""}
{"connection": "2186500","pid": "164519","request_id": "aa21defaa0a590422420732b52c58f83","request_length": "253","remote_addr": "13.93.105.179","time_local": "08/Apr/2022:16:18:21 +0800","status":"302","host":"fengqi.me","uri":"/new-index.php","server":"fengqi.me","port":"443","protocol":"HTTP/1.1","request_uri":"/new-index.php","args": "","scheme": "https","request_time": "0.000","request_method":"GET","http_referrer":"","body_bytes_sent":"138","http_x_forwarded_for":"","http_user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36","upstream_response_time":""}

正常用户不会这么访问,所以基本上一个ip重复来这么几次就是有问题的,写个脚本,定时扫描nginxaccess.log统计出频繁的ip,然后干掉。

- 阅读剩余部分 -

我通过自制的Kodi命令行刮削器申请到了JetBrains的开源许可证

项目地址

Kodi 刮削器命令行版本,使用TMDB数据源

更早的起源

2021年的双十一我在京东购买了索尼的X91J 65英寸版本,同时幸运的使用了那个2000的特殊优惠券,感谢京东没有回收这个羊毛。

电视安装完成后,我开始着手构建自己的影音环境,在此之前,我是通过PT下载到NAS,然后电脑+2.0音箱播放,没有刮削,这之后我会转移到电视上来。

索尼电视使用的是和当贝合作的Android系统国内特供版,不过也允许用户随意的安装第三方应用,我进行了大量的尝试,最后只保留了Bilibili、Kodi、SmartTubeNext、Netflix、Aptoide这几个应用。

其中Kodi用来管理我从网络下载的电影和剧集,提供海报墙,观看进度跟踪,因为Kodi自带的刮削器不能满足我的需求,tinyMediaManager等半自动又太麻烦,所以我决定自制刮削器。

- 阅读剩余部分 -