浏览模式: 标准 | 列表全部文章

freebsd下查看网卡流量信息

netstat -i  开机到当前时间的网络流量

netstat 1  实时且详细的统计当前网卡流量

systat -if   也是实时的{我喜欢这个}

» 阅读全文

Tags: 网卡流量, freebsd命令, systat

Ewebeditor 5.5

别的不说,看附件就知道了

» 阅读全文

ubuntu 里面的sudo配置文件

# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults        env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL) ALL

# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
# %sudo ALL=NOPASSWD: ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

» 阅读全文

Tags: freebsd, ubuntu, sudo配置

{转载}如何统计日志里面访问次数最多的IP

今天在论坛上看见有人在问这个问题,后面很多SHELL的高手在讨论,真的让我再一次深切的感受到了SHELL的博大精深,为之震撼。

   先看看我要处理的文件内容

[root@server2 ~]# netstat -ntu

Active Internet connections (w/o servers)

Proto Recv-Q Send-Q Local Address Foreign Address State

tcp 0 0 127.0.0.1:8652 127.0.0.1:40193 TIME_WAIT

tcp 0 0 127.0.0.1:8652 127.0.0.1:40192 TIME_WAIT

tcp 0 0 127.0.0.1:8652 127.0.0.1:40196 TIME_WAIT

tcp 0 0 127.0.0.1:8652 127.0.0.1:40199 TIME_WAIT

tcp 0 0 127.0.0.1:8652 127.0.0.1:40201 TIME_WAIT

tcp 0 0 127.0.0.1:8652 127.0.0.1:40204 TIME_WAIT

tcp 0 0 127.0.0.1:8652 127.0.0.1:40207 TIME_WAIT

tcp 0 0 127.0.0.1:8652 127.0.0.1:40210 TIME_WAIT

tcp 0 0 192.168.32.62:41682 192.168.47.207:5432 TIME_WAIT

tcp 0 0 192.168.32.62:41685 192.168.47.207:5432 TIME_WAIT

    netstat -ntu | tail -n +3 | awk '{ print $5}' | cut -d : -f 1 | sort | uniq -c| sort -n -r | head -n 5

    tail -n +3 :去掉上面用红色标明的两行。
   awk '{ print $5}':取数据的低5域(第5列),上面蓝色标明。
   cut -d : -f 1 :取蓝色部分前面的IP部分。
   sort:对IP部分进行排序。
   uniq -c:打印每一重复行出现的次数。(并去掉重复行)
    sort -n -r:按照重复行出现的次序倒序排列。
    head -n 5:取排在前5位的IP 。

[root@server2 ~]# netstat -ntu | tail -n +3|awk '{ print $5}' | cut -d : -f 1 | sort | uniq -c| sort -n -r | head -n 5
8 127.0.0.1
2 192.168.47.207

    这样我们就很清楚的得到了我们想要的结果

» 阅读全文

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'的解决

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'的解决

解决办法: 

$ sudo chown mysql:mysql /var/run/mysqld

$ sudo /etc/init.d/mysql restart

» 阅读全文

Tags: mysql, 启动错误, 错误, mysqld, mysqld.sock

不说话 watch -d free

不说话 watch -d free

» 阅读全文

ubuntu-8.04 server 软件的中文说明

花了一个下午的事件整理了一下ubuntu8.04server中安装的软件的中文说明{我主要是用来精简系统} 精简的进度很不理想.如果有朋友搞过.请留言活着加我Gmali ripsy110@gmail.com

» 阅读全文

Tags: 软件说明, ubuntu-server, ubuntu8.04

终于搞定了查询ubuntu下所有deb的依赖关系了

终于搞定了查询ubuntu下所有deb的依赖关系了
apt-cache depends $(dpkg-query -W -f='${Package} ')

根据unix shell 编程里面找到的 这个方法叫命令替换.

当使用$(command)的时候 括号里面的所有字符只用于构成命令.

» 阅读全文

Tags: dpkg-query, apt-cache, depends, 依赖关系, ubuntu

Records:24712345678910»