2015年12月31日 星期四

IE 這個網頁正在存取非其控制下的資訊

狀況:
IE 出現 "這個網頁正在存取非其控制下的資訊" 的提示訊息。

解法:
1. 在 [工具] 功能表上按一下 [網際網路選項]。
2. 在 [安全性] 索引標籤中,按一下 [網際網路],然後按一下 [自訂層級]。
3. 在 [安全性設定] 清單中的 [雜項] ,變更 跨網域存取資料來源,改為 停用(或啟用)。
4. 按一下[確定]以關閉 [安全性設定] 對話方塊。

Reference:
企業金融網 Q&A 100 的 Q20

2015年12月22日 星期二

Exchange 2010 resource for meeting room booking

用這個步驟新增會議室
Exchange Server 2010 Room Mailboxes Step by Step Guide

Add Management to owner

Add Meeting Room 1 to Outlook Calendar and set permission

Mantis mail sending log for debug

Reference:
Not send email

modify config_defaults_inc.php or add these to config_inc.php.
$g_log_level = LOG_EMAIL;
$g_log_destination = 'file:c:/temp/maillog.txt';


2015年12月17日 星期四

Exchange 2010 allow internal anonymous relay

Reference:
How to Configure a Relay Connector for Exchange Server 2010
How to anonymously Relay in Exchange Server 2007/ 2010

Exchange Management Console / Server configuration / Hub Transport
=> New Receive Connector (Ex: myRelay)
Local Network Setting: 用預設值
Remote Network Setting: 將預設值刪除,新增內部特定 IP address
Permission Group: Anonymous Users
Authentication: 全部取消

開啟 Exchange Management Shell
Get-ReceiveConnector “myRelay” | Add-ADPermission -User “NT AUTHORITY\ANONYMOUS LOGON” -ExtendedRights “Ms-Exch-SMTP-Accept-Any-Recipient”

2015年12月3日 星期四

(記錄) 舌頭破

2015/11/30 舌頭尖端破了個洞,說話變自動捲舌,超痛的....
2015/12/2 睡前刷牙後用一般的漱口水,醒來後似乎沒改善
2015/12/3 去藥房買藥用漱口水,店員特別說 "這是嘴巴有傷口用的,吐掉之後不要再用水漱口"
2015/12/4 漱口藥水用兩天有比較好一點,有朋友建議吃奇異果。吃了三顆。
2015/12/5 漱口藥水、奇異果三顆,傷口還沒全好,但已經不那麼痛了。

2015年11月23日 星期一

Microsoft HLK EV code signing certificates

Microsoft HLK 要求 2015/10/31 之後必須有 EV code signing 憑證,舊的憑證檔可以用到2016/5/1。

EV Certs
  • As of October 31, 2015, your Sysdev dashboard account must have at least one EV certificate associated with it to submit binaries for attestation signing or to submit binaries for HLK certification.
  • You can sign with either your EV certificate or your existing standard certificates until May 1, 2016. After May 1, 2016, you need to use an EV certificate to sign the cab file that is submitted.
我申請最便宜的 DigiCert EV code signing Certificates,USD$ 224 / year。
網頁上申請後會接到一通確認電話,然後過幾天收到 USB key,到網頁上啟用就可以了。

Sign Winqual.exe 方法
How to Sign Your Winqual.exe File with the DigiCert Certificate Utility




Cisco ASA 5505 connection numbers

Reference:
Cisco ASA 5505 Adaptive Security Appliance for Small Office or Branch Locations Data Sheet
How to view the number of connections per second?

Cisco ASA 5505 每秒連線數最高 10000。

查詢目前連線數指令:show conn count

CentOS auto update configuration

Reference:
Stopping automatic updates
Enabling automatic updates in Centos 6 and Red Hat 6

CentOS 4.x:
chkconfig yum on
service yum start

CentOS 5.x:
chkconfig yum-updatesd on
service yum-updatesd start

CentOS 6.x:
yum -y install yum-cron
/etc/init.d/yum-cron start
chkconfig yum-cron on

2015年11月18日 星期三

Surface Pro 3 安裝 Windows 10

Reference:
How to install Windows 10 on Surface Pro 3 via bootable USB drive

保留原本Windows 8.1,安裝Windows 10做多重開機。

