wheat 最近的时间轴更新
wheat

wheat

V2EX 第 54657 号会员,加入于 2014-01-21 18:07:29 +08:00
wheat 最近回复了
2015-12-14 22:54:30 +08:00
回复了 cevincheung 创建的主题 PHP 有木有玩过 ffmpeg 的童鞋?
<?php
$cmd = "/usr/local/bin/ffmpeg -i ~/Downloads/laji.mp4"
$proc = proc_open($cmd, array(array('pipe', 'r'),array('pipe', 'w'),array('pipe', 'w')), $pipes);
fwrite($pipes[0], $input);
fclose($pipes[0]);

$stdout = stream_get_contents($pipes[1]);
fclose($pipes[1]);

$stderr = stream_get_contents($pipes[2]);
fclose($pipes[2]);

$return_code = (int)proc_close($proc);

echo $stderr;

?>
2015-09-19 10:09:05 +08:00
回复了 xiaoc19 创建的主题 DNS 如何判断谷歌 DNS 是否被 ISP 劫持
8.8.8.8 的 dns 是被污染,不是被劫持, dns 默认为 udp ,无连接,所以 dns 请求发出后, gfw 跟 8.8.8.8 都会返回结果给你,但是系统以收到的第一个返回作为结果, gfw 抢先于 8.8.8.8 答复 dns 请求,造成 dns 污染,

详情可以用 tcpdump 查看 dns 请求即可
sudo tcpdump -i en0 -S -X -n -vv 'udp and (src 8.8.8.8 or dst 8.8.8.8 )'

在另外一个窗口
dig twitter.com @8.8.8.8

以下为 tcpdump 结果

# 发送请求
tcpdump: listening on en0, link-type EN10MB (Ethernet ), capture size 65535 bytes
10:01:04.714855 IP (tos 0x0, ttl 64, id 21027, offset 0, flags [none], proto UDP (17 ), length 57 )
10.0.0.110.59488 > 8.8.8.8.53: [udp sum ok] 42946+ A? twitter.com. (29 )
0x0000: 4500 0039 5223 0000 4011 0e14 0a00 006e E..9R#[email protected]
0x0010: 0808 0808 e860 0035 0025 8638 a7c2 0100 .....`.5.%.8....
0x0020: 0001 0000 0000 0000 0774 7769 7474 6572 .........twitter
0x0030: 0363 6f6d 0000 0100 01 .com.....
# gfw 冒充 8.8.8.8 返回错误的 dns 结果
10:01:04.758214 IP (tos 0x0, ttl 55, id 28944, offset 0, flags [none], proto UDP (17 ), length 84 )
8.8.8.8.53 > 10.0.0.110.59488: [udp sum ok] 42946 q: A? twitter.com. 1/0/0 twitter.com. A 159.106.121.75 (56 )
0x0000: 4500 0054 7110 0000 3711 f80b 0808 0808 E..Tq...7.......
0x0010: 0a00 006e 0035 e860 0040 4d25 a7c2 8180 ...n.5.`.@M%....
0x0020: 0001 0001 0000 0000 0774 7769 7474 6572 .........twitter
0x0030: 0363 6f6d 0000 0100 0107 7477 6974 7465 .com......twitte
0x0040: 7203 636f 6d00 0001 0001 0000 0ad4 0004 r.com...........
0x0050: 9f6a 794b .jyK
10:01:04.758553 IP (tos 0x0, ttl 117, id 59329, offset 0, flags [none], proto UDP (17 ), length 73 )
8.8.8.8.53 > 10.0.0.110.59488: [udp sum ok] 42946 q: A? twitter.com. 1/0/0 twitter.com. A 203.98.7.65 (45 )
0x0000: 4500 0049 e7c1 0000 7511 4365 0808 0808 E..I....u.Ce....
0x0010: 0a00 006e 0035 e860 0035 d8fc a7c2 8180 ...n.5.`.5......
0x0020: 0001 0001 0000 0000 0774 7769 7474 6572 .........twitter
0x0030: 0363 6f6d 0000 0100 01c0 0c00 0100 0100 .com............
0x0040: 0007 7600 04cb 6207 41 ..v...b.A

# 真正的 8.8.8.8 返回点结果
10:01:04.791550 IP (tos 0x0, ttl 44, id 37748, offset 0, flags [none], proto UDP (17 ), length 89 )
8.8.8.8.53 > 10.0.0.110.59488: [udp sum ok] 42946 q: A? twitter.com. 2/0/0 twitter.com. A 104.244.42.129, twitter.com. A 104.244.42.193 (61 )
0x0000: 4500 0059 9374 0000 2c11 e0a2 0808 0808 E..Y.t..,.......
0x0010: 0a00 006e 0035 e860 0045 5ece a7c2 8180 ...n.5.`.E^.....
0x0020: 0001 0002 0000 0000 0774 7769 7474 6572 .........twitter
0x0030: 0363 6f6d 0000 0100 01c0 0c00 0100 0100 .com............
0x0040: 0000 2b00 0468 f42a 81c0 0c00 0100 0100 ..+..h.*........
0x0050: 0000 2b00 0468 f42a c1 ..+..h.*.
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2871 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 06:43 · PVG 14:43 · LAX 23:43 · JFK 02:43
Developed with CodeLauncher
♥ Do have faith in what you're doing.