跳至内容

萝莉控のIT世界

萝莉控有什么错!

标签: python

发布于2022-07-202022-07-21

python3 通过年月日获取准确的年龄

要做个防沉迷验证,需要精确判断0-8,8-16,16-18和18+的用户,单纯使用年份相减显得不太严谨

继续阅读“python3 通过年月日获取准确的年龄”

发布于2021-11-242021-11-24

PIP安装提示ERROR: Cannot uninstall ‘setuptools’.

正在做一些数据迁移, 结果某个脚本迁移过来过后, 缺少某个库, 果断pip install一下, 好家伙...直接提示ERROR: Cannot uninstall 'setuptools'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

继续阅读“PIP安装提示ERROR: Cannot uninstall ‘setuptools’.”

发布于2018-12-102018-12-14

debian ubuntu 假蜘蛛硬核过滤方法

这几天服务器带宽无缘无故升高了很多, 看了一眼nginx日志,发现有很多Baiduspider的请求,百度啥时候这么给力了?

随即在nginx配置中过滤掉了所有带有Baiduspider字样UA的请求,带宽瞬间降低

怀疑网站遭受了伪装成爬虫的CC攻击
继续阅读“debian ubuntu 假蜘蛛硬核过滤方法”

00:00/00:00