1. 清理硬碟空間,至少要15GB才夠裝Windows 10。

  • Right-click on Start Button and select System from the context menu. 
  • Go to the Advanced tab > Performance and then click on Settings.
  • Navigate to the Advanced Tab within Performance Options
  • click on Change under the Virtual Memory section. 
  • Uncheck "Automatically manage paging file size for all drives" and select "No paging file."
  • Click OK to close the Dialog box.
  • 重開機讓設定生效
  • 到 磁碟管理 將 C: 縮小,至少要空出 15GB
2. 製作 Windows 10 USB 開機碟
  • 將 USB 隨身碟格式化為 FAT32
  • 將 Windows 10 ISO 解壓縮到 USB 隨身碟
3. 安裝 Windows 10
  • 將 Surface Pro 3 關機,按住音量 + 鍵不放,開機進入修改開機順序,讓 USB 為第一開機選項
  • 插入 USB 隨身碟,重開機開始安裝
  • Microsoft Surface Pro 網頁下載驅動程式 SurfacePro3_Win8x_151026_0.msi

2015年10月27日 星期二

Mount Solaris UFS disk on CentOS 6.4

有同仁拿給我有一台很古老的 Sun Blade 150,要我把裡面的檔案拿出來。
昨天開機還可以正常 login,也可以看到檔案。我想說隔天再把 IP address 改一下,就可以從別的 CentOS 把它 mount 起來。沒想到今天早上看到它當機,重開好幾次都開不起來了....

把它拆開來看,裡面是 IDE 硬碟。把硬碟接到 SATA/IDE 轉 USB 的轉接器,插到 Windows PC 結果 Windows 不認得。

我另外還有兩台 Sun Solaris 機器,但拆開後裡面是 SCSI 硬碟,而且這兩台都沒有 USB port。

把硬碟接到 CentOS PC USB port,用 fdisk -l 可以看到,但是執行 mount -t ufs -o ro /dev/sdc3 /mnt 卻說 kernel 不支援 ufs。

查到的解法:
HowTo: Mount UFS partition on CentOS / SL 6.2
Welcome to the ELRepo Project

步驟:

  1. rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
  2. rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm
  3. yum install kmod-r8168
  4. yum install kmod-ufs
  5. modprobe ufs
  6. mount -t ufs -o ro /dev/sdc3 /mnt
終於可以開始 copy 檔案了。

2015年10月19日 星期一

Install Redmine 3.x on Windows 2012 R2

Reference:
Redmine Installation Guide
HowTo install rmagick gem on Windows
Ruby Development Kit Installation
Initial Configuration Fails with NameError
Redmine卡卡奇案

Downloads:
Redmine download
ImageMagick download
Ruby and Devkit download

版本搭配:
Ruby 2.0.0 (32bit), Devkit (32bit), ImageMagick-6.9.2 (32bit), mysql 5.6 (64bit), Redmine 3.1.1

  • Ruby 必須用 2.0.0,用 2.2.3 在安裝 Redmine 的 bundle exec rake generate_secret_token 會出現錯誤訊息如下,解法為 改用 Ruby 2.0.0
    • NameError: uninitialized constant ActionView::Helpers::ActiveModelHelper
    • LoadError: cannot load such file -- actionpack-action_caching
  • ImageMagick 用 32bit 才會有這兩個目錄
    • C:\Program Files (x86)\ImageMagick-6.x.x-Q16\include
    • C:\Program Files (x86)\ImageMagick-6.x.x-Q16\lib

2015年9月24日 星期四

Migrate Windows 7 from HD to USB 3.0 flash

Reference:
How To Install Windows 7 To USB External Hard Drive
47 - How to install Windows Vista/7/SVR2K8 onto a USB drive (or any partition)
BootDriverFlags
Deploying Microsoft Hyper-V Server 2008 R2 on USB Flash Drive

目的:
出差人員的 Notebook 曾經發生突然無法開機的狀況,如果可以事先把 Hard Disk 複製一份到 USB flash,就可以用 USB flash 開機。

注意:
USB 3.0 隨身碟要買有標明讀寫速度 100M/s 以上的,不然會慢到很難用。

