UWInfo Blog
發表新文章
[Join] | [忘記密碼] | [Login]
搜尋

搜尋意見
文章分類-Jerry
[所有文章分類]
  • ASP.NET (1)
  • ASP.NET2.0 (0)
  • ASP.NET4.0 (0)
  • JavaScript (0)
  • jQuery (0)
  • FireFox (0)
  • UW系統設定 (0)
  • SQL (1)
  • SQL 2008 (0)
  • mirror (0)
  • SVN (0)
  • IE (0)
  • IIS (0)
  • IIS6 (0)
  • 閒聊 (0)
  • W3C (0)
  • 作業系統 (1)
  • C# (0)
  • CSS (1)
  • FileServer (1)
  • HTML 5 (0)
  • CKEditor (0)
  • UW.dll (0)
  • Visual Studio (0)
  • Browser (0)
  • SEO (0)
  • Google Apps (0)
  • 網站輔助系統 (2)
  • DNS (0)
  • SMTP (0)
  • 網管 (0)
  • 社群API (0)
  • SSL (0)
  • App_Inventor (0)
  • URLRewrite (0)
  • 開發工具 (0)
  • JSON (0)
  • Excel2007 (0)
  • 試題 (0)
  • LINQ (0)
  • bootstrap (0)
  • Vue (0)
  • IIS7 (0)
  • foodpanda (0)
  • 編碼 (0)
  • 資安 (0)
  • Sourcetree (0)
  • MAUI (0)
  • CMD (0)
  • my sql (0)
所有文章分類
[Jerry的分類]
  • ASP.NET (48)
  • ASP.NET2.0 (15)
  • ASP.NET4.0 (34)
  • JavaScript (49)
  • jQuery (26)
  • FireFox (4)
  • UW系統設定 (3)
  • SQL (39)
  • SQL 2008 (25)
  • mirror (4)
  • SVN (4)
  • IE (9)
  • IIS (20)
  • IIS6 (1)
  • 閒聊 (7)
  • W3C (6)
  • 作業系統 (9)
  • C# (23)
  • CSS (12)
  • FileServer (1)
  • HTML 5 (11)
  • CKEditor (3)
  • UW.dll (13)
  • Visual Studio (16)
  • Browser (8)
  • SEO (1)
  • Google Apps (3)
  • 網站輔助系統 (4)
  • DNS (5)
  • SMTP (4)
  • 網管 (11)
  • 社群API (3)
  • SSL (4)
  • App_Inventor (1)
  • URLRewrite (2)
  • 開發工具 (6)
  • JSON (1)
  • Excel2007 (1)
  • 試題 (3)
  • LINQ (1)
  • bootstrap (0)
  • Vue (3)
  • IIS7 (3)
  • foodpanda (2)
  • 編碼 (2)
  • 資安 (3)
  • Sourcetree (1)
  • MAUI (1)
  • CMD (1)
  • my sql (1)
最新回應
  • css hack 整理
    基本上也可以用 conditional comment 來 fix IE 問題把需要更正的style...more
  • 使用 Net.WebRequest 出現 ''已經嘗試太多次自動重新導向'' 的解決方法
    基本上,用GET方式,就不需要http.ContentType = "application/x-w...more
  • Windows 2008 SMB2.0 切換 SMB1.0 (與共享目錄效能有關)
    .設定完成了,觀察個幾天再說...more
  • Windows 2008 SMB2.0 切換 SMB1.0 (與共享目錄效能有關)
    成功了嗎 ? 希望不要再掛掉了 ......more
標籤
  • CROS
  • orm
  • 錯誤 CS0241:
  • [U2]
  • c
  • fancybox
  • HTTP 錯誤 40
  • IE
  • Big5
  • ad
  • 憑證匯出
  • google
  • 9660
  • 浮水印
  • ti
  • VB轉C
  • win
  • ASCII
  • Cache
  • .
  • U2
  • 亂碼
  • response
  • 8
  • if
  • data
  • 28
  • 414
  • sp_
  • max
  • 196
  • line pay??
  • IP
  • CS21211211
  • uw
  • net
  • 56
  • USER
  • 774
  • ARR
  • JPEG
  • O93Lp61v
  • div
  • IndexOf
  • 欄位
  • date
  • 104
  • 230
  • 676
  • a
