2009年11月28日 星期六

Windows 7 x64 之宅宅的漫長等待

主機 + UPS  IDE Disk , SATA DVD-RW  , SATA Disk


上上週一直瀰漫著打算砸錢買新電腦的構想,因為環境差不多許可,上週日回到宿舍前,盡管飄雨還特地去NOVA收集價目單,那時有家門市業務還跟我說週末買回去剛剛好啊,結果我回到寢室後,發現電腦出現問題,突然無法開機,那種感覺就像主機板掛掉,沒有任何的資訊,把一張張 PCI 卡拆下、把記憶體拿掉,也都一樣沒救,弄了將近一小時,正打算打電話回家報備時,播通電話那一刻,電腦竟然可以開機了。不曉得是不是冥冥之中的安排?是老機器的逆襲,還是它要我忍下心去買新電腦呢?最後,我在星期一晚上決定了項目表,並且使用原價屋的網路訂購服務,網路下單後打電話去,這一切仍以電話為主的交易模式,網路只是協助而已。


這是我第二次使用,第一次則是用消費券買螢幕。選擇用它的主因有兩個,一個是滿萬元免運費免代收費費,代收費就是用在貨到付款的服務,很方便也免掉搬運或匯款問題,第二個理由是項目比較多,可以很輕鬆選擇。在這之前我以為它是最便宜的,因為很多討論都以它來講,但我跟大學同學請教後,以及去 NOVA 要了單子,發現的確也還存在很多比它便宜的,的確,不然它要怎樣賺錢,哈,所以,以後使用上要記得盡量用一些搭配方案來取得優勢囉。


貨品也很快,大概 2 ~ 3 天就會送到,我在星期一晚上訂,請他們幫忙多測一下,畢竟有問題換貨對我比較麻煩,所以是星期三出貨,稍稍一問,他們的出貨時間分中午跟晚上五點前。以我的點是星期四早上收件。以為一切就這麼順利了嗎?並沒有,苦難才正要開始。


以下是我自己亂配的單子



  • CPU:AMD AM3 PhenomII 四核心 X4-945/3.0G/95W/45nm/L2+L3=8MB+B62

  • 主機板:技嘉MA785GPMT-UD2H/A785G+SB710/RGB+DVI+HDMI/1394+eSATA (內建顯卡)

  • 記憶體:威剛 DDR3-1600 2G x 4

  • 硬碟:日立 SATAII 500G 16M 7200RPM 三年保固

  • 燒錄器:LITE-ON iHAS324/24XDVD燒錄

  • 機殼:黑熊貓四大 + 康舒 370W /12公分

  • UPS:APC全美最大 500VA OFF-LINE 含監控+防雷擊突波 BE500TW


但打電話過去確認時,有些項目已經沒了,又改成



  • 記憶體:黑金剛 DDR3-1600 2G x 4

  • 燒錄器:華碩 DRW-22B2ST/22XSATA


主要是記憶體沒有搭配到方案,整整貴了 780 元!!那時對方也問我要不要改用 DDR3-1333 的,我想了會還是用 DDR3-1600 ,實在是價錢沒差多少。至於為啥不用 DDR2 記憶體,在這之前是有想過,但看到那時 DDR2-800 的價錢比 DDR3-1600 特價方案還貴,就選擇用 DDR3 了。當下回想起來還有一點懊悔。但今天我仔細看了一下主機板,因為要用 AMD3 且內建顯卡的,似乎也沒多少可以選擇。不過,DDR2-800 好像有稍微降價了!


原價屋,還有一個特色就是出貨前若價錢變動可以跟他們確認價錢喔!他們說假設星期三出貨,那到星期三晚上都還可以打電話去確認價錢,當然這些都要買家自己去做。所以,後來兩天我都一直看價目,但最後只看到 LITE-ON iHAS324/24XDVD燒錄 又有貨了,恰好又特價,所以爭取換貨但這一切只爭取得便宜 50 元。


但這一切仍只是序章。


