2014年12月22日 星期一

Windows 7 您已經使用暫時設定檔登入

Reference:
Windows 7 您已經使用暫時設定檔登入

1.「本機」=>「電腦」=>「內容」=>「進階系統設定」=>「使用者設定檔」, 「刪除問題帳號」

2. 「HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\ProfileList」,找到「問題帳號」, 刪除「帳號機碼」的「資料夾」

SIP phone 啟用 "代接"

UCM61xx 代接預設按鍵為 **

GXP2130, GXP1160:
Account / Call Settings / Dail Plan: { x+ | *x+ | *xx*x+ | **xxxx }

2014年12月19日 星期五

機車手套

這幾天太冷,騎機車戴手套還是覺得手好冷。
本來想說搜尋一下 "滑雪 手套" 看看有沒有比較保暖。
結果找到這一篇 我的滑雪手套
在一般手套外加洗碗用手套,這是一個不錯的 idea!

洗碗手套的 "笑果" 太厲害了,那我改一下戴兩層手套吧。
先戴右手邊那個一般的手套,再戴左手邊那個大一點的手套。
測試結果真的太棒了~~~ 手完全不會冷。


2014/12/10 理髮

到交大理髮。

2014年12月18日 星期四

VBA for excel 儲存格

加框線
http://www.blueshop.com.tw/board/FUM20050110200833I8T/BRD20070604154513A8F.html
http://forum.twbts.com/thread-9862-1-1.html

With Sheet1.Range("a1:c4").Borders
    .LineStyle = xlContinuous
    .ColorIndex = xlThin
    .Weight = xlAutomatic
End With


合併儲存格
https://tw.knowledge.yahoo.com/question/question?qid=1011091300690

Sheet1.Range("a1:a4").Merge


文字置中
http://smile0103.blogspot.tw/2014/02/excel-vba_6447.html

Sheet1.Cells(1, 1).HorizontalAlignment = xlCenter


用 cell 選擇 range
http://blog.xuite.net/crdotlin/excel/9092240-%E7%94%A8Range%EF%BC%9F%E7%94%A8Cells%EF%BC%9F

Sheet1.Range(Cells(2, 2), Cells(5, 5)).Value = 5

Exchange 2010 mail size limit

Reference:
Set Message Size Limits in Exchange 2010 and Exchange 2007

1. Organization Configuration | Hub Transport | Global Settings tab | Transport Settings | properties | General tab
2. Server Configuration | Hub Transport | select a Hub Transport server | Receive Connectors -> select a connector | Properties | General tab.
3. Organization Configuration | Hub Transport | Send Connectors -> select connector | Properties | General tab.
4. mailbox size limit: Organization Configuration | Mailbox | Database Management -> select a Database | Properties | Limits tab

2014年12月17日 星期三

Perl/TK的Entry無法輸入問題

Reference:
Perl/TK的Entry無法輸入問題

在Perl程式中加入以下設定,Entry就能輸入了

$ENV{"XMODIFIERS"}='@im=none';

原因:
之前裝 Acrobat reader 時加上中文支援 yum install "@Chinese Support" 造成的。

2014年12月5日 星期五

Windows 2008 R2 DNS server failure

狀況:
網頁打不開,用 nslookup 查詢出現 server failure。

解法:
安裝 hotfix 並重開機。
http://support.microsoft.com/kb/2549656/en-US

2014/12/12 update:
還是有問題,改為用 schedule job 每天凌晨 restart DNS service。
net stop "DNS Server"
net start "DNS Server"

2014年12月4日 星期四

CentOS 5.9 allow remote display to console

Reference:
Exporting DISPLAY in X Windows

Step:
vi /etc/gdm/custom.conf
[security]
DisallowTCP=false

restart gdm using command
gdm-restart

or restart X11 using the command
init 3 && init 5

2014年12月2日 星期二

VMware VDP backup fail

Situation:
VDP backup fail.
Windows 2008 event log: The system failed to flush data to the transaction log. Corruption may occur.

2014年11月26日 星期三

Find The Last Row or Last Column Using VBA

Reference:

