2008年12月31日 星期三

Symantec FTP - 快速更新病毒碼與掃毒引擎

Symantec FTP
ftp://ftp.symantec.com/AVDEFS/symantec_antivirus_corp/rapidrelease/

快速更新病毒碼與掃毒引擎

SAV 10.x, 9.x (Symantec AntiVirus Corporate Edition)
symrapidreleasedefsi32.exe
symrapidreleasedefsi64.exe

SEP 11 (Symantec Endpoint Protection)
symrapidreleasedefsv5i32.exe
symrapidreleasedefsv5i64.exe

2008年12月29日 星期一

無法移除Windows Search 4.0

首先檢查C:\Windows\$NtUninstallKB940157$是否有這個folder,
請注意此folder是個隱藏目錄,
若是找不到$NtUninstallKB940157$則進行以下步驟

1.備份系統設定 Backup System Configuration

若系統是Windows 2003請先備份registry
(1)開始Start->執行run->輸入regedit.exe->確定OK
(2)HKEY_LOCAL_MACHINE->右鍵->匯出(export)

若系統是XP建議也作備份registry或做一個系統還原點
(1)所有程式(Programs)->附屬應用程式(Accessories)->系統工具(System Tools)->系統還原(System Restore)


2.修改登錄檔 Modify registry
(1)開始Start->執行run->輸入regedit.exe->確定OK
(2)在登錄檔編輯器左邊展開到以下位置
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB940157

(3)在此位置KB940157按滑鼠右鍵,選擇刪除DELETE

(4)比照辦理刪除此registry Key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB940157

3.重新安裝Windows Search 4.0

4.從新增移除程式(Add or Remove programs)裡找到Windows Search 4.0並移除它

從文字檔清單中增加群組成員add Groups members from a textfile

1.Create a local group named "TESTGROUP"

2.Create three local users
net user brad /add
net user mary /add
net user jack /add

3.Create a Text file in C:\Temp\members.txt with the three local user

brad
mary
jack

C:\FOR /F %u IN (C:\Temp\members.txt) DO net locagroup TESTGROUP %u /ADD

2008年12月28日 星期日

SQL Server 2005 Books Online 線上叢書 (2008 年 11 月) (December 2008)

SQL Server 2005 Books Online 線上叢書新版本已經在2008-12-16發佈
開發人員或管理人員可以透過下面連結到微軟官方網站下載更新程式

[Microsoft Download官方下載更新]
版本: 9.00.3072
發佈日期: 2008/12/16
語言: 繁體中文
下載項目大小: 154.9 MB
SQL Server 2005 線上叢書 (2008 年 11 月)

File Name: SqlServer2K5_BOL_Dec2008.msi
Version: 9.00.3104
Date Published: 12/16/2008
Language: English
Download Size: 137.3 MB
SQL Server 2005 Books Online (December 2008)

2008年12月26日 星期五

控制台Control Panel 啟動Command

使用control.exe程式可跳過控制台直接開啟圖示,
大部分的control panel extension file放在C:\Windows\System32\*.cpl

以下列出常用
新增硬體 - CONTROL Hdwwiz.cpl
新增或移除程式 - CONTROL Appwiz.cpl
日期與時間 - CONTROL Timedate.cpl
顯示 - CONTROL Desk.cpl
網際網路選項 - CONTROL Inetcpl.cpl
網路連線 - CONTROL Ncpa.cpl
系統 - CONTROL System.cpl
電源選項 - CONTROL Powercfg.cpl
使用者帳戶 - CONTROL Nusrmgr.cpl
使用者帳戶2 - CONTROL Userpasswords2
系統管理工具 - CONTROL admintools
字型 - CONTROL fonts
鍵盤 - CONTROL keyboard
滑鼠 - CONTROL mouse
排定的工作 - CONTROL schedtasks

Windows firewall Command Line 開例外清單Port

Windows firewall Command Line 開例外清單Port Range
[Single Port]
開8080/TCP Port

C:\netsh firewall add portopening TCP 8080 "HTTP Port8080"
C:\netsh firewall delete portopening TCP 8080

