Netscreen VIP 設定

Netscreen OS5提供Virtual Host功能,對於非固定IP制的使用者算是個好消息,以在Netscreen 5XP新增PCAnywhere為例

Objects > Services > Custom > New: 輸入下面的內容,然後按一下 OK:
Service Name: PCAnywhere
No 1:
Transport protocol: TCP
Source Port Low: 0
Source Port High: 65535
Destination Port Low: 5631
Destination Port High: 5631
No 2:
Transport protocol: UDP
Source Port Low: 0
Source Port High: 65535
Destination Port Low: 5632
Destination Port High: 5632

Network > Interfaces > Edit ( 對於 Untrust) > VIP > New VIP Service
Virtual IP: 外部IP
Virtual Port: 5631(對於多連接埠服務,輸入服務的最低連接埠號碼作為虛擬連接埠號碼)
Map to Service: PcAnywhere(5631)

按下OK離開,接下來要設定規則
Policies > (From: Untrust, To: Trust) New: 輸入下面的內容,然後按一下 OK:
Source Address:
Address Book Entry: ( 選擇), Any
Destination Address:
Address Book Entry: ( 選擇), VIP(外部IP)
Service: PCAnywhere
Action: Permit

若要啟用 VIP 以支援多連接埠服務,必須輸入 CLI 指令set vip multi-port,儲存組態,然後將裝置重新開機。

開啟命令提示字元
> telnet xxx.xxx.xxx.xxx(Netscreen IP)
> login: your account
> password: your password
> nx5xp2-> set vip multi-port
> nx5xp2-> exit

重開防火牆,完成

CONVMV: perl 的批次檔案/目錄名稱轉碼

    iconv是好用的轉碼程式,但是對於批次轉目錄/檔案名稱時就有點麻煩,需要自己寫個小程式。不過其實免了,已有人開發了這個好用的PERL小程式叫做CONVMV

    下載點 http://www.j3e.de/linux/convmv/,目前最新版本為1.10

測試(僅列出結果)將filename目錄下的所有Big5檔名轉換為utf-8

$ convmv -f big5 -t utf-8 filename/*

實際轉檔

$ convmv –notest -f big5 -t utf-8 filename/*

MySQL 複製失敗

    按照官方說法只要MySQL Master的版本不比Slave新仍可以複製。由於Slave機器硬體更新系統亦從RH8升級到CENTOS5,內附MySQL為5.0版,直接將原來的BINARY資料庫直接複製過來使用,並未遇上短密碼的問題。但是網頁部分卻發生帳號無法登入的問題,目前仍無法解決。

    至於資料庫複製起初正常,但在Master新增某些資料時便會造成複製失敗。在拜過Google大神後,有人提到加大max_allow_packet後還是無法改善,看來只有更換回4.1一途了…

Centos 5 : Yum Update 無法升級 perl-5.8.8-10

進行yum update時出現以下錯誤

[root@mindman yum.repos.d]# yum upgrade perl
Loading “installonlyn” plugin
Setting up Upgrade Process
Setting up repositories
Reading repository metadata in from local files
Resolving Dependencies
–> Populating transaction set with selected packages. Please wait.
—> Package perl.i386 4:5.8.8-10.el5_0.2 set to be updated
–> Running transaction check

Dependencies Resolved

=========================================

Package Arch Version Repository Size
=========================================

Updating:
perl i386 4:5.8.8-10.el5_0.2 updates 12 M

Transaction Summary
=========================================

Install 0 Package(s)
Update 1 Package(s)
Remove 0 Package(s)

Total download size: 12 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test

Transaction Check Error:
file /usr/lib/perl5/5.8.8/Getopt/Long.pm from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Getopt-Long-2.36-1
file /usr/lib/perl5/5.8.8/newgetopt.pl from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Getopt-Long-2.36-1
file /usr/share/man/man3/Getopt::Long.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Getopt-Long-2.36-1
file /usr/lib/perl5/5.8.8/Test/Builder.pm from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Test-Simple-0.70-1
file /usr/lib/perl5/5.8.8/Test/Builder/Module.pm from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Test-Simple-0.70-1
file /usr/lib/perl5/5.8.8/Test/Builder/Tester.pm from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Test-Simple-0.70-1
file /usr/lib/perl5/5.8.8/Test/More.pm from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Test-Simple-0.70-1
file /usr/lib/perl5/5.8.8/Test/Simple.pm from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Test-Simple-0.70-1
file /usr/share/man/man3/Test::Builder.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Test-Simple-0.70-1
file /usr/share/man/man3/Test::Builder::Module.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Test-Simple-0.70-1
file /usr/share/man/man3/Test::Builder::Tester.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Test-Simple-0.70-1
file /usr/share/man/man3/Test::Builder::Tester::Color.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Test-Simple-0.70-1
file /usr/share/man/man3/Test::More.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Test-Simple-0.70-1
file /usr/share/man/man3/Test::Simple.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Test-Simple-0.70-1
file /usr/share/man/man3/Test::Tutorial.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Test-Simple-0.70-1
file /usr/lib/perl5/5.8.8/Math/BigFloat.pm from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Math-BigInt-1.86-1
file /usr/lib/perl5/5.8.8/Math/BigInt.pm from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Math-BigInt-1.86-1
file /usr/lib/perl5/5.8.8/Math/BigInt/Calc.pm from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Math-BigInt-1.86-1
file /usr/lib/perl5/5.8.8/Math/BigInt/CalcEmu.pm from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Math-BigInt-1.86-1
file /usr/share/man/man3/Math::BigFloat.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Math-BigInt-1.86-1
file /usr/share/man/man3/Math::BigInt.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Math-BigInt-1.86-1
file /usr/share/man/man3/Math::BigInt::Calc.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Math-BigInt-1.86-1
file /usr/share/man/man3/Math::BigInt::CalcEmu.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Math-BigInt-1.86-1
file /usr/lib/perl5/5.8.8/Math/BigRat.pm from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Math-BigRat-0.19-1
file /usr/share/man/man3/Math::BigRat.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Math-BigRat-0.19-1
file /usr/lib/perl5/5.8.8/bigint.pm from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-bignum-0.21-1
file /usr/lib/perl5/5.8.8/bignum.pm from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-bignum-0.21-1
file /usr/lib/perl5/5.8.8/bigrat.pm from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-bignum-0.21-1
file /usr/share/man/man3/bigint.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-bignum-0.21-1
file /usr/share/man/man3/bignum.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-bignum-0.21-1
file /usr/share/man/man3/bigrat.3pm.gz from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-bignum-0.21-1
file /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Sys/Syslog.pm from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Sys-Syslog-0.18-1
file /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/Sys/Syslog/Syslog.so from install of perl-5.8.8-10.el5_0.2 conflicts with file from package perl-Sys-Syslog-0.18-1

Error Summary
————-
原來是因為安裝了 MailScanner 造成的 , MailScanner 內附的一些 perl 模組以 –force 方式安裝 , 因此簡單的解決方式就是以手動方式以 –force 參數安裝新版 perl , 若 yum 已將該檔案下載至 /var/cache/yum/updates/packages , 直接以

# rpm -Uvh –force /var/cache/yum/updates/packages/
perl-5.8.8-10.el5_0.2.i386.rpm

修改 /etc/yum.repos.d/rpmforge.repo ,加入不檢查清單

exclude=perl-MIME-Base64 perl-Test-Simple perl-Getopt-Long perl-Math-BigInt perl-Math-BigRat perl-bignum perl-Sys-syslog
重新執行 yum update

最後重新安裝 MailScanner 即可