5 Different Ways to Find The Last Row or Last Column Using VBA


    '開啟 excel file
    Set myxlapp = CreateObject("excel.application")
    myxlapp.workbooks.Open my_excel
        With myxlapp.Sheets(1)
            excel_rows = .UsedRange.Rows.Count
            excel_columns = .UsedRange.Columns.Count
            MsgBox excel_rows & ", " & excel_columns
        End With

2014年11月18日 星期二

Lenovo x240 休眠後無法用鍵盤滑鼠喚醒

狀況:
Lenovo x240 休眠後無法用鍵盤滑鼠喚醒 (螢幕還是黑的),但是用遠端桌面可以連上。

解法:
將這三個 Windows update 解除,再立即檢查更新,將這三個更新設定為隱藏。

Linux CentOS 6.4 library error and solution

狀況:
安裝一個冷門的軟體 Q3D,它有自己的 library,執行時錯誤訊息為 symbol lookup error: /usr/lib/libXext.so.6: undefined symbol: _XGetRequest

這軟體安裝在 /opt,用 find /opt -name libXext.so.6 找到 /opt/AnsysEM/Q3DExtractor12.0/Linux/ansoftbin64/defer/libXext.so.6

試過用 setenv LD_LIBRARY_PATH /opt/AnsysEM/Q3DExtractor12.0/Linux/ansoftbin64/defer/libXext.so.6 沒效。

最後的解法:
mv /usr/lib/libXext.so.6 /usr/lib/libXext.so.6.bk
ln -s /opt/AnsysEM/Q3DExtractor12.0/Linux/ansoftbin64/defer/libXext.so.6 /usr/lib/libXext.so.6

Install Rar/Unrar centos 6

Reference:
http://whattheserver.me/billing/knowledgebase/34/Install-RarorUnrar-centos-6.html

for 64 bit
install unrar centos x64
#wget http://pkgs.repoforge.org/unrar/unrar-4.0.7-1.el6.rf.x86_64.rpm
#rpm -Uvh unrar-4.0.7-1.el6.rf.x86_64.rpm

install rar centos x64
#wget http://pkgs.repoforge.org/rar/rar-3.8.0-1.el6.rf.x86_64.rpm
#rpm -Uvh rar-3.8.0-1.el6.rf.x86_64.rpm

for 32 bit
install unrar centos 32
#wget http://pkgs.repoforge.org/unrar/unrar-4.0.7-1.el6.rf.i686.rpm
#rpm -Uvh unrar-4.0.7-1.el6.rf.i686.rpm
install rar centos 32
#wget http://pkgs.repoforge.org/rar/rar-3.8.0-1.el6.rf.i686.rpm
#rpm -Uvh rar-3.8.0-1.el6.rf.i686.rpm

you can also use matching OS rpm from
http://pkgs.repoforge.org/rpmforge-release/

2014年11月14日 星期五

vsphere data protection 5.1 安裝設定

請參考這一篇。
VMware vSphere Data Protection 5.1 安裝篇

1. 用 Deploy OVF Template 安裝
2. 設定 DNS 對應 vdp.domian.com 192.168.x.x
3. 連到 https://vdp.domain.com:8543/vdp-configure,預設帳號 root、密碼 changeme
4. 設定網路、時區、新密碼、vCenter
5. 將 VDP 重新開機
6. 登入 vSphere Web Client 才能設定 VDP 的相關備份機制
7. create backup job

2014年11月11日 星期二

SMTP Commands Reference

Reference: SMTP Commands Reference

HELO (Hello)The client sends this command to the SMTP server to identify itself and initiate the SMTP conversation. The domain name or IP address of the SMTP client is usually sent as an argument together with the command (e.g. “HELO client.example.com”). If a domain name is used as an argument with the HELO command, it must be a fully qualified domain name (also called FQDN). 

Exchange 2010 Inbound SMTP mail | 421 4.4.1 Connection timed out

狀況:
Exchange 2010無法收 mail,用 telnet mail.company.com 25 測試,敲完 helo 就出現 421 4.4.1 Connection timed out

解法:Exchange 2010 Inbound SMTP mail | 421 4.4.1 Connection timed out
1. restart service "MSExchangeTransport"
2. 將啟動模式改為 "Automatic (Delayed Start)"

2014年11月8日 星期六

Outlook and remove names from “ Global Address List “

Reference:
http://www.ozzu.com/mswindows-forum/outlook-and-remove-names-from-global-address-list-t74174.html