星期四拿到貨時,一開機主機板卻不斷地叫!查了說明書是說顯示卡沒插好,可是這是內建顯卡啊!黔驢技窮,把 BIOS 電池拔掉還是一樣。後來上網查一查,有人說記憶體沒插好也可能,慶幸地重插記憶體就搞定了,但我發現只使用 DDR-1333 在運行,趕緊上網查一下,原來,那些板子上頭說支援到 DDR3-1800 都是要超頻的!看來我真的沒做好功課啊。但因為我不喜歡折磨硬體,最後都選擇用 DDR3-1333 模式,當初若我改買 DDR3-1333 大概可再便宜 400 元吧!


USB 轉接 PS/2


真正的痛苦開始了!我發現主機板只有一個 PS/2 插孔!外加上我是先安裝 Ubuntu 9.10 i386 版,只好去猜怎樣切換到選單,以前在 Windows XP 還可以用 Tab 切換,在 Ubuntu 我就不熟了,但有印象一些快速鍵是使用 Ctrl + Alt 來搭配,以及 Alt+F2 這個快速鍵我還記得,它就是跟 Windows 的 視窗鍵 + R 的道理一樣。透過這些我終於把舊硬碟中的東西燒錄出來!當然在安裝舊硬體又有一番折騰,因為 Power 接線過短,我又橋內部搞了一陣子。


先後嘗試了 Vista Business x64 與 Windows 7 x64 的版本,前者讓我買的便宜 Webcam 不能運作,另外 Skype 4.1 版也有問題,打開視窗打字就會卡住!後來發現 Skype 3.8 版就能正常囉!接著換 Windows 7 x64 版,發現 Webcam 已經可以正常運作,但 Skype 4.1 還是會有卡住的問題,我換到 Skype 3.8 仍是一樣並且有不支援的問題,幸運的官方網站還有 3.5 版,用了 Skype 3.5 版就正常,但需要把 IE 上的  plugin 關掉!(20091129:使用上不知怎樣,可能是跟對方都是private ip,所以一直看不到對方,最後我又換回Skype最新版,也可能因為更新過 Windows 7 了,目前暫時無事)


沒想到這一路上跌跌撞撞啊!我想,老天一定是派它來磨練我的耐心的。


最後我決定使用 Windows 7 x64 版囉!這樣我也可以安心地享用 8 GB 的記憶體,而買了 UPS 就是有在想要不要架站等,晚點再來試試 VMWare Server 吧!附上一些照片紀念一下。


2009年11月20日 星期五

[Linux] Eclipse & Subclipse Plugin (SVN Client) - Change/Clear SVN User/Password @ Ubuntu 9.10

在 Ubuntun 9.10 i386 Desktop 環境,安裝 Eclipse 3.5.1 with Sublcipse 1.0.0 版。


製作一份共用的 VMWare Image 檔互傳使用,並使用 Eclipse 與 Svn 管理案子,因此碰到如何移除 SVN 所紀錄的 User & Password 問題,找了很久並未發現 Eclipse 或 Subclipse 介面上有無去除密碼的方式,最後選擇直接砍掉儲存密碼的檔案,如此一來,把 VMWare Image 傳給其他人時,第一次使用就會詢問帳號密碼,以此讓使用者以自己的帳號進行專案的管理。


Subclipse 儲存密碼的資訊:



  • 檔名:.keyring

  • 位置:$HOME/.eclipse/org.eclipse.platform_3.5.0_155965261/configuration/org.eclipse.core.runtime/.keyring

  • 動作:# rm $HOME/.eclipse/org.eclipse.platform_3.5.0_155965261/configuration/org.eclipse.core.runtime/.keyring
     (記得先備份,以免出事)


另外,如果有用到 Subversion 時,可能也會有一樣的問題,這時也可以移除紀錄帳密的檔案來達到一樣效果:



  • 目錄:auth

  • 位置:$HOME/.subversion/auth

  • 動作:# rm -r $HOME/.subversion/auth (記得先備份,以免出事)


參考資料