[Port Range]
為FTP passive mode開5500/TCP到5700/TCP Port

C:\FOR /L %I IN (5500,1,5700) DO netsh firewall add portopening TCP %I "FTP Passive mode Port Range"%I

C:\FOR /L %I IN (5500,1,5700) DO netsh firewall delete portopening TCP %I

PS.若要將以上command寫在batch file請將%I都改成%%I才能執行

固定IIS FTP Passive Mode 使用的Port Range

IIS 5
1.開始->執行->regedit.exe->確定
2.HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msftpsvc\ParametersPassivePortRange
3.將值修改為 5000-5100

IIS 6
1.開始->執行->cmd->確定
2.C:\cd C:\Inetpub\AdminScripts
3.C:\Inetpub\AdminScripts\adsutil.vbs set /MSFTPSVC/PassivePortRange "5000-5100"
4.若出現This script does not work with Wscript->Yes
5.則會出現Would you like to registry CScript as your default host for VBscript? ->Yes
則會出現 Successfully registered CScript
6.再執行一次adsutil.vbs set /MSFTPSVC/PassivePortRange "5000-5100"
7.則會出現PassivePortRange : (STRING) "5000-5100"
表示成功

[Windows Firewall設定]


[節錄Microsoft KB 555022]
For Windows 2003 Server

a) To Enable Direct Metabase Edit
1. Open the IIS Microsoft Management Console (MMC).
2. Right-click on the Local Computer node.
3. Select Properties.
4. Make sure the Enable Direct Metabase Edit checkbox is checked.


b) Configure PassivePortRange via ADSUTIL script
1. Click Start, click Run, type cmd, and then click OK.
2. Type cd Inetpub\AdminScripts and then press ENTER.
3. Type the following command from a command prompt.
adsutil.vbs set /MSFTPSVC/PassivePortRange "5500-5700"
4. Restart the FTP service.

You'll see the following output, when you configure via ADSUTIL script:

Microsoft (R) Windows Script Host Version 5.6

Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

PassivePortRange : (STRING) "5500-5700"


For Windows 2000 Server
IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs.

In order for this PassivePortRange to work in Windows 2000, system administrator must install Service Pack 4 (SP4) or later, For additional information, visit the following article number to view the article in the Microsoft Knowledge Base:

260910 How to Obtain the Latest Windows 2000 Service Pack

Configure PassivePortRange via Registry Editor
1. Start Registry Editor (Regedt32.exe).
2. Locate the following registry key:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msftpsvc\Parameters\
3. Add a value named "PassivePortRange" (without the quotation marks) of type REG_SZ.
4. Close Registry Editor.
5. Restart the FTP service.

Note: The range that FTP will validate is from 5001 to 65535.

2008年12月24日 星期三

編輯bat檔發生警告訊息"檔案名稱,目錄名稱或磁碟區標籤語法錯誤"

當在Windows Batch檔(MS-DOS Batch檔)按右鍵選擇編輯時出現警告訊息,
windows can not find this file, make sure you typed the name correctly and then try again
檔案名稱,目錄名稱或磁碟區標籤語法錯誤,

表示Windows無法關聯.bat附檔名的編輯程式,




































解決方法:
1 .Open My Computer
2 .Click TOOLS
3. Folder Options (XP)
4. Click File Types Tab
















1. Click New
2. Type in .BAT as the extension
3. Click The Advanced TAB
4. The default Associated File Type should now be MS-DOS BATCH FILE, if not use to drop down box and select it.
5. Click OK

























1. Click on that BATCH Extension
2. Click the ADVANCED Button.
3. Under ACTIONS, Click Edit.
4. Application used to perform action:
should be:
"C:\WINDOWS\System32\NOTEPAD.EXE %1"
Without the quotation marks
5. Make sure USE DDE is checked
For application "NOTEPAD"
For Topic "SYSTEM"
6. Click OK
7. OK Again
8. Close

2008年12月19日 星期五

Xming-在 Windows 使用 Linux 桌面應用程式

