V2EX wheat
 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     Solana     1074 人在线   最高记录 6679       Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 14ms UTC 18:09 PVG 02:09 LAX 11:09 JFK 14:09
Do have faith in what you're doing.
ubao snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86