<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5465154335668293722</id><updated>2025-05-10T02:24:05.395+08:00</updated><category term="Linux基礎"/><category term="What&#39;s Up"/><category term="百寶箱"/><category term="Mail Server"/><category term="SIP Server"/><category term="Monitor Server"/><category term="PHP"/><category term="Firewall Server"/><category term="ASP"/><category term="Android"/><category term="JavaScript"/><category term="Proxy Server"/><category term="VPN Server"/><title type='text'>唉呦~MIS先生</title><subtitle type='html'>唉呦~MIS先生，我的電腦壞了~&lt;BR&gt;&#xa;唉呦~MIS先生，我的網路不通~&lt;BR&gt;&#xa;I Yow .... MIS先生....&lt;BR&gt;&#xa;網路恆久遠，文件永留傳&lt;BR&gt;&#xa;除非是芥末日.... XD&lt;BR&gt;&#xa;或Google倒了~</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>82</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-5501910545030535802</id><published>2021-08-10T11:22:00.005+08:00</published><updated>2021-12-03T09:39:39.945+08:00</updated><title type='text'>Dedian 10 關閉休眠</title><content type='html'>Dedian 10 經過20分鐘後會進入休眠而導致斷線&amp;nbsp;&lt;div&gt;似乎是因為安裝了GNOME而造成的&amp;nbsp;&lt;/div&gt;&lt;div&gt;要取消網卡休眠：&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1.將(AC跟電池)休眠時間設為0&amp;nbsp;&lt;/div&gt;&lt;div&gt;vim
/etc/gdm3/greeter.dconf-defaults
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;span style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;sleep-inactive-ac-timeout=0&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;sleep-inactive-ac-type=&#39;blank&#39;&lt;br /&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;sleep-inactive-battery-timeout=0&lt;br /&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;sleep-inactive-battery-type=&#39;blank&#39;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;p&gt;cp /etc/gdm3/greeter.dconf-defaults /usr/share/gdm/greeter.dconf-defaults&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;background-color: black;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;2.重新啟動 gdm3&amp;nbsp;&lt;/div&gt;&lt;div&gt;systemctl restart gdm3&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3.關閉 PCI-E 的 ASPM (主動狀態電源管理)&amp;nbsp;&lt;/div&gt;vim /etc/default/grub&lt;br /&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;span style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&gt;pcie_aspm=off&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;4.重新載入 GRUB&amp;nbsp;&lt;div&gt;update-grub &amp;amp;&amp;amp; sudo update-grub2&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;5.關閉休眠服務&lt;/div&gt;&lt;div&gt;systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;6.重新開機後放置20分鐘後也不會進入休眠&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/5501910545030535802/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/5501910545030535802' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/5501910545030535802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/5501910545030535802'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2021/08/dedian-10.html' title='Dedian 10 關閉休眠'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-383225504347930852</id><published>2021-08-10T10:56:00.001+08:00</published><updated>2021-08-10T11:30:19.761+08:00</updated><title type='text'>開發人員工具 出現 網路集合代理程式無法啟動</title><content type='html'>在IE的 &lt;b&gt;開發人員工具&lt;/b&gt; 出現 &lt;b&gt;網路集合代理程式無法啟動&lt;/b&gt; 的錯誤&amp;nbsp;&lt;div&gt;修復方式為：&lt;/div&gt;&lt;div&gt;&lt;b&gt;以系統管理員身分執行&amp;nbsp;命令提示字元&lt;/b&gt;
輸入執行

&lt;blockquote&gt;&lt;span style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;color: #eeeeee;&quot;&gt;sc config diagnosticshub.standardcollector.service start=demand&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;