目的:將離職人員的e-mail從公用通訊路中移除。

1. 在 Active Directory and Computers 將要移除的帳號打開,選擇 Exchange Advanced,勾選 "Hide from Exchange address lists"


2014年11月6日 星期四

Symantec System Recovery 2013 Desktop Edition Error

錯誤訊息:
E4F3000E: Snapshot failure while using Volume Shadow Copy Service. Please check application event log for VSS errors. Error code: VSS_E_PROVIDER_VETO (-2,147,212,538). 0xE4F3000E (Symantec System Recovery)

按照 Symantec 這一篇做,還是卡在 磁碟快照 失敗。
http://www.symantec.com/business/support/index?page=content&id=TECH200584

SSR 2013 執行 磁碟快照 時,開啟 裝置管理員,發現有一個 磁碟裝置 沒有啟用。
把它啟用後磁碟快照就成功了。

-----------------------------------------------------------------------------------------------------------------------
2015/5/6 update
錯誤訊息:
EC8F03EA: Cannot create a virtual volume image of the selected drive.
E0BB00B5: 快照錯誤
EBAB03F1: 執行要求的作業時發生下列作業系統錯誤:「無法指出的錯誤.」。 0xE0BB00B5 (Symantec System Recovery)

用 Symantec 網站建議的方法還是發生錯誤。
最後把那個 partition 的資料先複製出來,把 patition format 後再將資料倒回去,就可以正常備份了。

2014年10月24日 星期五

Perl directory list - List all files that match a filename pattern

Reference:
http://alvinalexander.com/blog/post/perl/generate-all-html-files-in-directory

#!/usr/bin/perl -w

opendir(DIR, ".");
@files = grep(/\.html$/,readdir(DIR));
closedir(DIR);

foreach $file (@files) {
   print "$file\n";
}

2014年10月21日 星期二

Windows 7 TCP/IPv4 is disable

狀況:
Windows 7 網路中斷,顯示為 "沒有可用的連線"。
網路卡的狀態是已啟用。
網路和共用中心的狀態是 相依服務或群組無法啟動。
用Notebook測試網路線可正常連線。
網路卡的TCP/IPv4內容按鍵沒辦法按。

2014年10月20日 星期一

2014/10/20 理髮

到交大理髮。
老闆娘說我的頭髮變少了....

2014/10/18 ~ 19 生病記錄

10/18 (六) 晚上肚子感覺不舒服。
10/19 (日) 凌晨腹瀉。早上起床感覺肚子還好就照原定記畫去跑步。跑的時候感覺使不上力,跑起來比之前慢。洗澡後出現感冒症狀,眼睛發熱、偏頭痛、腰酸背痛。趕快吃科學中藥葛根湯(但這次沒能閃過去),早午晚各吃一次,晚餐後趕緊洗澡睡覺。
10/20(一)早上感覺似乎快好了。
結論:年紀大了還是不要逞強。

2014/10/18 公司家庭日 新竹老頭擺農庄




2014年10月13日 星期一

android remote desktop mouse right click

Reference:
http://technet.microsoft.com/en-us/library/dn473010.aspx

Mouse modeMouse operationGesture
Direct Touch
Left click
1 finger tap
Direct Touch
Right click
1 finger tap and hold
Direct Touch
Zoom
Use two fingers and pinch to zoom in or move fingers apart to zoom out
Mouse Pointer
Left click
1 finger tap
Mouse Pointer
Left click and drag
1 finger double tap and hold, then drag
Mouse Pointer
Right click
2 finger tap
Mouse Pointer
Right click and drag
2 finger double tap and hold, then drag
Mouse Pointer
Mouse wheel
2 finger tap and hold, then drag up/down

2014年10月2日 星期四

2014/10/2 健身筆記

上個月看到這一篇 什麼是全球最夯的「TABATA間歇訓練」?
一天只要運動四分鐘就有成效,找到這段影片跟著做。

經過一個月,發現體脂肪上升了。
2014/8/30 體重65.2KG、體脂16.7%
2014/9/27 體重64.5KG、體脂18.5%
宣告實驗失敗~~~

2014/9/28 改回原來的運動 (伏地挺身、健腹輪、深蹲),發現無法做到上個月的強度。
只好重新來過,慢慢增加強度。

