4/25/2013

安裝 SQL Server 2008時,在檢查"安裝程式支援規則”時出現 『效能計數器登錄區一致性』失敗

找了很多解決方案,包含改regedit很容易不成功,因此....從最遠史的流程動手


setup.exe /ACTION=install /SKIPRULES=PerfMonCounterNotCorruptedCheck
執行以上的參數,會忽略檢查,即可解決此問題。

4/05/2013

移除Win7的捷徑圖示

移除捷徑步驟

步驟一、解開壓縮檔,將Empty.ico放置C:\Windows
步驟二、執行Empty.reg
步驟三、重新開機,即可看到捷徑圖示不見了!

還原捷徑步驟

步驟一、點選Emptyremove.reg,重新開機即恢復預設值

下載

3/07/2013

Printer Server變更方式

常常都會碰到的問題,如何大量變更Client共用 Printer Server 的位置

請使用下列的Code,並儲存成VBScript 的格式

LISTING 1: Logon Script to Automatically Install New Printers
On error resume next

' This code enumerates the user's current network printer connections.
Set WshNetwork = CreateObject("WScript.Network")
Set oPrinters = WshNetwork.EnumPrinterConnections

For j = 0 to oPrinters.Count - 1 Step 2

  ' This code opens a comma-delimited text file containing  
  ' the corresponding old and new printers and assigns
  ' each line as an array variable.
  Const ForReading = 1
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objTextFile = objFSO.OpenTextFile ("C:\printers.txt", ForReading)

   Do Until objTextFile.AtEndOfStream
     strNextLine = objTextFile.Readline
     arrPrinterList = Split(strNextLine , ",")
     ' This section retrieves the registry value corresponding to the  
     ' default printer and assigns the registry value as a string variable.
     const HKEY_CURRENT_USER = &H80000001
     strComputer = "."
     Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _ 
        & strComputer & "\root\default:StdRegProv")
     strKeyPath = "Software\Microsoft\Windows NT\CurrentVersion\Windows"
     strValueName = "Device"
     oReg.GetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
     wscript.echo(strValue)
    ' This code takes both variables defined above and introduces conditional logic.
   
     For i = 1 to Ubound(arrPrinterList)
       If strValue =(arrPrinterList(0)) then
         Wscript.Echo "Your default printer will be changed to: " & arrPrinterList(i)
         WshNetwork.AddWindowsPrinterConnection arrPrinterList(i)
         WshNetwork.SetDefaultPrinter arrPrinterList(i)
         WshNetwork.RemovePrinterConnection arrPrinterList(0)
       Else
         If oPrinters.Item(j+1)=arrPrinterList(0) then
           WshNetwork.RemovePrinterConnection arrPrinterList(0)
           WshNetwork.AddWindowsPrinterConnection arrPrinterList(i)
         End If
     End If
  
     wscript.sleep 15000
     Next
  
   Loop
Next
wscript.echo ""
其中上述的流程需修改的應該是c:\Printers.txt
其內容應該為

\\oldserver\oldprinter,
  \\newserver\newprinter
依照上述流程,儲存後,至用戶端執行即可完成變更,亦可透過AD進行派送完成結果。
以上資訊來自於:http://www.windowsitpro.com/article/migration/print-server-migration-40882

8/28/2012

FreeBSD彩色人生

多人都覺得, 為什麼FreeBSD的人生怎麼都只有...黑與白, 因此我們可以透過下列兩套軟體, 來改變他的人生.

請先安裝Bash


cd /usr/ports/shells/bash
make install clean 
再來請安裝Gnuls

cd /usr/ports/misc/gnuls/
make install clean
兩套軟體安裝完成後還需要修改兩個部份的資訊,請依照以下資訊修改

vi /etc/profile
alias ls="gnuls --color=auto --show-control-chars"
以及

chsh
Shell: /bin/tcsh <== 把 /bin/tcsh 改成 /usr/local/bin/bash
兩個部分修改完成,登出再登入,即可看到美麗的彩人生呢!!!

8/24/2012

FreeBSD安裝防火牆(1)

FreeBSD的防火牆有很多套可以選擇,因為比較習慣IPFW因此介紹此套給各位使用,
此次也是使用CSUP進行更新,其操作方式如下
修改/etc/make.conf

 KERNCONF=I386                                     //指定要編譯的核心設定檔名稱
 SUP_UPDATE=yes                                    //自動呼叫 csup 更新
 SUP=/usr/local/bin/csup                           //指定 csup 的程式路徑
 SUPFLAGS=-L 2                                     //採用的 csup 參數
 SUPHOST=cvsup.tw.FreeBSD.org                      //指定 csup 的主機網址
 SUPFILE=/usr/share/examples/cvsup/stable-supfile
修改完成後執行以下指令

cd /usr/src
make update
此方式可以進行套件的下載,接下來需修改設定的核心資訊,
因為防火牆會與kernel有密切的關係,因此要修改後才會可以進行操作。

cd /usr/src/sys/i386/conf/
cp GENERIC MYKERNEL
vi MYKERNEL
新增以下訊息再KERNEL設定檔內
options         IPFIREWALL
options         IPFIREWALL_DEFAULT_TO_ACCEPT
options         IPFIREWALL_VERBOSE
修改後存檔,接下來要進行編譯,請使用以下指令
cd /usr/src
make buildkernel KERNCONF=MYKERNEL
make installkernel KERNCONF=MYKERNEL
安裝完成後,清除過程中產生的產物,

rm -rf /usr/obj/usr/src/sys/MYKERNEL
接下來重新開機,載入新的核心

sync ; sync ; sync ; reboot

blogspot 加入程式碼顯示


1、請登入您的blogspot,進入「設定」->「修改HTML」,將「展開小裝置範本」打勾,把底下的程式碼複製起來,放到CSS區塊中。

code { display: block;
font-family: 'Courier New';
font-size: 9pt;
overflow: auto;
border: 1px solid #ccc;
padding: 10px 10px 10px 21px;
max-height: 180px;
line-height: 1.2em;
letter-spacing: 0px;
color: #000;
background: #ccc url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFxQ2eDuDYc2mlCXj7En2XWsEXU7UwSpgOVVsxt1dlABV2__1CbPauIBKgXCyeNa7KdugI0gjZCKv0geDtw_PsvwzE5L_t45PHD7b8QD7vuPjNAZyo5ReD0hUx9oWPJXMldec9RxikAg/) left top repeat-y;}


2、貼到您的範本之後,如下圖所示


3、之後如果您要編寫有程式碼的文章,只要在「修改Html」模式中,將程式碼貼上,並在程式碼的前後加上<pre><code>程式碼</code></pre>即可。
轉載來自於:http://taium.blogspot.tw/2009/01/blog-post.html

FreeBSD更新Ports

CVSUP更新,需要另外再安裝套件,且此時也會進行編譯器等相關的套件安裝,
安裝的版本是最初的版本,但更新ports套件的時候可能會因為舊的版本而不行安裝新的套件,因此建議使用FreeBSD6.2後的版本均內建了CSUP的功能,可以直接取代CVSUP,
此我們僅需要修改以下的資訊

/etc/make.conf
將其內容新增為

 SUP_UPDATE=yes
 SUP=/usr/local/bin/csup                  //用於使用 Ports 安裝的路徑
 SUP=/usr/bin/csup                        //用於 Base System 的路徑
 SUPFLAGS=-L 2
 SUPHOST=cvsup.tw.FreeBSD.org
 PORTSSUPFILE=/usr/share/examples/cvsup/ports-supfile    
回到shell底下執行以下的指令

cd /usr/ports/
make update
執行完成後,即可進行ports套件的更新