即可修復網路分析的功能&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/383225504347930852/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/383225504347930852' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/383225504347930852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/383225504347930852'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2021/08/blog-post.html' title='開發人員工具 出現 網路集合代理程式無法啟動'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-1939866635051484859</id><published>2012-10-24T17:13:00.004+08:00</published><updated>2012-10-24T17:13:44.330+08:00</updated><title type='text'>不登入 X-Windows 就啟動 VNC Server</title><content type='html'>&lt;br /&gt;
在 X-Windows 安裝 VNC Server (vino) 時會發現，必須要登入後才會啟動服務。&lt;br /&gt;
想在登入前就啟動 VNC 必須安裝另一套服務&lt;br /&gt;
&lt;br /&gt;
1.安裝&amp;nbsp;x11vnc&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp;yum install x11vnc&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
2.修改設定&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;vim /etc/X11/xorg.conf&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
在&amp;nbsp;&quot;Screen&quot; 區塊裡新增：&lt;br /&gt;
Section &quot;Screen&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Identifier &quot;Screen0&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Device &amp;nbsp; &amp;nbsp; &quot;Videocard0&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DefaultDepth &amp;nbsp; &amp;nbsp; 24&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SubSection &quot;Display&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Viewport &amp;nbsp; 0 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Depth &amp;nbsp; &amp;nbsp; 24&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; EndSubSection&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Option &quot;SecurityTypes&quot; &quot;VncAuth&quot; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;#新增&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Option &quot;UserPasswdVerifier&quot; &quot;VncAuth&quot; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;#新增&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Option &quot;PasswordFile&quot; &quot;/root/.vnc/passwd&quot; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;#新增&lt;br /&gt;
EndSection&lt;br /&gt;
&lt;br /&gt;
在最後新增&amp;nbsp;&quot;Module&quot; 區塊&lt;br /&gt;
Section &quot;Module&quot;&lt;br /&gt;
&amp;nbsp; Load &quot;vnc&quot;&lt;br /&gt;
EndSection&lt;br /&gt;
&lt;br /&gt;
3.設定 VNC 密碼&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;vncpasswd&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/1939866635051484859/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/1939866635051484859' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/1939866635051484859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/1939866635051484859'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2012/10/x-windows-vnc-server.html' title='不登入 X-Windows 就啟動 VNC Server'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-7940788083290266955</id><published>2011-04-21T14:19:00.011+08:00</published><updated>2011-04-21T14:52:38.909+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><title type='text'>Android 編譯時遇到 LOCAL_MODULE_TAGS 的錯誤</title><content type='html'>&lt;div&gt;編譯時載入模組有時會出現錯誤.....&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;如果在編譯時出現下列訊息：&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:74: *** Module name: 01-test&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:75: *** Makefile location: external/dhcpcd&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:76: *&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:77: * Each module must use a LOCAL_MODULE_TAGS in its&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:78: * Android.mk. Possible tags declared by a module:&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:79: *&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:80: *     optional, debug, eng, tests, samples&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:81: *&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:82: * If the module is expected to be in all builds&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:83: * of a product, then it should use the&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:84: * &quot;optional&quot; tag:&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:85: *&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:86: *    Add &quot;LOCAL_MODULE_TAGS := optional&quot; in the&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:87: *    Android.mk for the affected module, and add&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:88: *    the LOCAL_MODULE value for that component&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:89: *    into the PRODUCT_PACKAGES section of product&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:90: *    makefile(s) where it&#39;s necessary, if&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:91: *    appropriate.&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:92: *&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:93: * If the component should be in EVERY build of ALL&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:94: * products, then add its LOCAL_MODULE value to the&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:95: * PRODUCT_PACKAGES section of&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:96: * build/target/product/core.mk&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:97: *&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;build/core/base_rules.mk:98: *** user tag detected on new module - user tags are only supported on legacy modules.  Stop.&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;只需要看第二行 『Makefile location: external/dhcpcd』 的 external/dhcpcd 路徑下，&lt;/div&gt;&lt;div&gt;修改 Android.mk ，&lt;/div&gt;&lt;div&gt;找到第一行的 『Module name: 01-test』的 LOCAL_MODULE := 01-test，&lt;/div&gt;&lt;div&gt;在下面加入 LOCAL_MODULE_TAGS := optional 即可&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;或是&lt;/div&gt;&lt;div&gt;有找到 LOCAL_MODULE_TAGS := user 的話&lt;/div&gt;&lt;div&gt;改成     LOCAL_MODULE_TAGS := optional&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/7940788083290266955/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/7940788083290266955' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/7940788083290266955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/7940788083290266955'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2011/04/android-localmoduletags.html' title='Android 編譯時遇到 LOCAL_MODULE_TAGS 的錯誤'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-7112595125208663534</id><published>2011-03-23T15:58:00.003+08:00</published><updated>2011-03-23T16:42:08.586+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux基礎"/><title type='text'>自訂記錄檔輪替 logrotate</title><content type='html'>&lt;div&gt;建立編輯 /etc/logrotate.d/ 下的檔案，例如：&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;vim /etc/logrotate.d/asterisk&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;※執行 logrotate 會自動匯入/etc/logrotate.d/ 下的檔案執行&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;內容格式為：&lt;/div&gt;&lt;div&gt;&lt;div&gt;/var/log/asterisk/messages {&lt;/div&gt;&lt;div&gt;        weekly&lt;/div&gt;&lt;div&gt;        size=10M&lt;/div&gt;&lt;div&gt;        rotate 5&lt;/div&gt;&lt;div&gt;        nocompress&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;※/var/log/asterisk/messages 為要進行處理的記錄檔&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;※weekly 為每週更換一次紀錄檔，另有 daily 每日、monthly 每月 &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;※size=10M 為紀錄檔的上限，超過即會更換記錄檔，另有單位 k&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;※rotate 5  為保留紀錄檔的數量，檔名會以 messages.1~messages.5 方式命名，數字越大的越舊&lt;/div&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, serif; font-size: 16px; white-space: normal; &quot;&gt;※&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, serif; font-size: 16px; white-space: normal; &quot;&gt;nocompress 為紀錄檔不壓縮，壓縮為 &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, serif; font-size: 16px; white-space: normal; &quot;&gt;compress&lt;/span&gt;  &lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, serif; font-size: 16px; white-space: normal; &quot;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;儲存後，可執行 logrotate -v -f /etc/logrotate.conf 來立即處理記錄檔的輪替&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/7112595125208663534/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/7112595125208663534' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/7112595125208663534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/7112595125208663534'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2011/03/logrotate.html' title='自訂記錄檔輪替 logrotate'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-8551116279808666574</id><published>2011-03-18T15:33:00.003+08:00</published><updated>2011-03-18T16:23:05.856+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SIP Server"/><title type='text'>Asterisk的canreinvite</title><content type='html'>&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;想要讓兩支分機通話封包直接互相傳送，而不經過Server，藉以藉低伺服器的負擔，可以修改 sip.conf裡分機設定的canreinvite。&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;reinvite的限制如下：&lt;br /&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;互通分機需都設成 &lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;canreinvite=yes&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt; 分機本身必須支援通話所用的 &lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;codecs&lt;/span&gt;&lt;/b&gt;，不能透過 Asterisk 去轉譯 &lt;/li&gt;&lt;li&gt; extensions.conf裡 &lt;a title=&quot;Asterisk cmd Dial&quot; href=&quot;http://www.voip-info.org/wiki/view/Asterisk+cmd+Dial&quot;&gt;Dial() &lt;/a&gt; 指令不能包含有 &lt;b&gt;&#39;&#39;&lt;span class=&quot;Apple-style-span&quot;&gt;t&lt;/span&gt;&#39;&#39;、&#39;&#39;&lt;span class=&quot;Apple-style-span&quot;&gt;T&lt;/span&gt;&quot;、&quot;&lt;span class=&quot;Apple-style-span&quot;&gt;h&lt;/span&gt;&quot;、&quot;&lt;span class=&quot;Apple-style-span&quot;&gt;H&lt;/span&gt;&quot;、&quot;&lt;span class=&quot;Apple-style-span&quot;&gt;w&lt;/span&gt;&quot;、&quot;&lt;span class=&quot;Apple-style-span&quot;&gt;W&lt;/span&gt;&quot;、&quot;&lt;span class=&quot;Apple-style-span&quot;&gt;L&lt;/span&gt;&quot;&lt;span class=&quot;Apple-style-span&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;還有一個特殊情況是當環境裡需要監聽DTMF時也不能 reinvite，如果要讓部分分機放棄監聽而可以 reinvite 的話，可以試試看在 sip.conf 裡指定 &lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;dtmfmode=info&lt;/span&gt;&lt;/b&gt; 。&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/8551116279808666574/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/8551116279808666574' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/8551116279808666574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/8551116279808666574'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2011/03/asteriskcanreinvite.html' title='Asterisk的canreinvite'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-7198171593993799137</id><published>2011-02-23T15:16:00.002+08:00</published><updated>2017-02-03T16:08:20.306+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux基礎"/><title type='text'>封鎖暴力入侵(更新版 V1)</title><content type='html'>新版本更新POP3登入錯誤紀錄的的篩選規則&lt;br /&gt;
&lt;div&gt;
及更新時間變數的BUG&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
使用方法如前版本 &lt;a href=&quot;http://i-yow.blogspot.com/2008/07/pop3logip-blockpop3-blocktime.html&quot;&gt;封鎖POP3暴力入侵&lt;/a&gt;  ，只需更新程式檔即可。&lt;br /&gt;
&lt;br /&gt;
新增：&lt;/div&gt;
&lt;div&gt;
◎blockpop3.pl：新增POP3紀錄判斷 ( &lt;a href=&quot;https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/blockpop3/blockpop3.pl&quot; id=&quot;lhzc&quot; title=&quot;下載&quot;&gt;下載&lt;/a&gt; )&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
更新：&lt;/div&gt;
&lt;div&gt;
◎blockpop3：主程式，進行頻率分析、封鎖 ( &lt;a href=&quot;https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/blockpop3/blockpop3&quot; id=&quot;lhzc&quot; title=&quot;下載&quot;&gt;下載&lt;/a&gt; )&lt;br /&gt;
◎blocktime.pl：LOG時間判斷程式 ( &lt;a href=&quot;https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/blockpop3/blocktime.pl&quot; id=&quot;xuaa&quot; title=&quot;下載&quot;&gt;下載&lt;/a&gt; )&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
未更新：&lt;/div&gt;
&lt;div&gt;
◎blockmsg.pl：訊息通知程式 ( &lt;a href=&quot;https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/blockpop3/blockmsg.pl&quot; id=&quot;lhn:&quot; title=&quot;下載&quot;&gt;下載&lt;/a&gt; )  　&lt;br /&gt;
◎blocksasl.pl：SASL判斷 ( &lt;a href=&quot;https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/blockpop3/blocksasl.pl&quot; id=&quot;lhn:&quot; title=&quot;下載&quot;&gt;下載&lt;/a&gt; )&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/7198171593993799137/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/7198171593993799137' title='18 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/7198171593993799137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/7198171593993799137'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2011/02/v1.html' title='封鎖暴力入侵(更新版 V1)'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>18</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-6469715765407583039</id><published>2010-08-23T09:53:00.005+08:00</published><updated>2010-08-23T09:56:20.843+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="百寶箱"/><title type='text'>檔案複寫服務的 JRNL_WRAP_ERROR 錯誤</title><content type='html'>&lt;div&gt;在事件檢視器的&quot;檔案複寫服務&quot;出現下列錯誤時：&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;檔案複寫服務偵測出複本組 &quot;DOMAIN SYSTEM VOLUME (SYSVOL SHARE)&quot; 在 JRNL_WRAP_ERROR 狀態。&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt; &lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt; 複本組名稱是:   &quot;DOMAIN SYSTEM VOLUME (SYSVOL SHARE)&quot; &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small; &quot;&gt;&lt;i&gt;複本根路徑是:   &quot;c:\windows\sysvol\domain&quot;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small; &quot;&gt;&lt;i&gt;複本根磁碟區是: &quot;\\.\C:&quot;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;  複本組發生 JRNL_WRAP_ERROR，因為它嘗試讀取 NTFS USN 日誌，但找不到這個日誌。 這可能是因為下列原因所導致。 &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt; &lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt; [1] 磁碟區 &quot;\\.\C:&quot; 已經被格式化。 &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt; [2] 在磁碟區 &quot;\\.\C:&quot; 的 NTFS USN 日誌已被刪除。 &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt; [3] 在磁碟區 &quot;\\.\C:&quot; 的 NTFS USN 日誌已被截斷。如果 Chkdsk 在日誌 結尾發現損毀的項目，就有可能會截斷日誌。 &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt; [4] 檔案複寫服務已經有很長一段時間並未在這台電腦上執行。 &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt; [5] 檔案複寫服務跟不上 &quot;\\.\C:&quot; 磁碟 IO 活動的速度。 &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt; 設定 &quot;Enable Journal Wrap Automatic Restore&quot; 登錄參數為 1 將造成 下列修復步驟自動修復錯誤狀態。 &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt; [1] 在 5 分鐘內會執行第一次輪詢，並從複本組上刪除這台電腦。 如果您不想等候 5 分鐘，可以先執行 &quot;net stop ntfrs&quot;，再執行  &quot;net start ntfrs&quot;，以重新啟動檔案複寫服務。 &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt; [2] 刪除這台電腦之後，後續的輪詢會將它重新加入複本組。 重新加入的動作會觸發整個複本組樹狀目錄的同步處理。 &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt; &lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;警告: 在修復過程中，複本樹狀目錄中的資料可能無法使用。如果這 個錯誤繼續發生，您應該將上述的登錄參數重設為 0，以避免自動修復 意外地將資料變成無法使用。 &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt; &lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;如果要變更這個登錄參數，請執行 regedit。 &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt; &lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;請按 [開始] 功能表、[執行]，然後輸入 regedit。 &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt; &lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;展開 HKEY_LOCAL_MACHINE。 &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;請按機碼路徑: &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;   &quot;System\CurrentControlSet\Services\NtFrs\Parameters&quot; &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;請在下列值名稱上按兩下: &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;   &quot;Enable Journal Wrap Automatic Restore&quot; &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;並更新值。 &lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt; &lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;如果值名稱不存在，您可以使用 [編輯] 功能表 New-&amp;gt;DWORD 值的功能來新增它。 請輸入如上所顯示的正確值名稱。&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;div&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;請在 http://go.microsoft.com/fwlink/events.asp 查看說明及支援中心，以取得其他資訊。&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;除了事件記錄中建議的新增 &lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;&quot;Enable Journal Wrap Automatic Restore&quot; &lt;/i&gt;&lt;/span&gt; 值外(光是這個步驟似乎沒用)，還有另一個處理方式：&lt;br /&gt;&lt;br /&gt;1. 停止 FRS 服務&lt;div&gt;    &lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;net stop ntfrs&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;p&gt;2. 執行 Regedt32.exe&lt;/p&gt;&lt;p&gt;3. 找到下列值:&lt;/p&gt;&lt;p&gt;     HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NtFrs\Parameters\Backup/Restore\Process at Startup\BurFlags&lt;/p&gt;&lt;p&gt;4. 修改十六進位值為：D2&lt;/p&gt;&lt;p&gt;5. 關閉Regedt32 &lt;/p&gt;&lt;p&gt;6. 啟動 FRS 服務&lt;/p&gt;&lt;p&gt;    &lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;net start ntfrs&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;資料來源：http://blogs.technet.com/b/csstwplatform/archive/2008/11/16/account-lockout.aspx&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:78%;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/6469715765407583039/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/6469715765407583039' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/6469715765407583039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/6469715765407583039'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2010/08/jrnlwraperror.html' title='檔案複寫服務的 JRNL_WRAP_ERROR 錯誤'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-6738479634117206626</id><published>2010-08-10T14:09:00.003+08:00</published><updated>2010-08-10T14:11:47.448+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><title type='text'>JavaScript  取小數點</title><content type='html'>JavaScript 要取到小數點下的指定位數，要四捨五入時有內建的toFixed()函數可使用，&lt;br /&gt;&lt;br /&gt;&lt;div&gt;例：&lt;br /&gt;var num = new Number(13.3714);&lt;br /&gt;document.write(num.toFixed());&lt;br /&gt;document.write(num.toFixed(1));&lt;br /&gt;document.write(num.toFixed(3));&lt;br /&gt;document.write(num.toFixed(10));&lt;br /&gt;&lt;br /&gt;結果：&lt;br /&gt;&lt;div&gt;13&lt;br /&gt;13.4&lt;br /&gt;13.371&lt;br /&gt;13.3714000000&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;若要無條件捨去或無條件進位，則可利用&lt;a href=&quot;http://www.w3schools.com/jsref/jsref_obj_math.asp&quot;&gt;Math Object&lt;/a&gt; 來達成。&lt;/div&gt;&lt;br /&gt;&lt;div&gt;1.使用Math.floor()無條件捨去&lt;/div&gt;&lt;br /&gt;&lt;div&gt;例：&lt;/div&gt;&lt;div&gt;var num = new Number(13.3714);&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Math.floor(num*100)/100;&lt;/div&gt;Math.floor(num*10)/10;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;結果：&lt;/div&gt;&lt;div&gt;13.37&lt;/div&gt;&lt;div&gt;13.3&lt;br /&gt;&lt;br /&gt;&lt;div&gt;2.使用Math.ceil()無條件進位&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;例：&lt;/div&gt;&lt;div&gt;var num = new Number(13.3714);&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Math.ceil(num*100)/100;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Math.ceil(num*10)/10;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;結果：&lt;/div&gt;&lt;div&gt;13.38&lt;/div&gt;&lt;div&gt;13.4&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/6738479634117206626/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/6738479634117206626' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/6738479634117206626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/6738479634117206626'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2010/08/javascript.html' title='JavaScript  取小數點'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-6343056005419332413</id><published>2010-07-21T12:04:00.003+08:00</published><updated>2010-07-21T12:06:17.157+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="百寶箱"/><title type='text'>安裝 SQL Server 2008 時，出現效能計數器登錄區已損毀的錯誤</title><content type='html'>&lt;span style=&quot;font-style: normal; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;我是在移除&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-style: normal; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;SQL Server 2005要安裝SQL Server 2008時出現。&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: normal; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;1.執行regedit&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: normal; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;2.找到 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-style: normal; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;004&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: normal; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;3.點開 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-style: normal; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Counter&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-style: normal; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;跟&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-style: normal; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;color: rgb(106, 168, 79);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Help&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-style: normal; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;看最後顯示的數字(約倒數第二行)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: normal; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;4.將數字對應到 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib 的 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-style: normal; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Last Counter&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-style: normal; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;、&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-style: normal; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;color: rgb(106, 168, 79);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;Last Help&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-style: normal; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt; ，修改為相同的數字，需注意十進位與十六進位，可在輸入時將右邊底數先選擇十進位，輸入完成後再改成十六進位即會自動換算。&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/6343056005419332413/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/6343056005419332413' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/6343056005419332413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/6343056005419332413'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2010/07/sql-server-2008.html' title='安裝 SQL Server 2008 時，出現效能計數器登錄區已損毀的錯誤'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-4402722228183379146</id><published>2010-02-26T15:37:00.002+08:00</published><updated>2010-02-26T15:39:12.813+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="What&#39;s Up"/><title type='text'>型男碟PATRIOT XPORTER XT BOOST 16G</title><content type='html'>在PCHOME買了 PATRIOT XPORTER XT BOOST 16G ，1288元&lt;br /&gt;&lt;div id=&quot;y._d&quot; style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://docs.google.com/File?id=ddqjxfsm_258f35n5zdj_b&quot; style=&quot;height: 189px; width: 300px;&quot; /&gt;&lt;br /&gt;圖片來源：&lt;a href=&quot;http://www.patriotmemory.com/products/detailp.jsp?prodline=7&amp;amp;catid=27&amp;amp;prodgroupid=64&amp;amp;id=637&amp;amp;type=11&quot;&gt;美商博帝&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;出廠預設的速度測試....&lt;br /&gt;&lt;div id=&quot;gd5h&quot; style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://docs.google.com/File?id=ddqjxfsm_259hmk6wsdc_b&quot; style=&quot;height: 232px; width: 615px;&quot; /&gt;&lt;/div&gt;&lt;br /&gt;格式化成NTFS 32K的速度測試&lt;br /&gt;&lt;div id=&quot;a_pz&quot; style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://docs.google.com/File?id=ddqjxfsm_2606tgnb8cr_b&quot; style=&quot;height: 232px; width: 615px;&quot; /&gt;&lt;/div&gt;&lt;br /&gt;果然格式化成NTFS 32K有比較快....就這樣~掰~</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/4402722228183379146/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/4402722228183379146' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/4402722228183379146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/4402722228183379146'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2010/02/patriot-xporter-xt-boost-16g.html' title='型男碟PATRIOT XPORTER XT BOOST 16G'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-6548614219266467618</id><published>2010-02-03T11:03:00.002+08:00</published><updated>2010-02-03T11:03:57.682+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux基礎"/><title type='text'>輕鬆安裝WEBMIN By YUM</title><content type='html'>&lt;span style=&quot;font-size:180%;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color:#ff9900;&quot;&gt;系統使用：CentOS 5&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1.新增WEBMIN站台&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;vim /etc/yum.repos.d/webmin.repo&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;color:#0b5394;&quot;&gt;[Webmin]&lt;/span&gt; &lt;span style=&quot;color:#0b5394;&quot;&gt;name=Webmin Distribution Neutral&lt;/span&gt; &lt;span style=&quot;color:#0b5394;&quot;&gt;baseurl=http://download.webmin.com/download/yum&lt;/span&gt; &lt;span style=&quot;color:#0b5394;&quot;&gt;enabled=1&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;2.新增WEBMIN站台GPG key&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;rpm --import http://www.webmin.com/jcameron-key.asc&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;3.YUM安裝WEBMIN&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;yum install webmin&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;4.登入WEBMIN&lt;br /&gt;http://localhost:10000/</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/6548614219266467618/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/6548614219266467618' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/6548614219266467618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/6548614219266467618'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2010/02/webmin-by-yum.html' title='輕鬆安裝WEBMIN By YUM'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-8335111390055992227</id><published>2010-01-27T10:01:00.002+08:00</published><updated>2010-01-27T10:07:24.905+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux基礎"/><title type='text'>封鎖暴力入侵(更新版)</title><content type='html'>新版本加入SASL的錯誤偵測，可以用來防止SMTP的字典攻擊&lt;br /&gt;&lt;br /&gt;使用方法如前版本 &lt;a href=&quot;http://i-yow.blogspot.com/2008/07/pop3logip-blockpop3-blocktime.html&quot;&gt;封鎖POP3暴力入侵&lt;/a&gt;  ，只需更新程式檔即可。&lt;br /&gt;&lt;br /&gt;◎blockpop3：主程式，進行頻率分析、封鎖 ( &lt;a title=&quot;下載&quot; href=&quot;http://blockpop3.googlecode.com/files/blockpop3&quot; id=&quot;lhzc&quot;&gt;下載&lt;/a&gt; )&lt;br /&gt;◎blocktime.pl：LOG時間判斷程式 ( &lt;a title=&quot;下載&quot; href=&quot;http://blockpop3.googlecode.com/files/blocktime.pl&quot; id=&quot;xuaa&quot;&gt;下載&lt;/a&gt; )&lt;br /&gt;◎blockmsg.pl：訊息通知程式 ( &lt;a title=&quot;下載&quot; href=&quot;http://blockpop3.googlecode.com/files/blockmsg.pl&quot; id=&quot;lhn:&quot;&gt;下載&lt;/a&gt; )  　&lt;br /&gt;◎blocksasl.pl：SASL判斷 ( &lt;a title=&quot;下載&quot; href=&quot;http://blockpop3.googlecode.com/files/blocksasl.pl&quot; id=&quot;lhn:&quot;&gt;下載&lt;/a&gt; )</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/8335111390055992227/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/8335111390055992227' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/8335111390055992227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/8335111390055992227'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2010/01/blog-post.html' title='封鎖暴力入侵(更新版)'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-4946283680359454832</id><published>2010-01-07T14:06:00.003+08:00</published><updated>2010-01-07T14:07:52.811+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="百寶箱"/><title type='text'>Win7、Vista 開啟被防火牆阻擋的網路地圖 By SEP</title><content type='html'>&lt;font size=&quot;2&quot;&gt;Windows 7 及 Vista上『網路地圖』(Network Map)功能所使用的LLTD，常常在使用非內建的防火牆後被阻擋而無法畫出網路環境，這時需要開啟連結層拓撲探索 (LLTD)。&lt;/font&gt;以 Symantec Endpoint Protection 11 為例：&lt;br&gt;&lt;br&gt;1.架構防火牆規則&lt;br&gt;2.新增規則&lt;br&gt;3.規則名稱自訂&lt;br&gt;4.動作選擇&lt;font size=&quot;2&quot;&gt;『&lt;/font&gt;允許此流量&lt;font size=&quot;2&quot;&gt;』&lt;/font&gt;&lt;br&gt;5.通訊埠與通訊協定&lt;br&gt;6.通訊協定選擇&lt;font size=&quot;2&quot;&gt;『&lt;/font&gt;乙太網路&lt;font size=&quot;2&quot;&gt;』&lt;br&gt;7.乙太網路類行自行輸入&lt;/font&gt;&lt;font size=&quot;2&quot;&gt;『0x88D9&lt;/font&gt;&lt;font size=&quot;2&quot;&gt;』&lt;/font&gt;&lt;br&gt;&lt;br&gt;確定加入規則後，即可在網路地圖中看到你的鄰居~&lt;br&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/4946283680359454832/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/4946283680359454832' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/4946283680359454832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/4946283680359454832'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2010/01/win7vista-by-sep.html' title='Win7、Vista 開啟被防火牆阻擋的網路地圖 By SEP'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-704851344167146097</id><published>2010-01-07T13:43:00.002+08:00</published><updated>2010-01-07T13:44:28.149+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>[PHP] 進行 HTTP 認証</title><content type='html'>&lt;font face=&quot;Courier New&quot;&gt;&amp;lt;?php&lt;br&gt;  if (!isset($_SERVER[&#39;PHP_AUTH_USER&#39;])) {&lt;br&gt;    header(&#39;WWW-Authenticate: Basic realm=&quot;My Realm&quot;&#39;);&lt;br&gt;    header(&#39;HTTP/1.0 401 Unauthorized&#39;);&lt;br&gt;    echo &#39;Text to send if user hits Cancel button&#39;;&lt;br&gt;    exit;&lt;br&gt;  } else {&lt;br&gt;    echo &quot;&amp;lt;p&amp;gt;Hello {$_SERVER[&#39;PHP_AUTH_USER&#39;]}.&amp;lt;/p&amp;gt;&quot;;&lt;br&gt;    echo &quot;&amp;lt;p&amp;gt;You entered {$_SERVER[&#39;PHP_AUTH_PW&#39;]} as your password.&amp;lt;/p&amp;gt;&quot;;&lt;br&gt;  }&lt;br&gt;?&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt;使用&lt;br&gt;&lt;font face=&quot;Courier New&quot;&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;header(&#39;WWW-Authenticate: Basic realm=&quot;My Realm&quot;&#39;);&lt;/span&gt;&lt;br style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;    header(&#39;HTTP/1.0 401 Unauthorized&#39;);&lt;/span&gt;&lt;br&gt;可使瀏覽器跳出要求輸入帳號密碼驗證的對話視窗&lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;font face=&quot;Courier New&quot;&gt;使用&lt;/font&gt;&lt;br&gt;&lt;font style=&quot;background-color: rgb(204, 204, 204);&quot; face=&quot;Courier New&quot;&gt;$_SERVER[&#39;PHP_AUTH_USER&#39;]&lt;br&gt;&lt;/font&gt;&lt;font face=&quot;Courier New&quot;&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;$_SERVER[&#39;PHP_AUTH_PW&#39;]&lt;/span&gt;&lt;br&gt;可取得輸入的帳號及密碼&lt;br&gt;&lt;br&gt;資料來源：&lt;/font&gt;PHP 手冊 &lt;a title=&quot;http://ftp.cse.yzu.edu.tw/pub/Mirror/php_manual/features.http-auth.html&quot; href=&quot;http://ftp.cse.yzu.edu.tw/pub/Mirror/php_manual/features.http-auth.html&quot; id=&quot;lz8t&quot;&gt;http://ftp.cse.yzu.edu.tw/pub/Mirror/php_manual/features.http-auth.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/704851344167146097/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/704851344167146097' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/704851344167146097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/704851344167146097'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2010/01/php-http.html' title='[PHP] 進行 HTTP 認証'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-5889666154963353127</id><published>2009-12-14T15:20:00.004+08:00</published><updated>2009-12-14T15:22:50.739+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Proxy Server"/><title type='text'>上班時間種田是沒薪水的~By Squid 定時規則</title><content type='html'>上班時間為09:00~18:00，午休時間12:00~13:00開放自由上網&lt;br&gt;&lt;br&gt;1.在squid.conf裡加入幾條規則&lt;br&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;&amp;nbsp;vim /etc/squid/squid.conf&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;◎設定休息時間&lt;br&gt;&lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;acl RestTime time 12:00-13:00&lt;/span&gt;&lt;br&gt;&lt;br&gt;◎設定上班時間&lt;br&gt;&lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;acl WorkTime time MTWHF 9:00-18:00&lt;/span&gt;&lt;br&gt;&lt;br&gt;◎設定禁止連線的網域(參考用)&lt;br&gt;&lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;acl Deny_Domain dstdomain .1001ya.com.tw .17funtv.com .51mole.com.tw .6-10.com.tw .6npc.com .6waves.com .941wan.com.tw .Plurk.com .aido.com.tw .battleknight.tw .bitefight.tw .buboo.tw .chinesegamer.net .cmwebgame.com .e72play.com .elex-tech.us .facebook.com .gamelet.com .gamez.com.tw .gindis.com .gladiatus.tw .godgame.com.tw .goldsky.com.tw .hugashaga.com.tw .ikariam.tw .joyct.com .katsuro.tw .kingsage.tw .meropar.tw .miniworld.com.tw .myspace.com .nindou.com.tw .ogame.tw .oldtu.com .playfish.com .po.msn.com.tw .roida.no-ip.org .serverhk.net .shuaing.com .tanoth.tw .timeheros.com .travian.tw .truehero.com.tw .twitter.com .wayi.com.tw .web3go.com.tw .webgame.pchome.com.tw .wlb.com.tw .wowuc.cn .ya7.com.tw .zynga.com&lt;/span&gt;&lt;br&gt;&lt;br&gt;◎設定禁止連線的IP(參考用)&lt;br&gt;&lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;acl Deny_IP dst 114.80.75.220/32 122.116.31.92/32 122.146.203.228/32 123.110.200.35/32 123.55.248.26/32 125.67.235.199/32 168.143.162.64/26 174.120.26.218/32 174.37.227.82/32 199.71.212.91/32 202.153.175.126/32 203.73.22.132/32 204.74.66.132/32 204.74.67.132/32 207.46.61.31/32 210.17.20.96/27 210.242.32.192/26 210.242.34.22/32 210.59.145.150/32 210.59.230.184/32 211.72.255.76/32 211.76.177.154/32 216.178.38.116/32 216.86.150.58/32 216.97.228.247/32 217.160.6.64/32 219.84.193.1/32 219.90.126.148/32 220.130.112.187/32 220.228.196.240/29 24.143.195.43/32 59.120.84.206/32 60.199.197.177/32 61.188.178.51/32 61.31.192.1/32 61.31.192.56/29 61.31.192.80/30 61.31.224.110/32 61.61.132.34/32 61.63.43.97/32 61.63.52.81/32 61.67.128.128/30 61.67.168.150/32 61.67.212.224/27 66.151.151.149/32 69.63.176.101/32 69.63.176.8/30 69.63.181.8/29 69.63.184.142/32 69.63.185.11/32 69.63.186.0/26 69.63.187.0/27 69.63.191.219/32 69.63.191.91/32 69.65.42.218/32 72.249.23.165/32 72.44.35.31/32 74.208.147.52/32 74.208.155.165/32 74.208.167.108/32 74.208.44.207/32 74.208.79.164/32 74.208.98.38/32 87.106.71.99/32&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;◎先設定午休時間允許的規則&lt;br&gt;&lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;http_access allow Deny_Domain RestTime&lt;/span&gt;&lt;br style=&quot;color: rgb(0, 0, 255);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;http_access allow Deny_IP RestTime&lt;/span&gt;&lt;br&gt;&lt;br&gt;◎再設定上班時間拒絕的規則&lt;br&gt;&lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;http_access deny Deny_Domain WorkTime&lt;/span&gt;&lt;br style=&quot;color: rgb(0, 0, 255);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;http_access deny Deny_IP WorkTime&lt;/span&gt;&lt;br style=&quot;color: rgb(0, 0, 255);&quot;&gt;&lt;/div&gt;&lt;br&gt;※squid的規則是越前面的規則優先順序越高。&lt;br&gt;※http_access allow 跟 deny後規則的邏輯是AND，兩個條件皆成立時才會作用。&lt;br&gt;&lt;br&gt;2.套用規則&lt;br&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;/usr/sbin/squid -k reconfigure&lt;/span&gt;&lt;br&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/5889666154963353127/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/5889666154963353127' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/5889666154963353127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/5889666154963353127'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2009/12/by-squid_14.html' title='上班時間種田是沒薪水的~By Squid 定時規則'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-6750959845538323512</id><published>2009-11-03T16:33:00.003+08:00</published><updated>2009-11-03T16:38:41.661+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>[PHP]指定範圍字串擷取、字串(數字)範圍判斷</title><content type='html'>因為某些特殊原因，所以做了這兩個FUNCTION.....&lt;br /&gt;&lt;br /&gt;◎可以在字串中取出兩特定關鍵字內的字串&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;function CatchStr($Str, $StaKey, $EndKey){&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;　$StaPos = strpos($Str, $StaKey);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;　$EndPos = strpos($Str, $EndKey);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;　$StaLen = strlen($StaKey);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;　$EndLen = strlen($EndKey);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;　$CatchKey = substr($Str, $StaPos + $StaLen , $EndPos - $StaPos - $EndLen);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;　$OtherKeyA = substr($Str, 0, $StaPos);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;　$OtherKeyB = substr($Str, $EndPos + $EndLen);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;　return array($CatchKey, $OtherKeyA, $OtherKeyB);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b style=&quot;color: rgb(0, 0, 255);&quot;&gt;CatchStr(&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;字串&lt;/span&gt;, &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;開頭關鍵字&lt;/span&gt;, &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;結尾關鍵字&lt;/span&gt;)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;例：&lt;br /&gt;$Str = &quot;ABCDE{1234567890}FGHIJK&quot;;&lt;br /&gt;$StrArray = &lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;CatchStr&lt;/span&gt;(&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;$Str&lt;/span&gt;, &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;{&lt;/span&gt;&quot;, &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;}&lt;/span&gt;&quot;);&lt;br /&gt;結果：&lt;br /&gt;$StrArray[0] = 1234567890&lt;br /&gt;$StrArray[1] = ABCDE&lt;br /&gt;$StrArray[2] = FGHIJK&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;◎可以判斷把字串中數字做範圍比較&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;function SearchNum($Str, $Target, $CountSym = &quot;,&quot;, $ToSym = &quot;-&quot;){&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　$StrArray = explode($CountSym, $Str);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　foreach ($StrArray as &amp;amp;$value) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　　if (strpos($value, $ToSym)) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　　　$VarArray = explode($ToSym, $value);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　　　if ($VarArray[0] &amp;lt;= $Target &amp;amp;&amp;amp; $Target &amp;lt;= $VarArray[1]){&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　　　　$Touch = &quot;true&quot;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　　　}else{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　　　　$Touch = &quot;false&quot;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　　　}&lt;/span&gt;&lt;br /&gt;           &lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　　}else{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　　　if ($value == $Target){&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　　　　$Touch = &quot;true&quot;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　　　}else{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　　　　$Touch = &quot;false&quot;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　　　}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　　}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　}&lt;/span&gt;&lt;br /&gt;   &lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;　return $Touch;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 0, 153);&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b style=&quot;color: rgb(0, 0, 255);&quot;&gt;SearchNum(&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;字串&lt;/span&gt;, &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;欲尋找的目標數值&lt;/span&gt;, &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;每筆資料的分隔符號&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;color: rgb(0, 0, 255);&quot;&gt;(預設 , ), &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;連續資料的連接符號&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;color: rgb(0, 0, 255);&quot;&gt;(預設 - )&lt;/b&gt;&lt;b style=&quot;color: rgb(0, 0, 255);&quot;&gt;)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;例：&lt;br /&gt;$Str = &quot;1,2,3,4,5,6-10,11,12,13&quot;;&lt;br /&gt;$StrAns = &lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;SearchNum&lt;/span&gt;(&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;$Str&lt;/span&gt;, 8);&lt;br /&gt;結果：&lt;br /&gt;$StrAns = &quot;true&quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;例：&lt;br /&gt;$Str = &quot;1,2,3,4,5,6,10,11,12,13&quot;;&lt;br /&gt;$StrAns = &lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;SearchNum&lt;/span&gt;(&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;$Str&lt;/span&gt;, 8);&lt;br /&gt;結果：&lt;br /&gt;$StrAns = &quot;false&quot;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;其實這兩個Function還沒有很完美，&lt;br /&gt;CatchStr()還不能判斷字串中有多個關鍵符號，目前只能取第一次出現的關鍵符號。&lt;br /&gt;SearchNum()還不能判斷連續數字的大小順序，只能由小到大判斷。&lt;br /&gt;&lt;br /&gt;以後有空在改版~ :P</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/6750959845538323512/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/6750959845538323512' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/6750959845538323512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/6750959845538323512'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2009/11/php.html' title='[PHP]指定範圍字串擷取、字串(數字)範圍判斷'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-4219264957045650697</id><published>2009-10-29T10:54:00.002+08:00</published><updated>2009-10-29T10:55:16.078+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="百寶箱"/><title type='text'>網路開機 Wake on Lan</title><content type='html'>◎在Windows下，使用命令列網路開機&lt;br /&gt;1.從Depicus下載&lt;a href=&quot;http://www.depicus.com/wake-on-lan/wake-on-lan-cmd.aspx&quot;&gt;WoL Command Line&lt;/a&gt;程式&lt;br /&gt;2.解壓縮後得到WolCmd.exe&lt;br /&gt;3.從命令列執行或是寫成批次擋執行&lt;br /&gt;EX.&lt;br /&gt;d:\wolcmd 001122334455 200.210.230.240 255.255.255.240&lt;br /&gt;d:\wolcmd 00aabbccddee 10.0.0.254 255.255.255.0&lt;br /&gt;&lt;br /&gt;Depicus官網： &lt;a title=&quot;http://www.depicus.com/wake-on-lan/&quot; href=&quot;http://www.depicus.com/wake-on-lan/&quot; id=&quot;krfr&quot;&gt;http://www.depicus.com/wake-on-lan/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Depicus下載： &lt;a title=&quot;http://www.depicus.com/download.aspx?product=commandline&quot; href=&quot;http://www.depicus.com/download.aspx?product=commandline&quot; id=&quot;bsy_&quot;&gt;http://www.depicus.com/download.aspx?product=commandline&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;◎在Linux下，使用命令列網路開機&lt;br /&gt;1.使用RPM安裝&lt;br /&gt;&lt;div style=&quot;margin-left: 40px; background-color: rgb(204, 204, 204);&quot;&gt;rpm -ivh http://gsd.di.uminho.pt/jpo/software/wakeonlan/downloads/wakeonlan-0.41-0.fdr.1.noarch.rpm&lt;br /&gt;&lt;/div&gt;2.執行 wakeonlan&lt;br /&gt;EX.&lt;br /&gt;一般喚醒&lt;br /&gt;&lt;div style=&quot;margin-left: 40px; background-color: rgb(204, 204, 204);&quot;&gt;wakeonlan 00:11:22:33:44:99&lt;br /&gt;&lt;/div&gt;指定IP跟PORT&lt;br /&gt;&lt;div style=&quot;margin-left: 40px; background-color: rgb(204, 204, 204);&quot;&gt;wakeonlan -i 192.168.1.1 -p 7 00:11:22:33:44:99&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;官網： &lt;a title=&quot;http://gsd.di.uminho.pt/jpo/software/wakeonlan/&quot; href=&quot;http://gsd.di.uminho.pt/jpo/software/wakeonlan/&quot; id=&quot;bu.k&quot;&gt;http://gsd.di.uminho.pt/jpo/software/wakeonlan/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/4219264957045650697/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/4219264957045650697' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/4219264957045650697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/4219264957045650697'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2009/10/wake-on-lan.html' title='網路開機 Wake on Lan'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-9009127473460594203</id><published>2009-10-22T13:43:00.004+08:00</published><updated>2009-10-22T13:47:16.860+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Firewall Server"/><title type='text'>使用tc進行限流(QOS)</title><content type='html'>&lt;div&gt;&lt;b id=&quot;m_nu2&quot;&gt;&lt;span id=&quot;m_nu3&quot; style=&quot;color: rgb(255, 102, 0);&quot;&gt;&lt;span style=&quot;font-size:180%;&quot;&gt;系統使用CentOS 5.1&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;使用內建的tc指令進行限流&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;1.編輯tc規則&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;◎此例是與iptables規則檔放在一起，也可另外存放執行&lt;br /&gt;&lt;/div&gt;&lt;p style=&quot;margin-left: 40px;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;vim /etc/iptables.rule &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 40px;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;#設定網卡參數&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 40px;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;WAN_IF=&quot;eth0&quot;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 40px;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;LAN_IF=&quot;eth1&quot;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;div&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;#下載限流規則(針對內部網卡)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;##清除規則&lt;/span&gt;&lt;br /&gt;/sbin/tc qdisc del dev $LAN_IF root 2&amp;gt;/dev/null&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;##設定預設群組&lt;/span&gt;&lt;br /&gt;/sbin/tc qdisc add dev $LAN_IF root handle 10: htb default 30&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;##設定群組總流量，rate保障頻寬、ceil限制頻寬&lt;/span&gt;&lt;br /&gt;/sbin/tc class add dev $LAN_IF parent 10:  classid 10:1 htb rate 256kbps ceil 256kbps&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;##設定各群組限流，prio為分配頻寬的優先順序&lt;/span&gt;&lt;br /&gt;/sbin/tc class add dev $LAN_IF parent 10:1 classid 10:10 htb rate 64kbps ceil 256kbps prio 1&lt;br /&gt;/sbin/tc class add dev $LAN_IF parent 10:1 classid 10:20 htb rate 64kbps ceil 128kbps prio 1&lt;br /&gt;/sbin/tc class add dev $LAN_IF parent 10:1 classid 10:30 htb rate 32kbps ceil 64kbps prio 2&lt;br /&gt;/sbin/tc qdisc add dev $LAN_IF parent 10:10 handle 101: pfifo&lt;br /&gt;/sbin/tc qdisc add dev $LAN_IF parent 10:20 handle 102: pfifo&lt;br /&gt;/sbin/tc qdisc add dev $LAN_IF parent 10:30 handle 103: pfifo&lt;br /&gt;/sbin/tc filter add dev $LAN_IF parent 10: protocol ip prio 100 handle 10 fw classid 10:10&lt;br /&gt;/sbin/tc filter add dev $LAN_IF parent 10: protocol ip prio 100 handle 20 fw classid 10:20&lt;br /&gt;/sbin/tc filter add dev $LAN_IF parent 10: protocol ip prio 100 handle 30 fw classid 10:30&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;#上傳限流規則(針對外部網卡)&lt;/span&gt;&lt;br /&gt;/sbin/tc qdisc del dev $WAN_IF root 2&amp;gt;/dev/null&lt;br /&gt;/sbin/tc qdisc add dev $WAN_IF root handle 10: htb default 30&lt;br /&gt;/sbin/tc class add dev $WAN_IF parent 10:  classid 10:1 htb rate 256kbps ceil 256kbps&lt;br /&gt;/sbin/tc class add dev $WAN_IF parent 10:1 classid 10:10 htb rate 64kbps ceil 256kbps prio 1&lt;br /&gt;/sbin/tc class add dev $WAN_IF parent 10:1 classid 10:20 htb rate 64kbps ceil 128kbps prio 1&lt;br /&gt;/sbin/tc class add dev $WAN_IF parent 10:1 classid 10:30 htb rate 32kbps ceil 64kbps prio 2&lt;br /&gt;/sbin/tc qdisc add dev $WAN_IF parent 10:10 handle 101: pfifo&lt;br /&gt;/sbin/tc qdisc add dev $WAN_IF parent 10:20 handle 102: pfifo&lt;br /&gt;/sbin/tc qdisc add dev $WAN_IF parent 10:30 handle 103: pfifo&lt;br /&gt;/sbin/tc filter add dev $WAN_IF parent 10: protocol ip prio 100 handle 10 fw classid 10:10&lt;br /&gt;/sbin/tc filter add dev $WAN_IF parent 10: protocol ip prio 100 handle 20 fw classid 10:20&lt;br /&gt;/sbin/tc filter add dev $WAN_IF parent 10: protocol ip prio 100 handle 30 fw classid 10:30&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;2.設定iptables規則，針對IP將封包加上標記&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;◎如果美各IP需分別設定上傳跟下載的規則，用戶多時會造成規則暴增，所以我改用陣列方式執行規則&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;#建立QOSa陣列，將分組10用戶IP加入&lt;/span&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;&lt;br /&gt;&lt;/span&gt;QOSa=(192.168.1.1 192.168.1.2 192.168.1.3)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;#針對QOSa陣列，標記為群組10&lt;/span&gt;&lt;br /&gt;for IPa in ${QOSa[@]}; do&lt;br /&gt;/sbin/iptables -t mangle -A POSTROUTING -d $IPa -j MARK --set-mark 10&lt;br /&gt;/sbin/iptables -t mangle -A PREROUTING -s $IPa -j MARK --set-mark 10&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;#建立QOSa陣列，將分組20用戶IP加入&lt;/span&gt;&lt;br /&gt;QOSb=(192.168.1.10 192.168.1.11 192.168.1.12)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;#針對QOSb陣列，標記為群組20&lt;/span&gt;&lt;br /&gt;for IPb in ${QOSb[@]}; do&lt;br /&gt;/sbin/iptables -t mangle -A POSTROUTING -d $IPb -j MARK --set-mark 20&lt;br /&gt;/sbin/iptables -t mangle -A PREROUTING -s $IPb -j MARK --set-mark 20&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;3.執行規則&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;如果規則都是放在iptables.rule的話，只要執行iptables.rule即可&lt;br /&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;sh /etc/iptables.rule &lt;/span&gt;&lt;br /&gt;或是執行自建的規則檔&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/9009127473460594203/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/9009127473460594203' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/9009127473460594203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/9009127473460594203'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2009/10/qos.html' title='使用tc進行限流(QOS)'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-9194268800607422565</id><published>2009-10-08T16:43:00.002+08:00</published><updated>2009-10-22T13:55:53.914+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SIP Server"/><title type='text'>SIP的圖形管理介面：asterisk-gui</title><content type='html'>&lt;b&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;使用CentOS系統，已安裝&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;asterisk 1.4&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;1.安裝svn&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;yum install subversion&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;2.使用svn下載&lt;span style=&quot;font-family:Courier New;&quot;&gt;asterisk-gui&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);font-family:Courier New;&quot; &gt;svn co http://svn.digium.com/svn/asterisk-gui/branches/2.0 asterisk-gui&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;&lt;br /&gt;3.安裝&lt;/span&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;asterisk-gui&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);font-family:Courier New;&quot; &gt;cd asterisk-gui&lt;/span&gt; &lt;span style=&quot;background-color: rgb(204, 204, 204);font-family:Courier New;&quot; &gt;sh configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;4.設定網頁環境&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;vim /etc/asterisk/http.conf&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;b&gt;http.conf: &lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;margin-left: 80px;&quot;&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;[general]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;enabled=yes&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;bindaddr=0.0.0.0    &lt;/span&gt;#指定使用IP&lt;br /&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;bindport=8088&lt;/span&gt;           #指定使用PORT&lt;br /&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;prefix=&lt;/span&gt;asterisk&lt;br /&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;enablestatic=yes&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;5.設定登入帳號&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;vim /etc/asterisk/manager.conf&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;b&gt;manager.conf: &lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;margin-left: 80px;&quot;&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;[general]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;enabled=yes&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;webenabled=yes&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;port=5038&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;bindaddr=0.0.0.0&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 80px;&quot;&gt;[admin]                                       #登入ID&lt;br /&gt;secret=admin123                          #登入密碼&lt;br /&gt;deny=0.0.0.0/0.0.0.0                    #拒絕來源的IP&lt;br /&gt;permit=127.0.0.1/255.255.255.0     #允許來源的IP&lt;br /&gt;read = system,call,log,verbose,command,agent,user&lt;br /&gt;write = system,call,log,verbose,command,agent,user&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;執行&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;make checkconfig &lt;span style=&quot;background-color: rgb(255, 255, 255);&quot;&gt;可以檢查是否有設定錯誤&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/9194268800607422565/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/9194268800607422565' title='6 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/9194268800607422565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/9194268800607422565'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2009/10/sipasterisk-gui.html' title='SIP的圖形管理介面：asterisk-gui'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-7850958025594471473</id><published>2009-09-13T18:20:00.002+08:00</published><updated>2009-09-13T18:22:02.213+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux基礎"/><title type='text'>Linux 指令歷程紀錄</title><content type='html'>&lt;div&gt;想要查詢之前執行過的指令，除了按↑一條條指令往前回溯外，也可以直接開啟 .bash_history 檔，直接瀏覽所有的歷程紀錄。&lt;br /&gt;.bash_history 的路徑位於每個帳號的家目錄下&lt;br /&gt;&lt;br /&gt;EX.&lt;br /&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family:細明體;&quot;&gt;/home/User/.bash_history  &lt;/span&gt;&lt;/b&gt;&lt;u&gt;&lt;span style=&quot;font-family:細明體;&quot;&gt;User的紀錄位置&lt;/span&gt;&lt;/u&gt;&lt;/p&gt;&lt;b&gt;&lt;span style=&quot;font-family:細明體;&quot;&gt;/root/.bash_history&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family:細明體;&quot;&gt;       &lt;/span&gt;&lt;/b&gt;&lt;u&gt;&lt;span style=&quot;font-family:細明體;&quot;&gt;root的紀錄位置&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;◎要使指令不進行紀錄，只需要修改profile&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 0); background-color: rgb(204, 204, 204);&quot; &gt;vim /etc/profile&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;b style=&quot;color: rgb(0, 0, 0);&quot;&gt;HISTSIZE=0&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;◎若只想部分指令不紀錄，可修改.bashrc&lt;br /&gt;&lt;br /&gt;1.編輯.bashrc，加入指令&lt;br /&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;vim .bashrc&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;b&gt;export HISTCONTROL=ignorespace &lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;2.重新載入.bashrc&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;source .bashrc&lt;/span&gt;&lt;br /&gt;或重新登入&lt;br /&gt;&lt;br /&gt;※也可以直接執行&lt;b&gt;HISTCONTROL=ignorespace&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;這樣只要在執行指令前加一個空格，指令就不會被記錄了~</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/7850958025594471473/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/7850958025594471473' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/7850958025594471473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/7850958025594471473'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2009/09/linux.html' title='Linux 指令歷程紀錄'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-3598544838374845722</id><published>2009-08-12T10:35:00.002+08:00</published><updated>2009-08-12T10:36:34.675+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="百寶箱"/><title type='text'>清除DNS Cache</title><content type='html'>※清除DNS Cache&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;◎Window系列&lt;br /&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;p&gt;&lt;br /&gt;&lt;b&gt; ipconfig /flushdns &lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;◎Linux系列&lt;br /&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;p&gt;&lt;br /&gt;&lt;b&gt; service nscd restart &lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;◎Mac系列&lt;br /&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;p&gt;&lt;br /&gt;&lt;b&gt;lookupd -flushcache&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/3598544838374845722/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/3598544838374845722' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/3598544838374845722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/3598544838374845722'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2009/08/dns-cache.html' title='清除DNS Cache'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-501099493705189822</id><published>2009-08-04T18:33:00.002+08:00</published><updated>2009-08-04T18:33:57.939+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP"/><title type='text'>ASP使用AD的LDAP做登入驗證</title><content type='html'>以下插入&amp;lt;head&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%&lt;br /&gt;MM_LoginAction = Request.ServerVariables(&quot;URL&quot;)&lt;br /&gt;If Request.QueryString &amp;lt;&amp;gt; &quot;&quot; Then MM_LoginAction = MM_LoginAction + &quot;?&quot; + Server.HTMLEncode(Request.QueryString)&lt;br /&gt;&#39;#驗證的帳號表單&lt;br /&gt;MM_valUsername = CStr(&lt;b style=&quot;color: rgb(255, 0, 0);&quot;&gt;Request.Form(&quot;userid&quot;)&lt;/b&gt;)&lt;br /&gt;If MM_valUsername &amp;lt;&amp;gt; &quot;&quot; Then&lt;br /&gt;  Dim MM_fldUserAuthorization&lt;br /&gt;  Dim MM_redirectLoginSuccess&lt;br /&gt;  Dim MM_redirectLoginFailed&lt;br /&gt;dim strpassword,domainname&lt;br /&gt;dim objDomain,objADsPath,objConnection,objCommand,objRS&lt;br /&gt; &lt;br /&gt;MM_fldUserAuthorization = &quot;&quot;&lt;br /&gt;&#39;#驗證成功後前往的頁面&lt;br /&gt;MM_redirectLoginSuccess = &quot;&lt;b&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;LoginSuccess.asp&lt;/span&gt;&lt;/b&gt;&quot;&lt;br /&gt;&#39;#驗證失敗後前往的頁面&lt;br /&gt;MM_redirectLoginFailed = &quot;&lt;b&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;LoginFailed.asp&lt;/span&gt;&lt;/b&gt;&quot;&lt;br /&gt;&#39;#驗證的密碼表單名稱&lt;br /&gt;strpassword=&lt;b style=&quot;color: rgb(255, 0, 0);&quot;&gt;Request.Form(&quot;passwd&quot;)&lt;/b&gt;&lt;br /&gt;&#39;#驗證網域名稱，EX:domain.com，填入domain即可&lt;br /&gt;domainname=&quot;&lt;b style=&quot;color: rgb(255, 0, 0);&quot;&gt;domain&lt;/b&gt;&quot;&lt;br /&gt;&lt;br /&gt;on error resume next&lt;br /&gt;&lt;br /&gt;Set objDomain = GetObject (&quot;GC://rootDSE&quot;)&lt;br /&gt;objADsPath = objDomain.Get(&quot;defaultNamingContext&quot;)&lt;br /&gt;Set objDomain = Nothing&lt;br /&gt;Set objConnection = Server.CreateObject(&quot;ADODB.Connection&quot;)&lt;br /&gt;objConnection.provider =&quot;ADsDSOObject&quot;&lt;br /&gt;objConnection.Properties(&quot;User ID&quot;) = domainname+&quot;\&quot;+MM_valUsername&lt;br /&gt;objConnection.Properties(&quot;Password&quot;) = strpassword&lt;br /&gt;objConnection.open &quot;Active Directory Provider&quot;&lt;br /&gt;Set objCommand = CreateObject(&quot;ADODB.Command&quot;)&lt;br /&gt;Set objCommand.ActiveConnection = objConnection&lt;br /&gt;objCommand.CommandText =&quot;select cn FROM &#39;GC://&quot;+objADsPath+&quot;&#39; where sAMAccountname=&#39;&quot;+MM_valUsername+&quot;&#39;&quot;&lt;br /&gt;Set objRS = objCommand.Execute&lt;br /&gt;&lt;br /&gt;If Err.Number = 0 Then&lt;br /&gt;&#39;#驗證成功後產生帳號的Session&lt;br /&gt;    Session(&quot;MM_Username&quot;) = MM_valUsername&lt;br /&gt;    Response.Redirect(MM_redirectLoginSuccess)&lt;br /&gt;else&lt;br /&gt;  Response.Redirect(MM_redirectLoginFailed)&lt;br /&gt;End if&lt;br /&gt;End if&lt;br /&gt;%&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;以下插入&amp;lt;body&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;form id=&quot;form2&quot; name=&quot;form1&quot; method=&quot;POST&quot; action=&quot;&amp;lt;%=MM_LoginAction%&amp;gt;&quot;&amp;gt;&lt;br /&gt;    &amp;lt;p align=&quot;center&quot;&amp;gt;帳號：&lt;br /&gt;        &amp;lt;label&amp;gt;&lt;br /&gt;            &amp;lt;input name=&quot;userid&quot; type=&quot;text&quot; id=&quot;userid&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/label&amp;gt;&lt;br /&gt;    &amp;lt;/p&amp;gt;&lt;br /&gt;    &amp;lt;p align=&quot;center&quot;&amp;gt;密碼：&lt;br /&gt;        &amp;lt;label&amp;gt;&lt;br /&gt;            &amp;lt;input type=&quot;password&quot; name=&quot;passwd&quot; id=&quot;passwd&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/label&amp;gt;&lt;br /&gt;    &amp;lt;/p&amp;gt;&lt;br /&gt;    &amp;lt;p align=&quot;center&quot;&amp;gt;&lt;br /&gt;        &amp;lt;label&amp;gt;&lt;br /&gt;            &amp;lt;input type=&quot;submit&quot; name=&quot;login&quot; id=&quot;login&quot; value=&quot;送出&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/label&amp;gt;&lt;br /&gt;        &amp;lt;label&amp;gt;&lt;br /&gt;            &amp;lt;input type=&quot;reset&quot; name=&quot;clean&quot; id=&quot;clean&quot; value=&quot;重設&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/label&amp;gt;&lt;br /&gt;    &amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/501099493705189822/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/501099493705189822' title='8 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/501099493705189822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/501099493705189822'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2009/08/aspadldap.html' title='ASP使用AD的LDAP做登入驗證'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-7739090961186172390</id><published>2009-07-29T10:33:00.003+08:00</published><updated>2009-07-29T10:59:46.978+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mail Server"/><title type='text'>Postfix的郵件&amp;quot;備份&amp;quot;方式</title><content type='html'>Postfix也可以使用BCC的方式來備份收發的信件&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;vim /etc/postfix/main.cf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;有三種模式可以使用，直接在main.cf加入即可&lt;div style=&quot;margin-left: 40px;&quot;&gt;1.以收件者判斷&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 80px;&quot;&gt;recipient_bcc_maps = hash:/etc/postfix/recipient_bcc&lt;br /&gt;加入後編輯規則檔&lt;br /&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;vim /etc/postfix/recipient_bcc&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;User@mail.com.tw bcc@mail.com.tw&lt;br /&gt;&lt;/div&gt;存檔後產生DB&lt;br /&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;/usr/sbin/postmap /etc/postfix/recipient_bcc&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;2.以寄件者判斷&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 80px;&quot;&gt;sender_bcc_maps = hash:/etc/postfix/sender_bcc&lt;br /&gt;加入後編輯規則檔&lt;br /&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;vim /etc/postfix/sender_bcc&lt;/span&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;Sender@mail.com.tw bcc@mail.com.tw&lt;br /&gt;&lt;/div&gt;存檔後產生DB&lt;br /&gt;&lt;span style=&quot;background-color: rgb(204, 204, 204);&quot;&gt;/usr/sbin/postmap /etc/postfix/sender_bcc&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;3.全部備份&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;always_bcc = Admin@mail.com.tw&lt;br /&gt;直接加入要轉寄的帳號即可&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;※關鍵字範例&lt;br /&gt;&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;br /&gt;  1.&quot;user@mail.tw&quot;：指定帳號&lt;br /&gt;2.&quot;user*@mail.tw&quot;：指定帳號含萬用字元&lt;br /&gt;3.&quot;user&quot;：指定本機帳號&lt;br /&gt;4.&quot;user*&quot;：指定本機帳號含萬用字元&lt;br /&gt;5.&quot;@mail.tw&quot;：指定網域&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/7739090961186172390/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/7739090961186172390' title='33 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/7739090961186172390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/7739090961186172390'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2009/07/postfix.html' title='Postfix的郵件&amp;quot;備份&amp;quot;方式'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>33</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5465154335668293722.post-6287454918411647134</id><published>2009-07-28T18:05:00.002+08:00</published><updated>2009-07-28T18:20:34.495+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mail Server"/><title type='text'>邪惡的Archive Mail備份郵件(By MailScanner)</title><content type='html'>MailScanner有一個邪惡又好用的功能：『Archive Mail』&lt;br /&gt;這個比Forward還要厲害的功能，當你想要存留(備份)用戶收、&lt;u&gt;&lt;b&gt;發&lt;/b&gt;&lt;/u&gt;的信件時，用這就就對了~&lt;br /&gt;&lt;br /&gt;1.啟動Archive功能&lt;br /&gt;    vim /etc/MailScanner/MailScanner.conf&lt;br /&gt;        Archive Mail = /etc/MailScanner/archive.rule&lt;br /&gt;&lt;br /&gt;2.編輯Archive規則&lt;br /&gt;    vim /etc/MailScanner/archive.rule&lt;br /&gt;    基本規則如下：&lt;br /&gt;    FromOrTo:      User@mail.com*  yes forward Admin@mail.com.tw&lt;br /&gt;    (收件者或寄件者)    (關鍵字，可配合萬用字元)    (yes，啟用規則)    (forward，動作)    (Forward的目標)&lt;br /&gt;&lt;br /&gt;※Archive Mail不但可以過濾到本機網域的帳號，也可以以外部帳號作為關鍵字，只要有經過MailScanner掃描的都可以做處理。&lt;br /&gt;※以上只是簡單的例子，Archive Mail還有許多變化跟應用</content><link rel='replies' type='application/atom+xml' href='http://i-yow.blogspot.com/feeds/6287454918411647134/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5465154335668293722/6287454918411647134' title='34 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/6287454918411647134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5465154335668293722/posts/default/6287454918411647134'/><link rel='alternate' type='text/html' href='http://i-yow.blogspot.com/2009/07/archive-mailby-mailscanner.html' title='邪惡的Archive Mail備份郵件(By MailScanner)'/><author><name>Yow</name><uri>http://www.blogger.com/profile/04409310655229730113</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>34</thr:total></entry></feed>