Windows 7 啟用 休眠

http://support.microsoft.com/kb/2349660/zh-tw

如果沒有 "允許混合式睡眠",請檢查 BIOS 的 Power 設定,ACPI 必須設定為 S3 以上。

2014年9月25日 星期四

2014/09/25 linux bash 漏洞

如何測試你的系統:
系統管理者可以在 Shell 底下輸入這串命令
env x='() { :;}; echo XD' bash -c "echo This is a test code"
如果回傳「XD」就代表有洞快補。
如果回傳「bash: warning: x: ignoring function definition attempt」就代表沒事,可以logout了。

修補方法:
Linux用戶使用yum update bash更新

2014年9月19日 星期五

USB flash 無法寫入 Solution

Reference:
Event ID 11 logged when plugging storage device into any USB port

狀況:
USB flash 無法寫入,拿到另一台 PC 可正常讀寫。

Event log:
Event ID 11. The driver detected a controller error on \Device\Harddisk2\DR2.

Solution:
到裝置管理員,將 USB controller 全部解除安裝後重開機。

Exchange 2010 啟用 Outlook Anywhere

Step 1: 安裝 Windows RPC Over HTTP Proxy 元件
Step 2: 啟用 Outlook Anywhere

等待 15 分鐘後生效,或是重新啟動 Exchange services 馬上生效。

沒有安裝 Windows RPC Over HTTP Proxy 元件 在 C:\inetpub\logs\LogFiles\W3SVC1 的 log 會有這樣的記錄:
2014-09-18 10:59:22 xxx.xxx.xxx.xxx RPC_OUT_DATA /rpc/rpcproxy.dll MAIL.domain.com:6004 443 - yyy.yyy.yyy.yyy MSRPC 404 0 64 15

Microsoft 提供的 Remote Connectivity Analyer

用 Outlook 2007 新建 profile 第一次必須在內部網路開啟 Outlook,如果直接從 Internet 連線會發生錯誤,這是 Outlook 2007 的 bug。

Reference:
排除RPC over HTTP故障的五大步驟

2014年9月18日 星期四

2014年9月17日 星期三

2014/9/16 新竹 飛鳳山

請假和學弟去爬山。

2014/9/14 跑步

跑快一咪咪,一下就没力了。

2014/9/14 新竹市 簡單風格牛排, 海洋冰城

牛肉不錯,但似乎和其他肉一起煎,味道混在一起了。

海洋冰城 自助冰 NT$ 75。和兩個小孩一起吃,簡單也是一種幸福。

2014年9月12日 星期五

2014年9月5日 星期五

2014年9月4日 星期四

英文版 Office 2007 繁轉簡 解法

錯誤訊息:
word is unable to proceed. more than one file necessary to do tc/sc translation is missing

解法:
http://c-s-y-86.blog.163.com/blog/static/5090904820102505358491/

更新 Microsoft WHCK 憑證

Reference:
http://msdn.microsoft.com/zh-TW/library/windows/hardware/br230783

1. download winqual.exe
2. 安裝 signtool。出現錯誤訊息 "Unable to install “Microsoft Windows SDK for Windows 7 and .NET Framework 4”",解法為移除 Microsoft Visual C++ 2010 xxxx。
3. 解開步驟 1 的 winqual.zip 裡面有 readme.rtf。按照 readme.rtf 指令執行 signtool


2014年8月21日 星期四

VMware ESXi 5.1 physical disk clone

安裝VMware ESXi 5.1後,測試將硬碟換到另一台不同規格的主機上是否能正常開啟。
為了避免重覆安裝VMware,所以想要將硬碟資料完全複製到另一個硬碟。

找到這一篇 How to clone ESXi 5,用clonezilla 測試 OK。

環境:
disk A 是安裝 VMware 的硬碟,disk B 是空硬碟。兩個硬碟一樣大。

步驟:
1. 只接 disk A 開機進入 BIOS,記錄 disk A 的序號 (因為硬碟一樣大只能靠序號判斷)
2. 關機,接上 disk B
3. download clonezilla 燒錄到光碟,用光碟開機
4. 選擇 expert mode
5. 選擇 disk to local disk clone
6. source disk 選擇 disk A (注意硬碟序號),target disk 選擇 disk B
7. 勾選 sector by sector 參數
8. 回答三次 Y 開始複製

