This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#进程按照内存占用逆序显示 | |
ps -eo pmem,pcpu,rss,vsize,args | sort -k 1 -r | less | |
#文件夹内批量替换字符串 | |
sed -i "s/127.0.0.1/172.16.1.1/g" `grep 127.0.0.1 -rl ./db.ini` | |
#查看连接你服务器 top10 用户端的 IP 地址 | |
netstat -nat | awk '{print $5}' | awk -F ':' '{print $1}' | sort | uniq -c | sort -rn | head -n 10 | |
#服务器查看出口ip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param string $domain Pass $_SERVER['SERVER_NAME'] here | |
* @param bool $debug | |
* | |
* @debug bool $debug | |
* @return string | |
*/ | |
function get_domain($domain, $debug = false) | |
{ |