This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str = "21:20:36.678356 IP 190.223.26.38.ldap > 39.108.626.17.64292: UDP, bad length 2903 > 1472 | |
21:20:36.678429 IP 5-198-122-238.static.kc.net.uk.ldap > 39.108.626.17.17604: UDP, bad length 3040 > 1464 | |
21:20:36.678430 IP 190.223.26.38 > 39.108.626.17: udp | |
21:20:36.678486 IP 13.69.135.13 > 39.108.626.17: udp | |
21:20:36.678577 IP itt67-1-88-182-62-59.fbx.proxad.net.ntp > 39.108.626.17.47721: NTPv2, Reserved, length 440 | |
21:20:36.678578 IP mail.centromedicomilitar.com.gt.ldap > 39.108.626.17.17604: UDP, bad length 3173 > 1472 | |
21:20:36.678496 IP host-195-33-224-54.reverse.superonline.net.ldap > 39.108.626.17.64292: UDP, bad length 2934 > 1472 | |
21:20:36.678497 IP host-195-33-224-54.reverse.superonline.net > 39.108.626.17: udp" | |
regex=/^[^I]*IP ([^>]*)>.*$/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//pip3 install Pillow | |
import os | |
from PIL import Image | |
// | |
path = "/Users/apple/Desktop/captcha_20190325" | |
tagerPath = "/Users/apple/Desktop/webcaptcha_20190325/" | |
files= os.listdir(path) | |
for file in files: | |
if not os.path.isdir(file): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110000 北京市 | |
110100 北京市市辖区 | |
110101 北京市东城区 | |
110102 北京市西城区 | |
110103 北京市崇文区 | |
110104 北京市宣武区 | |
110105 北京市朝阳区 | |
110106 北京市丰台区 | |
110107 北京市石景山区 | |
110108 北京市海淀区 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
切记在rails 使用 migration,rollback的时候需要注意的点 | |
1.删除表之后,执行rollback是无法回滚的 | |
2.删除字段之后,执行rollback是无法回滚的 | |
3.修改字段部分属性之后,执行rollback是无法回滚的 | |
总之删除动作和修改动作回滚比较复杂,乱用,为此付出血的代价 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
etcd1: | |
image: quay.io/coreos/etcd:v3.2.5 | |
restart: always | |
ports: | |
- 23791:2379 | |
- 23801:2380 | |
volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/docker/compose/releases | |
curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose | |
chmod +x /usr/local/bin/docker-compose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source: | |
https://pkg.cfssl.org/ | |
install: | |
$ curl -s -L -o /bin/cfssl https://pkg.cfssl.org/R1.2/cfssl_linux-amd64 | |
$ curl -s -L -o /bin/cfssljson https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64 | |
$ curl -s -L -o /bin/cfssl-certinfo https://pkg.cfssl.org/R1.2/cfssl-certinfo_linux-amd64 | |
$ chmod +x /bin/cfssl* | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
假设有一个九宫格表,格子里面有各种物品,有的格子上是空的,有的格子上的物品是同一种物品,只是数量不一,当你把格子的物品移动到别的格子上的时候,你该怎么做? | |
下面是代码逻辑的顺序,仅供参考 | |
理想思路算法逻辑 | |
1.如果目标格子上为空,则直接覆盖目标格子,并删除移动格子数据 | |
2.如果种类相同,直接让目标格子数量加上移动格子的数量,并清空移动的格子上的数据 | |
3.如果种类不相同,则互换格子上的数据即可 | |
上面这种情况在正常情况下是完全没有问题,但是当移动格子和目标格子是同一个格子的时候你会发现,他是满足条件2的,这时候奇迹发生了,物品数量翻倍了,老天,假如一直这么移动的话,那不是逆天了。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// go run -tags etcd client.go | |
package main | |
import ( | |
"context" | |
"flag" | |
"log" | |
"time" | |
"crypto/tls" | |
"io/ioutil" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// go run -tags etcd server.go | |
package main | |
import ( | |
"context" | |
"flag" | |
"log" | |
"time" | |
"crypto/tls" | |
metrics "github.com/rcrowley/go-metrics" |