etcd raft library
摘要:https://github.com/coreos/etcd/tree/master/raft import "github.com/coreos/etcd/raft" raft是一个协议,一个节点集群可以维护一个复制状态机。状态机通过使用复制日志保持同步。有关Raft的更多详细信息,请参阅Dieg
阅读全文
split files test
摘要:python split_upload.py /root/github/python/s3_test/test.txt dbelt dumps python download_to_a_file.py /root/file_test dbelt dumps/test
阅读全文
mysql 错误集锦
摘要:Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the first event '' at 4, the last event read from './mys
阅读全文
diff
摘要:cp /etc/passwd passwd_old cat /etc/passwd| sed -e '4d' -e '6c no six line' > passwd_new [root@mhc regular]# diff passwd_old passwd_new 4d3< adm:x:3:4:
阅读全文
awk
摘要:[root@mhc regular]# last -n 2|awk '{print $1 "\t" $3}'root :0root :0 wtmp Wed [root@mhc regular]# last -n 2|awk '{print $1 "\tlines:" NR "\t columes:"
阅读全文
sed
摘要:删除: [root@mhc regular]# sed '2,5d' num.txt 1678[root@mhc regular]# sed '5d' num.txt 1234678[root@mhc regular]# sed '5,$d' num.txt 1234新增: [root@mhc re
阅读全文
grep
摘要:[root@mhc regular]# cat a.txt|grep gooooooglegoooooogle yes![root@mhc regular]# [root@mhc regular]# [root@mhc regular]# cat a.txt|grep -A2 goooooogleg
阅读全文
scrapy
摘要:目前,为了加速页面的加载速度,页面的很多部分都是用JS生成的,而对于用scrapy爬虫来说就是一个很大的问题,因为scrapy没有JS engine,所以爬取的都是静态页面,对于JS生成的动态页面都无法获得。 解决方案: 利用第三方中间件来提供JS渲染服务: scrapy-splash 等。 利用w
阅读全文
uml 时序图
摘要:1.时序图的概念 时序图定义 : 描述了对象之间传递消息的时间顺序, 用来表示用例中的行为顺序, 是强调消息时间顺序的交互图; 时序图描述的事物: 时序图描述系统中类和类之间的交互, 将这些交互建模成消息交换, 时序图描述了类以及类之间的交换以完成的期望行为的消息, 时序图中每条消息都代表了类的一个
阅读全文
uml 类图
摘要:一、类的属性的表示方式 在UML类图中,类使用包含类名、属性(field) 和方法(method) 且带有分割线的矩形来表示,比如下图表示一个Employee类,它包含name,age和email这3个属性,以及modifyInfo()方法。 那么属性/方法名称前加的加号和减号是什么意思呢?它们表示
阅读全文
aws s3 python sdk
摘要:http://boto3.readthedocs.io/en/latest/reference/services/s3.html#S3.Client.get_object abort_multipart_upload() can_paginate() complete_multipart_uploa
阅读全文
查看文件大小
摘要:du -h --max-depth=1 work/testing
阅读全文
centos7 安装docker-ce ,最新版本docker,docker阿里云加速
摘要:直接用yum install docker -y安装的docker版本为1.12,但是docker发展很快,现在都17.06.2了。docker-ce是指docker的社区版 卸载老版本的 docker 及其相关依赖 安装 yum-utils,它提供了 yum-config-manager,可用来管
阅读全文
errant-transactions
摘要:https://www.percona.com/blog/2015/12/02/gtid-failover-with-mysqlslavetrx-fix-errant-transactions/ 使用GTID复制时,Errant transactions是一个主要问题。 虽然这不是什么新鲜事,但GT
阅读全文
scrapy
摘要:[root@mhc scrapy]# scrapy startproject tutorialTraceback (most recent call last): File "/usr/bin/scrapy", line 7, in <module> from scrapy.cmdline impo
阅读全文
consul event
摘要:Command: consul event event 命令提供了一种机制来将自定义用户事件触发到整个数据中心。 这些事件对Consul来说是不透明的,但是它们可以用来构建脚本基础架构来执行自动化部署,重新启动服务或执行其他编排操作。 事件可以通过使用watch来处理。 虽然细节对于使用事件并不重要
阅读全文
consul watch
摘要:consul watch -type key -key mhc ./key_handler.py [root@mhc consul]# cat key_handler.py #!/usr/bin/pythonimport sysimport base64import jsonprint "key h
阅读全文