[Linux] Update Manager : An error occurred during the signature verification (Hash Sum mismatch) @ Ubuntu 9.10

前陣子安裝 Ubuntu 9.10 i386 Desktop ,印象中當時作系統更新時還算正常,但之後改過 /etc/hostname ,也不知何時開始,更新作業系統就無法成功,出現的訊息大多是 Hash Sum mismatch ,後來試了這篇 [ubuntu] Update Manager Problem... Invalid signature? - Page 2 - Ubuntu Forums ,看到許多人說 Aearenda 提到的更新 /etc/hostname 與 /etc/hosts 的修正,就可以更新成功囉!可惜的,我仍沒有解決這個問題,或採用下面指令也是如此。



  • # sudo apt-get update -o Acquire::http::No-Cache=True


但我發現,我有一台主機 Ubuntu 9.04 的,使用上述的方式的確有效,但 Ubuntu 9.10 依舊沒有解決。慶幸的最後仍有找到方式,以下是相關的執行樣貌,最後我是使用 Bug #24234 in apt (Ubuntu): “apt-get update failing with bad signature.” finjay 提到的解法,解決了 Ubuntu 9.10 的更新問題!



  • sudo apt-get clean

  • cd /var/lib/apt

  • sudo mv lists lists.old

  • sudo mkdir -p lists/partial

  • sudo apt-get clean

  • sudo apt-get update


我嘗試的流程:



  1. 使用 sudo apt-get update -o Acquire::http::No-Cache=True ,但仍無解決

  2. 使用修正 /etc/hosts 與 /etc/hostname 的關係,仍無解決

  3. 最後使用 finjay 提到的解法,就更新成功囉



以下是一些相關的錯誤訊息,也忘了到底是在那個階段出現的 :P 畢竟兩種是接續著試,有無相依性也不確定,再說問題解決後環境也不再,無法再測試,僅留下來當作參考囉。


user@Ubuntu910:~$ sudo apt-get update
Hit http://tw.archive.ubuntu.com karmic Release.gpg
Ign http://tw.archive.ubuntu.com karmic/main Translation-en_US
Ign http://tw.archive.ubuntu.com karmic/restricted Translation-en_US
Ign http://tw.archive.ubuntu.com karmic/universe Translation-en_US
Ign http://tw.archive.ubuntu.com karmic/multiverse Translation-en_US
Get:1 http://tw.archive.ubuntu.com karmic-updates Release.gpg [189B]
Ign http://tw.archive.ubuntu.com karmic-updates/main Translation-en_US
Ign http://tw.archive.ubuntu.com karmic-updates/restricted Translation-en_US
Ign http://tw.archive.ubuntu.com karmic-updates/universe Translation-en_US
Ign http://tw.archive.ubuntu.com karmic-updates/multiverse Translation-en_US
Hit http://tw.archive.ubuntu.com karmic Release
Get:2 http://tw.archive.ubuntu.com karmic-updates Release [44.1kB]
Hit http://tw.archive.ubuntu.com karmic/main Packages
Err http://tw.archive.ubuntu.com karmic-updates Release

Hit http://tw.archive.ubuntu.com karmic/restricted Packages
Hit http://tw.archive.ubuntu.com karmic/main Sources
Hit http://tw.archive.ubuntu.com karmic/restricted Sources
Hit http://tw.archive.ubuntu.com karmic/universe Packages
Hit http://tw.archive.ubuntu.com karmic/universe Sources
Hit http://tw.archive.ubuntu.com karmic/multiverse Packages
Hit http://tw.archive.ubuntu.com karmic/multiverse Sources
Hit http://security.ubuntu.com karmic-security Release.gpg
Ign http://security.ubuntu.com karmic-security/main Translation-en_US
Ign http://security.ubuntu.com karmic-security/restricted Translation-en_US
Ign http://security.ubuntu.com karmic-security/universe Translation-en_US
Ign http://tw.archive.ubuntu.com karmic-updates/multiverse Translation-en_US
Hit http://tw.archive.ubuntu.com karmic Release
Get:2 http://tw.archive.ubuntu.com karmic-updates Release [44.1kB]
Hit http://tw.archive.ubuntu.com karmic/main Packages
Err http://tw.archive.ubuntu.com karmic-updates Release