做法:
  • 用 TrueImage 把 Notebook disk C: 備份成一個檔案
  • 用 "磁碟分區模式" 把備份檔裡面的 disk C: 復原到 USB flash (Ex: disk I:)
  • 用系統管理員身份執行命令提示字元 (cmd)
  • 執行 bcdboot I:\windows /s I: 把開機檔案 bootmgr 放到 USB flash
    • 如果有錯誤訊息 "BFSVC: Failed to open handle to bootmgr object. Status = [c0000034]",請找一台 Windows 8 的 bcdboot.exe 來用
  • 執行 BootSect.exe /nt60 I: 在 USB flash 製作開機磁區
    • bootsect.exe 在 Windows 7 光碟片裡面的 \boot 目錄下
    • 如果有錯誤訊息 "This tool can only be run on systems booted using a PC/AT BIOS.  This system was booted using EFI or some other firmware type.",請找一台 Windows 8 的 bcdboot.exe 來用
  • 下載 NT6.X_fast_installer_100219.7z,解壓縮到 NT6 目錄
  • 修改 NT6\UsbBootWatcher.conf,增加這幾行 for USB 3.0
[iusb3hub]
Start@REG_DWORD=0
Group@REG_SZ="Boot Bus Extender"
[iusb3xhc]
Start@REG_DWORD=0
Group@REG_SZ="Boot Bus Extender"
  • 修改 NT6\usb.reg,增加這幾行 for USB 3.0
[HKEY_LOCAL_MACHINE\sys\ControlSet001\services\iusb3hub]
"Start"=dword:00000000
"Group"="boot bus extender"
[HKEY_LOCAL_MACHINE\sys\ControlSet001\services\iusb3xhc]
"Start"=dword:00000000
"Group"="boot bus extender"
[HKEY_LOCAL_MACHINE\sys\ControlSet001\Control]
"BootDriverFlags"=dword:00000006
[HKEY_LOCAL_MACHINE\sys\ControlSet002\Control]
"BootDriverFlags"=dword:00000006
[HKEY_LOCAL_MACHINE\sys\ControlSet001\Control\PnP]
"PollBootPartitionTimeout"=dword:00007530
[HKEY_LOCAL_MACHINE\sys\ControlSet002\Control\PnP]
"PollBootPartitionTimeout"=dword:00007530
  • 執行 reg load HKLM\sys I:\Windows\system32\config\system
  • 執行 reg import NT6\usb.reg
  • 執行 reg unload HKLM\sys
  • 複製 NT6\UsbBootWatcher*.* 到 I:\Windows\system32
  • 重開機,修改 BIOS 讓 USB 做第一開機選項
  • 用 USB flash 開機
大功告成。

2015年9月2日 星期三

linux diff GUI

GUI version diff: tkdiff
http://sourceforge.net/projects/tkdiff/

download: http://sourceforge.net/projects/tkdiff/files/tkdiff/

Linux vi backspace not work under xwindow

狀況:
用 telnet 連到 linux 用 vi 在 insert mode 時按 backspace 正常
用 vnc 連到 linux 用 vi 在 insert mode 時按 backspace 出現 ^?

解法:
在 .cshrc 加上 stty erase ^\?

2015年8月26日 星期三

Mail sweeper Anti-Spam trust list



收信記錄文字檔路徑
C:\Program Files (x86)\Clearswift\MIMEsweeper for SMTP\Data\Logs\Operational

2015年8月21日 星期五

outlook 預約發信

Reference:
OUTLOOK 如何設定在凌晨自動發信

0. 開一封新郵件
1. Option
2. Delay Delivery
3. 設定預定寄信時間
4. Close
5. Send

注意!寄信後 Outlook 不能關掉。

SQL like query for nchar field

Reference:
SQL Server char and nchar columns search differently

狀況:
MS SQL DB Table 有一個欄位 TB007 是 nchar(10) 型態,裡面有一筆資料是 DR0019A。
用 select * from table where TB007 like '19A' 查詢回覆 0 筆資料。

原因:
nchar(10) 會把資料後面補空白變成 10 個字元,所以實際上那筆資料是 'DR0019A   '。

解法:
加上 RTRIM 去掉空白的部份。
select * from table where RTRIM(TB007) like '19A'

2015年8月19日 星期三

老舊電腦大復活 Lightweight OS for old computer