被控端-Redhat Enterprise 5
[在Windows 執行Linux 桌面GUI應用程式]-可多視窗
Linux Server端需設定
1.確認啟用forward
vi /etc/ssh/sshd_conf
確認以下三個前面沒有#符號
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

[在Windows 操作完整的 X 桌面]-單一視窗或全銀幕
Linux Server端需設定
1.確認啟用forward
vi /etc/ssh/sshd_conf
確認以下三個前面沒有#符號
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

2.啟用XDMCP Server
vi /etc/gdm/custom.conf

#找出 [xdmcp], 在它下一列輸入 Enable=1
[xdmcp]
Enable=1


控制端-Windows XP
1.安裝以下四個Xming
Xming v6.9.0.31
Xming-fonts v7.3.0.22
Xming-mesa v6.9.0.31
Xming-portable-PuTTY v7.3.0.26

2.設定啟動檔
請參考網址步驟


[參考網址]
Xming下載
http://sourceforge.net/project/showfiles.php?group_id=156984

簡易教學
http://www.cs.nctu.edu.tw/help/xming.html

在 Windows 使用 Linux 桌面應用程式
http://cha.homeip.net/blog/archives/2007/08/_windows_linux.html

Use Linux over Windows with Xming
http://www.linux.com/feature/118106?theme=print

Red Hat Enterprise Linux 說明文件 Hyper link

Red Hat Enterprise Linux 5 Manual 說明文件

Red Hat Enterprise Linux 4 Manual 說明文件

http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/zh-TW/

Online html Documents
Download PDF

Windows Server Update Services (WSUS) reference hyper link list

[New Website]
Microsoft - Technet(zh-tw) - Microsoft Windows Server Update Services

Microsoft - Technet(en-us) - Microsoft Windows Server Update Services

Microsoft - Download - Windows Server Update Services 3.0 - 繁體中文

[Old Website]
Microsoft - Windows Server Update Services 技術資訊

Microsoft Download - Microsoft Windows Server Update Services 入門逐步指2005-6-14

Microsoft Download - Windows Server Update Services 操作指南 2006-1-19

Microsoft Technet - Windows Server Update Services (WSUS)

2008年12月17日 星期三

如何將AD查詢式通訊群組(動態群組)加入安全性群組(一般靜態群組)

如何將MyDynamicGroup01查詢式通訊群組(動態群組)加入Group01安全性群組(一般靜態群組)

Step01.找到Group01按滑鼠右鍵->選擇 [新增Exchange查詢式通訊群組]















Step02.
輸入MyDynamicGroup01->查詢名稱->確定->完成













[參考資料]
Microsoft Technet-Exchange Server 2003
如何將查詢式通訊群組新增為通訊群組的成員

2008年12月16日 星期二

什麼是robots.txt和Robots META標籤

SEO (Search Engine Optimization)

Google - Changing your site's title and description in search results

How To Use HTML Meta Tags

影響網站排名因素--Meta標記
關鍵詞(keywords)部分字符數不要超過200個字符(包括空格符)
描述部分(description)不要超過150個字符(包括空格符)
這是在所有搜索引擎顯示全部文字最大的長度,否則,多余的字符將被砍掉

PS.說法不一,各家搜尋引擎可能不同

什麼是robots.txt和Robots META標籤

正确标准的网站优化 Meta标签写法

寫keywords的禁忌是:
1.不要用常見詞彙。例如www,homepage,net,web等。
2.不要用形容詞,副詞。例如最好的,最大的等。
3.不要用籠統的詞彙,要盡量精確。例如不用"摩托羅拉手機",改用"V998"等

尋找合適的關鍵詞的一個技巧是:到lycos,Alta,infoseek等搜索引擎,搜索與你內容相仿的網站,查看排名前十位的網站的meta關鍵字,copy下來用到自己的站點上。

2008年12月10日 星期三

SQL Server 2000 xp_cmdshell移除與回復

1.xp_cmdshell是一個延伸預存程序,可以讓T-SQL執行shell command

 

2.SQL Server 2000 預設是啟用xp_cmdshell,而SQL Server 2005預設是停用的,可使用 [SQL Server 介面區組態] 將此功能啟用