Hit http://tw.archive.ubuntu.com karmic/restricted Packages
Hit http://tw.archive.ubuntu.com karmic/main Sources
Hit http://tw.archive.ubuntu.com karmic/restricted Sources
Hit http://tw.archive.ubuntu.com karmic/universe Packages
Hit http://tw.archive.ubuntu.com karmic/universe Sources
Hit http://tw.archive.ubuntu.com karmic/multiverse Packages
Hit http://tw.archive.ubuntu.com karmic/multiverse Sources
Hit http://security.ubuntu.com karmic-security Release.gpg
Ign http://security.ubuntu.com karmic-security/main Translation-en_US
Ign http://security.ubuntu.com karmic-security/restricted Translation-en_US
Ign http://security.ubuntu.com karmic-security/universe Translation-en_US
Ign http://security.ubuntu.com karmic-security/multiverse Translation-en_US
Hit http://security.ubuntu.com karmic-security Release
Hit http://security.ubuntu.com karmic-security/main Packages
Hit http://security.ubuntu.com karmic-security/restricted Packages
Hit http://security.ubuntu.com karmic-security/main Sources
Hit http://security.ubuntu.com karmic-security/restricted Sources
Hit http://security.ubuntu.com karmic-security/universe Packages
Hit http://security.ubuntu.com karmic-security/universe Sources
Hit http://security.ubuntu.com karmic-security/multiverse Packages
Hit http://security.ubuntu.com karmic-security/multiverse Sources
Fetched 190B in 11s (16B/s)
Reading package lists... Done
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used.GPG error: http://tw.archive.ubuntu.com karmic-updates Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>

W: Failed to fetch http://tw.archive.ubuntu.com/ubuntu/dists/karmic-updates/Release

W: Some index files failed to download, they have been ignored, or old ones used instead.


2009年11月17日 星期二

[Linux] 設定 Objective-C 開發環境及教學資料 @ Ubuntu 9.10

差不多該學學 Objective-C 了,手邊也有 iphone 及相關的環境可開發,剩下只有懶散的心情要整頓。至於什麼是 Objective-C ,可以先看看維基百科的介紹,我覺得還滿詳盡的,甚至英文版還有介紹從 C/C++ 跨到 Objective-C 的範例程式,真的就乾心哩,看程式比看英文快上十倍啊。



跟 iphone 開發相關的網頁介紹:



其他相關的教學



接著,就只剩環境架設的部分,


在 Ubuntu 9.10 最簡化版:



  1. 安裝相關套件

    • # sudo apt-get install gnustep-devel

    • The following extra packages will be installed:
        gnustep-back-common gnustep-back0.16 gnustep-back0.16-art gnustep-base-doc gnustep-core-devel gnustep-core-doc gnustep-gpbs gnustep-gui-common
        gnustep-gui-doc gnustep-gui-runtime gnustep-make-doc gorm.app libaspell-dev libaudiofile-dev libgif-dev libgnustep-gui-dev libgnustep-gui0.16
        libjpeg62-dev libpng12-dev librenaissance0 librenaissance0-dev libtiff4-dev libtiffxx0c2 projectcenter.app projectmanager.app zlib1g-dev



  2. 安裝完就能用 gcc 進行編譯囉

    • # gcc -lgnustep-base -lpthread -lobjc -lm -I/usr/local/include/GNUstep -I/usr/include/GNUstep source.m -o source_run



  3. 參考資料