測試:
完成後關機,拔掉 disk A,只留 disk B 開機。
VMware 可以正常開啟,用 VMware vSphere Client 連上後提示找不到 storage。
按新增 storage 後可找回原來安裝的 VM guest。
VM guest 開機 OK,測試成功。


2014年8月14日 星期四

Exchange 2010 installation in Windows 2008

參考這一篇的安裝步驟

其中的 KB982867 抓下來安裝出現版本不合。
解法:安裝 Windows 2008 SP1 即可。(參考這一篇)

Webmail 設定:
重新導向Exchange 2010 OWA URLs
Web App didn’t initialize Couldn’t find a base theme
The WinRM client received an HTTP status code of 403 from the remote WS-Management service
==> Open IIS and then go to Powershell virtual directory and check that SSL in disabled

Create Mailbox
https://www.youtube.com/watch?v=63ncVQD2WmU

修改別人連上 SMTP port 時的訊息:
http://theucguy.net/setting-smtp-banner-in-exchange-2010/
http://forums.msexchange.org/m_1800486493/printable.htm
http://technet.microsoft.com/en-us/library/bb124740(v=exchg.150).aspx
開啟 Exchange Management Shell
執行 Get-ReceiveConnector
BIngings {:::25, 0.0.0.0:25} 的 Identity = MAIL01\Default MAIL01
修改 Banner 指令
set-receiveconnector "MAIL01\Default MAIL01" -banner "220 mail01.tht.com"

收外部信件的設定:
530 5.7.1 Client was not authenticated
==> Exchange Management Console / Server configuration / Hub Transport / default receive connector / properties / permission Groups / Anonymous users 啟用

550 5.7.1 Unable to relay (Incoming Emails rejected)
==> Exchange Management Console / Organization Configuration / Hub Transport / Accepted Domain / New Accepted Domain

Configure a Relay Connector for Exchange Server 2010

查看待寄郵件

寄信到外部的設定:

收外部信件慢解法:
參考 E-mail receive delay in Exchange 2010,disable IPV6 即可。

設定預設的 reply to
Exchange Server 2007/2010: How to Change the Primary Email Domain
Exchange Management Console / Organization Configuration / Hub Transport / Email Address Policies, edit default policy.

申請免費的憑證
永久免費SSL憑證,沃通SSL申請流程全攻略!!

將憑證匯入 IIS
IIS manager / 點一下 servername / Server Certificates / Import

更改網站憑證
IIS manager / 點一下 servername / Sites / Default Web Site / Bindings / https / Edit / 變更 ssl certificates

修正 outlook 開啟後的 warnning message
The name of the security certificate is invalid or does not match the name of the site
The Name on the security certificate is invalid or does not match the name of the site - PART 2
Invalid Fully Qualified Domain Names no longer accepted in Subject Alternative Names (SANS) in SSL certficates
開啟 Exchange Management Shell / 執行以下指令

  • Set-ClientAccessServer -Identity servername -AutodiscoverServiceInternalUri https://mail01.tht.com/autodiscover/autodiscover.xml
  • Set-WebServicesVirtualDirectory -Identity "servername\EWS (Default Web Site)" –InternalUrl  https://mail01.tht.com/EWS/Exchange.asmx
  • Set-OABVirtualDirectory -Identity “servername\OAB (Default Web Site)” -InternalURL https://mail01.tht.com/OAB
  • Set-ActiveSyncVirtualDirectory -Identity “servername\Microsoft-Server-ActiveSync (Default Web Site)” -InternalURL https://mail01.tht.com/Microsoft-Server-Activesync

Open IIS Manager.
Expand the local computer, and then expand Application Pools.
Right-click MSExchangeAutodiscoverAppPool, and then click Recycle.

預設的編碼字元集 default encoding charector set
Organization Management\Hub Transport\Remote Domain | select a domain -> properties | Message Format tab

允許群組(Distribution Group)收外部信件
Exchange 新增「通訊群組」信箱時預設無法收取外來郵件
Error: Diagnostic-Code: smtp;550 5.7.1 RESOLVER.RST.AuthRequired; authentication required
Recipient Configuration / Distribution Group / select a group -> properties / Mail Flow settings / Message Delivery Restrictions / disable "Require that all senders are authenticated"

