Linux Shell ??????tcp/updЭ????
???????????? ???????[ 2015/12/9 11:41:10 ] ?????????????? Linux
???????и????????
??????????windows??????telnet ???????tcp/updЭ?????????????????????????????
????[chengmo@centos5 ~/shell]$ echo -e "HEAD / HTTP/1.1 "|telnet www.baidu.com 80
????Trying 220.181.6.175...
????Connected to www.baidu.com.
????Escape character is '^]'.
????Connection closed by foreign host.
????#????????????
????[chengmo@centos5 ~/shell]$ (telnet www.baidu.com 80)<<EOF
????HEAD / HTTP/1.1
????EOF
????Trying 220.181.6.175...
????Connected to www.baidu.com.
????Escape character is '^]'.
????Connection closed by foreign host.
????#?????????????????
????????????????
????[chengmo@centos5 shell]$ (echo -e "HEAD / HTTP/1.1 ";sleep 2)|telnet www.baidu.com 80
????Trying 220.181.6.175...
????Connected to www.baidu.com.
????Escape character is '^]'.
????HTTP/1.1 200 OK
????Date: Thu?? 21 Oct 2010 15:51:58 GMT
????Server: BWS/1.0
????Content-Length: 6218
????Content-Type: text/html;charset=gb2312
????Cache-Control: private
????Expires: Thu?? 21 Oct 2010 15:51:58 GMT
????Set-Cookie: BAIDUID=0B6A01ACECD5353E4247E088A8CB345A:FG=1; expires=Thu?? 21-Oct-40 15:51:58 GMT; path=/; domain=.baidu.com
????P3P: CP=" OTI DSP COR IVA OUR IND COM "
????Connection: Keep-Alive
????#??????????sleep ??????????sleep ???1???????
?????????????sleep??echo?????2?????????telnet?????????????2???????????
??????????棺???()?????????????????????????????????У????????????????????????echo??????????????????????????????б?????????????????????????telnet ?????????????????????????????telnet ?????()?????????????????????????????
????????????棺??????????????????????????????????????telnet???????telnet???????????????????????????????????й????
????????????????????sleep???????????????telnet ????2????? ????????????telnet???????????????????????baidu??????????????
??????????????????????????????????й????
??????????echo ??telnet????????????????????????sleep?????÷?????
?????????????telnet??????????????????????????????????????????????????????????.
????????
????telnet??echo ??? http??????????????дsocket???????????socket????????????н????????????????????????????????????y????telnet???echo ??????????????
???????????shell?????????????memcache??
?????????
#!/bin/sh
#???????ip ???????????????÷???????
#copyright chengmo qq:8292669
#???????????????
function sendmsg()
{
msg=$1;
echo "$1">&8;
getout;
}
#??socket??????????????????÷??????
function getout()
{
#read ???? -u ???????????? 8 ????????-d???????????: ???з?
while read -u 8 -d $' ' name;
do
if [ "${name}" == "END" -o "${name}" == "ERROR" ];then
break;
fi;
echo $name;
done
}
#?????memcached??????????????END????ERROR(???????????ж??????"END"?????????????????????????????
if [ $
# -lt 2 ];then
echo "usage:$0 host port [command]";
exit 1;
fi;
[[ $
# -gt 2 ]]&&command=$3;
#???????? ???command??????????stats
command="${command=stats}";
host="$1";
port="$2";
exec 8<>/dev/tcp/${host}/${port};
#??????????8
if [ "$?" != "0" ];then
echo "open $host $port fail!";
exit 1;
fi
sendmsg "$command";
#???????????
sendmsg "quit";
#??????????????
exec 8<&-;
exec 8>&-;
#???socket???
exit 0;
???????????????????socket???У?????????????????????????????????????????????Ρ??????????????????????sendmsg ???????????????????????????д??????
????????????????
????????????telnet??????????
????[chengmo@centos5 shell]$ (echo “stats”;sleep 2)|telnet 127.0.0.1 11211
???????nc????????
????[chengmo@centos5 shell]$ (echo “stats”)|nc 127.0.0.1 11211
??????????????????????
????????????????棬????shell???????????????????????????????????ftp??pop3??stmp????????????????Щ?????????shell socket?????????????ò????????????緢??????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Linux??????DDR????????????Linux?????????????????豸??????????linux???в???????????м??????????????????????????Linux????Linux??DNS????????????γ???????????Linux?????????????Linux????(???)????????Linux ????????????????????????????????Windows???У?Linux???????Linux????????????????Linux iommu??vfio???????Linux????ε???TCP???????Linux?????????????СLinux?·???????????Linux???Jexus?й?Asp.Net Core??ó???Linux?????????Щ??
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????