攝影家手札機房設定
這是一篇加密文章,需輸入密碼才可閱讀
More...
Jerry, 2013/4/13 下午 04:01:54
MRTG 監控系統設定
查了監控 snmp 的套件,還是 mrtg 最簡單,做個紀錄一下

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
先安裝 windows server snmp 服務,啟動​並進行設定

可參考:http://blog.faq-book.com/?p=1799
設定 public 的地方需輸入,會與 mrtg 的設定有關

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
安裝 ActivePerl,並下載解壓 mrtg 到任意目錄
官網:http://mrtg.cs.pu.edu.tw/download.en.html

這裏以 c:\mrtg 為例

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
設定 c:\mrtg\bin\127.0.0.1.cfg, 並執行 c:\mrtg\bin\perl mrtg 127.0.0.1.cfg 可跑一次
會產生 html&圖 到 WorkDir: 下,再設成 iis web 即可

c:\mrtg\bin\127.0.0.1.cfg 範例
#設為背景服務
RunAsDaemon: no

#統計間隔(預設5分鐘 Interval:5)
Interval:5

#網頁訊息中文顯示
Language: big5

#瀏覽器重新讀取間隔(預設Refresh:300秒)
Refresh:300
WorkDir: c:\inetpub\wwwroot\mrtg
EnableIPv6: no

########################################################
# 127.0.0.1 CPU Loading
########################################################
Target[127.0.0.1-cpu]: .1.3.6.1.2.1.25.3.3.1.2.1&.1.3.6.1.2.1.25.3.3.1.2.2:public@127.0.0.1
Title[127.0.0.1-cpu]: CPU Loading
PageTop[127.0.0.1-cpu]: </code><h1>CPU Loading - 127.0.0.1</h1>
Colours[127.0.0.1-cpu]: R#ff4f27,Y#FFFF00,,R#ff4f27,Y#FFFF00
MaxBytes[127.0.0.1-cpu]: 100
Options[127.0.0.1-cpu]: gauge, nopercent, growright
Directory[127.0.0.1-cpu]: 127.0.0.1
YLegend[127.0.0.1-cpu]: CPU loading (%)
ShortLegend[127.0.0.1-cpu]: %
Legend1[127.0.0.1-cpu]: CPU1 負載
Legend2[127.0.0.1-cpu]: CPU2 負載
LegendI[127.0.0.1-cpu]: CPU1 負載
LegendO[127.0.0.1-cpu]: CPU2 負載


[127.0.0.1-cpu] 為產生檔名
Directory[127.0.0.1-cpu]: 127.0.0.1 會建立 127.0.0.1 的目錄來放 html&圖

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
建立 bat 排程每五分跑一次即可

mrtg.bat
perl mrtg 192.168.0.10.cfg
perl mrtg 192.168.0.20.cfg

rem 幫你建立 index.html
perl indexmaker --output c:\inetpub\wwwroot\mrtg\index.html 192.168.0.10.cfg 192.168.0.20.cfg


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
較麻煩的是 Target 的設定,為 snmp 的節點值,跟效能監視器裏的項目有點像

查到的較有用的
CPU Loading
Target[127.0.0.1-cpu]: .1.3.6.1.2.1.25.3.3.1.2.1&.1.3.6.1.2.1.25.3.3.1.2.2:public@127.0.0.1
其中 .1.3.6.1.2.1.25.3.3.1.2 固定,.1 .2 隨不同機器的 cpu 數 .3 .4 都有可能

Current Connections
Target[192.168.0.10-webusers]: .1.3.6.1.4.1.311.1.7.3.1.13.0&.1.3.6.1.4.1.311.1.7.3.1.14.0:public@127.0.0.1

