上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 55 下一页
摘要: Socket套接字 Python提供socket.py标准库 AF Address Family Server: 创建Socket对象 绑定IP地址和Port bind()方法IPv4地址必须是一个二元组('ipv4',Port) list报错 监听于bind()后的地址,listen()方法 获取 阅读全文
posted @ 2020-10-30 21:07 ascertain 阅读(125) 评论(0) 推荐(0) 编辑
摘要: concurrent.futures 异步并行任务模块 提供两个池执行器 ThreadPoolExcutor 异步调用的线程池Executor ProcessPoolExecutor 异步调用的进程池Executor 首先需要定义一个池的执行器对象,Executor类子类的对象 method imp 阅读全文
posted @ 2020-10-29 17:12 ascertain 阅读(379) 评论(0) 推荐(0) 编辑
摘要: 滑动窗口: 阅读全文
posted @ 2020-10-29 14:22 ascertain 阅读(57) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash echo $BASHPID for _ in `seq 100`;do echo start sleep 5 echo $BASH_SUBSHELL echo stop done & sleep 20 7267是脚本进程,其又开启了两个进程7268 7269,7268是for 阅读全文
posted @ 2020-10-29 12:06 ascertain 阅读(75) 评论(0) 推荐(0) 编辑
摘要: rsync Options: -v, --verbose 详细模式输出 -q, --quiet 精简输出模式 -c, --checksum 打开校验开关,强制对文件传输进行校验 -a, --archive 归档模式,表示以递归方式传输文件,并保持所有文件属性,等于 -rlptgoD -r, --re 阅读全文
posted @ 2020-10-26 19:43 ascertain 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 和Lock很像,信号量对象内部维护一个倒计算器,每次调用acquire()都会 -1 , 当acquire()时,计算器为0就会阻塞请求线程,直到其它线程对信号量 release()后,计数器 +1,恢复阻塞线程 name implication Semaphore(value=1) 构造方法,va 阅读全文
posted @ 2020-10-26 01:35 ascertain 阅读(69) 评论(0) 推荐(0) 编辑
摘要: name meaning Barrier(parties,action=None,timeout=None) 构建Barrier对象,指定参与方数目,timeout是wait方法未指定超时的默认值 n_waiting 当前在屏障中等待的线程数 parties 各方数,需要多少个等待 wait(tim 阅读全文
posted @ 2020-10-25 23:07 ascertain 阅读(412) 评论(0) 推荐(0) 编辑
摘要: from threading import Event,Thread import logging,time FORMAT='%(asctime)s %(threadName)s %(thread)d %(message)s' logging.basicConfig(format=FORMAT,le 阅读全文
posted @ 2020-10-25 21:04 ascertain 阅读(104) 评论(0) 推荐(0) 编辑
摘要: shell中if while等后必须接命令,利用命令的exit code作为判断,而其他高级语言是利用return值作为判断对于非命令变量,可以利用test or [ ] or [[ ]] 进行判断如果确实需要用命令或函数的返回值作为判断,可以如下 function p(){ echo $$ exi 阅读全文
posted @ 2020-10-25 12:54 ascertain 阅读(181) 评论(0) 推荐(0) 编辑
摘要: #下载fpm yum install ruby ruby-dev #切换gem源为国内源 gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/ #下载fpm gem install -y fpm # 阅读全文
posted @ 2020-10-25 01:36 ascertain 阅读(166) 评论(0) 推荐(0) 编辑
摘要: import logging logging.basicConfig(format='%(name)s %(asctime)s %(message)s',level=logging.INFO) root=logging.getLogger("") root.setLevel(logging.ERRO 阅读全文
posted @ 2020-10-24 17:03 ascertain 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 启停示例: startInstance.py #!/bin/env python3 # StartInstance #coding=utf-8 from aliyunsdkcore.client import AcsClient from aliyunsdkcore.acs_exception.ex 阅读全文
posted @ 2020-10-23 19:27 ascertain 阅读(164) 评论(0) 推荐(0) 编辑
摘要: at atd 等所有命令均由 at 包提供 默认只有/etc/at.deny ,此为黑名单 /etc/at.allow 为白名单,优先级高于 /etc/at.deny 当/etc/at.allow 和 /etc/at.deny 都不存在时,只有 root才能使用 at ,rpm包默认提供了空/etc 阅读全文
posted @ 2020-10-23 18:00 ascertain 阅读(147) 评论(0) 推荐(0) 编辑
摘要: shell中true & false是两个命令,其返回值为NULL,true 的 exit code为0,false 的exit code 为 1 #!/bin/env sh if [[ `$1` ]];then echo true else echo false fi 把false作为命令执行,其 阅读全文
posted @ 2020-10-23 11:51 ascertain 阅读(5134) 评论(0) 推荐(0) 编辑
摘要: IIS: Internet Information Server 服务显示名称为: World Wide Web Publishing Service 服务名称为: W3SVC IIS通过Windows服务主进程svchost.exe启动,启动后的进程为w3wp 我们可以用w3svc通过命令行,来控 阅读全文
posted @ 2020-10-23 11:18 ascertain 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 背景:windows下安装python相关的软件包的时候使用pip安装scrapy等软件包,依赖twisted等C++编写的程序时候: error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Bu 阅读全文
posted @ 2020-10-21 14:44 ascertain 阅读(261) 评论(0) 推荐(0) 编辑
摘要: IPSec是虚拟私密网络的一种实现,在server & client间建立加密隧道传输数据,分两个阶段 Phrase1交换密钥建立隧道,使用IKE协议(Internet Key Exchange)IKE分两个版本(IKE1/IKE2)IKE1有两种模式,主力模式(main mode),积极模式(野蛮 阅读全文
posted @ 2020-10-20 20:35 ascertain 阅读(2926) 评论(0) 推荐(0) 编辑
摘要: Openswan/Strongswan对接华为云VPN配置指南 作者 : 华为云VPN服务团队 文档中底色绿色代表命令,底色灰色代码命令显示信息,底色黄色为配置关注点 一、拓扑说明 本场景连接拓扑如下图所示,云端两个VPC。其中一个VPC购买VPN网关,另一个VPC购买ECS、 EIP并安装IPse 阅读全文
posted @ 2020-10-20 13:16 ascertain 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 简介 本文介绍IPSecVPN的搭建过程,并通过公网将分属于美团云上海与北京两个机房内的vpc子网打通。由于美团云经典网络在网络控制器上对ip_filter 做了限制,打通前需要确保两边网络都处于VPC下,且子网网段无交集。当前部署环境为CentOS 6.5。 一、网络模型 计划实现的效果是,从左侧 阅读全文
posted @ 2020-10-19 17:09 ascertain 阅读(3372) 评论(0) 推荐(0) 编辑
摘要: 新建空文件 type nul> file 阅读全文
posted @ 2020-10-18 10:57 ascertain 阅读(98) 评论(0) 推荐(0) 编辑
上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 55 下一页