上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 55 下一页
摘要: 注册函数到一个名字,调用名字的时候,路由到注册函数,如果名字没有注册函数,路由到缺省函数 def cmd_dispatcher(): command={} def reg(name): # 注册函数装饰器 def _reg(fn): command[name]=fn return fn return 阅读全文
posted @ 2020-09-12 20:37 ascertain 阅读(175) 评论(0) 推荐(0) 编辑
摘要: from functools import wraps import time,inspect,datetime def m_cache(duration): def _cache(fn): local_cache={} @wraps(fn) def wrapper(*args,**kwargs): 阅读全文
posted @ 2020-09-12 17:27 ascertain 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 第一版:bad @echo off :: 删除目录文件夹及其子文件夹内后缀名为.bak 且 7天之前的文件。 forfiles /p "G:\DBBak" /s /m *.bak /d -7 /c "cmd /c del @path" >> D:\DBBak\deletefile.txt 2>&1< 阅读全文
posted @ 2020-09-11 19:44 ascertain 阅读(883) 评论(0) 推荐(0) 编辑
摘要: 依赖环境 yum update yum install make gcc gmp-devel xmlto bison flex libpcap-devel openswan(ipsec) yum install openswan 接下来配置ipsec。ipsec的配置文件是/etc/ipsec.co 阅读全文
posted @ 2020-09-11 14:28 ascertain 阅读(2530) 评论(0) 推荐(0) 编辑
摘要: iptables入门:规则及路由基础 数据包关卡 到来自服务器外的其他用户访问这台服务器时,防火墙软件对数据包设置了多个关卡,根据数据处理的逻辑,在逻辑顺序的某些关键节点,防火墙对数据进行监控,根据规则对数据包进行放行、丢弃、拒绝、修改。而这些关卡就是被人称为“链”的逻辑位置。 用关卡来形容这个过程 阅读全文
posted @ 2020-09-11 14:06 ascertain 阅读(178) 评论(0) 推荐(0) 编辑
摘要: ip -d route proto字段的定义如下(部分): #define RTPROT_UNSPEC 0 #define RTPROT_REDIRECT 1 /* Route installed by ICMP redirects; not used by current IPv4 */ #def 阅读全文
posted @ 2020-09-10 17:09 ascertain 阅读(1174) 评论(0) 推荐(0) 编辑
摘要: 路由的设计远比一般的理解要复杂的多。典型的路由条目包括了源IP,目的IP,网关IP,scope,dev和type六个要素。 网关IP就是在配置路由的时候指定的via后面的地址,在路由表中叫Gateway,这是说明这条路由的下一跳是这个IP地址。这个IP地址之所以出现,是因为目的地址不是当前自己出口可 阅读全文
posted @ 2020-09-10 10:14 ascertain 阅读(1213) 评论(0) 推荐(0) 编辑
摘要: 1:在Linux操作系统中查看磁盘序列号 序列号特性可以用于在操作系统内为磁盘提供唯一身份标识,从而达到识别和区分不同磁盘的目的。 使用lsblk命令查询块存储的设备名 使用以下命令获取块存储设备的序列号 udevadm info --query=all --name=DEVICE_NAME |gr 阅读全文
posted @ 2020-09-08 21:44 ascertain 阅读(991) 评论(0) 推荐(0) 编辑
摘要: 一、修改注册表1、在“开始 > 运行”中,输入regedit命令,单击“确定”,进入注册表编辑器。2、在“注册表编辑器”页面的左侧导航树中,选择“HKEY_LOCAL_MACHINE > SYSTEM >CurrentControlSet > Services > Rasman > Paramete 阅读全文
posted @ 2020-09-08 18:43 ascertain 阅读(3912) 评论(0) 推荐(0) 编辑
摘要: Let's Encrypt 表示,一直以来都希望 ACME 能成为证书颁发和管理的标准化协议,如今梦想终实现,对于业界也颇有意义。 ACME 协议最初由 Let's Encrypt 团队开发并被认为是其提供的 CA 服务的核心。ACMEv1 协议旨在确保验证、发布和管理方法是完全自动化、一致、符合合 阅读全文
posted @ 2020-09-08 10:05 ascertain 阅读(331) 评论(0) 推荐(0) 编辑
摘要: s1='abcdefg' s2='efgabcd' s3='zdxc' s4='mn' def findcom(str1,str2): if len(str1)>len(str2): str1,str2=str2,str1 commonstr=[] flag=False count=0 for su 阅读全文
posted @ 2020-09-07 20:38 ascertain 阅读(1033) 评论(0) 推荐(0) 编辑
摘要: server { listen 80 default_server; listen [::]:80 default_server; # redirect all HTTP requests to HTTPS with 301 Moved Permanently reponse return 301 阅读全文
posted @ 2020-09-07 10:08 ascertain 阅读(115) 评论(0) 推荐(0) 编辑
摘要: @echo off set host=%1 echo %host% if not "zzz" == "zzz" goto a echo ppppppppppppppp echo zzzzzzzzzz ::exit 1 :a if "aa" == "aa" goto b echo bbbbbbbbbb 阅读全文
posted @ 2020-09-07 10:01 ascertain 阅读(254) 评论(0) 推荐(0) 编辑
摘要: dip=[x for x in range(1,10)]import math def jum(b): depth=math.ceil(math.log2(len(b)+1)) width=2**depth-1 print(depth,width) index=0 # 记录每次打印的索引 for x 阅读全文
posted @ 2020-09-06 22:23 ascertain 阅读(211) 评论(0) 推荐(0) 编辑
摘要: source={'a':{'b':1,'c':2},'d':{'e':3,'f':{'g':4}}} target={} def flatmap(src,prefix=''): for k,v in src.items(): if isinstance(v,(dict,)): flatmap(v,p 阅读全文
posted @ 2020-09-05 20:58 ascertain 阅读(138) 评论(0) 推荐(0) 编辑
摘要: import functools def logger(fn): # @functools.wraps(fn) def wrapper(*args,**kwargs): 'this is wrapper' print('before call fn') kin=fn(*args,**kwargs) 阅读全文
posted @ 2020-09-05 20:53 ascertain 阅读(146) 评论(0) 推荐(0) 编辑
摘要: def copy_properties(src,dst): # 提供一个函数,被封装函数属性 copy 到包装函数属性,保持被封装函数属性不变 dst.__name__=src.__name__ dst.__doc__=src.__doc__ dst.__qualname__=src.__qualn 阅读全文
posted @ 2020-09-05 17:29 ascertain 阅读(388) 评论(0) 推荐(0) 编辑
摘要: import random hip=list(range(10)) random.shuffle(hip) print(hip) def hum(b,reverse=False): hop=[] for x in b: for i,y in enumerate(hop): flag= x>y if 阅读全文
posted @ 2020-09-04 23:59 ascertain 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 使用类Unix系统的同学可能都对“#!”这个符号并不陌生,但是你真的了解它吗? 这个符号的名称,叫做”Shebang”或者”Sha-bang”。长期以来,Shebang都没有正式的中文名称。Linux中国翻译组的GOLinux将其翻译为“释伴”,即“解释伴随行”的简称,同时又是Shebang的音译。 阅读全文
posted @ 2020-09-03 13:58 ascertain 阅读(1278) 评论(0) 推荐(0) 编辑
摘要: 安装certbot wget https://dl.eff.org/certbot-auto chmod a+x certbot-auto ./certbot-auto certonly --standalone -d abc.com -d www.abc.com certonly: obtain 阅读全文
posted @ 2020-09-03 09:56 ascertain 阅读(1941) 评论(0) 推荐(0) 编辑
上一页 1 ··· 42 43 44 45 46 47 48 49 50 ··· 55 下一页