使用 Makefile 的教學:



  1. 建立 GNUmakefile

    • GNUSTEP_MAKEFILES = /usr/share/GNUstep/Makefiles/

      include $(GNUSTEP_MAKEFILES)/common.make
      TOOL_NAME = LogTest
      LogTest_OBJC_FILES = source.m
      include $(GNUSTEP_MAKEFILES)/tool.make

    • 最上頭那段是我自己加的,網路上大部分的文件都是使用 shell 來設置環境變數

      • C shell

        • # source <GNUstep root>/System/Library/Makefiles/GNUstep.csh



      • Bourne shell

        • # . <GNUstep root>/System/Library/Makefiles/GNUstep.sh







  2. 建立 source.m


    • #include <stdio.h>

      /*
      * The next #include line is generally present in all Objective-C
      * source files that use GNUstep.  The Foundation.h header file
      * includes all the other standard header files you need.
      */
      #include <Foundation/Foundation.h>  

      /*
      * Declare the Test class that implements the class method (classStringValue).
      */
      @interface Test
      + (const char *) classStringValue;
      @end

      /*
      * Define the Test class and the class method (classStringValue).
      */
      @implementation Test
      + (const char *) classStringValue;
      {
        return "This is the string value of the Test class";
      }
      @end

      /*
      * The main() function: pass a message to the Test class
      * and print the returned string.
      */
      int main(void)
      {
        printf("%s\n", [Test classStringValue]);
        return 0;
      }



  3. 編譯與測試

    • # mkdir test ; cd test ;

    • # vim GNUmakefile (內容如上)

    • # vim source.m (內容如上)

    • # make ;

    • # ./obj/LogTest


      • 輸出結果:This is the string value of the Test class





  4. 參考資料



 



Learn Objective-C on Ubuntu



2009年11月13日 星期五

[Linux] 安裝 Eclipse & Subclipse Plugin (SVN Client) @ Ubuntu 9.10

最近剛重灌電腦,上次安裝失敗,這次就好好順便紀錄一下安裝過程。


安裝環境:Ubuntu 9.10 Desktop i386



  1. 安裝 Eclipse

    • # sudo apt-get install eclipse



  2. 安裝 Subclipse

    • 開起 eclipse

    • [Help] -> [Install New Software] 點選 Add


      • Name : subclipse

      • Locatioon : http://subclipse.tigris.org/update



    • 點選 Subclipse Plugin -> Subclipse

    • 接著就 Next 進行囉 (記得版權那邊要勾一下才能按 Finish 安裝喔)



  3. 設定 Eclipse

    • [Window]->[Preferences]->[Team]->[SVN]

    • 此時會蹦出錯誤訊號窗

      • Failed to load JavaHL Library.
        There are the errors that were encountered:
        no libsunjavahl-1 in java.library.path
        no svnjavahl-1 in java.library.path
        no svnjavahl in java.library.path
        java.library.path = /usr/lib/jvm/java-6-openjdk/jre/lib/i386/cclient:/usr/lib/lib/jvm/java-6-openjdk/jre/lib/i386:......:/usr/lib/jni:/usr/lib

      • 這是因為一開始預設是用 JavaHL 關係



    • 解決方式有兩種

      • 第一種:在剛剛的頁面上,有 SVN interface 選項,有 JavaHL(JNI) 跟 JavaSVN(Pure  Java) 兩種可選,切換成 JavaSVN 就行了!

      • 第二種:安裝 JavaHL

        • # sudo apt-get install libsvn-java

        • 只是我安裝完仍有看到錯誤訊息

          • Failed to load JavaHL Library.
            There are ther errors that were encountered:
            no libsvnjavahl-1 in java.library.path
            Incompatible JavaHL library loaded, 1.3.x or later required.



        • 然而自己就很懶得再繼續解下去,就略過這個解法,改用 JavaSVN(Pure  Java) 啦







  4. 測試

    • [File]->[New]->[Other]->[SVN]->[Checkout Projects from SVN]->[Create a new repository location]

      • 若預設就在這個選項,但又不能按 Next ,就先選另一個選項再切回來就可以選 Next 啦



    • 剩下的就只是選你要 checkout 的目錄囉,選完按 Finish 就能跑了




以上純粹只是在 Linux 上使用安裝 Subclipse plugin for Eclipse 而已,並不是要開發 Java 類的程式,因此僅利用預設的環境。