Reference:
What's the Best Lightweight Operating System for a Crappy Old Computer?
Puppy Linux

Old Computer:
ASUS S5N (S5200) notebook,出廠年份 2003 年。
CPU - Intel Pentium M 1.0 GHz
RAM - 760MB
Disk - IDE 40GB

先來一張安裝好了畫面,有圖有真相。

Exchange 2010 OWA open another user mailbox

Reference:
Allow Mailbox Access
Opening other users Inboxes/Mailboxes using OWA 2010

  • 在 server 上用 Exchange Management Console 調整權限,讓管理員的帳號可以開其他人的信箱。
  • 登入 OWA 網頁,在管理員信箱按滑鼠右鍵,選擇 Open Other User's Inbox。


2015年8月14日 星期五

HP Elitepad 900 install Windows 8.1

Reference:
Installing Microsoft Windows 8 on HP ElitePad 900 G1 Tablet 
Update ElitePad 900 with Windows 8.1
HP ElitePad 900 G1 Base Model Tablet


  • 長按電源鍵關機
  • 插上 USB disk with Windows 8.1 (製作方法)
  • 按住音量鍵(-)不放,再按電源鍵開機
  • 選擇 Boot Option 裡面的 USB Disk 開始安裝
  • 到 HP 網站下載驅動程式
    • HP 只提供 32bit driver,所以 Windows 8.1 也只能裝 32bit
    • 安裝 HP ElitePad 900 系統 BIOS/韌體及驅動程式更新
    • 安裝 Atheros AR600x 802.11a/b/g/n 無線區域網路驅動程式
    • 安裝 近距離近接感測 (NFP) 驅動程式 (恩智浦半導體提供) 



Microsoft Windows ISO to USB boot

Reference:
HP ElitePad 900 G1 平板電腦 - 建立 32 位元的 UEFI 可開機 USB 快閃磁碟機,以安裝 Windows

  1. 以系統管理員身份執行 "命令提是字元"
  2. 執行 diskpart
  3. list disk (假設 USB disk 在 disk 7)
  4. select disk 7
  5. clean
  6. create partition primary
  7. format fs=fat32 quick
  8. active
  9. assign 
  10. exit
  11. 用解壓縮軟體 (Ex: 7-zip) 將 ISO 解壓縮到 USB disk 

2015年8月7日 星期五

Sophos update manager for second office

環境需求:
兩個辦公室網路必須是 VPN 可互通。
server1 是第一辦公室的 sophos server
server2 是第一辦公室的 sophos update server

安裝:
在第二辦公室的 server2 執行 \\server1\SUMInstallSet\setup.exe,用預設值裝到底。

設定:

  • 開啟 server1 的 Sophos Enterprise Console,選 Update Managers
  • 在 server2 按右鍵選 View/Edit Configuration
  • 加入 update source,選 server1

Remote install application for Windows domain administrator

Reference:
Is it possible for an administrator install a program remotely in the background of Windows 7 with the admin share?
PsExec download

用來遠端安裝防毒軟體很方便。

batch script:
set computer=remotePC
psexec -d -c \\%computer% C:\sophos\SophosEndpoint.exe

Linux 設定子目錄繼承群組權限

想要在建立子目錄時,子目錄的 group 權限和上一層相同。

指令:chmod g+s .

2015年8月5日 星期三

Onenote 無法登入

狀況:
開啟onenote後一直顯示需要登入,但是按 "登入" 卻一直無反應。

解法:
1. 到 onenote 安裝目錄執行 onenote.exe /safeboot
在OneNote上按滑鼠右鍵,選內容。 

Windows 7: 點左下角Windows圖案,在 "搜尋程式及檔案" 輸入 cmd
Windows 10: 點左下的放大鏡,輸入 cmd

2. 選擇 "Delete Notebook Cache" 後會開啟 onenote
3. 在右上角選擇切換帳號,輸入 Microsoft 帳號

原因:
這一台電腦有加入公司網域,可能 onenote 一直嘗試用公司帳號登入,但是進不去又不顯示錯誤訊息....

參考:
Onenote無法與Skydrive同步

2015年7月30日 星期四

Outlook 2007 – how to disable the Hand cursor

狀況:
在 mail 內容上游標變成一個手的圖示,無法做文字圈選、複製貼上。

