公告版位

指令為 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) 人氣()

# mkdir /mnt/cifs 

mount.cifs //192.168.1.1/file_dir /mnt/cifs -o username='myUsername',password='myPassword',codepage=cp950
(此指令為掛載)

or 

mount -t cifs //192.168.1.1/file_dir /mnt/cifs -o username='myUsername',password='myPassword',codepage=cp950
(此指令也是掛載) 

 

# umount /mnt/cifs
(此為取消掛載) 

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

step1. # vim /etc/init.d/dhcpd

step2. 將daemon --pidfile=$pidfile $exec $DHCPDARGS 2>/dev/null 改成 daemon --pidfile=$pidfile $exec eth0 $DHCPDARGS 2>/dev/null
(主要是加上了eth0, 這樣一來,DHCP server在派送ip只會對這個interface(eth0)做,而不會對eth1做。這樣做的理由為假設兩張網卡為不同網段,這樣就可以避掉eth1這個網段的其他電腦來要ip) 

step3. # service dhcpd restart

 

資料來源:
1. http://go-linux.blogspot.com/2006/12/dhcp-server.html
2. http://www.csie.nctu.edu.tw/~tsaiwn/course/introcs/history/linux/linux.tnc.edu.tw/techdoc/dhcp.htm 

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

由於工作需求,主管要我另起一台DNS server,但這台新的DNS server要把舊的DNS server資料全部copy過來,於是我參考了一些文章,自己來記錄一下過程!

step1: 在新的CentOS 5.5 安裝所需之packages
        # yum install bind-utils bind-chroot bind bind-libs 

step2: 先停止舊的DNS service
        # service named stop 

step3: 將舊的DNS server的/var/named/chroot下的var與etc目錄皆複製到新的CentOS的/var/named/chroot也就是要有以下這兩個目錄! 因為DNS主要的設定檔皆在裡面!
        - /var/named/chroot/var
        - /var/named/chroot/etc

step4: 啟動新的CentOS裡的DNS service,指令如下!
        # service named start 

 

參考資料來源:
1. http://blog.faq-book.com/?p=2969
2. http://linux.vbird.org/linux_basic/0580backup/0580backup-fc4.php
3. http://ithelp.ithome.com.tw/question/10072913 

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

原來acpid daemon要啟動後,才有辦法在遠端用OpenIPMI下ipmitool指令去做power soft.不過,如果在BIOS下已開啟ACPI的話,就可以在BIOS的畫面直接下power soft.

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

自己建來CentOS的LiveCD,裡面有詳細的教學https://projects.centos.org/trac/livecd/

網頁有地方有錯:請將「LANG=C livecd-creator --config=centos-livecd-desktop.ks --fslabel=CentOS-5.4--LiveCD」改成「LANG=C livecd-creator -c kickstart.ks -f LiveCD」

註:可使用livecd-iso-to-pxeboot指令將iso換成pxe可以吃的檔案!

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

OpenIPMI command

Packages are OpenIPMI, OpenIPMI-tools, OpenIPMI-libs.

$ ipmitool -U username -P password -H 192.168.1.5 chassis power on
$ ipmitool -U username -P password -H 192.168.1.5 chassis power off
$ ipmitool -U username -P password -H 192.168.1.5 chassis power cycle
$ ipmitool -U username -P password -H 192.168.1.5 chassis power soft
$ ipmitool -U username -P password -H 192.168.1.5 chassis power status

$ ipmitool -U username -P password -H 192.168.1.5 chassis bootdev pxe
$ ipmitool -U username -P password -H 192.168.1.5 chassis bootdev bios
$ ipmitool -U username -P password -H 192.168.1.5 chassis bootdev disk

$ ipmitool -U username -P password -H 192.168.1.5 bmc info
$ ipmitool -U username -P password -H 192.168.1.5 lan print
$ ipmitool -U username -P password -H 192.168.1.5 lan set 1 ipsrc static
$ ipmitool -U username -P password -H 192.168.1.5 lan set 1 ipaddr 192.168.1.5
$ ipmitool -U username -P password -H 192.168.1.5 lan set 1 netmask 255.255.255.0
$ ipmitool -U username -P password -H 192.168.1.5 lan set 1 defgw ipaddr 192.168.1.254
$ ipmitool -U username -P password -H 192.168.1.5 mc info
$ ipmitool -U username -P password -H 192.168.1.5 mc reset cold

$ ipmitool -U username -P password -H 192.168.1.5 sdr
$ ipmitool -U username -P password -H 192.168.1.5 sel list

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

ALPHA AGS-24X switch開關ports的方法:
$ config ports 1 state enable
$ config ports 1 state disable

ALPHA AGS-24X switch看ports狀態的方法:
$ show ports 1
$ sh ports 1

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