公告版位

DHCP Server與Client的收發或溝通關係:

step1. DHCPDISCOVER

        DHCP Server  <----------  Client
        (Client向Server要IP)


step2. DHCPOFFER

        DHCP Server ----------> Client
        (Server允許Client有獲得IP的權利)


step3. DHCPREQUEST

        DHCP Server <---------- Client
        (Client正式對Server請求一個IP)


step4. DHCPACK

        DHCP Server ----------> Client
        (Server正式發放一個IP給Client)

dreamtails 發表在 痞客邦 留言(0) 人氣()

若要把/tmp/testfile.log裡的所有數字123取代為數字888,那要如何下指令呢? 如下:

# sed -i 's/123/888/g' /tmp/testfile.log

 

dreamtails 發表在 痞客邦 留言(0) 人氣()

1>/dev/null 2>&1 為何呢?

0 = standard input (stdin)
1 = standard output (stdout)
2 = standard error (stderr)

意指將stderr轉向為stdout,而一起丟進/dev/null裡,就不會顯示文字在螢幕上。

 

dreamtails 發表在 痞客邦 留言(0) 人氣()

環境:
    (1) CentOS 6.2
    (2) Cacti-0.8.7i-PIA-3.1
    (3) settings-0.71-1, thold-0.4.9-3, monitor-1.3-1 (可至 http://docs.cacti.net/ 下載)

    我們把Cacti預設放在/var/www/html/cacti

 

dreamtails 發表在 痞客邦 留言(0) 人氣()

less /etc/service

dreamtails 發表在 痞客邦 留言(0) 人氣()

以下資料參考至:
(1) Cacti官方網頁 - http://www.cacti.net/index.php
(2) chris's Blog - http://blog.linuxchris.com/?p=38


# 安裝基本的packages
yum install -y httpd php php-mysql php-snmp php-xml mysql mysql-server \
cairo-devel libxml2-devel pango-devel pango libpng-devel freetype \
freetype-devel libart_lgpl-devel net-snmp-utils gcc wget man make \
perl-CPAN perl-ExtUtils-MakeMaker perl-ExtUtils-MakeMaker-Coverage \
crontabs xorg-x11-fonts-100dpi xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi \
ntp

dreamtails 發表在 痞客邦 留言(4) 人氣()

# wget http://192.168.100.100/test.txt
        (下載test.txt)

# wget -q http://192.168.100.100/test.txt
        (下載test.txt,而不顯示任何訊息)

dreamtails 發表在 痞客邦 留言(0) 人氣()

指令為 uptime

dreamtails 發表在 痞客邦 留言(0) 人氣()

# vim /var/lib/dhclient/dhclient-eth0.leases
      (得知eth0是由哪一台DHCP Server取得IP)

# vim /var/lib/dhclient/dhclient-eth1.leases
      (得知eth1是由哪一台DHCP Server取得IP)

dreamtails 發表在 痞客邦 留言(0) 人氣()

首先要準備兩個檔案,ip.txt 與 batTelnet.sh

ip.txt 如下:
-----------------------------------

192.168.1.11
192.168.2.22
192.168.3.33

-----------------------------------

 

batTelnet.sh 如下:
-----------------------------------

#!/bin/bash

username='root'

password='1234'
cmd1='show config'
for i in `cat ip.txt`
do
    (sleep 1;echo $username;sleep 1;echo $password;sleep 1;echo $cmd1;sleep 1)|telnet $i
done

-----------------------------------

dreamtails 發表在 痞客邦 留言(0) 人氣()

The target is a file:
# ln -s target_file create_file_link
 (create file_link)
# unlink file_link
 (remove file_link)


The target is a directory:
# ln -s target_dir create_dir_link
 (create dir_link)
# unlink dir_link
 (remove dir_link)

dreamtails 發表在 痞客邦 留言(0) 人氣()

若要找出ls指令的實際存放位置,可以下which指令來取得,如下:

# which ls
alias ls='ls --color=auto'
        /bin/ls

 

那我們就可以知道ls是存放在/bin目錄下。

dreamtails 發表在 痞客邦 留言(0) 人氣()

將以下複製貼到文字檔上,然後改成.bat檔

---------------------------------------------------------------------

@echo off
route add 66.2.0.0 mask 255.255.0.0 66.1.0.254
route add 66.3.0.0 mask 255.255.0.0 66.1.0.254
route add 66.5.0.0 mask 255.255.0.0 66.4.0.254
route add 66.7.0.0 mask 255.255.0.0 66.6.0.254
route add 66.9.0.0 mask 255.255.0.0 66.8.0.254
route add 66.11.0.0 mask 255.255.0.0 66.11.0.254
route add 66.13.0.0 mask 255.255.0.0 66.13.0.254

---------------------------------------------------------------------

 

解說:
route add 66.2.0.0 mask 255.255.0.0 66.1.0.254
只要是跑66.2的網段的封包,則都丟給66.1.0.254來做routing

 

若以上有錯誤的話,也請各位告知! 謝謝~

 

dreamtails 發表在 痞客邦 留言(0) 人氣()

# smartctl -a /dev/sda | grep -i temp | awk '{print $10}'

 

解說:

      smartctl -a /dev/sda  → 顯示HDD資訊

      grep -i temp  → -i為不分temp的大小寫

dreamtails 發表在 痞客邦 留言(0) 人氣()

# brctl delif br0 eth0
    將br0裡的eth0刪除

# brctl addif br0 eth0
    綁定eth0至br0 

# ifconfig br0 down
    將br0 down下來

# brctl show
    顯示bridge哪裡interface 

dreamtails 發表在 痞客邦 留言(0) 人氣()