3.預設值只有System Administrator角色可以執行xp_cmdshell

[安全考量]
雖然預設值只有System Administrator角色可以執行xp_cmdshell,當系統不幸遭遇SQL Injection攻擊,而程式沒做進一步的防禦時,而SQL Server安裝時又習慣以本機系統帳戶來啟動SQL Server,此時攻擊者則可以下dir或del等命令取得檔案目錄資訊或刪除檔案等動作,或進一步下net user等命令建立Windows管理員帳戶,或些改OS系統設定,此時等於整台系統都被駭客接管了

因此,如果不需要用到xp_cmdshell,可以考慮將xp_cmdshell移除,以下說明兩種移除法
1.T-SQL Command 移除法
2.Enterprise Manager 移除法(UI圖形介面)

-- [T-SQL Command 移除法]
-- 移除xp_cmdshell, 從SQL Server移除後
-- 更進一步可以把dll檔都刪除,
補充1的命令可以查出dll檔名稱
USE master
GO
EXEC sp_dropextendedproc 'xp_cmdshell'
GO

-- 執行以下命令來測試xp_cmdshell目前是否可用
xp_cmdshell 'dir c:\'

-- 如果將來又需要使用的時候,執行以下回復命令將xp_cmdshell加回來
-- 執行此命令的前提是xplog70.dll檔需存在
USE master
GO
EXEC sp_addextendedproc 'xp_cmdshell', 'xplog70.dll'
GO

-- [補充1]:此命令可以查出xp_cmdshell的dll檔的名稱
SELECT o.name,c.text

FROM dbo.syscomments c , dbo.sysobjects o

WHERE c.id=o.id and o.name='xp_cmdshell'

-- [補充2]:此命令可查出有哪些預存程序仍有用到xplog70.dll檔
SELECT o.name,c.text 

FROM dbo.syscomments c , dbo.sysobjects o

WHERE c.id=o.id and c.text='xplog70.dll'

-- xplog70.dll的預設路徑是
-- C:\Program Files\Microsoft SQL Server\MSSQL\Binn\xplog70.dll

-- [Enterprise Manager 移除法]
Step1.啟動Enterprise Manager
Step2.依照左圖找到xp_cmdshell

Step3.按滑鼠右鍵,選擇刪除


Step4.點選 [顯示依存的情況],此按鈕可顯示目前SQL Server有哪些物件還有用到xp_cmdshell





若沒有顯示任何物件則可進行下一個步驟,若是有顯示依存物件,則需要將依存的問題解決後才進行移除
Step5.點選 [卸除全部]

2008年12月8日 星期一

SQL Server 2000 還原資料庫到另一台主機後Login的回復作業

-- Step01.還原資料庫到另一台SQL Server
這個太簡單了就不寫了

-- Step02.查詢該資料庫User的SID
-- 假設資料庫名稱是 pubs
USE pubs
GO
SELECT [NAME],[sid] FROM sysusers;
GO

-- 假設查出資料中,有一筆名為Michael的帳戶是該資料庫的db_owner
NAME sid
Michael 0x0123456789ABCDEF0123456789ABCDEF

-- Step03.新增一個SQL Server Logins帳戶with該User的SID
USE master
GO
EXEC sp_addlogin 'Michael', 'login密碼', 'pubs', @SID=0x0123456789ABCDEF0123456789ABCDEF;
GO

-- Step04.給予db_owner角色
USE Pubs
GO
EXEC sp_addrolemember 'db_owner', 'Michael';
GO

MySQL Server Logs

MySQL 5.0 Reference Manual :: 5 MySQL Server Administration :: 5.2 MySQL Server Logs

MySQL has several different logs that can help you find out what is going on inside mysqld:

Log Type Information Written to Log
The error log Problems encountered starting, running, or stopping mysqld
The general query log Established client connections and statements received from clients
The binary log All statements that change data (also used for replication)
The slow query log All queries that took more than long_query_time seconds to execute or didn't use indexes
By default, all log files are created in the mysqld data directory.