解法:
1. 開啟一封信件,在最上面那一排點選下拉,選 “More Commands…”。

2. 選 “Commands not in the Ribbon”,將 “Panning Hand” 加上。

3. 可以啟用或停用 "手" 了。

參考:
Outlook 2007 – how to disable the Hand cursor

2015年7月29日 星期三

SVN (Subversion) install on Windows 2012 R2

Reference:
[研究] Win32Svn 1.8.0-1 架設(Windows 2008 R2)
How to Install Apache 2.4 MySQL and PHP on Windows Server 2012 R2

因為 svn for Windows 有好幾個版本,我採用 Win32Svn 因為它比較不像商業版,但它只有 32bit 版本。所以 Apache 也必須用 32bit 版本。

1. download Apache 2.4 Win32. 它需要事先安裝 Visual C++ Redistributable (也是用 x86 版本)
2. download Win32Svn 1.8
3. 解壓縮 Apache 2.4,用 Apache24\bin\httpd.exe -k install 安裝 service。
4. 修改 Apache24\conf\httpd.conf

  • Listen 8080    # 因為 port 80 被 IIS 用掉了
  • 將以下這兩行最前面的 # 刪除
    • LoadModule dav_module modules/mod_dav.so 
    • LoadModule dav_fs_module modules/mod_dav_fs.so
  • 加入以下兩行(放在 mod_dav.so 之後) (檔案路徑請依 Subversion 實際安裝位置調整)
    • LoadModule dav_svn_module "C:\Program Files (x86)\Subversion\bin\mod_dav_svn.so" 
    • LoadModule authz_svn_module "C:\Program Files (x86)\Subversion\bin\mod_authz_svn.so"
  • 在檔案最後面加入

WSUS 4.0 on Windows 2012 R2

Reference:
Windows Server 2012 筆記(一) WSUS 4.0 安裝設定

我用 Microsoft Report Viewer Redistributable 2012
它需要先安裝 Microsoft® System CLR Types for Microsoft® SQL Server® 2012
x64 package, x86 package

2015/7/31 update:
開 report 時它說要 Microsoft Report Viewer Redistributable 2008 sp1..... 只好再裝上去。

2015年7月28日 星期二

Outlook 2007 sort mail by conversation

目的:
在 outlook 2007 中,將同一主題的信件集中起來

做法:
1. Add field "Conversation"

 2. Right Click on field Conversation. Arrange by Conversation.


Reference:
Managing Outlook 2007 Email Via Threaded Conversations by Mike Heald

2015年7月21日 星期二

WSUS client error 800b0001

WSUS server: Windows 2008 R2
Client: Windows 2012 R2

狀況:
Client 可以用 Microsoft Windows Update,但是用 WSUS update 時會有錯誤訊息 800b0001。

解法:

Reference:

2015年7月15日 星期三

TSMC jobview with IE10

TSMC jobview 用 IE9 可以進入,但是用 IE 10 卻不行。
解法:
將 IE 10 的相容模式啟用就可以了。

2015年7月9日 星期四

VMware Replicating a virtual machine fails

Error: VR server has no hosts through which to access destination datastore

Environment:
VMware ESXi 5.1
vCenter (install via OVF Template)
vSphere Replication Appliance (install via OVF Template and use Embedded vSphere Replication Database)

Reference::
Replicating a virtual machine fails with the error: VR server localhost.localdom has no hosts through which to access destination datastore (2032571)
Connecting to vPostgres Databases
How do I list all databases and tables using psql?

Solution:
1. login vSphere Replication Appliance with account root (using putty)
2. su - vrmsdb
3. psql
4. \connect vrmsdb
5. Run this query to determine if any hosts are marked as Unsupported:
  • To query hosts that are not associated with a VR server:
select * from HostEntity h where state=4 and not exists (select * from HbrHostEntity where h.vcMoId=HbrHostEntity.vcHost_vcMoId);
  • To query hosts that are associated with a VR server:
select * from HostEntity h where state=4 and exists (select * from HbrHostEntity where h.vcMoId=HbrHostEntity.vcHost_vcMoId);
This query returns a host ID. You can use the vCenter MOB to identify the host using the host ID.

6. Run this query to perform a cleanup:
  • To clean up Unsupported records for hosts that are not associated with a VR server:
