Skip to content

Instantly share code, notes, and snippets.

View lidaobing's full-sized avatar
🦍
Mammal - verified by Github

LI Daobing lidaobing

🦍
Mammal - verified by Github
View GitHub Profile
$ host a.alipayobjects.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:
Host a.alipayobjects.com not found: 5(REFUSED)
$ host a.alipayobjects.com 8.8.4.4
Using domain server:
Name: 8.8.4.4
$ curl -v http://rails-bestpractices.com/posts/27-replace-instance-variable-with-local-variable
* About to connect() to rails-bestpractices.com port 80 (#0)
* Trying 74.207.244.80...
^C
$ tsocks curl -v http://rails-bestpractices.com/posts/27-replace-instance-variable-with-local-variable
* About to connect() to rails-bestpractices.com port 80 (#0)
* Trying 74.207.244.80...
* connected
* Connected to rails-bestpractices.com (74.207.244.80) port 80 (#0)
> GET /posts/27-replace-instance-variable-with-local-variable HTTP/1.1
@lidaobing
lidaobing / gist:5472213
Last active December 16, 2015 17:40
苹果家的 cpp 行为不一致
#define a(k) printf("k")
int main() {
a(hello);
}
$ bundle exec bin/backup2qiniu gen_token
input your keys (you can find them on https://dev.qiniutek.com/account/keys)
Access Key: 1PpS-UnbKewFTut4qBETq5kbq9Z1MtkLPTMANJ6h
Secret Key: *******
Your buckets: paperclip-qiniu-example, backup2
Select Bucket: backup2
Token Valid Days (365):
Params
access_key: 1PpS-UnbKewFTut4qBETq5kbq9Z1MtkLPTMANJ6h
$ ping mail.qq.com
PING mail.qq.com (14.17.19.167): 56 data bytes
64 bytes from 14.17.19.167: icmp_seq=0 ttl=51 time=34.707 ms
64 bytes from 14.17.19.167: icmp_seq=1 ttl=51 time=53.788 ms
^C
--- mail.qq.com ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 34.707/44.248/53.788/9.540 ms
$ echo | openssl s_client -connect mail.qq.com:443 2>&1
CONNECTED(00000003)
$ dig mail.qq.com
; <<>> DiG 9.8.3-P1 <<>> mail.qq.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49683
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;mail.qq.com. IN A
$ echo | openssl s_client -connect login.live.com:443 2>&1
CONNECTED(00000003)
depth=0 /1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Washington/businessCategory=Private Organization/serialNumber=600413485/C=US/postalCode=98052/ST=Washington/L=Redmond/street=1 Microsoft Way/O=Microsoft Corporation/OU=Passport/CN=login.live.com
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 /1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Washington/businessCategory=Private Organization/serialNumber=600413485/C=US/postalCode=98052/ST=Washington/L=Redmond/street=1 Microsoft Way/O=Microsoft Corporation/OU=Passport/CN=login.live.com
verify error:num=27:certificate not trusted
verify return:1
depth=0 /1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Washington/businessCategory=Private Organization/serialNumber=600413485/C=US/postalCode=98052/ST=Washington/L=Redmond/street=1 Microsoft Way/O=Microsoft Corporation/OU=Passport/CN=login.live.com
verify error:num=21:unable to verify t
$ echo | openssl s_client -connect mail.google.com:443 2>&1
CONNECTED(00000003)
=depth=0 /C=US/ST=California/L=Mountain View/O=Google Inc/CN=mail.google.com
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 /C=US/ST=California/L=Mountain View/O=Google Inc/CN=mail.google.com
verify error:num=27:certificate not trusted
verify return:1
depth=0 /C=US/ST=California/L=Mountain View/O=Google Inc/CN=mail.google.com
verify error:num=21:unable to verify the first certificate
@lidaobing
lidaobing / 1.go
Last active December 19, 2015 01:19
package main
import (
"fmt"
)
type A struct {
I int
}
package main
import (
"fmt"
"os"
)
import (
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"