11 2018 档案

摘要:formkey快速建立空字典 result = {}.fromkeys(['name','age','job'],None) print(result) #往字典里添加元素 result.update(name='simida') result.update({'age':20}) del resu 阅读全文
posted @ 2018-11-30 20:47 aclover 阅读(4663) 评论(0) 推荐(0)
摘要:1、元组 列表 字典 元组( 元组是不可变的) hello = (1,2,3,4,5) type(hello) 2、数组(可变) myinfo = ['simida', 20, 'dalao', ['史蒂夫', 2000]] print(myinfo[0]) print(myinfo[3][0]) 阅读全文
posted @ 2018-11-30 20:46 aclover 阅读(29087) 评论(0) 推荐(0)
摘要:一、变量(内存地址,数值,数值类型) usernam = 'simida' print(id(username)) 查看username内存地址 print(type(username)) 查看username数据类型 print(username) 查看变量username python数字缓冲- 阅读全文
posted @ 2018-11-30 20:44 aclover 阅读(252) 评论(0) 推荐(0)
摘要:ss -tnl 查看端口 telnet ip 查看端口是否通 yum配置 [mariadb] name = MariaDB baseurl = http://mirrors.ustc.edu.cn/mariadb/yum/10.3/centos7-amd64/ gpgkey=http://mirro 阅读全文
posted @ 2018-11-28 09:07 aclover 阅读(235) 评论(0) 推荐(0)
摘要:--创建学生表 create table students ( id int unsigned not null auto_increment primary key, name varchar(20) default '', age tinyint unsigned default 0, high 阅读全文
posted @ 2018-11-26 19:43 aclover 阅读(608) 评论(0) 推荐(0)
摘要:视图 视图本质就是对查询的封装 创建视图(定义视图 起名以v_开头) create view v_students as select classes.name as c_name ,students.* from students inner join classes on students.cl 阅读全文
posted @ 2018-11-26 16:28 aclover 阅读(472) 评论(0) 推荐(0)
摘要:python系统监控及邮件发送 #psutil模块是一个跨平台库,能轻松实现获取系统运行的进程和系统利用率 import psutil #先导入psutil模块 res = psutil.cpu_percent(1) #1s内cpu的使用率 print(res) res1 = psutil.cpu_ 阅读全文
posted @ 2018-11-24 14:14 aclover 阅读(1451) 评论(0) 推荐(0)
摘要:shell脚本 shell脚本 vim jk.sh #命名脚本名 #!/bin/bash time=`date "+%Y-%m-%d %H:%M:%S"` #定义时间 echo "$time" echo " 警告!!!!!!" cpu_info(){ cpu_free=`top -i -c -bn 阅读全文
posted @ 2018-11-24 11:06 aclover 阅读(266) 评论(0) 推荐(0)
摘要:--查询基本使用 -- 查询所有列 --select * from 表名 select * from students; --一定条件查询 select * from students where name='小李飞刀'; select * from students where id>3; -- 阅读全文
posted @ 2018-11-21 16:22 aclover 阅读(432) 评论(0) 推荐(0)
摘要:mysql增删改查 查 show databses; #查看数据库 select database(); #查看当前数据库 use mysql; #进入数据库 show create database p1807; #查看数据库字符集类型 desc xxxx; #查看表类型 select * fro 阅读全文
posted @ 2018-11-20 19:59 aclover 阅读(180) 评论(0) 推荐(0)
摘要:mysql的安装使用及其用户管理 一、mariadb安装 搭建yum源 [mariadb] name = MariaDB baseurl = http://mirrors.ustc.edu.cn/mariadb/yum/10.3/centos7-amd64/ gpgkey=http://mirror 阅读全文
posted @ 2018-11-19 19:29 aclover 阅读(168) 评论(0) 推荐(0)
摘要:keepalived 一、keepalive的介绍: Keepalived软件起初是专为LVS负载均衡软件设计的,用来管理并监控LVS集群系统中各个服务节点的状态,后来又加入了可以实现高可用的VRRP功能。因此,Keepalived除了能够管理LVS软件外,还可以作为其他服务(例如:Nginx、Ha 阅读全文
posted @ 2018-11-16 14:33 aclover 阅读(979) 评论(0) 推荐(0)
摘要:lVS(Linux Virtual Server) Linux虚拟服务器,是一个虚拟的服务器集群系统。用来实现负载均衡。 一、LVS的三种模式: 1、LVS-DR:直接路由 此种方式是最常用的方式,所有的Director和RealServer都在同一个物理网络中(交换机)并且都只有一块网卡。 2、L 阅读全文
posted @ 2018-11-15 21:10 aclover 阅读(3103) 评论(0) 推荐(0)
摘要:Ansible自动化运维工具的使用 host lnventory 管理主机 ip root账号密码 ssh端口 core modules 核心模块(user server yum等模块) custom modules 自定义模块 支持任何编程语言 connection plugins 连接插件,An 阅读全文
posted @ 2018-11-14 20:13 aclover 阅读(667) 评论(0) 推荐(0)
摘要:(三台都需要关闭防火墙 前两台需要安装dhcp ) 第一台linux(vmnet2)(192.168.1.1) vim /etc/sysconfig/network-scripts/ifcfg-ens33 网卡配置 配置IP 添加网关把第二台虚机的ip作为网关指向中继 BOOTPROTO=none 阅读全文
posted @ 2018-11-13 19:28 aclover 阅读(701) 评论(0) 推荐(0)
摘要:import requests #导入模块 response = requests.get('http://www.baidu.com') print(response.status_code) #打印状态码 print(response.url) #打印请求url print(response.h 阅读全文
posted @ 2018-11-13 12:46 aclover 阅读(198) 评论(0) 推荐(0)