To be a better coder
发布时间:2019-03-05 16:38:18
Linux Bonding一、什么是bondingLinux bonding 驱动提供了一个把多个网络接口设备捆绑为单个的网络接口设置来使用,用于网络负载均衡及网络冗余二、bonding应用方向1、网络负载均衡对 于bonding的网络负载均衡是我们在文件服务器中常用到的,比如把三块网卡,当做一块来用,解决一个IP地址,流量过大,服务器.........【阅读全文】
发布时间:2019-03-01 13:53:30
[root@localhost /]# [root@localhost /]# cat ./for.py #!/bin/pythonfrom random import randintfrom itertools import chaina=[randint(10,100) for _ in range(20)]b=[randint(10,100) for _ in range(20)]c=[randint(10,100) for _ in range(20)]for n,m,v in zip(a,b,c): print n+m+vcou.........【阅读全文】
发布时间:2019-02-26 10:53:31
[root@localhost /]# [root@localhost /]# cat split.py #!/bin/pythonimport res='aa,bb:cc;dd/tee<ff>gg'def mysplit(s,symbol): t=[s] for num in symbol: res=[] map(lambda x:res.extend(x..........【阅读全文】
发布时间:2019-02-25 17:18:32
[root@localhost /]# [root@localhost /]# cat strduiqi.py #!/bin/pythonimport os, statli=os.listdir('/software/script/shell')st=[n for n in li if n.endswith(('.sh','.py'))]for nm in st: os.chmod(nm,os.stat(nm).st_mode | stat.S_IXGRP)[root@localhost /]# [root@localhost /]# .........【阅读全文】
发布时间:2019-02-25 16:57:05
[root@localhost /]# cat strduiqi.py #!/bin/pythonimport relog=open('/var/log/pacman.log').read()print re.sub('(\d{4})-(\d{2})-(\d{2})',r'\2/\3/\1',log)[root@localhost /]# 捕获组命名[root@localhost /]# cat strduiqi.py #!/bin/pythonimport relog=open('/var/log/pacman.log').read()print re.sub.........【阅读全文】