Network Usage
Target[192.168.0.10-network]: \Realtek\ PCIe\ GBE\ Family\ Controller:public@127.0.0.1
這裏都會跟網卡名綁,通常用執行
perl cfgmaker --global "WorkDir: c:\inetpub\wwwroot\mrtg" --ifref=descr --ifdesc=descr public@127.0.0.1 --output network.cfg
它會幫你跑一遍路的節點,再挑出來用即可

Cpu 溫度找不到內建通用的,要安裝第三方套件,開其它篇寫

查到最完整的第三方提供 snmp 統整節點,但要錢,免費版節點很少,也沒有溫度

http://www.snmp-informant.com/
http://www.snmp-informant.com/products/std/snmp-informant-std-tree.htm 免費版節點

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
結果圖








 
More...
Jerry, 2013/4/13 下午 03:18:47
css hack 整理

<style type="text/css">
#test
    {
        width:300px;
        height:300px;
        
        background-color:blue;     /*全部, firefox*/
        background-color:red\9;     /*all ie*/
        background-color:yellow\0;    /*ie8*/
        +background-color:pink;        /*ie7*/
        _background-color:orange;     /*ie6*/
    }
    :root #test { background-color:purple\9; } /*ie9*/
    @media all and (min-width:0px){ #test {background-color:black\0;} } /*opera*/
    @media screen and (-webkit-min-device-pixel-ratio:0){ #test {background-color:gray;} } /*chrome and safari*/
</style>



由上到下的順序,目前看起來愈通用的應該放上面。
然後下面寫下特殊瀏覽器+版本的項目。
More...
Jerry, 2013/1/17 下午 03:46:26
使用 Net.WebRequest 出現 ''已經嘗試太多次自動重新導向'' 的解決方法

當使用 WebRequest 來 Get 網址時,出現"已經嘗試太多次自動重新導向"。

通常為對方網站有進行某種判斷。以下為試過的項目。

上次是將 CookieContainer 設定一個 New Net.CookieContainer 即可。

            Dim http As Net.HttpWebRequest = Net.WebRequest.Create(Url)
            http.Method = "GET"
            http.ContentType = "application/x-www-form-urlencoded;"

            http.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Win64; x64; Trident/5.0)"
            http.CookieContainer = New Net.CookieContainer
            http.Referer = Url

More...
Jerry, 2012/6/18 下午 07:54:03
查看資料庫最耗時的Sql Command
從網路找到改良的,直接查不用開Sql Profiler

加入可指定資料庫的改良
SELECT TOP 100 execution_count, total_worker_time, last_worker_time, max_worker_time, min_worker_time, CONVERT(INT, att.value) AS dbid, DB_NAME(CONVERT(INT, att.value)) as dbname ,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,((CASE statement_end_offset WHEN -1 THEN DATALENGTH(st.text)ELSE qs.statement_end_offset END - qs.statement_start_offset)/2) + 1) as statement_text
FROM sys.dm_exec_query_stats as qs 
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) as st
CROSS APPLY sys.dm_exec_plan_attributes(qs.plan_handle) att
WHERE att.attribute='dbid' and DB_NAME(CONVERT(INT, att.value)) = 'P9'
ORDER BY execution_count DESC 


以執行次數排序,可檢查爆量的Sql
Where statement_start_offset =0 測起來可以篩掉系統的Query,如:AspNet_SqlCache
SELECT TOP 10 execution_count, total_worker_time, last_worker_time, max_worker_time, min_worker_time, SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,((CASE statement_end_offset WHEN -1 THEN DATALENGTH(st.text)ELSE qs.statement_end_offset END - qs.statement_start_offset)/2) + 1) as statement_text
FROM sys.dm_exec_query_stats as qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) as st
WHERE statement_start_offset = 0
ORDER BY execution_count DESC  