Tsueng'blog - MySQL 設定 記錄執行過的 SQL 語法

SQL - MySQL Server 日常維護: Log 分析(mysqlsla)

Diagnosing Oracle High CPU Utilization on NT

PURPOSE
-------
The purpose of this article is to define a procedure for
diagnosing high CPU utilization by Oracle on the NT platform.


SCOPE & APPLICATION
-------------------

Intended audience for this article is anyone responsible for an
Oracle database running on an NT platform.


Diagnosing High CPU Utilization on NT
-------------------------------------

The first symptom of high CPU utilization by Oracle on NT is
usually a slow down of the entire system. The first step in
isolating Oracle as the culprit is to start Task Manager
and sort the output by CPU utilization.

The Task Manager can be started on NT by typing CTRL-ALT-DELETE.
This key sequence will NOT reboot NT it will produce a dialog box
that will allow the activation of task manager.

Once Task Manager is started the Processes tab should be selected
and then the title of the CPU column should be selected. This
will sort the output by CPU utilization. Each mouse select on the
column will switch back and forth between sorting the output
ascending and descending.

At this point viewing the output of task manager should make
it obvious if Oracle is actually the culprit and if not which
process is the problem.

After it has been established that Oracle is actually causing
the problem, then it is time to isolate what thread(s) in the
Oracle process is causing the problem. This can be done with
the NT performance monitor.

The NT performance monitor can be started on the server by following
Start --> Programs --> Administrative Tools --> Performance Monitor.

Once the Performance Monitor has been started then the following
steps should be taken.

1) click on the plus "+" sign button on the button menu bar -- the
Add to Chart dialog box should appear

2) in the Object: list box select Thread

3) in the Counter: list box select % Processor Time

4) in the Instance: list box do a multiple select on all of the ORACLE
threads (The multiple select can be accomplished by clicking on
the first instance and then shift clicking the last.)

5) Click the Add button in the dialog box and then the Done button

At this point you will see a list of instance numbers/thread/% Processor
Times at the bottom of the screen. The list shows each thread associated
with the Oracle process (assuming that only one Oracle instance is running).
If multiple Oracle instances are running, then you will find that some of
the instance numbers (thread numbers) are duplicated.

Each thread has a specific function within the Oracle process. The first
few are Oracle processes such as PMON, SMON and so forth. This is
discussed in more detail in the following articles, Note 104981.1 and
Note 48681.1.

The thread numbers that are beyond the background processes are the
server processes retrieving data from the database.

The key sequence CTRL-H will cause the current line in the display to
be highlighted. The arrow key can then be used to isolate which
process is consuming a large amount of CPU time.

One of the possible reasons for high Oracle CPU utilization is
related to SMON space management activity. Note 61997.1 covers
this activity in detail.

Note 61997.1
http://jno.h14.ru/txt/ORA-01575.html

http://kr.forums.oracle.com/forums/thread.jspa?threadID=579564

2008年12月6日 星期六

啟動AWE並設定最大最小記憶體

USE master
GO
-- 顯示進階選項
sp_configure 'show advanced options', 1
RECONFIGURE
GO
-- 啟動AWE
sp_configure 'awe enabled', 1
RECONFIGURE
GO
-- 重新啟動 SQL Server 之後,下列訊息會寫入 SQL Server 錯誤記錄:「已啟用 Address Windowing Extensions」

-- 設定最小記憶體
sp_configure 'min server memory', 1024
RECONFIGURE
GO

-- 設定最大記憶體,以下是設定為6G
sp_configure 'max server memory', 6144
RECONFIGURE
GO

[參考文件]
MSDN Library - SQL Server 2008 - 針對 SQL Server 啟用 AWE 記憶體

2008年12月5日 星期五

SQL Server CURSOR

-- DEMO CURSOR
DECLARE @ContactName nvarchar(30)
DECLARE CUR CURSOR FOR
SELECT ContactName FROM Northwind.dbo.Customers

OPEN CUR
FETCH CUR INTO @ContactName

WHILE (@@FETCH_STATUS=0)
BEGIN

PRINT @ContactName