啟用收發信件記錄 for debug
Logging SMTP Protocol Activity in Exchange 2013/2010 and Exchange 2007
Receive log: \Exchange Server\V14\TransportRoles\Logs\ProtocolLog\SmtpReceive
Server Configuration | Hub Transport | select the Receive Connector -> Properties | General tab, change the Protcol logging level to Verbose
Send log: \Exchange Server\V14\TransportRoles\Logs\ProtocolLog\SmtpSend
Organization Configuration | Hub Transport | Send Connectors tab | select the Send Connector -> properties | General tab, change the Protocol logging level to verbose

Outlook error message:
error (0x8004010F): 'The operation failed. An object could not be found.'
Solution:
修改 C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\OAB\web.config 檔案權限,增加 Autheticated Users group 的 Read and Read & Execute  權限。
Reference:
Exchange 2010: Cannot download Offline Address Book. 500 - Internal Server Error
How to troubleshoot the Outlook Offline Address Book in an Office 365 environment


2014年8月6日 星期三

2014年8月4日 星期一

2014年7月30日 星期三

2014/7/27 清大夜市吃冰

清大夜市海洋冰城,這一大盤70元。

2014/7/26 跑步

這次的路線感覺不錯,大部分都有樹蔭,不會太熱。

靜心湖

2014年7月20日 星期日

2014/7/19 台北微風廣場

放鬆一下。
美食街的咖哩牛肉蛋包飯

85度C冰淇淋買一送一

2014/7/19 跑步

這次跑內灣線新莊站(竹科站)到竹中站來回。
在新莊站後面跑錯路跑到死巷子,只好從田埂穿過去 ^__^!!!

剛開始跑的時候覺得左腹有點痛,過了竹中站後不痛了,換成右膝蓋有點酸。


2014年7月14日 星期一

2014/7/13 跑步

爸媽有參加游泳協會,早上5:00就會去興達港海邊游泳。
一大早跟去海邊跑跑步。

剛到時還沒日出

2014年7月7日 星期一

Perl XML parse

Reference:
http://stackoverflow.com/questions/487213/whats-the-best-xml-parser-for-perl
http://stackoverflow.com/questions/10404152/perl-script-to-parse-xml-using-xmllibxml

use XML::LibXML;

$xmlfilename = "2639.XML";

$parser = XML::LibXML->new();
$doc = $parser->parse_file($xmlfilename);

@nodes = $doc->findnodes("/Statistics/Stats/Sample");

print $nodes[0]->nodeName(), ": ", $nodes[0]->textContent(), "\n";

2014/7/7 理髮

到交大理髮。


2014年7月5日 星期六

2014/7/5 跑步

今天跑內灣線新莊站(竹科站)後面。
車站前面高樓大廈蓋了一大堆,車站後面還是稻田。
應該過幾年又會被建商蓋滿了房子.....

車站前

車站後

小溪?可能是灌溉溝渠吧。

2014年6月25日 星期三

Exchange 2003 SMTP setting for authenticated user

Reference:
http://help.globalscape.com/help/me3/configuring_authenticated_access_to_exchange.htm

狀況:
有一個 Part time user 要從公司外收發信件。但是他的 Outlook 已經設定其他地方的 Exchange server,只能用 POP3 + SMTP 的方式收發信件。

Exchange Server 2003 設定:
(要 restart SMTP service 讓他生效)

Outlook 2007 設定:


2014年6月24日 星期二

FTP login - 500 OOPS cannot change directory

Reference:
http://tilt.lib.tsinghua.edu.cn/node/784
http://www.nidify.com/index.php?option=com_content&view=article&id=228&Itemid=247

原因:
啟用了SELinux (Secure Enhance Linux)

解法一:調整SELinux設定。
1. 用 getsebool -a | grep ftp 確認 ftp_home_dir --> off
2. 以指令 setsebool -P ftp_home_dir on 修改

解法二:關閉SELinux。
1. vi /etc/selinux/config
2. 修改 SELINUX=enforcing to SELINUX=disabled
3. 執行 setenforce 0 生效

2014年6月21日 星期六

2014/6/21 跑步

這次從安康社區跑到靜心湖,總計跑了 40 分鐘。
靜心湖的荷花開了~~~