摘要: class InfoMG(View): @method_decorator(csrf_exempt) @method_decorator(login_required) def dispatch(self, request, *args, **kwargs): return super(InfoMG 阅读全文
posted @ 2021-08-16 19:26 lucky_tomato 阅读(559) 评论(0) 推荐(0) 编辑
摘要: salt-cp '节点名字' 源路径 目标路径 salt-cp 'test1' /root/test.sh /tmp/test.sh 阅读全文
posted @ 2021-08-08 17:49 lucky_tomato 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 查看僵尸进程 ps -A -ostat,ppid,pid,cmd |grep -e '^[Zz]' 杀死僵尸进程 kill -15 ppid 阅读全文
posted @ 2021-08-08 17:42 lucky_tomato 阅读(426) 评论(0) 推荐(0) 编辑
摘要: find ./ -type f -name consumer.xml -exec sed -i "s/aaaa/bbb/g" {} \; 阅读全文
posted @ 2021-08-08 17:26 lucky_tomato 阅读(166) 评论(0) 推荐(0) 编辑
摘要: netstat -an|awk '/^tcp/{++S[$NF]}END{for (a in S)print a,S[a]}' 输出结果: TIME_WAIT 65 ESTABLISHED 99 CLOSING 1 LISTEN 735 阅读全文
posted @ 2021-08-08 17:24 lucky_tomato 阅读(586) 评论(0) 推荐(0) 编辑
摘要: du -x --max-depth=1/ |sort -k1 -nr 阅读全文
posted @ 2021-08-08 17:22 lucky_tomato 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 显示当前目录下前十个使用inodes最多的目录 find -type f | awk -F / -v OFS=/ '{$NF="";dir[$0]++}END{for(i in dir)print dir[i]""i}'|sort -k1 -nr|head 显示/data目录下前十个使用inodes 阅读全文
posted @ 2021-08-08 17:18 lucky_tomato 阅读(734) 评论(0) 推荐(0) 编辑
摘要: ip a|grep "global" | awk '{print $2}' |awk -F / '{print $1}' 阅读全文
posted @ 2021-08-08 17:15 lucky_tomato 阅读(425) 评论(0) 推荐(0) 编辑
摘要: 1.在某张表添加一个字段 alter table 表名(table_name) add 字段(field) 2.在某张表删除一个字段 ALTER TABLE 表名(table_name) drop COLUMN 字段(field); 3.修改某张表字段不为空 alter table 表名(table 阅读全文
posted @ 2021-08-08 10:31 lucky_tomato 阅读(75) 评论(0) 推荐(0) 编辑
摘要: 问题: 解决方法: pip install 包名 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com因为连接外国源,设置为国内豆瓣源就好 阅读全文
posted @ 2021-07-27 15:30 lucky_tomato 阅读(81) 评论(0) 推荐(0) 编辑