随笔分类 -  Linux

摘要:seq -w 10|sed -r "s#(.*)#useradd oldboy\1;echo 123456|passwd --stdin oldboy\1#g"|bash ip a s eth0|egrep "([0-9]+\.?){4}" -o|head -3|tail -1 find ./ -m 阅读全文
posted @ 2020-09-06 23:00 xuqidong 阅读(157) 评论(0) 推荐(0)
摘要:yum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpmhttp://npm.taobao.org/mirrors/chromedriver/ 阅读全文
posted @ 2020-07-30 00:17 xuqidong 阅读(159) 评论(0) 推荐(0)
摘要:free -h|awk 'NR==2' 396 free -h|awk 'NR==3' 397 free -h|awk 'NR==2{print $NF}' 398 free -h|awk 'NR==2{print $NF,$2}' 399 free -h|awk 'NR==2{print $NF/ 阅读全文
posted @ 2020-07-04 19:26 xuqidong 阅读(232) 评论(0) 推荐(0)
摘要:cpu:top、htop 内存:free -h 磁盘:df -h、iotop 网络:iftop 负载:w、uptime 监控:10分钟负载 15分钟负载 < cpu内核数 正常 万能命令: glances 阅读全文
posted @ 2020-06-29 21:46 xuqidong 阅读(168) 评论(0) 推荐(0)
摘要:1 ansible-doc -s user 2 64 ansible ali -m user -a "name=cls uid=2000 home=/opt/cls shell=/sbin/nologin groups=root" 3 65 ansible ali -m user -a "name= 阅读全文
posted @ 2020-06-16 00:17 xuqidong 阅读(163) 评论(0) 推荐(0)
摘要:1 ps aux |grep 18816 2 kill -9 18816 3 date 4 cd /tmp 5 ls 6 find -name test.log 7 find ./ -name test.log 8 cat test.log 9 ping 192.168.31.218 10 ping 阅读全文
posted @ 2020-06-14 23:40 xuqidong 阅读(220) 评论(0) 推荐(0)
摘要:1 #!/usr/bin/env python 2 3 import json 4 import shutil 5 from ansible.module_utils.common.collections import ImmutableDict 6 from ansible.parsing.dat 阅读全文
posted @ 2020-05-27 23:47 xuqidong 阅读(199) 评论(0) 推荐(0)
摘要:1.安装ansible wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo yum install ansible -y 2.管理被控端,管理机先生成秘钥,然后推送公钥 [root@demo ~] 阅读全文
posted @ 2020-05-24 23:18 xuqidong 阅读(200) 评论(0) 推荐(0)
摘要:select table_schema,group_concat(table_name) from tables group by table_schema; -- 统计每个库的数据量大小,并从大到小排序 select table_schema,sum(AVG_ROW_LENGTH*TABLE_RO 阅读全文
posted @ 2020-04-04 23:28 xuqidong 阅读(148) 评论(0) 推荐(0)
摘要:1. 镜像管理 1.1 获取镜像 docker search centos docker pull centos:6.9 docker pull centos:7.5.1804 docker pull nginx 1.2 查询镜像 docker images docker images -q doc 阅读全文
posted @ 2019-11-03 13:13 xuqidong 阅读(478) 评论(0) 推荐(0)
摘要:cd / 1021 ls 1022 mv data /root 1023 ls /root 1024 cd data 1025 cd /root/data 1026 ls 1027 cat 6379 1028 cd 6379 1029 ls 1030 cd - 1031 touch oldboy.t 阅读全文
posted @ 2019-09-22 00:45 xuqidong 阅读(202) 评论(0) 推荐(0)