日常工作

ZYongboy 2013-04-12

1.查询机器对外ip

curl http://20140507.ip138.com/ic.asp

2. 安装rz/sz

 yum install lrzsz

3. 安装jdk

yum install jdk -y

4. DNS,IP对应关系检测

http://ns.pb.cachecn.net/fetch_ldns.php

5. 上传文件(数据出错会重传,但不能断电续传)

rz -ybe -Z

6. 包依赖问题解决

ldd /path/to/nginx
libluajit-<VERSION>.so => not found

此类问题通常使用ldconfig命令就能解决:

echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf
ldconfig

7. 磁盘io详情查看

iostat -x -k -d 2

8. 安装iostat

yum install sysstat

安装后 就会有iostat、mpstat、sar、sa的功能

9. 网络检查

http://tools.fastweb.com.cn/index.php/Index/Diag

10. 查询重复数据

SELECT * FROM table WHERE name IN (SELECT name FROM table GROUP BY name HAVING COUNT(name) > 1)

11. 删除重复数据

DELETE FROM table WHERE name IN (SELECT name FROM table GROUP BY name HAVING COUNT(name) > 1) AND id NOT IN (SELECT MIN(id) FROM table GROUP BY name HAVING COUNT(name )>1)

12. 查出哪个IP地址连接最多,将其封了.

netstat -na|grep ESTABLISHED|awk {print $5}|awk -F: {print $1}|sort|uniq -c|sort -r +0n
netstat -na|grep SYN|awk {print $5}|awk -F: {print $1}|sort|uniq -c|sort -r +0n

相关推荐