delete from HostEntity where state=4 and not exists (select * from HbrHostEntity where vcMoId=HbrHostEntity.vcHost_vcMoId);

  • To change the state of hosts that are tagged as Unsupported and associated with a VR server to ACTIVE:
update HostEntity set state=1 where state=4 and exists (select * from HbrHostEntity where vcMoId=HbrHostEntity.vcHost_vcMoId);

7. Restart vSphere Replication Appliance at the Recovery site.
8. setup replication configuration for the VM guest again.

Possible Cause:
VMware host upgrade from ESX 4.x to 5.1. (I think)

2015年6月30日 星期二

2015/06/30 理髮

到交大理髮。
本來想到第一餐廳吃飯,沒想到已經開始放暑假了沒開。

2015/6/24, 25 宜蘭 小旅行

福山植物園
彎彎曲曲的山路開好久才到,平日去人不多。(有人數管制要事先預約)

2015年6月22日 星期一

Windows 2003 Active Directory 轉移到 Windows 2008 R2

Reference:
如何將現有Windows Server 2000/2003網域升級成為Windows 2008
現有win2003網域環境加入一台windows 2008 R2 DC準備工作
請問windows server 2003 AD移轉至server 2008
正常移轉 FSMO 五大角色 (Windows 2003)
How to Migrate DHCP from Server 2003 to Server 2008 R2 in 5 Easy Steps

現在 Windows 2003 用得好好的,但 Microsoft 只支援到 2015/7/14,撐到最後只好升級。

我的是 Windows 2003 server 32bit 兩台,Microsoft 原機升級只能升級為 Windows 2008 32bit,
但我想升級為 Windows 2008 R2 64bit,並沿用原本的 IP address 和 hostname。

規劃:
1. 把 FSMO 五個角色轉移到第二台 Windows 2003
2. 第一台 Windows 2003 備份 DHCP server config
3. 第一台 Windows 2003 退出 AD、退出 domain,重裝為 Windos 2008 R2,加入 domain、加入 AD
4. 第一台 Windows 2008 R2 復原 DHCP server config
5. 把 FSMO 五個角色轉移到第一台 Windows 2008 R2
6. 把第二台 Windows 2003 退出 AD、退出 domain,重裝為 Windos 2008 R2,加入 domain、加入 AD

2015年6月19日 星期五

2015年6月17日 星期三

2015 員工健康檢查結果

紅字:
RBC 紅血球 4.48 (參考值 4.5 ~ 6)
r-GT 丙麩氨酸轉酵素 46 (參考值 9 ~ 40)
疑似肝血管瘤 0.3cm (去年 1.9cm,居然縮小了)

去年紅字有 5 個,今年只剩 3 個 ^__^


2015年6月11日 星期四

2015/6/4 ~ 6/9 東京旅遊前後

出國玩一星期,吃吃喝喝多了 2.3KG。但是神奇的是體脂率居然下降!!
不過看照片馬上現出原形,肚子明顯腫了一圈 ^____^
估計要兩星期才能恢復原狀。

出發前


回來後

出發前 V.S. 回來後



2015/6/4 ~6/9 日本東京旅遊

旅館:銀座大英酒店
雖然室內空間不大,但是我們只是用來睡覺,這旅館乾淨、舒適、便宜,很不錯。
在銀座三丁目,從JR有樂町站走過去大約 5~10 分鐘。

檢討:
日本的外食很少蔬菜,長期這樣吃會便秘吧。
築地場外市場去看看就好,那邊吃東西超貴,專門賺觀光客的錢。
觀光區的東西貴又不一訂好吃,反而是路邊的小店價格比較正常,口味也不錯。

6/4 出發
長榮航空 Hello Kitty 班機

2015年5月29日 星期五

Mount and dismount hard drive through a script on Windows 7

Reference:
Mount and dismount hard drive through a script

find volume name command: mountvol

umount script:
@echo off
REM Be sure to change this to the drive you want to unmount!
set drive=G:
echo Unmounting Drive...
mountvol %drive% /p
echo Drive Unmounted!
pause
exit

