上一页 1 2 3 4 5 6 7 8 ··· 55 下一页

2023年4月16日

docker 容器访问宿主redis和mongo配置

摘要: 容器内:host.docker.internal 相当于宿主机器:127.0.0.1 阅读全文

posted @ 2023-04-16 21:04 星河赵 阅读(143) 评论(0) 推荐(0) 编辑

2023年2月27日

ubuntu中更新安装node.js

摘要: sudo apt update #下载Ubuntu下的nodejs sudo apt install nodejs #安装新版的node 和npm sudo apt-get install curl curl -sL https://deb.nodesource.com/setup_18.x | s 阅读全文

posted @ 2023-02-27 14:50 星河赵 阅读(99) 评论(0) 推荐(0) 编辑

2023年2月24日

Ubuntu20.04如何更换国内源

摘要: 1.打开终端。 2.输入以下命令备份原来的源。 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak 3.再输入以下命令打开sources.list配置文件更换源。 sudo vim /etc/apt/sources.list 配置内容如下 阅读全文

posted @ 2023-02-24 10:27 星河赵 阅读(7999) 评论(0) 推荐(0) 编辑

2023年2月23日

docker 操作笔记

摘要: 1.Docker 创建ubuntu系统更换 apt-get源 创建Dockerfile并且更新apt源 在Dockerfile中添加如下两句代码: RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.li 阅读全文

posted @ 2023-02-23 18:05 星河赵 阅读(91) 评论(0) 推荐(0) 编辑

2023年2月11日

Python 使用grequests发送并发请求

摘要: Python requests 并发请求 requests是Python发送接口请求非常好用的一个三方库,由K神编写,简单,方便上手快。但是requests发送请求是串行的,即阻塞的。发送完一条请求才能发送另一条请求。为了提升测试效率,一般我们需要并行发送请求。这里可以使用多线程,或者协程,geve 阅读全文

posted @ 2023-02-11 21:22 星河赵 阅读(151) 评论(0) 推荐(0) 编辑

2023年2月6日

Python requests.Session 协程 下载文件

摘要: Python requests.Session 协程 下载文件 # coding: utf-8 from gevent import monkey monkey.patch_all() from gevent.pool import Pool import gevent import request 阅读全文

posted @ 2023-02-06 18:21 星河赵 阅读(150) 评论(0) 推荐(0) 编辑

2023年2月2日

Python 根据经纬度坐标计算位置

摘要: 高德API 经纬度地址查询:https://lbs.amap.com/tools/picker 示例代码 from math import radians, cos, sin, asin, sqrt # 公式计算两点间距离(m) def geodistance(lng1, lat1, lng2, l 阅读全文

posted @ 2023-02-02 15:47 星河赵 阅读(202) 评论(0) 推荐(0) 编辑

2023年1月31日

Python cjson序列化与反序列化

摘要: cJSON cJSON是一个使用C语言编写的JSON数据解析器,具有超轻便,可移植,单文件的特点,使用MIT开源协议。 cJSON项目托管在Github上,仓库地址如下: https://github.com/DaveGamble/cJSON CJSON比JSON速度更快,完善字符格式,推荐使用 C 阅读全文

posted @ 2023-01-31 21:07 星河赵 阅读(73) 评论(0) 推荐(0) 编辑

2022年12月22日

python字典转为对象,用"."方式访问对象属性

摘要: python字典转为对象,用"."方式访问对象属性 params = { "name": "login", "params": { "transaction_id": "cc258bdb3dd4d6bba2", "platformType": "第三方平台", "uid": 9 } } class 阅读全文

posted @ 2022-12-22 15:31 星河赵 阅读(227) 评论(0) 推荐(0) 编辑

2022年12月14日

crontab执行shell脚本

摘要: shell 脚本如下 #!/bin/sh source /etc/profile #需要导入环境变量,否则非原生命令执行不成功 procs=`ps -ef | grep python | grep aiphoto_data_maintain/bin/aiphoto_data | awk '{prin 阅读全文

posted @ 2022-12-14 13:10 星河赵 阅读(936) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 ··· 55 下一页

导航