2011年6月30日 星期四

折床單

參考 http://www.youtube.com/watch?v=YHTyH2nuFAw












Windows server allow domain account logon through terminal service

需求:開放domain account 用 MSTSC terminal 登入 server。
做法:在 server 的 local group "Remote Desktop Users",將允許登入的 domain account / group 加進來。

2011年6月29日 星期三

如何回復誤刪的 Microsoft Word 資料?

原文 http://antbsd.twbbs.org/~ant/wordpress/?p=945


如果你是 word 97, 2000, 2002 或 2003
在功能表上點 “工具”(Tools) → “選項”(Options) → “檔案位置”(File Locations) 的頁籤 → 在 “自動回復檔案”(AutoRecover files) 上用滑鼠點兩下。
然後複製或記住這個資料夾路徑,然後從 “我的電腦” 一層一層進去該資料夾所在位置,然後尋找任何 .asd 副檔案的檔案,其中可能有一個是你要的。

人類基因暗藏外星人的種?「垃圾DNA」解答進化關鍵

www.nownews.com
〔國際中心/綜合報導〕人類長期以來探索太空,試圖尋找外星生命,但是否有可能我們就是外星人?有一組進行「人類基因計畫」的科學家宣稱,在人類的DNA..

Google神秘伺服器大公開| CNET Taiwan Crave 科技瘋

http://taiwan.cnet.com/crave/0,2000088746,20137241,00.htm

taiwan.cnet.com
伺服器上裝電池、使用技嘉主機板、資料中心以貨櫃為單位,每箱裡面有1160台伺服器...在不景氣當道的年代,Google要分享自家過去秘而不宣的資料中心省錢方式。

免錢的資產管理軟體

免錢的資產管理軟體
http://newsletter.ascc.sinica.edu.tw/news/read_news.php?nid=1819

newsletter.ascc.sinica.edu.tw
 當MIS人員在面對單位內個人電腦或網路型印表機的數量增加時,總是面臨管理上的挑戰。下列提出四點我們最常遇到的困擾:

[很有智慧的說法] 某某人欺騙我

From Henry.Lee Facebook.

但是,我們有時候說:「某某人欺騙我!」
若在佛法的道理上說,沒有這回事,任何人不能欺騙你!
那麼為什麼說欺騙呢?是自己欺騙自己!
為什麼呢?因為智慧不夠。
人都是自己做一些蠢事,使令將來受很多的苦,
所以不能怨天尤人,而是自己智慧不夠。
所以佛法是重視智慧的。

MSTSC terminal 指令偷偷改了,真是機車~~

指令偷偷改了,真是機車~~
mstsc /admin

http://weblogs.asp.net/jeffwids/archive/2005/12/14/remote-desktop-to-console-session-on-windows-server-2003.aspx

NFS for Windows

NFS for Windows 2008 筆記:
Linux NFS server + Windows NFS client
重點:Windows 2008一定要做AD才能設定UID對應
http://technet.microsoft.com/zh-tw/library/dd758767(WS.10).aspx

除了那台Windows 2008的NFS Client外,還要在DC伺服器上安裝NFS伺服器,安裝完成後會有此選項。

Windows 2003 必須 R2 版本才有此功能。
http://www.interopsystems.com/LearningCenter/Implement_Configure_NFS.htm
http://blogs.msdn.com/b/sfu/archive/2007/04/19/set-up-server-for-nfs-in-windows-server-2003-r2.aspx

Windows 2003 mount NFS時出現錯誤訊息。
解法:
1. 設定DNS反解
http://support.microsoft.com/kb/926095
2. 修改registry
http://blogs.msdn.com/b/sfu/archive/2007/06/05/network-error-53-the-data-area-passed-to-a-system-call-is-too-small-or-unknown-error.aspx

Windows 2003 client foe NFS slow issue.
2012/1/4 有人反應從 Windows 2003 連部分的 NFS mount point 很慢。
找到兩篇相關的文章,把 Windows 2003 重新開機可以暫時解決。
http://www.suacommunity.com/forum/tm.aspx?m=16546
http://support.microsoft.com/kb/959200

2015/5/27 update:
無法寫入檔案,錯誤訊息為 "The process cannot access the file because another process has locked a portion of the file."
解法:自己下mount nfs01:/mnt/vol/data P: -o nolock

2015/8/3 update:
在 Windows 2012 登入後自動執行 mount script。
解法:必須把 batch file 放到 C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

2015/8/4 update:
Windows 2008 AD user mapping for UNIX 搞不定,只能用單一user account連到NFS server。
NFS: How to connect to NFS using Windows Server 2008 R2 without using User Mapping Server

三招教你停好車

http://www.youtube.com/watch?v=gkf2Mi3w0vo&feature=player_embedded

文字的力量 [HQ]

Good!


http://www.youtube.com/watch?v=67fJAmb-NsU

2011年6月28日 星期二

CMAK DNS 順序(order), 尾碼(suffix)

