-
对一段代码的疑惑
conn := db.freeConn[0] copy(db.freeConn, db.freeConn[1:]) db.freeConn = db.freeConn[:numFree-1]为什么不用 freeConn = freeConn[1:]
-
Saisai
都两点了,赛赛还不睡觉,在床上疯。
爷爷强抱起来他去奶奶屋里,要哄他去睡觉。抱他去的路上,赛赛嘴里一直说,“抓走啦,抓走啦”。
-
Openssl Check Https Server Cert
echo | openssl s_client -servername www.example.com -connect www.example.com:443 2>/dev/null | openssl x509 -text -
Saisai
今天去逛了野生动物园,看完大象,差不多逛到一半的时候,赛赛终于在撑不住了,在电动车上睡着了。
-
Saisai
今天妈妈哄睡的时候,听见赛赛在房间里面大哭了起来,我打开门进去看,赛赛自己爬下床,然后噔噔噔噔跑出去,跑去爷爷房间自己伸手把门开开找爷爷去了。
-
Golang Mod Replace
golang mod 里面的 replace 语法和应用简单学习一下。
语法
replace module-path [module-version] => replacement-path [replacement-version]
module-version: 可以用来指定特定的版本,如果不指定,则所有版本都替换
例子
例1 换成自己的 fork
require example.com/othermodule v1.2.3 replace example.com/othermodule => example.com/myfork/othermodule v1.2.3-fixed例2 换成其他版本
require example.com/othermodule v1.2.2 replace example.com/othermodule => example.com/othermodule v1.2.3例3 换成本地代码
require example.com/othermodule v1.2.3 replace example.com/othermodule => ../othermodulerequire example.com/othermodule v1.2.5 replace example.com/othermodule v1.2.5 => ../othermodule -
Saisai
早晨迷迷糊糊的觉得赛赛在床上翻。
我后面算是“彻底”醒了,跟赛赛说了几句话,然后我说“赛赛你去找爷爷吧”,他就自己下床,跑去自己开门,然后出去找爷爷了~
-
Flock
( flock -n 9 || exit 1 # ... commands executed under lock ... ) 9>/var/lock/mylockfile -
Glog No Append Mode
glog 也没有使用 append 模式打开日志文件,导致第三方 truncate 日志文件之后,glog 还继续原来的 offset 写。
-
Dns Injection
从 8.8.8.8 返回了多个 UDP 包。看起来,第一个返回时间太短,TTL 也不对。是不是被污染了?
[root@VMS160953 ~]# tcpdump -nn -vvvv host 8.8.8.8 tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes 16:36:18.031876 IP (tos 0x0, ttl 64, id 25326, offset 0, flags [none], proto UDP (17), length 126) 10.60.225.127.47457 > 8.8.8.8.53: [bad udp cksum 0xfc46 -> 0x6d26!] 55814+ [1au] A? prod-eu-central-1-starport-layer-bucket.s3.eu-central-1.amazonaws.com. ar: . OPT UDPsize=4096 (98) 16:36:18.035181 IP (tos 0x0, ttl 35, id 48898, offset 0, flags [DF], proto UDP (17), length 131) 8.8.8.8.53 > 10.60.225.127.47457: [udp sum ok] 55814 q: A? prod-eu-central-1-starport-layer-bucket.s3.eu-central-1.amazonaws.com. 1/0/0 prod-eu-central-1-starport-layer-bucket.s3.eu-central-1.amazonaws.com. [3m16s] A 104.244.46.186 (103) 16:36:18.035199 IP (tos 0x0, ttl 29, id 0, offset 0, flags [none], proto UDP (17), length 131) 8.8.8.8.53 > 10.60.225.127.47457: [udp sum ok] 55814 q: A? prod-eu-central-1-starport-layer-bucket.s3.eu-central-1.amazonaws.com. 1/0/0 prod-eu-central-1-starport-layer-bucket.s3.eu-central-1.amazonaws.com. [1m51s] A 4.78.139.54 (103) 16:36:18.271586 IP (tos 0x0, ttl 94, id 28433, offset 0, flags [none], proto UDP (17), length 163) 8.8.8.8.53 > 10.60.225.127.47457: [udp sum ok] 55814 q: A? prod-eu-central-1-starport-layer-bucket.s3.eu-central-1.amazonaws.com. 2/0/1 prod-eu-central-1-starport-layer-bucket.s3.eu-central-1.amazonaws.com. [33s] CNAME s3-r-w.eu-central-1.amazonaws.com., s3-r-w.eu-central-1.amazonaws.com. [1s] A 52.219.75.128 ar: . OPT UDPsize=512 (135) 16:36:18.271618 IP (tos 0xc0, ttl 64, id 47249, offset 0, flags [none], proto ICMP (1), length 191) 10.60.225.127 > 8.8.8.8: ICMP 10.60.225.127 udp port 47457 unreachable, length 171 IP (tos 0x0, ttl 94, id 28433, offset 0, flags [none], proto UDP (17), length 163) 8.8.8.8.53 > 10.60.225.127.47457: [udp sum ok] 55814 q: A? prod-eu-central-1-starport-layer-bucket.s3.eu-central-1.amazonaws.com. 2/0/1 prod-eu-central-1-starport-layer-bucket.s3.eu-central-1.amazonaws.com. [33s] CNAME s3-r-w.eu-central-1.amazonaws.com., s3-r-w.eu-central-1.amazonaws.com. [1s] A 52.219.75.128 ar: . OPT UDPsize=512 (135) ^C 5 packets captured 5 packets received by filter 0 packets dropped by kernel [root@VMS160953 ~]# ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=95 time=241 ms ^C --- 8.8.8.8 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 241.706/241.706/241.706/0.000 ms