mount script:
@echo off
REM Be sure to change this to the drive letter you want to mount the drive to!
set drive=G
REM Be sure to change this to the Volume Name of the drive you want to mount!
set volume=\\?\Volume{ae101d9f-7653-11e3-be83-8056f23387a6}\
:start
echo Mounting Drive...
mountvol %drive%: %volume%
echo Drive Mounted!
pause
exit

在 Windows 7 執行這兩個 script 需要 Run as Administrator。
如果想直接執行必須 disable UAC。

2015年5月21日 星期四

Remote Desktop Client slow, hanging at “Securing remote connection…”

狀況:
部分無法對外連線的電腦使用遠端桌面會在連線時卡很久。

解法1:
修改 Firewall,將 Deny 改為 Reject。

解法2:
修改 group policy,改為不更新 root CA

2015年5月5日 星期二

VirtualBox 4.3 VM auto start on CentOS host

需求:CentOS 開機時將 VM 自動開機

做法:
vi /etc/rc3.d/S99local
/usr/bin/vboxmanage startvm "VM name" --type headless

Reference:
VBoxHeadless, the remote desktop server

用這種 VM 開機方式在 VM VirtualBox Manager 上只能 preview,沒辦法進去 VM 操作。
必須另外安裝 VirtualBox Extension Pack 才能用 RDP 進入操作。

VirtualBox Extension Pack 安裝指令
vboxmanage extpack install <.vbox-extpack>

在 VM 的 Remote Display 設定 server port,Ex: 5000。

用 RDP client 連線,這時要連 CentOS host IP + server port。
Ex: mstsc.exe CentOS_host_IP:5000

CentOS 5.9 安裝 VirtualBox 4.3

錯誤訊息:(more /var/log/vbox-install.log)
Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.

解法:
1. yum install -y gcc kernel-devel
2. export KERN_DIR=/usr/src/kernels/2.6.18-404.el5-x86_64
3. /etc/init.d/vboxdrv setup

Reference:
CentOS 6.2: VirtualBox Guest Additions -> Error: unable to find the sources ...
[Ubuntu] 解決 linux 核心升級後 VirtualBox 無法執行編譯問題

2015年4月30日 星期四

Lenovo IdeaPad S410 安裝 Windows XP

這一台的 BIOS 沒辦法調整 SATA mode,它預設只有 AHCI 沒有 IDE,因為 Windows XP 預設只支援 IDE 硬碟,所以安裝 Windows XP 時會說找不到硬碟。

Lenovo 網站上 S410 沒有提供 Windows XP driver download。

先安裝 Windows 7 查看 SATA controller 的晶片,確認是 Intel(R) 8 Series Chipset Family SATA AHCI Controller。Hardware Id: VEN_8086&DEV_9C03。

2015年4月29日 星期三

2015年4月17日 星期五

Group Policy exclude one hostname by WMI filter

需求:在 GPO 將某一台電腦 host1 排除

做法:
在 Group Policy Management 新增一條 WMI filters。
WMI Query = select * from Win32_ComputerSystem where name <> "host1"

點選要修改的 Group Policy,將 WMI Filter 設定為 exclude_host1。

2015年4月13日 星期一

Windows Remote Desktop and App

Server: Windows 2008 R2
Client: Windows 7 Professional

Remote App 設定

Windows 2008 Terminal License (試過OK)

Windows 7 使用 RDP 的聲音設置
Windows 7 Professional 在 RDP 不支援麥克風.....

Windows 7版本清單
Professional version 沒有 "通過終端服務錄音" 功能。
Professional 不能升級到 Enterprise,只能升級到 Ultimate (旗艦版)。
Windows 7 各版本比較

如果要把 Professional 升級為 Enterprise,先修改 registry 就可以升級。
參考這一篇,實測可用。

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
"EditionID"="Enterprise"
"ProductName"="Windows 7 Enterprise"

把 Google Chrome 做成 Remote App,在 Windows 7 執行會出現錯誤 "He's Dead, Jim!"。
解法為加上參數 --allow-no-sandbox-job --disable-accelerated-compositing
Reference 1, Reference 2.

Chrome disable flash 參數 --disable-bundled-ppapi-flash

Chrome 和 Microsoft RemoteApp 搭配起來不太好,測試過 Firefox 就很正常。

RemoteApp 啟用錄音功能:
RemoteApp Manager / RDP setting / Custom RDP setting 加上 audiocapturemode:i:1