註冊到DNS server (Register this connection's address in DNS)
http://help.lockergnome.com/windows2/CMAK-registering-DNS--ftopict467792.html

DNS順序(order)
http://support.microsoft.com/default.aspx?scid=kb;en-us;311218&Product=winxp

尾碼(suffix)
http://www.pcreview.co.uk/forums/cmak-dns-suffix-help-t2053607.html
http://www.carbonwind.net/blog/post/Adding-the-connection-specific-DNS-Suffix-for-the-VPN-adapter-using-CMAK.aspx
編輯C:\Program Files\Cmak\Profiles\[Your Profile]\[Your Profile].cms
在 [TCP/IP&EntryName Tunnel] 新增DNSSuffix=[your suffix]

Connection Manager Administration Kit (CMAK) for Windows remote access service

CMAK可以讓你把使用者PC需要做的設定包裝一個安裝檔。

CMAK安裝方式請參考這一篇

製作CMAK注意事項:
  • 修改 C:\Program Files\Cmak\Support\template.cms,改 Dialup=0, ConnectionType=1,可避免使用者安裝時出現設定modem的畫面。參考資料 http://technet.microsoft.com/en-us/library/cc939869.aspx
  • 取消以 remote access server 當作gateway,可避免使用者PC上網流量穿過 server。



    • Windows XP安裝CMAK,對於Routing Table Update這一段看起來好像有bug。建議將Make this connection the client's default gateway打勾,將內部網段192.168.10.0, 192.168.11.0加入Routing Table Update的 route.txt 內容如下。
             ADD 192.168.10.0 MASK 255.255.255.0 default METRIC default IF default
               ADD 192.168.11.0 MASK 255.255.255.0 default METRIC default IF default
                 DELETE 0.0.0.0 MASK 0.0.0.0 default METRIC 1 IF default
          2014/3/21 update:
          Windows 7 32bit CMAK profile 必須找一台 Windows 7 32bit 來做,請參考這一篇。
          http://technet.microsoft.com/en-us/library/cc771679.aspx

          2019/2/14 update:
          Windows 10 使用 L2TP 無法建立連線,必須修改 registry 並重開機。參考這一篇
          [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PolicyAgent]
          "AssumeUDPEncapsulationContextOnSendRule"=dword:00000002


          Windows 2003 remote access service

          啟用 Routing and Remote Access

          如果要用Control access through Remote Access Policy功能,必須將Windows改為Native mode。
          參考
          http://www.techtalkz.com/windows-server-2003/33665-gpo-allow-access-remote-access-permission-dial-tab.html
          http://groups.google.com/group/microsoft.public.windows.server.migration/browse_thread/thread/0b2e5f72086e0b49?pli=1

          2011年6月25日 星期六

          How to: Export/import group policy

          原文 http://www.chicagotech.net/netforums/viewtopic.php?t=447

          To backup/export the GPO 

          1. Open Group Policy Management from Administrative Tools. 
          2. Click Group Policy Object 
          3. Right click on the GPO you want to backup or export. 
          4. Select Backup to back up the GPO. 

          To restore/import GPO 

          1. Open Group Policy Management from Administrative Tools. 
          2. Click Group Policy Object 
          3. Create a new GPO 
          4. Right click on the GPO you just created 
          5. Select restore or Import Settings.

          Skype Administrator Group Policy Templates

          原文 http://www.ehow.com/how_7146807_limit-skype-usage-business.html

          2011年6月24日 星期五

          英文版 Windows 顯示中文

          參考 http://alexchuo.blogspot.com/2007/05/windows-xp.html


          作業系統是使用英文版 Windows XP,但是在安裝中文版軟體時,中文字卻顯示成亂碼,經過調整「Control Panel」中的「Regional and Language Options」的相關設定之後,問題依舊沒有解決,請問該如何處理? 問題發生的原因在於,英文版 Windows XP 預設不會安裝「東亞語言檔案」,因此請先安裝 East Asian Languages,步驟如下:
          1. Open Control Panel -> [Regional and Language Options]->[Languages] tab ->check [Install files for East Asian languages]-> click [Apply] -> Reboot your system
          2. 如果該應用程式不是使用 Unicode 編碼的話,還需於開機完畢之後,到控制台裡的 [Regional and Language Options] -> [進階] 索引標籤->在 [選擇一個符合於您所要使用的非 Unicode 程式語言版本的語言] 選擇 [中文(台灣)]
          測試過Windows 2003可用此方法。

          2011年6月23日 星期四

          Windows Logo 認證 WHQL

          WHQL: Windows Hardware Quality Lab,驗證通過才能貼Windows Logo。
          參考 http://www.wretch.cc/blog/dogclub/3104374

          WLK: Windows Logo Kit,整包驗證測試工具
          參考 http://msdn.microsoft.com/en-us/windows/hardware/gg463010

          WLK download,要用 Windows Live ID (MSN) 帳號登入,按照下面網頁說明download WLK。
          http://msdn.microsoft.com/en-us/windows/hardware/gg487533

          DTM: Driver Test Manager,包含在WLK裡面,安裝方式參考下面網頁說明。
          http://msdn.microsoft.com/en-us/library/ff563424(v=vs.85).aspx

          台灣微軟WHQL諮詢e-mail:whqltwn@microsoft.com,可用中文提問。

          Windows Help file .chm 無法顯示網頁

          開啟 .chm 出現 無法顯示網頁 解法 (二選一):

          1. 在 .chm 檔案按滑鼠右鍵 -> 選 內容 -> 按右下角的 解除封鎖
          參考 http://tw.myblog.yahoo.com/jw!lc.5MdOBEhihnauvO6YAYnc-/article?mid=370&prev=371&l=a&fid=1

          2. 改 registry

          [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\HHRestrictions]
          "MaxAllowedZone"=dword:00000003
          "UrlAllowList"=""
          [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]
          "MaxAllowedZone"=dword:00000003
          "UrlAllowList"=""
          參考 http://blog.csdn.net/guopengzhang/archive/2009/11/30/4905132.aspx

          Word 2007 進階技巧 Field Mergeformat

          今天修改一份Word文件後列印,見鬼了,不是改了嗎?怎麼印出來又變回原來的樣子,而且連Word內容都變回原來的樣子....

          研究一下這一份Word檔案,發現它有使用 Field 功能,這是一個進階技巧,真的長知識了。

          例如:文件內容有許多地方用到 Keyword,用 Field 功能可以更新文件內容所有用到 Keyword 的部分。

          使用方法請參考這一篇。

          2011年6月22日 星期三

          可遠觀而不可褻玩焉

          這兩篇文章感覺有點類似,都是 "可遠觀而不可褻玩焉" ~~~

          部落格文章不是寫來讓你們抄的。
          http://yuminghui.pixnet.net/blog/post/29324045

          又是"恐龍法官"? 偷拍美腿無罪!
          http://tw.news.yahoo.com/article/url/d/a/110617/69/2thsf.html

          Exchange 2003 Server 啟用 Smart Host 步驟

          原文 http://support.microsoft.com/kb/265293

          1. 開啟 "Exchange 系統管理員"
          2. 新增 Connector,選 SMTP Connector
          3. 設定Smart host,IP要用中括號 [ ] 包起來
          4. 設定Address Space

          2011年6月21日 星期二

          VMware vmdk reduce size 縮小

          VMware版本VMware-server-2.0.2-203138.x86_64.rpm,安裝在CentOS 5.6。

          在VM console上執行vmware-vdiskmanager縮小vmdk。

          [root@Linux2]# vmware-vdiskmanager -d /vm/XP-test1/XP-test.vmdk
            Defragment: 100% done.
          Defragmentation completed successfully.
          [root@Linux2]# vmware-vdiskmanager -k /vm/XP-test1/XP-test.vmdk
            Shrink: 100% done.
          Shrink completed successfully.

          測試結果只縮小一點點而已....

          Anti Spam DNS 檢查

          DNS檢查Spam的方式:

          狀況:收到一封信 sender@abc.com,寄信的server IP是123.123.123.123

          檢查方式:
          1. 查詢abc.com的domain MX record,取得abc.com的mail server IP lists。
          2. 比對123.123.123.123是否在IP lists中,若比對不到則視為Spam。

          查看 Linux 作業系統下的硬體資訊 (hardware info)

          可用以下這幾個指令
          dmidecode
          lscpu
          lspci
          lsusb
          lsmod
          smbiosDump (for VMware ESX 5.x)

          原文 

          Sendmail remote connection refused 解法

          原文 http://www.electrictoolbox.com/article/sendmail/remote-connection-refused/

          狀況:
          telnet mail01 25
          telnet: connect to address 192.168.1.10: Connection refused

          解法:
          修改 sendmail.cf,將這一行 mark 掉,再 restart sendmail。
          # O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA

          How to force Sendmail to redeliver or resend all mails in queue ?

          原文 http://tech.ebugg-i.com/2009/02/how-to-force-sendmail-to-redeliver-or.html

          You can force sendmail to resend or redeliver all mail in the mail server queue using this command.

          Here is the command 
          **You must be root to execute this command.
          sendmail -q -v

          2011年6月19日 星期日

          消防水管維修

          http://www.flickr.com/photos/chdutw/sets/72157626869491205/
          切開天花板更換消防水管。
          原本的管子(白色)搞半天弄不出來,工人和消防技師連絡後,改用小一點的管子(銀色)穿過原來的水管替代。







          2011年6月17日 星期五

          Remote install fonts 從遠端安裝字型

          參考 http://www.tomshardware.com/forum/29328-45-remote-install-fonts

          batch script 內容:
          copy \\server\fonts\aaa.ttf
          reg add /v "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\AAA fonts" /d aaa.ttf

          2011年6月15日 星期三

          Hotfix 更新造成無法連接 Samba 主機

          狀況:         今天 (2011/6/15) 有 user 反應更新 Hotfix (KB2536276)後,即無法連線 Samba  主機(如下圖),錯誤訊息"指定的伺服器無法..........."
          解決方式: 
                  移除Hotfix (KB2536276),重開機後正常。         
          進一步處理:         停止 KB2536276  WSUS 更新佈署。 


          Linux 網路卡連線速度

          原文 http://yu-minspace.blogspot.com/2010/10/linux.html


          指定 Linux 網路卡連線速度,除了在載入 module 時以參數指定外,亦可使用以下指令 ifconfig、mii-tool、ethtool。
          查詢目前狀態,用ethtool比較準確。
          ethtool eth0

          設定範例:
          ifconfig eth0 media 100baseTX
          若出現以下訊息,可以改用 mii-tool,ethtool指令
          port: SIOCSIFMAP: Operation not supported

          mii-tool -F 100baseTx-FD eth0

          ethtool -s eth0 speed 100 duplex full autoneg on

          2011年6月14日 星期二

          VMware 實體網路卡

          bridge mode 實體網路卡,就算是沒有設定 IP address,也要設定為開機啟用,這樣虛擬網路卡才能正常運作。

          VMware add network adaptor 新增網路卡對應

          參考 http://nst.sourceforge.net/nst/docs/faq/ch13s11.html

          執行 /usr/bin/vmware-config.pl 可重做網路卡對應。
          注意!執行 /usr/bin/vmware-config.pl 會把 VMware service 關閉。


          查詢網路卡對應方式:
          ps aux | grep vmnet

          root      8456  0.0  0.0  59324   380 ?        Ss   17:08   0:00 /usr/bin/vmnet-bridge -d /var/run/vmnet-bridge-0.pid -n 0 -i eth0
          root      8463  0.0  0.0  59324   380 ?        Ss   17:08   0:00 /usr/bin/vmnet-bridge -d /var/run/vmnet-bridge-2.pid -n 2 -i eth1

          vsftpd IP restriction 限制連線

          參考 http://linux.vbird.org/linux_server/0250simple_firewall.php#tcp_wrappers

          1. 先確認 vsftpd 是否支援 tcp_wrappers
              ldd $(which vsftpd) | grep libwrap.so,有 libwrap.so 即支援 tcp_wrappers
          2. edit /etc/vsftpd/vsftpd.conf
              設定 tcp_wrappers=YES
          3. 設定 service 連線限制,檢查順序為

              a. 先以 /etc/hosts.allow 為優先比對,該規則符合就予以放行
              b. 再以 /etc/hosts.deny 比對,規則符合就予以抵擋
              c. 若不在這兩個檔案內,亦即規則都不符合,最終則予以放行

          4. edit /etc/hosts.allow
              ALL: 127.0.0.1   # 這就是本機全部的服務都接受
              vsftpd: 192.168.1.0/255.255.255.0
              vsftpd: 10.0.0.100
          5. edit /etc/hosts.deny
              vsftpd: ALL
           

          CentOS 硬碟 partition 超過 2TB

          參考
          http://phorum.vbird.org/viewtopic.php?f=1&t=31842
          http://blog.yam.com/wesley1981/article/16596463
          http://wanggen.myweb.hinet.net/ech1/ech1.html

          6TB disk array 用 fdisk 做成一個 partition,把它 mount 起來看,怎麼只有 2TB?
          因為 fdisk 只支援到 2TB....

          必須改用 parted 才能超過 2TB。

          請注意:parted 裡面的指令是 "馬上生效",請小心使用!

          建立 partition:
          1. parted -a minimal /dev/sdb
          2. (parted) mklabel
              New disk label type? [bsd]? gpt
              Label-type 一定要選擇「gpt」,否則仍然會有容量的限制。
          3. (parted) mkpart
              Partition name? []? primary
              File system type? [ext2]? ext4
              Start? 0%
              End? 100%
          4. (parted) quit

          format partition:
          mkfs.ext4 /dev/sdb1

          vsftpd ssl/tls 設定

          Create certificate
          openssl req -x509 -nodes -days 3650 -newkey rsa:1024 -keyout /etc/vsftpd/vsftpd.pem -out /etc/vsftpd/vsftpd.pem

          /etc/vsftpd/vsftpd.conf 增加 ssl/tls 的部分如下:


          ssl_enable=YES
          allow_anon_ssl=NO
          force_local_data_ssl=NO
          force_local_logins_ssl=YES
          ssl_tlsv1=YES
          ssl_sslv2=NO
          ssl_sslv3=NO
          rsa_cert_file=/etc/vsftpd/vsftpd.pem
          ssl_ciphers=HIGH

          pasv_enable=YES
          pasv_address=xx.xx.xx.xx   # your Internet public IP address
          pasv_min_port=60000
          pasv_max_port=60009
          pasv_promiscuous=NO

          port_enable=NO
          port_promiscuous=NO

          firewall 會去判讀 ftp passive mode 所欲使用的 port 並自動開放,但是因為經過加密了所以 firewall 就看不懂了。firewall 必須加開 port pasv_min_port to pasv_max_port 才行。(Juniper Firewall詳細設定)

          如果沒有用 pasv_address=xx.xx.xx.xx 會變成內部可以連上,但是從 Internet 連不上。

          參考
          http://wiki.vpslink.com/Configuring_vsftpd_for_secure_connections_(TLS/SSL/SFTP)
          http://wiselysong.blogspot.com/2008/07/vsftpd-ssl-in-debian.html
          http://www.linuxquestions.org/questions/linux-software-2/vsftpd-ssl-passive-%3D-listing-problem-262063/
          http://bubble.gritto.net/db/query.php?id=5&ty=HOWTO
          http://william123617.wordpress.com/2010/11/12/vsftp-%E9%85%8D%E7%BD%AE-ftps/

          2013/5/22 update:
          Filezilla client and VSFTPD : GnuTLS error -12: A TLS fatal alert has been received
          solution:
          http://serverfault.com/questions/385286/filezilla-client-and-vsftpd-gnutls-error-12-a-tls-fatal-alert-has-been-recei
          add: ssl_ciphers=HIGH in the vsftpd.conf file

          2011年6月13日 星期一

          2011年6月10日 星期五

          設定Windows Xp 開機時Num Lock燈自動On

          原文 http://blog.fashion-style.com.tw/2008/02/16/%E8%A8%AD%E5%AE%9Awindows-xp-%E9%96%8B%E6%A9%9F%E6%99%82num-lock%E7%87%88%E8%87%AA%E5%8B%95on/


          要改變登入前的Nun lock,請修改
          HKEY_USERS\.DEFAULT\Control Panel\Keyboard\InitialKeyboardIndicators

          登入後的Nun lock,請修改
          HKEY_Current_User\ControlPanel\Keyboard\InitialKeyboardIndicators

          在類型REG_SZ中,將值的資料改成2,重新開機Num Lock就是Enable了。
          0 是關閉
          2 是開啟

          收件者反應收到的信中含有亂碼,且含有一個 Winmail.dat的附件圖示

          原因:
          Microsoft RTF (Rich Text Formatting) 造成的。

          參考文件:
          http://support.microsoft.com/kb/821881/zh-tw
          http://support.ceci.com.tw/directory/worldwide/zh-tw/faq/3254.htm#5
          http://ithelp.ithome.com.tw/question/10015567?tab=opinion

          Exchange server解法:

          按一下 [開始],指向 [程式集]、 指向 Microsoft Exchange,然後再按一下 [系統管理員]。
          展開左窗格中的 [通用設定] 、 按一下 [網際網路郵件格式]、 預設 物件或在右窗格中不同的網域相關聯的另一個物件上按一下滑鼠右鍵,然後按一下 [內容]。
          按一下 [進階] 索引標籤。
          在 [Exchange RTF 格式],下方按一下您想要的設定 (選 Never),然後按一下 [確定]。

          OutLook解法:
          打開 Outlook,到「工具」→「選項」→「郵件格式」,選為「轉換成HTML格式或純文字格式」都可以, 不要選擇「使用 Outlook Rich Text (RTF) 格式傳送」。

          如何 建立&刪除 Windows 服務Service

          原文 http://kevinfatal.blogspot.com/2009/01/windows-service.html

          COMMAND 模式:
          建立服務名稱:
          sc create [服務名稱] BinPath= "[執行檔案路徑]"

          刪除服務名稱: (服務必須先停止服務)
          sc delete [服務名稱]

          查詢服務名稱:
          sc query

          *詳細相關sc.exe指令,可在DOS視窗下打SC (or SC [command]即可)

          2011年6月9日 星期四

          Windows 2008 on VMware 系統時間變更

          狀況:
          Windows 2008安裝在VMware上,更改系統時間後,看到已經更改完成,但是重開機後系統時間又變回之前的狀態。

          原因:
          VMware guest OS安裝VMware tools後會參考VM主機的系統時間。

          解法:
          先更改VMware主機的系統時間,再將guest OS重開機即可。

          2011年6月7日 星期二

          CentOS ISO 虛擬光碟

          原文 http://hon0612.blogspot.com/2007/09/linuxiso.html

          mount -o loop CentOS-5.6-x86_64-bin-DVD-1of2.iso /media/cdrom

          CentOS Desktop GNOME 之後安裝

          原文參考
          http://susexd.blogspot.com/2009/11/centos-5-gnome.html
          http://hi.baidu.com/chif/blog/item/4d915a55d0b0f5cdb645ae37.html

          我用網路安裝 yum groupinstall "GNOME Desktop Environment"

          如果要從光碟安裝,節錄原文如下:(沒測過)
          mount /dev/cdrom /media/cdrom/
          yum --disablerepo=* --enablerepo=c5-media update
          yum --disablerepo=* --enablerepo=c5-media groupinstall "GNOME Desktop Environment"

          從光碟安裝: (已測過)
          mount /dev/cdrom /media/cdrom/
          yum -c /etc/yum.repos.d/CentOS-Media.repo groupinstall "GNOME Desktop Environment"

          2011年6月3日 星期五

          CentOS vsftpd download control

          1. edit /etc/vsftpd/vsftpd.conf,新增兩行
              download_enable=NO
              user_config_dir=/etc/vsftpd/user_config_dir
          2. 新增目錄 /etc/vsftpd/user_config_dir
          3. 只開放 root 可以 download,新增檔案 /etc/vsftpd/user_config_dir/root
              檔案內容 download_enable=YES
          4. 要允許 root 可以使用 vsftpd,修改兩個檔案,將檔案內容有 root 的部分用 # 註解掉
              /etc/vsftpd/ftpusers
              /etc/vsftpd/user_list

          Money雜誌企業策略專欄2011年5月號- Facebook 把你我都變成商品!

          ‎(原文)講難聽一點,其實臉書跟盜賣個資的人沒什麼兩樣。
          (翻譯)被賣了還很高興的幫忙數鈔票。

          NTP 網路對時 (Windows server, Linux client, TCP port)

          台灣對時網站 http://www.stdtime.gov.tw/chinese/home.aspx

          Windows server啟用Windows Time Service就可以當NTP server了。
          如果service啟動後還是無法對時,請參考這幾篇文章
          http://technet.microsoft.com/en-us/library/bb490605.aspx
          http://support.microsoft.com/kb/816042/zh-tw
          http://www.atomic-clock.galleon.eu.com/support/windows-2003-ntp-time-server.html

          範例:Windows 2003 server啟用Windows Time Service當作NTP
          1. 用regedit修改registry

              HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\
                  Type Set value to NTP.

              HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\
                  AnnounceFlags Set the value to 5 (for reliable time source).

          2. restart service "Windows time service"

          網域主控站(DC)如何正確設定 Windows 時間服務 (w32tm)
          w32tm /config /manualpeerlist:"time.stdtime.gov.tw clock.stdtime.gov.tw tick.stdtime.gov.tw watch.stdtime.gov.tw" /syncfromflags:manual /reliable:yes /update

          ----------------------------------------------------------------------------------------------------------
          Linux client向NTP server對時。
          參考 http://linux.vbird.org/linux_server/0440ntp.php#client_windows
          1. ntpdate [-d] NTP-server-IP-or-DNS-name
              -d 是 debug 使用,會列出詳細的訊息
              Ex: ntpdate pdc.company.com
          2. hwclock -w
              將時間寫入BIOS
          3. 編輯crontab
              crontab -e,加入 10 5 * * * ntpdate pdc.company.com; hwclock -w

          ----------------------------------------------------------------------------------------------------------
          如果NTP需要穿過防火牆對時,請開啟UDP 123 port。
           
          2022/7/29 update:
          DC 對時錯誤狀況:
          C:\Windows\system32>w32tm /monitor
          DC02.domain.com[192.168.x.x:123]:
              ICMP: 0ms delay
              NTP: -8.6596986s offset from DC03.domain.com
                  RefID: (unspecified / unsynchronized) [0x00000000]
                  Stratum: 0
          DC03.domain.com *** PDC ***[[::1]:123]:
              ICMP: 0ms delay
              NTP: +0.0000000s offset from DC03.domain.com
                  RefID: 'LOCL' [0x4C434F4C]
                  Stratum: 1
          DC01.domain.com[192.168.x.x:123]:
              ICMP: 0ms delay
              NTP: -0.1569371s offset from DC03.domain.com
                  RefID: (unspecified / unsynchronized) [0x00000000]
                  Stratum: 0
           
          C:\Windows\system32>W32tm /query /source
          Local CMOS Clock
           
          C:\Windows\system32>w32tm /query /peers
          #??: 1
          Peer: clock.stdtime.gov.tw
          State: Pending
          Time Remaining: 888.3607281s
          Mode: 0 (reserved)
          Stratum: 0 (unspecified)
          PeerPoll Interval: 0 (unspecified)
          HostPoll Interval: 0 (unspecified)
           
          處理方法: (先確認 registry 已經設定 NTP)
          net stop w32time
          w32tm /unregister
          w32tm /register
          net start w32time
          w32tm /resync
          w32tm /query /peers

          處理後:
          C:\Windows\system32>w32tm /monitor
          DC02.domain.com[192.168.x.x:123]:
              ICMP: 0ms delay
              NTP: -0.0253315s offset from DC03.domain.com
                  RefID: 211-22-103-158.hinet-ip.hinet.net [211.22.103.158]
                  Stratum: 3
          DC03.domain.com *** PDC ***[[::1]:123]:
              ICMP: 0ms delay
              NTP: +0.0000000s offset from DC03.domain.com
                  RefID: 211-22-103-158.hinet-ip.hinet.net [211.22.103.158]
                  Stratum: 3
          DC01.domain.com[192.168.x.x:123]:
              ICMP: 0ms delay
              NTP: -0.0140247s offset from DC03.domain.com
                  RefID: 211-22-103-158.hinet-ip.hinet.net [211.22.103.158]
                  Stratum: 3

          C:\Windows\system32>w32tm /query /source
          clock.stdtime.gov.tw

          C:\Windows\system32>w32tm /query /peers
          #??: 1
          Peer: clock.stdtime.gov.tw
          State: Active
          Time Remaining: 53.5851137s
          Mode: 1 (Symmetric Active)
          Stratum: 2 (secondary reference - syncd by (S)NTP)
          PeerPoll Interval: 6 (64s)
          HostPoll Interval: 6 (64s)

          Reference:

          CentOS RPM 用法

          1. 安裝:rpm -ivh package-name
          2. 升級:rpm -Uvh package-name
          3. 查詢檔案屬於哪一個package:rpm -qf full-path
              Ex: rpm -qf /usr/bin/crontab
          4. 查詢package包含哪些檔案:rpm -ql package-name
              Ex: rpm -ql vixie-cron

          CentOS crontab: command not found

          參考:http://phorum.study-area.org/index.php?topic=51351.0

          找一台 centos 機器跑 rpm -qf /usr/bin/crontab 可以知道是屬於 vixie-cron 該套件,所以安裝上該套件即可。

          安裝方法:
          yum install vixie-cron

          外線電話轉接

          昨天晚上和以前的朋友吃飯,聊到外線電話轉接的事情,我們常常會接到轉接過來的外線電話要找 XX主管,這通常是要來推銷產品的,我朋友提到他的做法,他設定一個虛擬分機,如果有人找 XX主管,而且對方講不出來確定要找誰,就轉接到這個虛擬分機,這個分機當然沒有人會接 ^___^

          如果電話交換機的功能比較簡單,沒辦法設定虛擬分機,可以請總機幫忙先確認對方是否講
          得出主管的名字,如果講不出來,請總機回答說我們公司沒有 XX主管

          2011年6月1日 星期三

          每個孩子在九歲以前該學會的好禮儀(轉貼)

          原文 http://blog.sina.com.tw/sunnysandiego/article.php?pbgid=57803&entryid=613978

          很多大人也沒做到。


          Manner #1
          When asking for something, say "Please." 
          做任何要求的時候,都要說 "請"

          Manner #2
          When receiving something, say "Thank you."
          收到任何的禮物或幫助,都要說 "謝謝"

          Manner #3
          Do not interrupt grown-ups who are speaking with each other unless there is an emergency. They will notice you and respond when they are finished talking.

          除非是緊急事件,否則不可以打斷大人之間的談話。當大人結束談話時,他們會回應你。

          我知道很多小朋友受不了大人講電話,常常在電話那頭嘰嘰叫,讓大人很難好好的把話講完,這點其實都是小朋友的通性,但是真的要從小教他們,大人可以準備一些事情給孩子做,讓他們不會一直想到以打斷大人談話的方式來得到注意力,這對你講話的對象也是一種尊重。

          Manner #4
          If you do need to get somebody's attention right away, the phrase "excuse me" is the most polite way for you to enter the conversation.
          如果你真的需要立刻得到大人的注意,要記得先說 "Excuse Me",才能插入大人的對話。(Excuse me 差不多等於中文的 "對不起")

          Manner #5
          When you have any doubt about doing something, ask permission first. It can save you from many hours of grief later.
          如果你對於 (碰觸或是做)任何東西或事情不確定的時候,最好先得到許可才做,以免惹禍或是後悔。
          這點主要是告訴小朋友,只要不是你的東西,最好都是問過了主人再碰或拿取,免得惹禍,同時也顯示你對別人的尊重。再者,在美國如果要摸別人的寵物,也一定要先徵求主人同意才摸,因為不見得每個主人都希望你碰他的寵物,或者有些寵物可能有特殊狀況碰不得 (因為萬一他的寵物咬人了,主人可能會吃上官司的)

          Manner #6
          The world is not interested in what you dislike. Keep negative opinions to yourself, or between you and your friends, and out of earshot of adults.
          別人不會對你不喜歡的事物感興趣,所以那些負面的評論留給你自己或是自己的朋友之間討論就好了,不要去跟大人講。

          Manner #7
          Do not comment on other people's physical characteristics unless, of course, it's to compliment them, which is always welcome.
          不要批評別人的外表或是長相,除非你是讚美別人。
          這點我覺得在美國比較重視,他們常常教孩子不要因為人的膚色,種族,頭髮,胖瘦,高矮或是身體的缺陷等等而去取笑別人,要對大家一視同仁; 同時也教孩子要喜歡自己本來的樣子。我覺得華人一般對這點比較不重視,隨便會給人取不好的綽號,例如矮冬瓜,大鋼牙,瘦皮猴,大胖豬等等,相信大家都有經驗,甚至深受其害。

          Manner #8
          When people ask you how you are, tell them and then ask them how they are.
          當別人問候你的時候,你要回答,並且也要問候對方。

          Manner #9
          When you have spent time at your friend's house, remember to thank his or her parents for having you over and for the good time you had.
          當你在朋友家玩完要離開的時候,記得要向朋友的父母說謝謝,並且告訴他們你玩得很開心。

          Manner #10
          Knock on closed doors -- and wait to see if there's a response -- before entering.
          如果房門 (或是廁所門) 是關著的時候,進入之前要先敲門,而且要等一下看看有沒有人回應才能進入
          美國一般的公共廁所其實是不用敲門的,因為公廁通常有很大的門縫,讓你可以從底下看到裡面有沒有人在。請看 sunny 以前寫過的這篇文章: [美國生活] 關於上廁所
          不過像餐廳或是圖書館之類的廁所,就不會有很大的門縫,因此門關著的時候,就不知道裡面有沒有人,這時候就要先敲門,等待沒有人回應之後 (或等裡面的人出來之後) 再進入。至於如果自己在廁所裡,而剛好有人敲門的時候該怎麼回應呢,我也不是很確定,不過我問過一次圖書館的小姐,她告訴我可以說 "Just a minute!" 可以讓大家參考看看。

          Manner #11
          When you make a phone call, introduce yourself first and then ask if you can speak with the person you are calling.
          當你打電話的時候,記得先報上自己的姓名,再請問對方可不可以和某某人說話?

          Manner #12
          Be appreciative and say "thank you" for any gift you receive. In the age of e-mail, a handwritten thank-you note can have a powerful effect.
          收到任何禮物,都要感激道謝。在這個電子郵件的年代,手寫的感謝卡更能觸動人心。
          這項其實跟前面的第二項禮儀是差不多的,不過是針對所收到的實質禮物。總之,只要有人為你做了什麼事,送了你什麼禮物,無論大小,無論貴重或禮輕情意重,都必須表達你的感謝。

          Manner #13
          Never use foul language in front of adults. Grown-ups already know all those words, and they find them boring and unpleasant.
          絕對不要說髒話,大人早就知道這些話,只是他們覺得這些話既無聊,也令人覺得不舒服。

          Manner #14
          Don't call people mean names.
          不要用刻薄難聽的綽號叫別人 (不要說,也不要取)
          這跟剛剛提到的不要評論別人的外表長相是有異曲同工之妙,這樣的批評或是不好的綽號,都會深深的傷了別人的自尊心。叫別人肥豬,白痴,禿頭驢,短腿,...等等都是。除非當事人完全不介意這樣的綽號,不然應該避免叫別人不好的綽號。

          Manner #15
          Do not make fun of anyone for any reason. Teasing shows others you are weak, and ganging up on someone else is cruel.
          不要以任何原因嘲笑任何人。嘲笑只會使你自己顯得軟弱 (因為有自信的人會懂得欣賞別人的優點,也不會以貶低別人,來顯示自己的優越)。(我不確定 ganging up on someone else is cruel. 這句該怎麼翻比較恰當)
          我覺得台灣的文化是比較不重視這一種的禮儀,一般人好像也不認為這點有什麼不對,社會上也有很多的例子,像我就非常無法接受大家總是拿殘障的歌手阿吉仔身體的缺陷來開玩笑,還有很多人以模仿他跛腳的表演方式為樂,我非但一點也不覺得好笑,而且覺得很殘酷,那樣的取笑,不只是對那位歌手殘酷,對所有同樣有身心障礙的人都是非常殘酷的。沒有人天生希望自己是殘疾人士,我們只是比他們幸運能夠擁有健康的身體,所以請教導您的孩子去尊重別人,關懷別人,幫助別人,而不是去取笑他們。

          Manner #16
          Even if a play or an assembly is boring, sit through it quietly and pretend that you are interested. The performers and presenters are doing their best.
          即使一場戲劇表演或是學校的集會很無聊,還是要安靜地坐好,並表現出你有興趣的樣子。表演者和演說者都是盡了他們最大的努力要做好這一場的表演。
          這項禮儀是要說明對表演者的尊重,別說是小朋友了,我想很多的成人也都不見得可以做得很好。當然各種演出時有些表演比較好,有些比較差,但是我想沒有人是存心要搞砸一場表演的,他們一定都是事先做了準備才來的,如果可以將心比心這樣想,應該就會比較釋懷了。

          Manner #17
          If you bump into somebody, immediately say "Excuse me."
          如果你不小心撞到別人了,要立刻說 "對不起"

          Manner #18
          Cover your mouth when you cough or sneeze, and don't pick your nose in public.
          當你咳嗽或是打噴嚏的時候,記得要摀住你的嘴巴, 也不要在別人面前挖鼻子。

          Manner #19
          As you walk through a door, look to see if you can hold it open for someone else.
          當你經過一道門的時候,要看看後面還有沒有人要經過,有的話,要幫他們把門扶住。
          這是在美國一個非常非常重要的禮儀,卻也是在台灣完全不存在的禮儀,所以要特別說明一下。台灣很多公共場合都有電動門自動門之類的,所以不必自己開門。就算有些地方需要把門推開,也是一進門就放手了。可是在美國可千萬別這樣,因為這樣是會被認為非常沒有禮貌的,不論你的後面有沒有人,在推開公共場所的門之後,放手之前一定要先回頭看看後方還有沒有人要進來,如果有的話,要幫後面的人把門扶住 (讓門還是開著的狀態),等到後面的人接手扶住門了之後,你才可以放手。
          可是ㄌㄟ,對於性別還有個不成文的習俗。如果你是男生,不論是大男生,或是年長的男士,本著 ladies first 尊重女士優先的原則,如果你後面來的是女生 (不論是小女生,年輕女士或是老婆婆),你都應該要把門一直扶住 (在全開的狀態),直到女士們都通過了之後,才能放手,或是直到下一位男士接手之後,才能放手,這樣就是所謂的紳士風度。小子去圖書館有時候也會幫後面的人把門扶住,曾經有一次別人對他說: "Thank you, young gentleman." (謝謝你,小紳士),讓他銘記在心,開心好久。
          我在美國十多年,因為已經太習慣這樣的作法,忘記台灣沒有這樣的習慣,結果上次回台灣的時候,有一次差點被迎面彈而來的門給砸到臉上,因為我沒有想到前面的人一走完就直接放手,而我又還沒有伸手過去接住,險些釀成慘劇呀。之後就非常小心了,這也算是一種 culture shock 文化衝擊吧! 在這裡要特別提醒來美國旅遊或是求學的人,務必記得這一項重要的禮儀。

          Manner #20
          If you come across a parent, a teacher, or a neighbor working on something, ask if you can help. If they say "yes," do so -- you may learn something new.
          如果你看到學校家長,老師,或是鄰居正在做事的時候,問看看有沒有什麼你可以幫忙的地方? 如果他們說有,那麼就去幫忙,你可能會從這件事學到一些新東西。

          Manner #21
          When an adult asks you for a favor, do it without grumbling and with a smile.
          當大人請你幫忙做事的時候,要開心笑臉的去做,不要臭著一張臉。

          Manner #22
          When someone helps you, say "thank you." That person will likely want to help you again. This is especially true with teachers!
          當別人 (尤其是你的老師)幫助你的時候,要記得說謝謝,那個人很可能以後還會再次幫助你喔! 

          Manner #23
          Use eating utensils properly. If you are unsure how to do so, ask your parents to teach you or watch what adults do.
          要學會正確使用餐具。如果你不確定如何使用,請你的父母教你,或者是觀察其他的大人是怎麼做的。

          Manner #24
          Keep a napkin on your lap; use it to wipe your mouth when necessary.
          用餐時把餐巾放在大腿上,需要的時候就可以拿起來擦嘴巴,中餐沒有這樣的禮儀,通常都會有紙巾,放在桌上,需要的時候在拿來擦就可以了。

          Manner #25
          Don't reach for things at the table; ask to have them passed.
          這一條也是西餐禮儀,中餐沒有這樣的規矩。不可以伸手經過別人面前去取用東西 (例如胡椒或是鹽罐),必須要請別人幫你遞過來。同樣的,如果搭乘電梯的時候,你前面有人,也不應該直接伸手越過別人的身體去按鈕,而是要請最靠近按鈕的那個人幫你按。