FETCH CUR INTO @ContactName
END

CLOSE CUR
DEALLOCATE CUR

GO

2008年12月3日 星期三

遠端啟動Windows遠端桌面

前題被控制端的RPC遠程呼叫(135/TCP)要開

1.啟動登錄檔編輯器

開始->啟動->regedit->確定


2.連線到遠端主機

檔案->連線網路登錄


3.輸入要連線的主機名稱或IP



4.若出現帳號驗證視窗,則輸入遠端主機管理員帳號與密碼



5.以192.168.1.103為例,則會出現以下視窗







6.修改機碼

找到HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server

將右邊的fDenyTSConnection的REG_DWORD值改為0

按下確定後即設定完成


7.測試遠端桌面連線,若是還不行,則用shutdown命令將遠端的主機重開機

C:\shutdown –m \\遠端主機名 -r


2008年12月2日 星期二

LDAP Free Tools

LDAP Free Tools
LDAP Browser/Editor version 2.8.1
免安裝

(1)LDAP物件管理
可以檢視與編輯修改物件屬性或刪除物件

(2)Ldif檔匯出與匯入
可以將LDAP物件匯出與匯入做為備份與還原使用,
或進行新增與修改物件使用

CISC與RISC架構CPU整理

CISC架構 CISC CPU (複雜指令集的CPU)-Intel x86
RISC架構 RISC CPU (精簡指令集的CPU)-各家RISC

CISC架構
1985年,SUN公司設計出第一個RISC晶片,命名為SPARC。
在此之前,所有電腦CPU的設計都採用
CISC(Complex Instruction Set Computer,複雜指令集電腦)架構
致力追求更多更複雜的指令,讓每個指令儘可能執行更多的計算工作。
RISC原是IBM所發展出來的電腦設計觀念,其CPU只提供必要的少數指令,
而且每個指令只執行一個算數或邏輯運算。
和CSIC相比,RISC的CPU結構要簡單許多,因此容易小型化和積體化。
RSIC的優點顯而易見,CPU容易量產、比較便宜、更容易提升速度。
電腦市場中共有五種RISC CPU:
IBMPower(加上與Motorola合作的Power-PC)
DigitalAlpha(Digital因財務危機被Compaq購併,幾可預見Alpha晶片即將停產)
HPPA-RISC
SGIMIPS (SGI購併Cray)
SUNSPARC

RISC CPU在嵌入式市場的應用-
精簡指令集(RISC)架構CPU主要供應商
安謀(ARM)與美普思(MIPS)


CISC架構
x86
承襲Intel 8086,Intel 80268,Intel 80386....Pentiem..
以往x86 CPU功耗較大
在x86陣營方面,市場原本係由英特爾、超微(AMD)與威盛三分天下;
前兩造挾雙核心及多核心處理器在高效能嵌入式市場各據山頭,
而低功耗嵌入式應用則多半是超微Geode與威盛C7和Eden處理器的天下。
不過,在歷經多年的醞釀後,英特爾也打出先前代號為「Silverthorne」的神秘王牌

Intel MID(Mobile Internet Device)產品-Atom處理器
代號Silverthorne與Diamonddrille兩款,以45nm製程,1.8GHz時脈,面積不到25mm2,功耗最高只到2.5W

Atom處理器Z500系列,以及搭配另一顆系統控制器(System Controller Hub)的Menlow平台,
試圖翻轉此一局面,並做為其拓展消費性電子版圖的先鋒部隊。
正式名稱為Intel Centrino Atom,支援雙核心Core 2 Duo指令集,可執行多線程Multiple threads,
也就是與現有的x86作業系統相容。
Atom直接進入45nm(奈米)製程,使用high-k金屬閘極半導體技術,
A110與A100最高可以跑到400MHz外頻,800MHz內頻,功率在5W以下,一般是3W,
Atom的功耗低到比80486還省,連風扇都不用了,預設為BGA封裝要用專業機器才能焊接到電路板上。

AMD Geode

VIA C7-M

SQL Server Database Mirroring 資料庫鏡像

SQL Server Database Mirroring 資料庫鏡像