摘要: 中间件的使用核心: Engine.Use(HandlerFunc) main文件中展示 func MyHandler() gin.HandlerFunc{ return func(c *gin.Context){ fmt.Println("MyHandler") } } func Handler(c 阅读全文
posted @ 2024-02-19 11:08 嘿十三 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 爬虫爬取网页图片《滕王阁序》文徵明 行草 python爬取网页图片 import urllib.request # python自带的爬操作url的库import re # 正则表达式def getImage(url): headers = { 'User-Agent': 'Mozilla/5.0(linux; android 6.0; N 阅读全文
posted @ 2023-09-14 17:46 嘿十三 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 原文出处 aiohttp 什么是 aiohttp?一个异步的 HTTP 客户端\服务端框架,基于 asyncio 的异步模块。可用于实现异步爬虫,更快于 requests 的同步爬虫。 安装 pip install aiohttp aiohttp 和 requests对比 requests 版爬虫 阅读全文
posted @ 2023-06-12 11:30 嘿十三 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 正则方式: 1.对文本进行排序,让重复行排在一起 2.使用正则表达式替换(注意) ^(.*?)$\s+?^(?=.*^\1$) 阅读全文
posted @ 2023-05-11 10:13 嘿十三 阅读(739) 评论(0) 推荐(0) 编辑
摘要: 原文 写完代码后,我们一般这样 git add . //添加所有文件 git commit -m "本功能全部完成" 执行完commit后,想撤回commit,怎么办? 这样凉拌: git reset --soft HEAD^ 这样就成功的撤销了你的commit 注意,仅仅是撤回commit操作,您 阅读全文
posted @ 2022-09-29 10:06 嘿十三 阅读(3273) 评论(0) 推荐(0) 编辑
摘要: 配置阿里云源 echo http://mirrors.aliyun.com/alpine/v3.15/main/ > /etc/apk/repositories && \ echo http://mirrors.aliyun.com/alpine/v3.15/community/ >> /etc/a 阅读全文
posted @ 2022-03-21 11:37 嘿十三 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 说明 宿主机需要安装Docker和Docker-compose创建3个容器: 主机名分别为host1、host2和ansible2.11 host1和host2安装python3.7、openssh server ansible安装openssh server、openssh client、ansi 阅读全文
posted @ 2022-03-18 16:54 嘿十三 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 脚本ssh-keygen新生成公钥私钥密钥对时,使用非交互式创建最好,用以下命令就可以ssh-keygen -t rsa -P "" -f /etc/ssh/ssh_host_rsa_key-P:私钥的密码,自动登录设置为空 阅读全文
posted @ 2022-03-18 16:42 嘿十三 阅读(311) 评论(0) 推荐(0) 编辑
摘要: alpine是比较小巧的镜像,占用存储空间小,更新apline源为阿里云的源提高更新速度 更新时要注意版本,3.10要对应3.10的源哦 Dockerfile写法: FROM alpine:3.10 RUN echo http://mirrors.aliyun.com/alpine/v3.10/ma 阅读全文
posted @ 2022-03-18 16:17 嘿十三 阅读(779) 评论(0) 推荐(0) 编辑
摘要: rsync命令 常用命令 rsync -zav z 压缩 a -topglrD v 显示过程 阅读全文
posted @ 2021-11-30 09:24 嘿十三 阅读(31) 评论(0) 推荐(0) 编辑