Wednesday, September 28, 2011

Upgrade CentOS6 to CentOS6.x

RHEL6.1已經出來一陣子了, 但是CentOS似乎沒有趕上? 一直停留在6.0, 我們該懷疑CentOS不再繼續提供更新了嗎? 喔~不! CentOS team還是有持續努力的! 只要裝上一個extra repository就可以將CentOS6.0升級到CentOS6.1了.

Steps:
# yum install centos-release-cr
# yum update

強烈建議每位CentOS users一定要裝上這個extra repository才能繼續讓你的CentOS6頭好壯壯.

Tuesday, September 27, 2011

檢查MacOSX的partition layout

MacOSX沒有fdisk的指令,但是還是有類似的指令的,其指令如下:
# diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *160.0 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh 60.2 GB disk0s2
3: Apple_HFS Data 99.4 GB disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: *8.0 GB disk1
/dev/disk2
#: TYPE NAME SIZE IDENTIFIER
0: Garmin-Asus *3.3 GB disk2

話說diskutil還真是MacOSX下的好工具呀!

Sunday, September 04, 2011

Linux上的網路流量監控程式iftop

在Linux上我常使用iptraf去監控本機的網路流量,然而今天又發現到了另一套簡單而有用的程式也可以在Linux上監控流量,它叫做iftop

以下是在CentOS6中的安裝與使用:

1. 抓取source:
# wget ftp://rpmfind.net/linux/dag/redhat/el6/en/i386/dag/RPMS/iftop-0.17-1.el6.rf.i686.rpm
(這是i386的版本 for CentOS6)

2. 安裝:
# rpm -ivh iftop*

3. 使用:
# iftop
4. 加上-P,顯示port number:

More parameters:
[root@centos6 ~]# iftop -h
iftop: display bandwidth usage on an interface by host

Synopsis: iftop -h | [-npbBP] [-i interface] [-f filter code] [-N net/mask]

-h display this message
-n don't do hostname lookups
-N don't convert port numbers to services
-p run in promiscuous mode (show traffic between other
hosts on the same network segment)
-b don't display a bar graph of traffic
-B Display bandwidth in bytes
-i interface listen on named interface
-f filter code use filter code to select packets to count
(default: none, but only IP packets are counted)
-F net/mask show traffic flows in/out of network
-P show ports as well as hosts
-m limit sets the upper limit for the bandwidth scale
-c config file specifies an alternative configuration file

iftop, version 0.17
copyright (c) 2002 Paul Warren and contributors
[root@centos6 ~]#