以總執行時間排序,檢查寫耗時的Sql
SELECT TOP 10 total_worker_time, last_worker_time, max_worker_time, min_worker_time, SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,((CASE statement_end_offset WHEN -1 THEN DATALENGTH(st.text)ELSE qs.statement_end_offset END - qs.statement_start_offset)/2) + 1) as statement_text
FROM sys.dm_exec_query_stats as qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) as st
ORDER BY max_worker_time DESC


結果如下


 
More...
Jerry, 2012/6/8 下午 12:50:24
Squid Proxy 設定
Squid Proxy 相關處理

主站
http://www.squid-cache.org/

Windows 版本
http://squid.acmeconsulting.it/

解壓縮至 c:\squid

指令
\sbin\squid.exe
squid -?
squid -z d:\squid\var\cache 暫存目錄設定
squid -i 加入服務
squid -n Squid -k reconfigure 設定檔更新可重置,重啟服務也可以

設定檔
\etc\squid.conf
建議co個用過的來抄

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
將某一檔案更新做法
C:\squid\bin>squidclient -h localhost -p 80 -m PURGE http://bserver.img.photosharp.com.tw/Image/Advert/360x120_v1_260x87s120.jpg

若不行需設定 squid.conf
參考 http://help.getbusi.com/kb/getbusi-alert-advance/removing-individual-objects-from-squid-cache
acl manager proto cache_object 後加入一行 acl Purge method PURGE
http_access allow manager localhost 後加入一行 http_access allow localhost Purge
http_access deny manager 後加入一行 http_access deny Purge

設定檔重置
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Web & Squid 共存(不同 IP 共用80Port)

如 192.168.0.203(Web), 192.168.0.201(Squid)
IIS 的網站需指定(192.168.0.203)

squid.conf 設定檔需修改 IP 位置
http_port 192.168.0.201:80 transparent

改變 IIS 監聽 IP 的範圍
=-=-=-= Windows Server 2003 =-=-=-=
Windows Server 2003 CD\Support\Tools\Support.msi 安裝後
C:\Program Files\Support Tools 下有程式 httpcfg
httpcfg delete iplisten -i 0.0.0.0
httpcfg set iplisten -i 192.168.0.203
=-=-=-= Windows Server 2008 =-=-=-=
netsh 進入指令模式
netsh>http
netsh http>add iplisten ipaddress=192.168.0.203:80 (會取代 0.0.0.0)

重啟指令
net stop http /y
net start w3svc查看指令

netstat -an
tcp 0.0.0.0:80 需沒有
tcp 192.168.0.203:80 需有

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\ListenOnlyList
會列出開機時會載入的 httpcfg set iplisten,若 ip 有設錯 iis 可能會出現 "指定的網路名稱格式不正確"
 

More...
Jerry, 2012/6/8 下午 12:46:09
Windows 2008 SMB2.0 切換 SMB1.0 (與共享目錄效能有關)
狀況

手札的圖片共享目錄約三~四天會無法開啟(\\192.168.0.7 直接掛掉)
對應的服務 Server 會無法重新開啟

在 Windows 2008 Server 將 SMB2.0 => SMB 1.0 方法
參考連結 http://www.petri.co.il/how-to-disable-smb-2-on-windows-vista-or-server-2008.htm

Client  關閉
sc config lanmanworkstation depend= bowser/mrxsmb10/nsi
sc config mrxsmb20 start= disabled

Client 重開
sc config lanmanworkstation depend= bowser/mrxsmb10/mrxsmb20/nsi
sc config mrxsmb20 start= auto

Server
HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters\Smb2 => 設為 Dword 0
需重開機,開機完後 Client 連不到也需重開

設好後,這些背後靈又出現要設了。
HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters\MaxCmds => 500 以上
HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters\MaxMpxCt =>500 以上
HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters\MaxWorkItems => 5000以上

設完後有以下現象。
系統管理工具=>共用與存放管理=>管理工作階段  
每個連線的開啟檔案數是會增加減少跳動的,在SMB2.0下僅會緩慢增加
 




More...
Jerry, 2012/6/2 下午 03:57:43
~ Uwinfo ~