摘要: import os d1 = '/home/yy/test1' #源地址 d2 = '/home/yy/test2' #目的地址 不能存在 os.symlink(d1, d2) 阅读全文
posted @ 2022-04-17 12:58 yy9knsg 阅读(73) 评论(0) 推荐(0)
摘要: 需要通过pip install requests进行安装 import requests url = 'http://192.168.1.203/dev/live_ver' r = requests.get(url) print('1', r) print('2', r.text) [yy@192 阅读全文
posted @ 2022-04-16 23:08 yy9knsg 阅读(49) 评论(0) 推荐(0)
摘要: 需要通过pip install wget进行安装 import wget url = 'http://192.168.1.203/dev/live_ver' dest_dir = '/home/yy/test' wget.download(url, dest_dir) 阅读全文
posted @ 2022-04-16 23:06 yy9knsg 阅读(76) 评论(0) 推荐(0)
摘要: 发送邮件 # coding=utf-8 from audioop import add from email.mime.text import MIMEText from email.header import Header from email.utils import formataddr, p 阅读全文
posted @ 2022-04-15 10:01 yy9knsg 阅读(35) 评论(0) 推荐(0)
摘要: 模块 python struct name == 'main' __name__ 是当前模块名,当模块被直接运行时模块名为__main__。意思是,当模块被直接运行时,下面的代码块将被运行,当模块是被导入时,代码块不被运行 例子 #综合案例 - 猜丁壳 from random import rand 阅读全文
posted @ 2022-04-15 09:57 yy9knsg 阅读(57) 评论(0) 推荐(0)
摘要: 基类 基类,父类,超类是指被继承的类,派生类,子类是指继承于基类的类 阅读全文
posted @ 2022-04-15 09:56 yy9knsg 阅读(71) 评论(0) 推荐(0)
摘要: playbook 单个变量循环 多个变量循环 条件判断 group变量 根据文件名使用组变量 inventory默认配置文件 优先级: 1.当前目录下的ansible.cfg配置文件 2.配置环境变量 目录结构 以root身份进行操作 module copy template 需要jinja2语法 阅读全文
posted @ 2022-04-15 09:54 yy9knsg 阅读(30) 评论(0) 推荐(0)
摘要: docker进阶 docker-compose 安装 下载 [root@192 ~]# curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname - 阅读全文
posted @ 2022-04-15 09:53 yy9knsg 阅读(42) 评论(0) 推荐(0)
摘要: docker docker官网:https://www.docker.com/ Docker文档地址https://docs.docker.com/ 仓库地址:https://hub.docker.com/ 安装Docker 安装 卸载旧的版本 yum remove docker \ docker- 阅读全文
posted @ 2022-04-15 09:51 yy9knsg 阅读(54) 评论(0) 推荐(0)
摘要: ansible 1.安装 使用 yum 安装 #安装epel-release包相当于添加了一个第三方源 yum install epel-release -y yum install ansible –y ansible 程序结构 安装目录如下(yum安装): 配置文件目录:/etc/ansible 阅读全文
posted @ 2022-04-15 09:44 yy9knsg 阅读(55) 评论(0) 推荐(0)