瀏覽模式: 普通 | 列表

xargs指令

當一個目錄裡的檔案太多,而我卻仍是要刪除它們,該怎麼作
rm: too many arguments 或 rm: Argument list too long)

怎麼作

ls | xargs -0 rm -f

怎麼排成一個名稱一行

ls | xargs -n1


怎麼排成只有一行

cat /etc/passwd | xargs
標籤: xargs

HA + heartbeat-director

為了備援 Director主機


安裝負載平衡

   參考: http://ssorc.tw/index.php?load=read&id=205

安裝備援

   參考: http://ssorc.tw/index.php?load=read&id=204

 

接著修改 Master & Slaver的 haresources

   vi /etc/ha.d/haresources

cross.ssorc.tw IPaddr::192.168.1.88/32/eth0/192.168.1.88 ldirectord

記得事先停用 ldirectord

 

測式 master

   service network stop

[閱讀全文]

標籤: 負載平衡

Mrtg + 其它應用

由 top指令得到 mysql的 CPU百分值

top -b -u mysql -n1 | grep mysqld | awk '{print $9}'

free指令取得記憶體容使用量

#!/bin/bash

memtotal=`free -m | grep "Mem:" | awk '{print $2}'`
memused=`free -m | grep "Mem:" | awk '{print $3}'`
memfree=`free -m | grep "Mem:" | awk '{print $4}'`

echo $memused
echo $memfree
echo $memtotal

   vi mrtg-mem.cfg

[閱讀全文]

標籤: 監控 mrtg

iptables.sh + Bridge mode

#!/bin/bash
# 2006/10/18 Author cross@ssorc.tw
set -x

exif="eth0"
inif="eth1"

exip="210.17.16.68"
inip="10.1.1.1"

exnet="210.17.16.64/255.255.255.224" # -> 210.17.16.64/27
innet="10.1.1.0/24"

iptables -F
iptables -F -t nat
iptables -F -t mangle

[閱讀全文]

iptables.sh + NAT

#!/bin/bash
# 2006/10/19 Fixed by cross@ssorc.tw
set -x

[閱讀全文]

sysstat套件

每兩秒查看 cpu使用率,共五次

        sar -u 2 5

Linux 2.6.9-42.0.3.EL (ssorc.tw)     01/03/2007

09:46:46 AM       CPU     %user     %nice   %system   %iowait     %idle
09:46:48 AM       all      4.02      0.00      2.01      0.00     93.97
09:46:50 AM       all      3.00      0.00      1.00      0.00     96.00
09:46:52 AM       all      2.50      0.00      2.00      0.00     95.50
09:46:54 AM       all      5.50      0.00      2.50      0.00     92.00
09:46:56 AM       all      8.00      0.00      2.50      0.00     89.50
Average:          all      4.60      0.00      2.00      0.00     93.39

查看網路設備

[閱讀全文]

標籤: 硬碟 io

重裝 WindwosXP + 錯誤訊息

自已碰過的情況,查了資料
   Quote: http://support.microsoft.com/kb/326676/zh-tw

徵狀

當您在 Windows XP 安裝程式的檔案複製部份後重新啟動電腦時,可能會收到下列錯誤訊息:
Error Loading Operating System (作業系統載入錯誤)

發生的原因

這個問題的發生原因,是因為電腦 BIOS 並未正確管理或支援安裝 Windows XP 的硬碟容量。

以上資訊,我的解讀

為舊 bios支援安裝 xp所要的硬碟容量相容性問題

有這問題的那塊主機板(GA-8SIMLP F5)雖然更新了 bios,但仍產生Error Loading Operating System

原 Bios為 f3版本,更新到f5,最新為 f6不知為何無法更新