2009-01-01

jQuery

2009-01-03

  • 98年歲修停電配合,北群訂於1月3日(週六)8~17時停電
  • SOA Predictions for 2009
    I also predict that Cloud Computing will take over the hype machine from SOA (if it hasn't already) 
    and the same discussions we had with SOA will now occur with the clouds.
    
    SOA Gets Cloudy.
    

Web Service : Comet

Web Service : JavaScript

2009-01-04

Cloud Computing

  • Did Google's Eric Schmidt Coin "Cloud Computing"?
    • Cloud Computing一辭的起源為 2006 年 Google CEO Eric Schmidt 用來描述自家的 SaaS 服務。
      When Google CEO Eric Schmidt  used it in 2006 to describe their own stuff and then Amazon included the word 
      “cloud” in EC2 when it was launched a few weeks later (August 24), the term became mainstream.
      
  • JumpBox Releases 38 Open Source Virtual Appliances for Amazon Cloud Service
    • JumpBox 的 Logo / Website 先前有逛過,至於展示攤位我也有在 LinuxWorld 2008 看過,我也覺得它蠻有趣的。它把目前熱門的 Open Source 專案都變成以前網頁虛擬主機(Hosting)的一種軟體服務(Software as a Service)。
    • 如何使用 VirtualBox 執行 JumpBox - 從影片可以學到他們把 VM 的根目錄(root)跟資料碟(data)分開,此外用網頁的方式讓使用者去試用這些 JumpBox VM。(OS: 原來光賣設定好的 VM 也可以賺錢?!不會吧?!)

Web Service : JavaScript

jQuery

  • 測試 RhinoRhino/env.js
    • 作者說可以參考Rhino Shell來了解 Rhino 的使用方法
      ~$ wget ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_7R1.zip
      ~$ unzip rhino1_7R1.zip
      ~$ cd rhino1_7R1/
      ~/rhino1_7R1$ wget http://jqueryjs.googlecode.com/svn/trunk/jquery/build/runtest/env.js
      ~/rhino1_7R1$ java -jar js.jar        ### 執行 Rhino
      Rhino 1.7 release 1 2008 03 06
      js> load('env.js');                   ### 載入 env.js
      js> window.location = 'some.html';    ### 載入存在 DOM 的
      ### 作者說在載入任何與 DOM 相關的程式碼之前,一定要先指定 window.location
      js> window.onload = function(){       
      ### 從這裡就可以開始寫自己的 JavaScript
      }
      js> quit()                            ### 離開 Rhino
      
    • [安裝] Debian (Lenny) 已經有套件 - rhino
  • 另一個互動式 JavaScript Shell - SpiderMonkey
    • [安裝] Debian (Etch) 已經有套件 - spidermonkey-bin
      $ sudo apt-get install spidermonkey-bin
      $ dpkg -L spidermonkey-bin
      $ smjs
      js> help()
      JavaScript-C 1.8.0 pre-release 1 2007-10-03
      Command                  Description
      =======                  ===========
      version([number])        Get or set JavaScript version number
      options([option ...])    Get or toggle JavaScript options
      load(['foo.js' ...])     Load files named by string arguments
      readline()               Read a single line from stdin
      print([exp ...])         Evaluate and print expressions
      help([name ...])         Display usage and help messages
      quit()                   Quit the shell
      gc()                     Run the garbage collector
      gcparam(name, value)
        Wrapper for JS_SetGCParameter. The name must be either 'maxBytes' or
        'maxMallocBytes' and the value must be convertable to a positive uint32
      countHeap([start[, kind]])
        Count the number of live GC things in the heap or things reachable from
        start when it is given and is not null. kind is either 'all' (default) to
        count all things or one of 'object', 'double', 'string', 'function',
        'qname', 'namespace', 'xml' to count only things of that kind
      trap([fun, [pc,]] exp)   Trap bytecode execution
      untrap(fun[, pc])        Remove a trap
      line2pc([fun,] line)     Map line number to PC
      pc2line(fun[, pc])       Map PC to line number
      stackQuota([number])     Query/set script stack quota
      stringsAreUTF8()         Check if strings are UTF-8 encoded
      testUTF8(mode)           Perform UTF-8 tests (modes are 1 to 4)
      throwError()             Throw an error from JS_ReportError
      build()                  Show build date and time
      clear([obj])             Clear properties of object
      intern(str)              Internalize str in the atom table
      clone(fun[, scope])      Clone function object
      seal(obj[, deep])        Seal object, or object graph if deep
      getpda(obj)              Get the property descriptors for obj
      getslx(obj)              Get script line extent
      toint32(n)               Testing hook for JS_ValueToInt32
      evalcx(s[, o])
        Evaluate s in optional sandbox object o
        if (s == '' && !o) return new o with eager standard classes
        if (s == 'lazy' && !o) return new o with lazy standard classes
      sleep(dt)                Sleep for dt seconds
      scatter(fns)             Call functions concurrently (ignoring errors)
      js> quit()
      

Lighttpd

SQLite

2009-01-05

  • [專案] 專案計畫書撰寫

Cloud Computing

  • vdoop - Automatically configured virtual clusters running Google's architecture
    • 2007 就拿 Xen 來部署 Hadoop Virtual Cluster 的計畫,由 Google 贊助。不過軟體現在已經下載不到了。
  • EUCALYPTUS (Elastic Utility Computing Architecture for Linking Your Programs To Useful Systems ) - an open-source software infrastructure for implementing "cloud computing" on clusters.
    • 第一次聽到 EUCALYPTUS 這個計畫是在五月 OSGCC 2008 會議上聽到的,他們用很多語言撰寫的工具,企圖打造一個類似 Amazon EC2 的『自有』雲端服務。
    • EUCALYPTUS 特別的地方在於它一開始就針對 Amazon EC2 的 Client 做相容性設計,也就是原本用 Amazon EC2 的指令產生 VM 的步驟,都可以在 EUCALYPTUS 上執行。(OS: 他們應該是希望提供一個不用付錢就可以練習 EC2 的環境吧?!)

Web Service

  • 靜態網頁轉址語法
    • 有些時候以前舊的網址有了新包裝,或者移到其他主機上去了。這時候就需要用轉址的語法來做重新導向。這篇提供了一個簡單的語法。
      <html>
      <head><meta HTTP-EQUIV="REFRESH" content="0; url=新網址"/></head>
      <body></body>
      </html>
      

Web Service : JavaScript

2009-01-06

Web Service

Google App Engine

  • Google App engine 中文儲存
    • 這位仁兄還蠻強的,把一些法拍的資訊結合 Google Map 用 Google App Enigne 來提供免費服務,有一些經驗蠻值得學習的。

公務預算執行

型態 使命 工作項目 謎之聲 參考
第一階段 IaaS 服務 提供我們的機器給別人玩
育才 敎會大家怎麼用這些機器 開課
寫書
演講
第二階段 Open Source Package 研發 提供軟體給大家一起玩 source tarball, deb, rpm
LiveCD
VM Image - 可參考JumpBox
育才 敎會大家怎麼用這些軟體 開課
寫書
演講
第三階段 SaaS? 研發 叫大家把機器串起來一起玩

國家資通政策

http://www.intelligenttaiwan.nat.gov.tw/include/getfile.php?vars=8c02d5585112aea9f58ec4c0efd247d490678ac0df7fb2aa

2009-01-07

  • 10:00 2009年公務預算計劃書討論 @ 318 (每人10分鐘報告,5-10分鐘討論)
    • 結合策略行動方案
    • 論文數提升: SCI, Impact factor: 2.x
      • 篇數認養:
      • 工程師協會
    • 積極爭取國家型計畫
  • 北群計劃書工作項目溝通

2009-01-08

  • 計畫書工作項目溝通
  • 組內聚餐(中群)

2009-01-09

R Related

2009-01-10

  • 2009-01-02 為元旦彈性放假一天,2009-01-10補行上班。
  • e-Science 2008 Archived Webcast : for PRAGMA Workshop on e-Science Highlights
2008-12-09 08:00-08:15 Peter Arzberger PRAGMA Workshop on e-Science Highlights Video
2008-12-09 08:15-08:40 Cindy Zheng Interfacing SCMSWeb with Condor-G -- A Joint PRAGMA-Condor Effort Video
2008-12-09 08:40-09:05 Zhaohui Ding Grid Workflows and Data-aware Plugins for Improved Metaschedulers CSF4 Video
2008-12-09 09:05-09:30 Blaire Bethwaite Grid Interoperability: An Experiment in Bridging Grid Islands Video
2008-12-09 09:30-09:55 Jongbae Moon CFD Cyber Education Service Using Cyberinfrastructure Video
2008-12-09 09:55-10:20 Somsak Sriprayoonsakul Identification of a Specific Inhibitor for the Dual-Specificity Enzyme SSH-2 via Docing Experiments on the Grid Video
2008-12-09 10:20-10:45 Simon X Han Virtual Screening for SHP-2 Specific Inhibitors Using Grid Computing Video
2008-12-09 11:00-11:25 Luca Clementi Bioscience: Service Oriented Architecture for Managing Workflows of Avian Flu Grid Video
2008-12-09 11:25-11:50 Daniel Tenedorio Telescience: Optimized Rendering for a Three-Dimensional Videoconferencing System Video
2008-12-09 11:50-12:15 Susumu Date Education: PRIUS: And Educational Framework on PRAGMA toward Fostering of Globally-leading Researchers in Integrated Sciences Video
  • e-Science 2008 Archived Webcast : for Cloud Computing, Bioinformatics Related Events
2008-12-10 09:00-10:00 Rich Wolski [Keynote]: Building Science Clouds using Commodity, Open-Source Software Components Video
2008-12-10 10:00-10:30 Paul Roe Towards an Acoustic Environmental Observatory(No Video, Only Audio) Video
2008-12-10 10:00-10:30 Bernie Acs Meandre: Semantic-Driven Data-Intensive Flows in the Clouds(Only Video, No Audio) Video
2008-12-10 10:45-11:15 Jane Hunter Scalable Semantics—The Silver Lining of Cloud Computing Video
2008-12-10 11:45-12:00 Youngik Yang BioVLAB-Microarray: Microarray Data Analysis in Virtual Environment(Only Video, No Audio) Video
2008-12-11 10:00-10:30 Bill Howe End-to-End e-Science: Integrating Workflow, Query, Visualization, and Provenance at an Ocean Observatory(Only Video, No Audio) Video
2008-12-11 11:30-12:00 Ian Gorton A Web Services Architecture for Visualization Video
2008-12-11 13:30-14:00 Kate Keahey Contextualization: Providing One-click Virtual Clusters Video
2008-12-11 16:00-16:30 Andrea Matsunaga CloudBLAST: Combining MapReduce and Virtualization on Distributed Resources for Bioinformatics Applications Video
2008-12-12 08:30-09:30 Alexander Szalay [Keynote] Science in the Cloud Video
2008-12-12 10:15-10:45 Jaliya Ekanayake MapReduce for Data Intensive Scientific Analyses Video
2008-12-12 10:30-11:30 Simon Lin eBioinformatics Workshops - Cloud Computing for Bioinformatics Video
2008-12-12 11:00-11:30 Chao Ji MRPGA: An Extension of MapReduce for Parallelizing Genetic Algorithms Video
2008-12-12 14:45-15:15 Naotaka Yamamoto VO-enabled Service Harmonization in the GEO Grid Video
  • [專案] Atom 主機板安裝 SDL 測試
    • 環境: Debian 4.0 Etch
      sdl-test:~# apt-get install build-essential libsdl1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev alsa-utils mpg123-alsa 
      sdl-test:~# alsaconf
      sdl-test:~# wget http://www.libsdl.org/projects/aliens/src/aliens-1.0.2.tar.gz
      sdl-test:~# tar zxvf aliens-1.0.2.tar.gz
      sdl-test:~# cd aliens-1.0.2
      sdl-test:~/aliens-1.0.2# ./configure
      sdl-test:~/aliens-1.0.2# make
      sdl-test:~/aliens-1.0.2# cd
      sdl-test:~# vi /boot/grub/menu.lst
      
    • 加入 vga=0x305 把解析度調到 640x480 - 也會順便在開機的時候就載入 Frame Buffer 裝置,並切記要跑過 alsaconf 讓音效卡可以啟動
      • /boot/grub/menu.lst

        old new  
        117117 
        118118title          Debian GNU/Linux, kernel 2.6.18-6-686 
        119119root           (hd0,1) 
        120 kernel         /boot/vmlinuz-2.6.18-6-686 root=/dev/sda2 ro 
         120kernel         /boot/vmlinuz-2.6.18-6-686 root=/dev/sda2 ro vga=0x305 
        121121initrd         /boot/initrd.img-2.6.18-6-686 
        122122savedefault 

File System / partclone

Open Source

Virtualization

HPC

Programming : C/C++

JavaScript

jQuery

職場技能

2009-01-11

  • 台北捷運

2009-01-12

DRBL : PXES-like

  • PXES is a Linux micro distribution that will convert (or recycle) in minutes any compliant hardware into a versatile thin client capable of accessing any Unix/Linux XDMCP server, Microsoft Terminal Server through RDP protocol, Citrix ICA server or VNC sever. PXES 可以讓 PXE Client 可以登入遠端的 RDP / ICA / VNC 桌面。同樣的動作也可以讓 DRBL 也辦得到,底下的步驟在金屬加工業的佈署經驗中已被驗證過,並從 2008 年存活至今。
  • [備忘] 修改 DRBL Client 的 inittab 來連結 rdesktop
    • inittab

      old new  
      51 1:2345:respawn:/sbin/getty 38400 tty1 
       511:2345:respawn:/usr/bin/xinit /root/rdesktop.sh 38400 tty1 
    • 最簡單的 /root/rdesktop.sh 如下,請自行填寫 IP 跟使用者帳號密碼
      #!/bin/bash
      while [ -n 1 ]; do /usr/bin/rdesktop ${TERMINAL_SRV_IP} -f -u ${LOGIN_ID} -p ${LOGIN_PASSWORD} ; done
      

2009-01-13

  • 11:00 [專案] Atom + SDL 展示

  • Wubi - Ubuntu installer for Windows

Programming / Debuger / GDB

DRBL

SDL

2009-01-14

  • Trac Wiki 改名的終極方法: 到 db/trac.db 去改內容
    # sqlite3 db/trac.db
    sqlite> update wiki set name='BOINC/Server' where name='BOINC_Server';
    
  • 如果有附件(Attachment)的話,比較麻煩 (1) 改 wiki (2) 改 attachment (3) 必須到 attachments/wiki/ 目錄去搬檔案
    # sqlite3 db/trac.db
    sqlite> update wiki set name='FlyCircuit/2008-03-26' where name='FlyCircit/2008-03-26';
    sqlite> update attachment set id='FlyCircuit/2008-03-26' where id='FlyCircit/2008-03-26';
    sqlite> update wiki set name='FlyCircuit/2008-06-24' where name='FlyCircit/2008-06-24';
    sqlite> update attachment set id='FlyCircuit/2008-06-24' where id='FlyCircit/2008-06-24';
    

Linux 開機畫面 bootsplash / USplash / Splashy

pixel 解析度 640x480 800x600 1024x768 1280x1024
text 文字行數 80x30 100x37 128x48 160x64
256 色( 8bit) 0x301 / 769 0x303 / 771 0x305 / 773 0x307 / 775
32k 色(16bit) 0x310 / 784 0x313 / 787 0x316 / 790 0x319 / 793
64k 色(24bit) 0x311 / 785 0x314 / 788 0x317 / 791 0x31A / 794
16M 色(32bit) 0x312 / 786 0x315 / 789 0x318 / 792 0x31B / 795

bootsplash

USplash

Splashy

  • Splashy 是 bootsplash 的接班人,官方網站在 http://splashy.alioth.debian.org/
  • [參考] usplash v.s. splashy
    ### 安裝 Splashy 和 佈景主題 ###
    $ sudo apt-get install splashy splashy-themes
    ### 更換佈景主題的指令 ###
    $ sudo splashy_config -s themename
    

BUGFIX: jfbterm (4)

  • 在看 fbcommon.c 時,發現在這組出現錯誤的 mmap 前曾跑過另一組 mmap, 因此把參數印出來對照看看。
  • gdb debug 程序
    file jfbterm
    set args -e ls
    show args
    break fbcommon.c:500
    break fbcommon.c:557
    break fbcommon.c:566
    run
    p fb_fix
    c
    p fb_fix
    c
    p fb_fix.smem_len
    p p->soff
    p p->slen
    p fb_fix.mmio_len
    p p->moff
    p p->mlen
    
    root@intrepid:~/jfbterm-0.4.7-dev# gdb
    GNU gdb 6.8-debian
    Copyright (C) 2008 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    (gdb) file jfbterm
    Reading symbols from /root/jfbterm-0.4.7-dev/jfbterm...done.
    (gdb) set args -e ls
    (gdb) show args
    Argument list to give program being debugged when it is started is "-e ls".
    (gdb) break fbcommon.c:500
    Breakpoint 1 at 0x40303d: file fbcommon.c, line 500.
    (gdb) break fbcommon.c:557
    Breakpoint 2 at 0x40327e: file fbcommon.c, line 557.
    (gdb) break fbcommon.c:566
    Breakpoint 3 at 0x403301: file fbcommon.c, line 566.
    (gdb) run
    Starting program: /root/jfbterm-0.4.7-dev/jfbterm -e ls
    ...略...
    Breakpoint 1, tfbm_open (p=0x6146e0) at fbcommon.c:501
    501             if (fb_var.yres_virtual != fb_var.yres) {
    (gdb) p fb_fix
    $1 = {id = "▒\204▒▒Q\177\000\000\006\000\000\000\000\000\000", smem_start = 21037808, 
      smem_len = 4269392626, type = 32593, type_aux = 0, visual = 0,
      xpanstep = 65535, ypanstep = 65535, ywrapstep = 65535, line_length = 1, mmio_start = 15, 
      mmio_len = 21076240, accel = 0, reserved = {53071, 64, 0}}
    (gdb) c
    Continuing.
    ...略...
    Breakpoint 2, tfbm_open (p=0x6146e0) at fbcommon.c:557
    557             p->smem = (u_char*)mmap(NULL, p->slen, PROT_READ|PROT_WRITE,
    (gdb) p fb_fix
    $2 = {id = "VESA VGA\000\000\000\000\000\000\000", smem_start = 4026531840, 
      smem_len = 1572864, type = 0, type_aux = 0, visual = 3, xpanstep = 0,
      ypanstep = 0, ywrapstep = 0, line_length = 1024, mmio_start = 0, 
      mmio_len = 0, accel = 0, reserved = {0, 0, 0}}
    (gdb) c
    Continuing.
    
    Breakpoint 3, tfbm_open (p=0x6146e0) at fbcommon.c:566
    566             if(p->mlen == 0)
    (gdb) p fb_fix.smem_len
    $3 = 1572864
    (gdb) p p->soff
    $4 = 0
    (gdb) p p->slen
    $5 = 1572864
    (gdb) p fb_fix.mmio_len
    $6 = 0
    (gdb) p p->moff
    $7 = 0
    (gdb) p p->mlen
    $8 = 0
    
fb_fix.smem_len = 1572864 p->soff = 0 p->slen = 1572864 mmap 成功
fb_fix.mmio_len = 0 p->moff = 0 p->mlen = 0 mmap 失敗 (因為 length = 0)
  • 從數據看起來,無論是從 SSH 登入,或在本機 tty 使用,所得到的 fb_fix.mmio_len = 0 是主要原因。只是 mmio 所代表的意涵,fbcommon.h 程式碼並無註解。
  • 繼續往 fb_fix.mmio_len 的源頭追,是 tfbm_get_fix_screen_info 函式去更新 fb_fix 這個結構。資料是透過 ioctl 去詢問核心中對應的 FBIOGET_FSCREENINFO。
    <fbcommon.c>
    
    509         tfbm_get_fix_screen_info(p->fh, &fb_fix);
    
    244 static void tfbm_get_fix_screen_info(int fh, struct fb_fix_screeninfo *fix)
    245 {
    246         if (ioctl(fh, FBIOGET_FSCREENINFO, fix)) {
    247                 print_strerror_and_exit("ioctl FBIOGET_FSCREENINFO");
    248         }
    249 }
    
  • 定義在 Kernel 2.6.11/drivers/video/fbmem.c 中 FBIOGET_FSCREENINFO 的 ioctl handler
     804        case FBIOGET_FSCREENINFO:
     805                return copy_to_user(argp, &info->fix,
     806                                    sizeof(fix)) ? -EFAULT : 0;
    
  • 定義在 Kernel 2.6.27/drivers/video/fbmem.c 中 FBIOGET_FSCREENINFO 的 ioctl handler
    1247        case FBIOGET_FSCREENINFO:
    1248                ret = fb_get_fscreeninfo(inode, file, cmd, arg);
    1249                break;
    
    • fb_get_fscreeninfo 會呼叫 fb_ioctl 並以 cmd = FBIOGET_FSCREENINFO 去處理,看起來最後執行的程式碼是跟 2.6.11 一樣。
      1013 static int 
      1014 fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
      1015          unsigned long arg)
      
      1018        struct fb_info *info = registered_fb[fbidx];
      
      1046        case FBIOGET_FSCREENINFO:
      1047                return copy_to_user(argp, &info->fix,
      1048                                    sizeof(fix)) ? -EFAULT : 0;
      
  • 從 fb.h 的定義,我們可以確定 mmio_len 是從 info (型態為 fb_info) 結構中抓出 fb_fix_screeninfo 型態的 fix 回傳給使用者。
    <linux-2.6.27.7/include/linux/fb.h>
    
     152 struct fb_fix_screeninfo {
    
     156        __u32 smem_len;                 /* Length of frame buffer mem */
    
     164        unsigned long mmio_start;       /* Start of Memory Mapped I/O   */
     165                                        /* (physical address) */
     166        __u32 mmio_len;                 /* Length of Memory Mapped I/O  */
    
     808 struct fb_info {
    
     811        struct fb_var_screeninfo var;   /* Current var */
     812        struct fb_fix_screeninfo fix;   /* Current fix */
    
  • 目前懷疑是 uvesafb 攔截了 FBIOGET_FSCREENINFO 的 ioctl 並回傳了不正確的 fb_fix_screeninfo 內容。因此先來寫一個測試程式,透過 FBIOGET_FSCREENINFO 的 ioctl 把 fb_fix_screeninfo 內容取出來。

2009-01-15

Programming

Web Service

2009-01-16

2009-01-17

Screen

  • 在網路不穩定的環境下,為了保持 SSH 連線的畫面,常常會使用 screen 來作為長時間登入伺服器的工具。使用 screen 後,就可以在 ssh client 不正常關閉或網路斷線後,仍可以接回原本的畫面。
  • screenrc 範例
    • [備註] 拿掉時鐘的部份,以免造成往上捲動會不斷被拉回的困擾。
      $ cat > .screenrc <<EOF
      caption always "%{= wk} %{= KY} [%n]%t @ %H %{-} %= %{= KR} %l %{-} | %{= KG} %Y-%m-%d %{-} "
      hardstatus alwayslastline " %-Lw%{= Bw}%n%f %t%{-}%+Lw %=|"
      EOF
      
  • Redhat 寫的 screen 教學
    • 參考 ~/.screenrc 檔
      hardstatus alwayslastline
      hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'
      # Default screens
      screen -t shell1	0
      screen -t shell2	1
      screen -t server	2	ssh me@myserver
      
    • 其中語法 screen -t 可以幫你預設開好常用的連線
      	screen -t NameOfScreen ScreenNumber ShellCommand
      
    • 快速鍵
      • CTRL + a + 0 ~ 9 – 從第一個視窗切換到第九個視窗
      • CTRL + a + n – 切換到下一個(還存在)的視窗
      • CTRL + a + Backspace – Switches to the previous available
      • CTRL + a + a – 切換到跟最後一次切換的視窗
      • CTRL + a + A – 切換視窗"抬頭"
      • CTRL + a + K – 關閉目前視窗
      • CTRL + a + c – 開啟一個新的視窗
      • CTRL + a + [ - 進入 copy mode,方便上下捲動歷史紀錄(因為常用的 SHIFT + PgUp/PgDn? 會失效)
      • CTRL + a + ESC - 進入 copy mode,方便上下捲動歷史紀錄(因為常用的 SHIFT + PgUp/PgDn? 會失效)
    • 共用 screen
      帳號一 $ screen
      # 按 CTRL + a ,然後輸入 :multiuser on (ENTER)
      # 按 CTRL + a ,然後輸入 :acladd 帳號二 (ENTER)
      
      帳號二 $ screen -x 帳號一/ (一定要加 / 才行喔)
      
    • [註] 在共用 screen 之前,必須改權限,否則會出現類似底下的訊息
      jazz@trac-pool:~$ screen -x jazz/
      Must run suid root for multiuser support.
      
      # chmod u+s /usr/bin/screen
      # chmod 755 /var/run/screen
      
    • 最後他敎用 irssi 當作 console 底下的 pidgin (ㄜ....以前用 mcabber 會容易遇到中文字集的問題, 但據說在 Linux 底下不會(疑))
  • 使用 Serial Port(RS-232) Terminal 原來可以這麼容易 (09-08-22)
    screen /dev/ttyUSB0 115200
    

Virtualization : Xen

Virtualization : KVM

  • 2010-07-19: Vhost.net - 針對 I/O-intensive KVM virtualization 高讀寫的虛擬化需求而設計 參考來源(2010-05-17)
    According to the Linux-kvm.org page, Vhost.net is a kernel-level backend for virtio, the main platform for I/O virtualization in KVM. Vhost.net reduces virtualization overhead for virtio by removing up to four system calls per packet on data path, without guest changes, says the Vhost.net project. The intended result: faster performance for I/O-intensive KVM virtualization sessions.
    

Cloud Computing

Web Service

  • [影音][演講] Ajax 效能 - 正確的使用Ajax來減低JavaScript和DOM物件在網頁應用程式中造成的負擔

jQuery

Eclipse

2009-01-18

  • [專案] 台北捷運內湖線 軟體改版

2009-01-19

  • [專案] 台北捷運 @ 七堵 & 南港機廠

2009-01-20

  • 14:00 [驗收] 田間伺服器 @ 中群
  • [測試] debian etch debootstrap + matchbox + tightvnc

Shell 快速鍵

  • [參考] Linux Shell Editing Shortcuts
    CTRL + A = 把游標移到行首
    CTRL + E = 把游標移到行尾
    CTRL + K = 從游標位置往後刪除到行尾
    CTRL + U = 把指令全部清掉
    CTRL + W = 往前刪除一個參數(到空白處)
    
  • Lazy Linux: 10 essential tricks for admins (很多小技巧,不過大部分都已經會了,補紀錄還不會的四個指令)
    $ seq -w 20            ### 會列出 01~20 的數列 (哇!!會補零耶!!)
    $ fuser /home/jazz     ### 會列出目前正在使用這個目錄的 process
    $ reset                ### 把畫面清空(Ex. 不小心 cat 到二進位檔而佈滿亂碼的時候)
    $ sudo ethtool -i eth0 ### 會列出網路卡的韌體資訊(cool!)
    driver: tg3
    version: 3.65
    firmware-version: 5705-v3.18
    bus-info: 0000:01:0d.0
    
    ==================================
    另外,還蠻常用,卻老會忘記的 shell script 技巧: expr
    P = 1
    P = $(expr $P + 1)   ### 如果用 P=$P+1 是不行的啦~沒用空白也不行~Ex. P=$(expr $P+1)
    ==================================
    ~$ P = 1
    ~$ echo $P
    1
    ~$ P = $(expr $P + 1)
    ~$ echo $P
    2
    ~$ P=$P+1
    ~$ echo $P
    2+1
    ==================================
    

Virtualization : Trend

  • 神奇...M$ 的 Hyper-V 居然部署得比 VMWare 的 ESX 還多,比例上 Xen 居然差那麼懸殊,真是出乎我意料之外。
    http://www.virtualization.info/images/vir.infosVirtualizationIndustrySurvey200_14D51/Q6.png

Network Virtualization

Cloud Computing

Hadoop

Webservice: JavaScript

  • C3DL - Canvas 3D JS Library
  • Web Resource of Javascript, jQuery Essential Widgets, etc

Programming : Performance Inspection

Programming : VIM Indent, Less Hightlight, diff viewer

2009-01-21

  • Japan's Next Generation Supercomputer R&D Budget in FY2009
    • 日本 2009 年次世代超級電腦預算一百九十億日圓( 19,000 Million Yen),2006~2012 年總預算高達一千一百五十四億日圓( 115,447 Million Yen)
    • 2009 年 NGSC 計畫方向
      • Pilot manufacturing and testing of system : 10,992 Million Yen
      • Grand Challenge Software R&D: 1,877 Million Yen
      • Facility Construction: 6,131 Million Yen

Cloud Computing

Flex / ActionScript

職場技能

2009-01-22

DRBL Shutdown Agent

  • [源起] 由於 DRBL Client 在 NFS 斷線後會因為 ROOTFS 消失而找不到關機程序所需的檔案。因此需要有一個背景程序持續等在記憶體中來協助 DRBL Client 關閉電源。
  • 準備 sysvinit 套件環境
    # apt-get install dpkg-dev build-essential
    # apt-get source sysvinit
    # apt-get build-dep sysvinit
    # cd sysvinit-2.86.ds1/src
    ~/sysvinit-2.86.ds1/src# vi Makefile
    
    • Makefile

      old new  
      9 CFLAGS = -Wall -O2 -fomit-frame-pointer -D_GNU_SOURCE 
      10 LDFLAGS= -s 
       9CFLAGS = -g -Wall -O2 -fomit-frame-pointer -D_GNU_SOURCE # 加入 -g ,讓 gcc 加入 DEBUG Symbol 
       10LDFLAGS=                                                 # 拿掉 -s ,讓 LD 進行 Linking 時不進行 strip  
    ~/sysvinit-2.86.ds1/src# make
    ~/sysvinit-2.86.ds1/src# nm init                          # 用 nm 可以看到是否有保留 Symbol
    ~/sysvinit-2.86.ds1/src# file init                        # 顯示 not stripped 才會保留 Symbol 哦!
    init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), for GNU/Linux 2.4.1, not stripped
    
  • 先前有追蹤過 shutdown.c 跟 halt.c 的原始碼,發現最後都還是呼叫 init 來執行關機程序。因此這次改追蹤 init.c
  • 用 gdb 追蹤 init 0 的程序
    ~/sysvinit-2.86.ds1/src# gdb init
    (gdb) set args 0
    (gdb) show args
    Argument list to give program being debugged when it is started is "0".
    (gdb) br 2598
    Breakpoint 1 at 0x804e140: file init.c, line 2598.
    (gdb) br 2555
    Breakpoint 2 at 0x8049bfd: file init.c, line 2555.
    (gdb) run
    Starting program: /root/sysvinit-2.86.ds1/src/init 0
    Failed to read a valid object file image from memory.
    
    Breakpoint 1, main (argc=1282785413, argv=0x54a165) at init.c:2598
    2598    {
    (gdb) c
    Continuing.
    
    Breakpoint 2, telinit (progname=0xbfff5c53 "init", argc=2, argv=0xbfff5b34)
        at init.c:2555
    2555            SETSIG(sa, SIGALRM, signal_handler, 0);
    (gdb) handle SIGALRM nopass
    Signal        Stop      Print   Pass to program Description
    SIGALRM       No        No      No              Alarm clock
    (gdb) s
    
  • 用 strace init 0 觀察關機程序
    root@debian:~/sysvinit-2.86.ds1/src# strace init 0
    execve("/sbin/init", ["init", "0"], [/* 14 vars */]) = 0
    rt_sigaction(SIGALRM, {0x8049ad0, [], 0}, NULL, 8) = 0
    alarm(3)                                = 0
    open("/dev/initctl", O_WRONLY)          = 3
    write(3, "i\31\t\3\1\0\0\0000\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 384) = 384
    close(3)                                = 0
    alarm(0)                                = 3
    exit_group(0)                           = ?
    

ACPI and Power Management

2009-01-23

  • 11:00 98年度第1次中心月會
    • 全面性、全盤性思考做什麼?為何做?預期目標為何?如何做?
  • 15:00 中心宣傳影片拍攝

Green Computing / Power Management / Power Grid

2009-01-25

2009-01-26

Linux Kernel

Linux Power Management

Linux Programming

HPC

File System / partclone

Virtualization

Cloud Computing

Hadoop

Web Service

Embedded Trend: Mobile

生活

2009-01-27

File System

Virtualization

GP-GPU

2009-01-28

  • What is linux-gate.so.1?
    • 偶爾 ldd 的結果都會看到 linux-gate.so.1 這個檔案,可是又找不到歸屬在哪個 deb 裡,原來它並不是檔案 :(

Virtualization

S5: 用網頁做投影片

AIR for Linux

Debian Package

  • 打包 deb 的方法
    • 自己打包
    • debhelper
    • checkinstall
    • align

2009-01-30

  • 5 Things Mark Shuttleworth Has Learned about Organizational Change - Ubuntu 創始人 Mark Shuttleworth 從組織變革中學習到的五件事
    • There are limits to the wisdom of crowds. <一: 群體的智慧是有限的> : 與"寫給生存不安的年輕人"一書闡述的成長策略,論調相同!!
      In other words, if you do the same thing as everyone else, 
      you are going to get the same result as everyone else. 
      You won't stand out. Be conscious of the things you do differently. 
      
      換言之,如果你做的事情跟別人一樣,你也會得到跟別人一樣的結果。
      你無法成就傑出。確保自己做的事情是有差異的。 
      
    • It is necessary to harness both individualism and teams. <二: 充分駕馭個人與團隊是必要的>
      Many of the best ideas, concepts, prototypes and innovations come from a single person's insight. 
      
      許多傑出的點子、概念、雛型與創新都來自於某個人的洞察力。
      
      But to scale any operation takes the work of teams, and more often than not, teams of teams. 
      Leaders inspire that flash of genius and also make those individuals want to work together. 
      Great teamwork is a real skill.
      
      然而當要把營運的規模擴大時,需要團隊(甚至一大群團隊)的努力。
      領導者啟發天才的靈感,並讓這些天才們願意在一起工作。
      良好的團隊合作是一項實際的技能。
      
      Finding a way to nurture individual passion and pride while at the same time creating a spirit 
      of teamwork is a hallmark of the leaders I admire most. Pulling off both of those in the same 
      organization is magical but essential.
      
      我最推崇的領導者特質是能找到一個方法兼顧培養個人熱情與自尊,同時建立團隊合作的精神。
      在同一個組織中完成這兩件工作,雖然不可思議,卻又十分重要。
      
    • Tough times are good. <三: 逆境是種祝福>
      Austerity creates pressure to innovate; necessity is truly the mother of invention. 
      During hard times, we try to get more out of what we have and we assess investments with a different eye. 
      Rather than simply doing "more of the same, faster," we ask whether we can do things differently, 
      and we create the opportunity for long-term improvements. 
      Plus, innovators can use their slack time to work on new ideas 
      (since some of them are laid off and living on their severance packages, 
      or simply with more idle time at the office). 
      
      The survivors today will thrive tomorrow. 
      They will have less competition, and they will have proven their agility and their efficiency. 
      
      嚴峻的環境造成創新的壓力;需求是創新之母。
      在金融風暴中,我們會嘗試從既有的成果中取得更多,並且用不同的角度評估我們的投資。
      與其簡單地提供"更多、更快卻與跟別人一樣的服務",我們反思能否做一些有差別的事情,
      我們也創造長期改善的機會。此外,創新者可以運用他們閒暇的時間來經營新的點子。
      (既然他們有些人被裁撤,或者在辦公室有更多閒置時間)
      
      今日存活下來的將在明日茁壯。
      他們將面臨較少的競爭,並証明他們的敏捷與效率。
      
    • Large changes are only possible when they have the potential to deliver radical improvements. <四: 當組織需要根本的改善時,巨大的變革是唯一之道>
      To persuade people to make changes, you have to offer them compelling and dramatic improvements. 
      If you are asking people to change the way they work, it isn't enough for a product to be slightly cheaper 
      or slightly faster or slightly newer. One needs to deliver a 50 percent saving in cost and improved reliability 
      (or efficiency or functionality) to create space for one's product in a crowded marketplace. 
      You have to be 50 percent, 100 percent better. Not just ten percent.
      
      要說服人們改變,你必須讓他們面臨強迫性而戲劇性的改善。
      如果你要求人們改變他們工作的方式,這樣是不足以讓一個產品便宜一點、快一點或新一點。
      你需要節省五成的成本,並加強可靠度(或效率、功能性),好在擁擠的市場中替自家產品開創一番天地。
      你必須比別人好上五成,甚至好上一倍。而不僅僅只是一成。
      
    • The earth from space is the most beautiful thing most people never get to see. <五: 地球是太空中最美的事物,但多數人卻沒有機會親眼目睹>
      It's also a small place, which we have to share, 
      so it's worth taking time to figure out how we can live together here more peacefully.
      
      (相較於太空)地球也是一很小的地方,我們必須分享。因此值得我們花時間思考我們該如何更和平地共同生存。
      

Parallel R

Open Source Education

  • Open Source Schools - 英國一個分享校園自由軟體的網站
  • GCompris - 一套合適二至十歲兒童學習電腦的自由軟體遊戲

Virtualization

  • VMWare ESXi - Implement Production-Proven Server Virtualization for Free
    • 必須先註冊,並要序號才能使用。

Cloud Computing

  • ABC for Cloud Computing - 用雲端運算來做 ABC 財務統計, COOL!! (院部這麼喜歡算 ABC 可以考慮一下 *_*)

Web Service

LinuxBIOS / CoreBoot

AMQP

  • ZeroMQ - 用 C++ 寫的 Message Queue

Embedded / Mobile

2009-01-31

  • A time for change - "改變"的時代
    • 很有趣的文章,但也不難從中看出歐巴馬當選之後對各行各業的衝擊跟影響,大家跟著正面思考,期待改變,特別是在這嚴峻的不景氣中。是啊!一切都在改變!我們曾經認知的一切都在改變。BIOS 不再是 BIOS,BIOS 開始取代傳統作業系統的地位,好讓開機更快,更節能省電。而傳統的作業系統也因為虛擬化技術的發展而逐漸像是以前的應用程式,開機程序變得更複雜了,為了讓新的虛擬化 Hypervisor 可以同時啟動不同的作業系統。為了善用多核心的優勢,各種已成熟的軟體勢必面臨另一波加強平行化的考驗。這一波危機中,隱藏著諸多轉機。因為危機,大家也不得不使出渾身解數,發揮創意,找出不曾存在的新市場。昨晚就在想:以前做 Access Grid 的時候,遇到的錄影問題,或者是有些系統需要很多音效卡、影像擷取卡,在虛擬化出現之後,是否 PCI 裝置也將走向多核心(Multicore)、多通道(Multi-Channel)呢??這些就留待時間去考驗吧!電腦的演進從 Main Frame (合) 轉變為 PC Cluster (分) 進化成 Virtual Cluster (分中有合),更巨觀的有 Grid / Cloud (合中有分),在這個改變的時代裡,挑一個主題,做出差別。你我都是這波改變的推手!!
      I've heard it said on may occasions lately, "Let's use this recession to our advantage." 
      There's not really any other way to look at it right now.
      
      我最近常在各種場合聽到"讓我們把不景氣當作是咱們的優勢"。似乎目前也沒有其他方式來面對它了。
      

Open Source Education

  • K12LTSP - LTSP 專案的 K12 計畫
  • openSUSE Edu - openSUSE 的教育版 :) 一如 Debian Edu, Edubuntu

UNetbootin

Web Service : Dojo & REST

Network

Cloud Computing

CoreBoot and Virtualization

  • 做了一些 Mail List 閱讀,去年(2008年)似乎有做了一個計畫叫做 AVATT(All Virtual All The Time)可以讓 LinuxBIOS 支援虛擬化,但目前他們做的是使用 Linux Kernel 內建的 KVM 模組。
  • 讓 LinuxBIOS 支援 Xen 的關鍵在於要讓 FILO (bootloader of LinuxBIOS) 支援 Multiboot (嗯~ pxelinux 也是要支援 multiboot 才能支援 Xen PXE Boot) <0><1><2> ( 2007 年的文章提到 FILO 必須支援 ELF modules , 2008 年的文章則沒有提到,或許已經解掉了 ) 其次要讓 Linux Kernel 支援 kexec 好切換到 patch 過的 Xen Hypervisor Kernel
  • <0> booting Xen3 via FILO? (2006-09)
  • <1> Xen and LinuxBIOS(2007-09)
  • <2> booting xen from coreboot(2008-03)
  • 此外,關於 CoreBoot 啟動 Windows 7 Beta 影片中,為何會有兩個螢幕,應該一個是另一台電腦透過 serial console 去觀察 LinuxBIOS 的行為,真正在跑的是第二個出現的螢幕畫面(比較慢,但出現 Windows 7 Beta 的那個螢幕)。

中科周遭超商

2009-02-01

favicon.ico

Programming : Source Code Tracing

  • GNU Global - trace source code 的工具 - 把程式原始碼變 HTML 網頁 ,有點類似 LXR
    • Debian 套件 - global
    • [參考] Trace code tool
      $ htags -g -F
      -g 先執行 gtags
      -F 代表要將網頁切成多個Frame 
      

GNU Toolchain

OpenCSL

CGDB

  • [參考] http://www.cmlab.csie.ntu.edu.tw/~daniel/linux/cgdb.html
    基本操作方法
    
        * ESC -- switch to source window
        * i -- switch to GDB mode
        * spacebar -- 在目前的地方設一個中斷點 (source window mode)
        * t -- 在目前的地方設一個暫時中斷點 (source window mode)
        * '-' -- 縮減 source window
        * '=' -- 增加 source window
    
  • [參考] ~/.cgdb/cgdbrc 參考設定
        set arrowstyle=highlight
        set autosourcereload
        set shortcut
        set tabstop=4
        set winsplit=top_big
        hi Statement cterm=bold ctermfg=6
        hi PreProc cterm=bold ctermfg=4
        hi IncSearch ctermfg=2
        hi LineHighlight cterm=bold ctermfg=3 ctermbg=4
    
  • [參考] http://blogkrogh.blogspot.com/2008/05/gdb-xxgdb-ddd.html
    • kgdb 的介面看起來不錯。cgdb 有中文支援問題?! gdb 也有 ui 界面:
      $ gdb -tui 程式碼
      

BUGFIX: jfbterm (5)

#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>       // include frame buffer header files
#include <sys/ioctl.h>

int main(void)
{
  int fbfd = 0 ;            // frame buffer file description

  /* Get device independent unchangeable information about a frame buffer
   * device and a specific video mode by FBIOGET_FSCREENINFO ioctl. */
  struct  fb_fix_screeninfo finfo;

  fbfd = open( "/dev/fb0" , O_RDWR );
  if ( !fbfd )
  {
    printf( "Error: cannot open framebuffer device.\n" );
    exit(1);
  }
  printf("The framebuffer device was opened successfully.\n");

  /* Get fixed screen information */
  if ( ioctl ( fbfd ,  FBIOGET_FSCREENINFO , &finfo )  )
  {
    printf("Error reading fixed screen information.\n");
    exit(2);
  } else {
    printf("Succesfully Read the Fixed Screen Information\n");
  }

  printf("fb_fix_screeninfo.smem_len = %d\n", finfo.smem_len);
  printf("fb_fix_screeninfo.mmio_len = %d\n", finfo.mmio_len);
}
  • 在 Ubuntu Intrepid 上執行結果
    root@intrepid:~# uname -a
    Linux intrepid 2.6.27-7-server #1 SMP Tue Nov 4 20:16:57 UTC 2008 x86_64 GNU/Linux
    root@intrepid:~# ./fbinfo
    The framebuffer device was opened successfully.
    Succesfully Read the Fixed Screen Information
    fb_fix_screeninfo.smem_len = 16777216
    fb_fix_screeninfo.mmio_len = 0
    
  • 以下是在 Debian Sarge 上執行結果,值得一提的是 jfbterm 在 2.6.8 核心上可以正常執行。(不過還有字型問題需要調整)
    root@wsu-admin:~# uname -a
    Linux wsu-admin 2.6.8-2-386 #1 Tue Aug 16 12:46:35 UTC 2005 i686 GNU/Linux
    root@wsu-admin:~# ./fbinfo
    The framebuffer device was opened successfully.
    Succesfully Read the Fixed Screen Information
    fb_fix_screeninfo.smem_len = 65536
    fb_fix_screeninfo.mmio_len = 0
    
    root@wsu-admin:~# jfbterm
    jfbterm - Kanji on framebuffer console Version 0.4.7
           Copyright (C) 2003 Fumitoshi UKAI
            Copyright (C) 1999-2000 Noritoshi Masuichi
    This program is based on KON2
            Copyright (C) 1992-1996 Takashi MANABE
    
    (**) : Configuration file `/etc/jfbterm.conf'
    .... 略 ....
    exec : /bin/bash ioctl FBIOGET_CON2FBMAP: Invalid argument
    color 0 : 0, 0
    color 1 : 2a, 2a
    color 2 : 2a, 2a
    color 3 : 2a, 2a
    color 4 : 2a, 2a
    color 5 : 2a, 2a
    color 6 : 2a, 2a
    color 7 : 2a, 2a
    color 8 : 15, 15
    color 9 : 3f, 3f
    color 10 : 3f, 3f
    color 11 : 3f, 3f
    color 12 : 3f, 3f
    color 13 : 3f, 3f
    color 14 : 3f, 3f
    color 15 : 3f, 3f
    
  • 以下是在 Debian Etch 上執行結果,有趣的是 jfbterm 0.4.7-7 在 2.6.18-4 上執行,縱使有 cannot mmap(mmio) : Invalid argument 的錯誤訊息,但仍舊可以正常進入 jfbterm 的環境。
    root@etch:~# uname -a
    Linux etch 2.6.18-4-686 #1 SMP Wed May 9 23:03:12 UTC 2007 i686 GNU/Linux
    root@etch:~# ./fbinfo
    The framebuffer device was opened successfully.
    Succesfully Read the Fixed Screen Information
    fb_fix_screeninfo.smem_len = 1920000
    fb_fix_screeninfo.mmio_len = 0
    
    root@etch:~# jfbterm
    jfbterm - Kanji on framebuffer console Version 0.4.7
           Copyright (C) 2003 Fumitoshi UKAI
            Copyright (C) 1999-2000 Noritoshi Masuichi
    This program is based on KON2
            Copyright (C) 1992-1996 Takashi MANABE
    
    (**) : Configuration file `/etc/jfbterm.conf'
    ... 略 ...
    exec : /bin/bash color 0 : 0, 0
    color 1 : 15, 15
    color 2 : 540, 540
    color 3 : 555, 555
    color 4 : a800, a800
    color 5 : a815, a815
    color 6 : ad40, ad40
    color 7 : ad55, ad55
    color 8 : 52aa, 52aa
    color 9 : 52bf, 52bf
    color 10 : 57ea, 57ea
    color 11 : 57ff, 57ff
    color 12 : faaa, faaa
    color 13 : fabf, fabf
    color 14 : ffea, ffea
    color 15 : ffff, ffff
    cannot mmap(mmio) : Invalid argument
    
  • 為了測試 jfbterm 的中文相容性,我們寫了一隻簡單的 script
    #!/bin/bash
    echo " TEST 中文測試 "
    echo "Press Any Key to continue!"
    read
    
  • 在 Ubutnu intriped 的 tty1 上執行 jfbterm -f /etc/jfbterm.conf -e /root/test.sh 可以正常看到" TEST 中文測試 "字樣,但卻無法正常跳出,因此我們再來 DEBUG 一下。
    file jfbterm
    set args -f /etc/jfbterm.conf -e /root/test.sh
    show args
    break fbcommon.c:500
    break fbcommon.c:557
    break fbcommon.c:566
    break term.c:103
    break term.c:284
    r
    c
    c
    c
    bt
    c
    bt
    p utp->ut_time
    p utp->ut_tv
    
    Breakpoint 4, tterm_final (p=0x6147c0) at term.c:103
    (gdb) bt
    #0  tterm_final (p=0x6147c0) at term.c:103
    #1  0x0000000000408adf in sigchld (sig=<value optimized out>) at term.c:82
    #2  <signal handler called>
    #3  0x00007f5dfc00f433 in select () from /lib/libc.so.6
    #4  0x0000000000408873 in tterm_start (p=0x6147c0, tn=<value optimized out>, en=<value optimized out>) at term.c:192
    #5  0x0000000000402cf2 in main (argc=<value optimized out>, argv=0x7fff049477f8) at main.c:438
    (gdb) c
    Continuing.
    
    Breakpoint 5, tterm_reset_utmp (p=<value optimized out>) at term.c:284
    (gdb) bt
    #0  tterm_reset_utmp (p=<value optimized out>) at term.c:284
    #1  0x0000000000408a50 in tterm_final (p=0xe) at term.c:103
    #2  0x0000000000408adf in sigchld (sig=<value optimized out>) at term.c:82
    #3  <signal handler called>
    #4  0x00007fa268131433 in select () from /lib/libc.so.6
    #5  0x0000000000408873 in tterm_start (p=0x6147c0, tn=<value optimized out>, en=<value optimized out>) at term.c:192
    #6  0x0000000000402cf2 in main (argc=<value optimized out>, argv=0x7fff70a69328) at main.c:438
    (gdb) p utp->ut_time
    There is no member named ut_time.
    
  • [註] utp->ut_time = utp->ut_tv.tv_sec
    < /usr/include/bits/utmp.h >
    
     59 /* The structure describing an entry in the user accounting database.  */
     60 struct utmp
     61 {
     62   short int ut_type;            /* Type of login.  */
     63   pid_t ut_pid;                 /* Process ID of login process.  */
     64   char ut_line[UT_LINESIZE];    /* Devicename.  */
     65   char ut_id[4];                /* Inittab ID.  */
     66   char ut_user[UT_NAMESIZE];    /* Username.  */
     67   char ut_host[UT_HOSTSIZE];    /* Hostname for remote login.  */
     68   struct exit_status ut_exit;   /* Exit status of a process marked
     69                                    as DEAD_PROCESS.  */
     70 /* The ut_session and ut_tv fields must be the same size when compiled
     71    32- and 64-bit.  This allows data files and shared memory to be
     72    shared between 32- and 64-bit applications.  */
     73 #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
     74   int32_t ut_session;           /* Session ID, used for windowing.  */
     75   struct
     76   {
     77     int32_t tv_sec;             /* Seconds.  */
     78     int32_t tv_usec;            /* Microseconds.  */
     79   } ut_tv;                      /* Time entry was made.  */
     80 #else
     81   long int ut_session;          /* Session ID, used for windowing.  */
     82   struct timeval ut_tv;         /* Time entry was made.  */
     83 #endif
     84
     85   int32_t ut_addr_v6[4];        /* Internet address of remote host.  */
     86   char __unused[20];            /* Reserved for future use.  */
     87 };
    
     94 # define ut_time        ut_tv.tv_sec
    
  • GDB 線上除錯練習
    [tty1]
    
    root@etch:~# apt-get build-dep jfbterm
    root@etch:~# apt-get source jfbterm
    root@etch:~# apt-get install jfbterm
    root@etch:~# cd jfbterm-0.4.7
    root@etch:~/jfbterm-0.4.7# ./configure --enable-debug
    root@etch:~/jfbterm-0.4.7# make
    root@etch:~/jfbterm-0.4.7# ./jfbterm -f /etc/jfbterm.conf -e /root/test.sh
    
    [tty2]
    
    root@etch:~# gdb /root/jfbterm-0.4.7/jfbterm `pidof jfbterm`
    GNU gdb 6.4.90-debian
    Copyright (C) 2006 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for details.
    This GDB was configured as "i486-linux-gnu"...Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
    
    Attaching to program: /root/jfbterm-0.4.7/jfbterm, process 7480
    Reading symbols from /lib/tls/i686/cmov/libutil.so.1...done.
    Loaded symbols for /lib/tls/i686/cmov/libutil.so.1
    Reading symbols from /lib/tls/i686/cmov/libm.so.6...done.
    Loaded symbols for /lib/tls/i686/cmov/libm.so.6
    Reading symbols from /lib/tls/i686/cmov/libc.so.6...done.
    Loaded symbols for /lib/tls/i686/cmov/libc.so.6
    Reading symbols from /lib/ld-linux.so.2...done.
    Loaded symbols for /lib/ld-linux.so.2
    Reading symbols from /lib/tls/i686/cmov/libnss_compat.so.2...done.
    Loaded symbols for /lib/tls/i686/cmov/libnss_compat.so.2
    Reading symbols from /lib/tls/i686/cmov/libnsl.so.1...done.
    Loaded symbols for /lib/tls/i686/cmov/libnsl.so.1
    Reading symbols from /lib/tls/i686/cmov/libnss_nis.so.2...done.
    Loaded symbols for /lib/tls/i686/cmov/libnss_nis.so.2
    Reading symbols from /lib/tls/i686/cmov/libnss_files.so.2...done.
    Loaded symbols for /lib/tls/i686/cmov/libnss_files.so.2
    Failed to read a valid object file image from memory.
    0xb7fea410 in ?? ()
    (gdb) break term.c:284
    Breakpoint 1 at 0x804f552: file term.c, line 284.
    (gdb) c
    Continuing.
    
    Breakpoint 1, tterm_final (p=0x8058be0) at term.c:284
    284             time(&(utp->ut_time));
    (gdb) c
    Continuing.
    
    Breakpoint 1, tterm_final (p=0x8058be0) at term.c:284
    284             time(&(utp->ut_time));
    (gdb) c
    Continuing.
    
    Program exited normally.
    
  • GDB 遠端除錯練習
    [tty1]
    gdbserver 127.0.0.1:1234 /root/jfbterm-0.4.7/jfbterm
    [pts1]
    (gdb) target remote 127.0.0.1:1234
    
  • 在 DEBUG 的時候偶爾會看到 <value optimized out>,但是該怎麼去掉呢??
    • [參考] http://www.cs.utk.edu/~vose/c-stuff/onlinedocs/gdb_7.html - 不要最佳化 ( 查 gcc manpage 得知 -O0 可以取消最佳化 )
      The values of arguments that were not saved in their stack frames are shown as `<value optimized out>'.
      
      If you need to display the values of such optimized-out arguments, either deduce that from other variables 
      whose values depend on the one you are interested in, or recompile without optimizations.
      
    • [作法] 在 configure 的時候加上 CFLAGS
      • 註: 因為如果有設定 CFLAGS 的話,在 configure 裡是會直接採用我們提供的 CFLAGS。因此縱使加上 --enable-debug 也沒有用,configure 不會幫你加 -g 進去。
        root@intrepid:~/jfbterm-0.4.7-dev# CFLAGS="-g -O0" ./configure
        
  • 繼續追為何結束時會收到 SIGSEGV 的主因
    < 直接在 tty1 或在 screen 中執行 >
    root@intrepid:~/jfbterm-0.4.7-dev# ./jfbterm -f /etc/jfbterm.conf -e /root/test.sh
    
    root@intrepid:~/jfbterm-0.4.7-dev# gdb ./jfbterm `pidof jfbterm`
    break term.c:103
    break term.c:284
    c
    #### 直接在 tty1 不透過 screen 執行 的結果 #####
    Breakpoint 1, tterm_final (p=0x617a00) at term.c:103
    103             tterm_reset_utmp(p);
    (gdb) s
    tterm_reset_utmp (p=0x617a00) at term.c:271
    271     {
    (gdb) s
    275             tn = rindex(p->name, '/') + 4;
    (gdb) p p->name
    $1 = "/dev/pts/0", '\0' <repeats 53 times>
    #### 直接在 tty1 有透過 screen 執行 的結果 #####
    
    Breakpoint 1, tterm_final (p=0x617a00) at term.c:103
    103             tterm_reset_utmp(p);
    (gdb) s
    tterm_reset_utmp (p=0x617a00) at term.c:271
    271     {
    (gdb) s
    275             tn = rindex(p->name, '/') + 4;
    (gdb) p p->name
    $1 = "/dev/pts/1", '\0' <repeats 53 times>
    
  • manpage of getutid(3)
    SYNOPSIS
    
           struct utmp *getutid(struct utmp *ut);
    
    DESCRIPTION
    
           getutid() searches forward from the current file position in  the  utmp
           file  based  upon  ut.   If  ut->ut_type  is one of RUN_LVL, BOOT_TIME,
           NEW_TIME, or OLD_TIME,  getutid()  will  find  the  first  entry  whose
           ut_type  field matches ut->ut_type.  If ut->ut_type is one of INIT_PRO-
           CESS, LOGIN_PROCESS, USER_PROCESS, or DEAD_PROCESS, getutid() will find
           the first entry whose ut_id field matches ut->ut_id.
    
    RETURN VALUE
           getutent(), getutid(), getutline() and pututline() return a pointer  to
           a  struct  utmp  on  success, and NULL on failure.  This struct utmp is
           allocated in static storage,  and  may  be  overwritten  by  subsequent
           calls.
    
    FILES
           /var/run/utmp  database of currently logged-in users
           /var/log/wtmp  database of past user logins
    
    NOTES
       Glibc Notes
           The above functions are not thread-safe.  Glibc adds reentrant versions
    
           #define _GNU_SOURCE    /* or _SVID_SOURCE or _BSD_SOURCE */
           #include <utmp.h>
    
           int getutent_r(struct utmp *ubuf, struct utmp **ubufp);
    
           int getutid_r(struct utmp *ut,
                         struct utmp *ubuf, struct utmp **ubufp);
    
           int getutline_r(struct utmp *ut,
                           struct utmp *ubuf, struct utmp **ubufp);
    
           These  functions  are  GNU  extensions, analogs of the functions of the
           same name without the _r suffix.  The ubuf parameter gives these  func-
           tions  a  place to store their result.  On success they return 0, and a
           pointer to the result is written in *ubufp.  On error  these  functions
           return -1.
    
    
    root@intrepid:~# w
     02:02:14 up 6 min,  5 users,  load average: 0.35, 0.78, 0.39
    USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
    root     pts/0    :tty1:S.0        01:58    1:46m  0.24s  0.21s ./jfbterm -f /etc/jfbterm.conf -e /root/test.sh ### screen 0
    root     pts/1    :tty1:S.1        01:58    3:55m  0.01s  0.01s /bin/bash                                       ### screen 1
    root     pts/3    172.21.253.1     01:59    1:19m  0.12s  0.10s gdb ./jfbterm 3833                              ### from ssh for gdb
    root     pts/2    -                01:59    1:46m  0.00s  0.21s ./jfbterm -f /etc/jfbterm.conf -e /root/test.sh ### fb created by jfbterm
    root     pts/4    172.21.253.1     02:01    0.00s  0.02s  0.00s w                                               ### from ssh for this command `w'
    

2009-02-02

  • MiTAC 台北捷運內湖線測試

2009-02-03

  • [備忘] 原來 passwd 指令還可以用來鎖住(Lock)帳號登入 - 參考
    ~# passwd -l <使用者帳號>
    ~$ ssh-copy-id -i .ssh/id_rsa.pub <使用者帳號>@<遠端主機位址>
    

Virtualization

Web Service: Javascript

Embedded

國際合作

2009-02-04

  • 404 Error:回收掛點了 電腦製造商回收成績不佳
    • 最近在整理宿舍,清出不少年代久遠的"電子產品",像是有點故障的 HUB、 IP 分享器或閒置不用的 16MB MP3 Player、PDA 等等,家裡也有不少掛點的電腦主機。總在想該送到哪裡才能確保真的有做回收後處理呢??從產品週期(Life Cycle)來看,目前除了比較有宣導的一些回收項目,大家比較清楚該怎麼回收以外,像是鐵鋁罐、玻璃、寶特瓶等,六年以上的電子產品,縱使丟給資源回收車,但後面真的有在處理嗎??存疑...

Cloud Computing

http://www.isgtw.org/images/2009/gEclipse-screenshot_1_L.jpg

2009-02-05

  • [備忘] 讓 Trac 的 graphviz 支援中文字
    • [參考] http://www.debian.org.tw/index.php/graphviz
    • [改法] (1) 安裝中文字型 (2) 修改 trac.ini
      $ sudo apt-get install ttf-arphic-uming
      
      • conf/trac.ini

        old new  
        4845[graphviz] 
        49 default_graph_fontname = "Andale Mono" 
         46default_graph_fontname = "/usr/share/fonts/truetype/arphic/uming.ttf" 
        5047default_graph_fontsize = 10 

Debian

Open Source Enterprise

  • Openchange - Open Source Exchange Server Alternative (微軟 Exchange Server 的替代品)

Google Latitude

  • http://www.google.com/latitude/
  • [影片] Google Latitude - 概念說明
  • [影片] Google Latitude privacy tips - 分享自己目前的位置,首當其衝的當然是隱私囉!!
  • 這個服務應該是用手機訊號,透過 GSM 基地台做三角定位。事實上這類需求也不要求精準,只是讓別人知道你大概的位置而已。
  • 非常標準而經典的 Location-Aware Service,跟智慧生活格網家人走失的服務是類似的。

Cloud Computing

Social Network

Mobile Computing

  • 向創意行動英雄致敬
    戴維告訴我們:「我最喜歡的職場是:懷抱某個社會目標或使命,能提供有用的產品與服務。也能為工作創造意義的『小型』企業。」
    
    這也是我在經過二十年後,一直在實驗的挑戰。如何創造出這樣且能獲利的「覺醒企業」(Fred Kaufman的《Conscious Business》),
    能讓每個人在自己選擇的工作中自我實現。
    
    戴維的書提醒了我們:
    
    l、為什麼這麼多人埋怨陷入(trapped)一個沒有意義的工作,但卻不知道當我們減少自己的物質慾望,願意只拿一半的薪水,
      會給我們真正的自由,尋找到更有意義的工作嗎?
    2、為什麼年輕人把成功定義成擁有財富、成為名人?
    3、會有愈來愈多的人,願意多付一點錢,支持對社區有幫助的在地企業及合乎環保的產品。
    4、以社區為主的農業(Community Based Farming)是人類未來必須要走的一條路。因為目前以石油能源為主的生活及文明將面臨挑戰。
    
    我相信會有愈來愈多有才氣的人會進入在地小型企業,降低對財富、名望、物質的需求,不求百萬年薪、股票選擇權,
    但堅持能用到自己的專長,發揮自己的熱情,能創造更高的社會、環保意義。
    

2009-02-06

  • 準備國科會科普計劃書

Cloud Computing

2009-02-07

Cloud Computing

Virtualization

  • Virtualized desktops "run anywhere"
    • 我一直很好奇所謂 VDI 到底是用什麼方式傳輸虛擬機器的桌面呢?!
    • 圖裡提到 Virtual Delivery Protocal 跟 Desktop Streaming 兩種方式。越來越神奇了...不會用影像的方式傳輸桌面吧?!

2009-02-08

Clonezilla

Cloud Computing

2009-02-09

  • [個人] Atom + AIR
    • 原本以為 AIR Runtime 目前只能在 Ubuntu 上跑?! 其實只要有 SDK 就可以跑
    • [參考] Adobe® AIR on Gentoo Linux
    • [步驟] 採用 Debian Lenny + 2.6.18 核心
      ### Install Debian Lenny Base System ###
      $ sudo apt-get install ssh sudo xserver-xorg-video-vesa xinit xfonts-base xterm bzip2 alsa-utils mpg123-alsa matchbox-window-manager unzip libxml2 libnss3-1d
      $ sudo echo "deb http://free.nchc.org.tw/debian etch main non-free contrib" > /tmp/etch.list
      $ sudo mv /tmp/etch.list /etc/apt/sources.list.d/
      $ sudo apt-get update
      $ sudo apt-get install linux-image-2.6.18-6-686
      $ sudo alsaconf
      $ sudo rm -f /etc/apt/sources.list.d/etch.list
      $ export DISPLAY=:0
      $ xinit /usr/bin/matchbox-window-manager &
      $ mkdir AIR-1.5
      $ cd AIR-1.5
      ~/AIR-1.5$ wget http://airdownload.adobe.com/air/lin/download/latest/air_1.5_sdk.tbz2
      ~/AIR-1.5$ tar jxvf air_1.5_sdk.tbz2
      ~/AIR-1.5$ wget http://www.twhirl.org/files/twhirl-0.8.7.air
      ~/AIR-1.5$ apt-get install unzip
      ~/AIR-1.5$ unzip twhirl-0.8.7.air
      ~/AIR-1.5$ bin/adl -nodebug META-INF/AIR/application.xml . &
      ~/AIR-1.5$ wget http://www.aolcdn.com/aol_top_100/aol_top_100.air
      ~/AIR-1.5$ mkdir aol_top_100
      ~/AIR-1.5$ unzip -d aol_top_100/ aol_top_100.air
      ~/AIR-1.5$ bin/adl -nodebug aol_top_100/META-INF/AIR/application.xml aol_top_100
      

2009-02-10

  • 科普計劃 deadline
  • [風險管理] 2009 年的風險參考 - 成長,險中求 迎戰36種全球風險
  • [備忘] 在 interfaces 設定 DNS 的語法 : dns-nameservers 跟 dns-search ,而且必須安裝 resolvconf 套件
    auto eth0
    iface eth0 inet static
            address 192.168.0.1
            netmask 255.255.255.0
            network 192.168.0.0
            broadcast 192.168.0.255
            gateway 192.168.0.254
            # dns-* options are implemented by the resolvconf package, if installed
            dns-nameservers 168.95.192.1 168.95.1.1
            dns-search nchc.org.tw
    
  • The Personal Cluster: Coming To A Desk Near You

Debian

Cloud Computing

Virtualization

Web Service : RIA : Flex

學習的智慧

曾經,有一個學生誠惶誠恐的來請教他的老師,
學生問:「老師,請問我要怎麼樣做,才能夠學會您所有的智慧呢?」
這個學生的老師,是一位深具智慧的老師,他聽到學生這樣的問題,笑了笑之後,
反問學生說:「那麼,你認為應該怎麼樣,才能夠學會我所有的智慧呢?」
學生想了想,立刻說:「我以為,最好老師能夠一次教會我所有智慧的關鍵,
讓我能夠完全了解老師您所了解的事情!」
老師又笑了笑,從桌上拿起了一個蘋果,放到嘴邊,大大地咬了一口。
大師望著他的學生,口中不斷咀嚼著蘋果,不發一言。
過了好一會兒,大師才又張開嘴,將口中已經嚼爛的蘋果,吐在手掌當中。
老師伸出手,將已嚼爛的蘋果拿到他面前,然後對著他說:「來,把這些吃下去!」
學生驚惶地說:「老師,這……這怎麼能吃呢?」
老師又笑了笑,說:「我咀嚼過的蘋果,你當然知道不能吃;
但為什麼又想要汲取我的智慧的精華呢?你難道真的不懂?
所有的學習,都必須經過你本身親自去咀嚼的....」
是的,有些事情的答案,如果能夠經過自己的思考,
而來獲得許多人生寶貴的答案,那是值得的!
畢竟,蘋果新鮮而甜美的滋味,是需要由你自己深刻來品嚐與體會的。
學習的過程中,除了你自己,沒有任何人可以代勞;
透過知識的吸收,加上你不斷地反省、思考,化為自己寶貴的經驗,
這 就是智慧的開啟之處,也是奠定你一生能夠永續成長的真正基礎。

2009-02-11

  • 14:00 公務預算計畫書內容討論(與主任)
  • CoreBoot 討論
  • 雲端運算與資訊安全討論(與張機要)

Grid Computing

  • Gridipedia - The European Grid Marketplace 歐洲格網市場

A-SIS & COW

Virtualization and Education

  • 今天剛好看到German schools pilot remote virtual Debian/KDE desktops這篇文章(註:NoMachine 網站也有一篇),跟我去年幫陽明上課前的構想很相似。用到的技術是 "Xen 虛擬化" 跟 "NoMachine(NX) 遠端桌面" 兩種技術,根據 DESQUE Kids的介紹,他們是應用在 3~6 歲的兒童身上,讓舊電腦也可以跑高階的圖形應用,用租賃"虛擬化服務"代替採購新硬體,降低成本。因為採用 NX 的關係,所以網路頻寬也不用太高。這個專案好像是外包給一家廠商做,叫做 Budget-IT,不過找不到任何原始碼可以下載。
  • NX Web Player - 透過瀏覽器連結 NX 的畫面。

http://www.nomachine.com/img/screenshot/nxwebplayer/diagram1.jpg http://www.nomachine.com/img/screenshot/nxwebplayer/diagram2.jpg

  • 題外話: Logo 畫得蠻可愛的。

http://www.linuxdevices.com/files/misc/desque_icon.jpg http://www.v-2-db.de/desque/cms/templates/desque_kids/images/figur.png

  • DESQUE 上使用的軟體列表
    • OpenOffice?
    • Any browser
    • Ghemical
    • Stellarium
    • GeoGebra?
    • Geonext
    • Yacas
    • Granule
    • Pauker
    • Typespeed
    • KVocTrain
    • Calcium (or Kalzium?)
    • KBruch
    • KGeography
    • Kig
    • KPercentage
    • KTouch
    • TKgate
    • Xdrawchem
    • Tuxmath
    • Gcompris
    • Koctave
    • Greenfoot
    • Step
    • Klogic
    • KtechLab?
    • Katomic
    • Tux Paint
    • QGIS
    • KTurtle
    • Quanta Plus
    • QCAD
    • Mind Manager (VYM)
    • OpenProj?
    • Gimp
    • Scribus
    • VNC Eye

3G/3.5G 網卡

2009-02-12

  • 15:30-16:00 計畫進度追蹤方式討論會議 @ 竹科 主管會議室
    • 一個月一次,查核點該完成的是否有完成,時程表上填寫該開始的是否有開始,若無,原因為何。可邀請成員進來 Review。
  • 營運計劃書修訂
  • 營運計劃書簡報英文版翻譯

2009-02-13

  • 準備公務計畫簡報

Cloud Computing

Virtualization

Green Computing

  • 在 Debian 跟 Ubuntu 都有一個套件叫做 lm-sensor - utilities to read temperature/voltage/fan sensors
    ~$ sudo apt-get install lm-sensors
    ~$ sudo /etc/init.d/lm-sensors start
    ~$ sudo sensors-detect
    
    這個指令會跑很多測試,我跑出來最後秀這行,我就把它加到 /etc/modules
    To load everything that is needed, add this to /etc/modules:
    
    #----cut here----
    # Chip drivers
    coretemp
    #----cut here----
    
    ~$ sudo modprobe coretemp
    ~$ sudo sensors
    coretemp-isa-0000
    Adapter: ISA adapter
    Core 0: +40.0°C (crit = +100.0°C)
    
    coretemp-isa-0001
    Adapter: ISA adapter
    Core 1: +37.0°C (crit = +100.0°C)
    
  • 透過 lm-sensors 可以知道現在 CPU 溫度是多少。還有另外一個跟 lm-sensor 有關的套件叫 sensord,應該就可以幫忙紀錄歷史 CPU 溫度吧~想操機器的可以試試看 CPU 一直維持 99% 時,溫度是怎麼變化 :)

2009-02-14

Cloud Computing

2009-02-15

2009-02-16

2009-02-17

Cloud Computing

Web Service : JavaScript

APEC TEL

OID

Debian

  • 準備 Sarge 的 apt mirror
    ~# apt-get install apt-mirror
    ~# mount /dev/sdb1 /mnt
    ~# mkdir /mnt/apt-mirror /mnt/apt-mirror/mirror /mnt/apt-mirror/skel /mnt/apt-mirror/var
    ~# mv /etc/apt/mirror.list /etc/apt/mirror.list.dpkg
    ~# cat > /etc/apt/mirror.list << EOF
    set base_path       /mnt/apt-mirror
    set _tilde          0
    set defaultarch     i386
    deb http://archive.debian.org/debian/ sarge main
    EOF
    ~# apt-mirror
    

2009-02-18

2009-02-20

  • 14:45~15:30 2009年計畫報告會議 - 泛用型格網技術之開發與應用 @ 中群

2009-02-22

  • [陽明] 使用 jQuery 撰寫 Motif Finder 雛型網站 - 原始碼
  • Impressive - 用 LaTeX 跟 Python 產生投影片的軟體。特點是 Highlight boxes 跟 Spotlight effect
  • iotop - 用來觀察 I/O 的 top 程式
  • Bespin - Mozilla 針對雲端運算寫的協同程式編輯器
  • Microsoft, Google, and Yahoo! partner to improve web standards - 微軟、谷歌跟雅虎希望共同制定網頁標準,減少重複網頁造成的搜尋困擾。
    • 這個問題去年聽簡立峰演講的時候,我也有問過。因為 Web 2.0 時代,部落格此起彼落,大家引用來引用去,搜尋引擎如何減少這些重複的內容呢??當然可以靠傳統的 Page Rank 來做,因為勢必大者恆大,名氣這玩意總是如此。只是能否不要浪費太多計算在重複的網頁內容,或許又是另外一個需要新演算法的研究領域了。

Debian

Virtualization

Cloud Computing

Key/Value Database

Web Service : jQuery

Mobile

  • Tegaki - Linux 底下的中日文手寫辨識軟體
  • Zinnia - Online hand recognition system with machine learning - Linux 底下的手寫辨識引擎
  • Tomoe - A handwriting recognition engine - Linux 底下的手寫辨識引擎

無私 / 生活

2009-02-23

  • 月會摸彩

Cloud Computing

2009-02-24

  • 日本海中的變性珊瑚
    成為雄性,牠們能渡過糟糕的那幾年,接著,當環境變得更合適時,再變回明顯的雌性。
    成為雌性會花掉更多能源。而能夠週期性的改變性別,讓一個物種能最大化其再生的努力。
    
  • 先前有點麻煩驅動的網卡 Attansic L1 - 要用 atl1 驅動程式
    • 有點搞不清楚 Attansic 跟 Atheros 的關係,不過確實目前名字都是寫在一起。
    • Ex. Attansic L2 Fast Ethernet Adapter PCI Atheros/Attansic l251x86 L2 Fast Ethernet 10/100

partclone / File System

Virtualization

Cloud Computing

Web Service

2009-02-25

  • [陽明] 討論 Motif Finder 的改善方向
  • [個人] 配合升級到 lenny 跟 PHP5, 只好升級用很久的 Gallery 版本從 1.4 -> 1.5.10
    ~/public_html$ wget http://nchc.dl.sourceforge.net/sourceforge/gallery/gallery-1.5.10.tar.gz
    ~/public_html$ mv gallery old_gallery
    ~/public_html$ tar zxvf gallery-1.5.10.tar.gz
    ~/public_html$ mv gallery-1.5.10 gallery
    ~/public_html$ cd gallery/locale
    ~/public_html/gallery/locale$ wget http://nchc.dl.sourceforge.net/sourceforge/gallery/zh_TW-1.5.2.tar.gz
    ~/public_html/gallery/locale$ tar zxvf zh_TW-1.5.2.tar.gz
    ~/public_html/gallery/locale$ cd ../..
    ~/public_html$ cp old_gallery/config.php gallery/.
    ~/public_html$ touch gallery/.htaccess
    ~/public_html$ chmod 777 gallery/.htaccess gallery/config.php
    
    • 瀏覽 http://yourhost/gallery/ 依照指示進行升級與內容更新
    • 關於舊的 CSS - 先前有設定了一些 CSS, 為了讓系統通用, 需要拷貝幾個檔案
      ~/public_html$ cp old_gallery/css/standalone_style.css.default gallery/css/.
      ~/public_html$ vi gallery/css/screen.css.default
      
      • screen.css.default

        old new  
        2222body { 
        2323    font-family: Geneva,Arial,Helvetica,sans-serif; 
        2424    font-size: 10px; 
        25     background-color: #FFFFFF; 
         25    background-color: #ADB6C6; 
        2626    color: #FFFFFF; 
        2727} 
  • 手機進入投影時代?

2009-02-26

  • 休假

Cloud Computing

  • Opinion - Will there be a cloud of clouds?
    • 各家雲端運算服務提供廠商各有不同的規範,因此現階段已經開始在談跨服務之間的協同合作標準,此舉也可以避免商業壟斷。
  • 網上文書可靠性被質疑
    電腦操作系統GNU創始人斯托爾曼(Richard Stallman)指出,雲端電腦只是一個強迫人們陷入封閉私有系統的陷阱和商業行銷手法,
    隨時間過去人們將付出高昂代價。隨着愈來愈多人依賴雲端電腦,將資料存放在網絡可存取的伺服器上,一旦如Google等網站服務中斷,
    隨時令公司的日常運作癱瘓。此外,上傳文件的保密亦惹來隱憂,最好自行加密。斯托爾曼說,電腦用家應該將資料掌握在自己手中,而非
    交第三者處理。
    

2009-02-27

  • 2月份辦公室安全檢查
  • 休假

git

fast boot

HPC / Cluster

  • Asia Top500 - 全球 Top 500 已經慢慢分化成地區性的 Top 500.

Cloud Computing

Mobile Computing

生活 / 職場競爭力

2009-02-28

  • Qimo, 小朋友專用的 Linux 發行版
    這是一套專為三歲以上小孩設計的 Linux 發行版,它用的是 Ubuntu 核心,介面則是 Xfce4.0,而且有中文介面,
    裡頭除了基本該有的功能外,還內建了一些益智遊戲,再加上把管理者跟小孩的帳號分開來,除了可以更有效的管理外,
    也可以避免因為小孩不懂而被搞壞掉的機率。
    
  • [備忘] 怎麼用 SSH 穿透 NAT 把服務送出來
    • [目的] 在 NAT 背後的 PC 建立兩個連線,一個 SSH 一個 80 port 送到 SERVER 的 1000 port 跟 8123 port
    • 使用行為一: ADMIN 從 SERVER 的 22 port 連進去後,用 ssh -p 10000 就可以登入 PC 的 SSH
    • 使用行為二: USER 連線 SERVER 的 8123 port 會直接看到 PC 的 80 port
      +----------------+      | |          +--------------------------------+
      |     ssh client +------| |----------+ localhost:1000    0.0.0.0:22   +----- ADMIN
      |                |      | |          |                                |
      |     [ PC ]     |      | |          |         [ SERVER ]             |
      |                |      | |          |                                |
      |     apache(80) +------| |----------+------------------ 0.0.0.0:8123 +----- USER
      +----------------+      | |          +--------------------------------+
      
  • [做法]
    • STEP 1: 用 ssh-copy-id 交換 SSH key - 幫忙加進 SERVER 的 .ssh/authorized_keys
      jazz@PC:~$ ssh-keygen
      jazz@PC:~$ ssh-copy-id .ssh/id_rsa.pub jazz@${SERVER}
      
    • STEP 2: 在 PC 上定期用 crontab 跑 remote_ssh.sh 這隻 Script
      jazz@PC:~$ cat remote_ssh.sh
      #!/bin/bash
      kill -9 $(pidof ssh)
      nohup ssh -f -N -R 10000:localhost:22 jazz@${SERVER}
      nohup ssh -f -N -R ${SERVER}:8123:localhost:80 jazz@${SERVER}
      
    • STEP 3: 要達成使用行為二的目的,必須在 SERVER 上設定 /etc/ssh/sshd_config,加入 GatewayPorts yes 的描述
      jazz@SERVER:~$ cat >> /etc/ssh/sshd_config < EOF
      # SSH Port Forwarding
      GatewayPorts yes
      EOF
      

Cloud Computing

2009-03-02

  • [專案] 神通電腦
  • HPC Asia 2009

2009-03-03

  • HPC Asia 2009

2009-03-04

  • OSSPAC travel budget issue ...
  • [陽明] DRBL Server 測試安裝 Matlab

Kerrighed

Cloud Computing

2009-03-05

  • HPC Asia 2009
  • PC Grid Workshop - Fang-Pang

2009-03-06

  • 補休

2009-03-07

2009-03-08

Booting

Virtualization

Cloud Computing : Map Reduce

  • Collaborative Map-Reduce in the Browser 提出用 Javascript 寫 Map Reduce 的做法,並認為這麼作可以發揮更大的協同效益。當然網站上也列舉了 Hadoop (Java), Disco (Erlang+Python), 跟 Skynet (Ruby) 三種 Map Reduce 的實作。

Cloud Computing

  • LightCloud - Distributed and persistent key-value database
  • Is Cloud Computing Like Teenage Sex? - 雲端運算是否就像青少年的性愛一樣,大家都在談論它,但是卻鮮少有人真正參與去做它。真是有趣的比喻啊!!
  • Cloud Computing Gains in Currency - 關於使用雲端運算服務的群眾比例研究(Ex.多少人把資料放在雲端運算的儲存服務中?!)
  • 雲端運算時代即將改寫電腦運作模式
    Katz 把 Amazon 視為 Web 軟體產業的台積電(TSMC),它就像台積電的代工服務概念一樣催生出眾多‘無晶圓廠’的小型新創企業,
    以提供可執行於數千台電腦並由大量線上零售商(e-tailer)所支援的服務。
    

Network

GlusterFS

Mobile

Web Service : jQuery

Web Service : JavaScript & RIA

  • Zero Clipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie, and a JavaScript interface.

職場競爭力

  • 十個方法讓你的大腦更靈光
  • 慢跑與散步的文化衝突
    跑步不僅只是肉體及意志的鍛鍊,跑步也可以是性靈的修煉。禪修可以是靜,也可以是動,慢跑是動禪。
    慢跑有助於思考,還可以練氣功,與東方老子哲學及禪宗精神相近。
    
  • 做好時間管理,不如改正工作習慣
    1 思考要慢,執行要快。
    2 再三確認,知道你該做什麼。如果你一開始就會錯意,不清楚對方要的是什麼,就是在浪費時間做白工。
    3 時間壓力愈大,工作效率愈高。
    4 工作之前,先把辦公桌清理乾淨。
    5 向外求助,別閉門造車。
    6 凡事主動,等待只是浪費時間。
    7 改變自己,適應其他人的工作習慣。
    8 成功也要花時間分析。我們常要求自己了解犯錯背後的原因,避免下次再犯。
    
    • 一般人最常見的4種浪費時間的原因
      1 多做沒有必要的工作
      2 當濫好人
      3 迷信科技產品
      4 重量不重質
      
  • 什麼才是好工作?
    在我看來,對一個年輕人而言,一份「好工作」就是能讓他產生熱情,能夠在其中看到自己實實在在做出的貢獻,
    能夠讓他從挑戰中磨練成長,同時又能讓他自食其力,這就夠了。
    
  • 組織的「腰力」
    組織也有「腰力」。組織的腰就是位居中堅的管理幹部。
    
    中堅管理團隊除了上述「承上啟下」的角色之外,還必須積極肩負起一些重要的管理功能,
    包括:策略創意的發想、各種問題的發掘、服務品質的監控、各層級間構想與資訊的傳遞,
    以及吸收過濾外部的資訊,並傳達給組織內需要這些資訊的決策者。
    
  • 戀愛地點論-找對象,住哪裡很重要!
    在竹科任職的單身工程師,週休或放假時,不要只想著待在家裡,
    不妨多往異性多的地方跑(例如大台北都會區),替自己增加一些認識異性的機會。
    光是待在新竹,就算碰上心儀的異性,恐怕競爭對手也不少。
    

2009-03-09

  • OGF 26 註冊期限 - 4/10 以前有優待 -> Q: 以前是報名哪一種等級?
  • 工時表更新

Web Service : jQuery

Linux Programming

2009-03-10

DRBL Agent

Open Source

  • Blueprint for Competing with Proprietary Software - 談自由軟體與商業軟體的競爭之道
    • OSS concentrates on the software, not the problems the software can solve
      Take a look at an OSS site, any OSS site. You’ll see a whole lot of talking 
      about the software, the implementation of the software, the source code for 
      the software, how you can contribute to the software, etc. You’ll almost 
      never see anything about the problem domain — the assumption is that, 
      if you’ve stumbled upon the site, you already know you have a software problem.
      
    • 自由軟體僅僅專注在軟體本身,而忽略軟體要解決的問題!隨便找一個自由軟體網站,你會發現整個網站都在談這個軟體、如何實作、如何回饋社群,然而你從未看到關於要解決的問題領域。這代表了一個基本假設,那就是一旦你來到這個網站,你就已經知道你要解決的軟體問題是什麼。

Cloud Computing

Firefox

  • 由於有使用 PPPoE 進行撥接,不過很煩的是當切換成 WAN 的時候還是會不時跳出撥號的視窗。找了一下參考資料,原來要在 IE 裡面設定不要撥號。好吧~Windows 的設定果然還是要透過 IE :(

2009-03-11

  • 行政院科技貢獻獎頒獎典禮 企鵝龍與再生龍團隊 - m(_ _)m 感謝所有使用者的支持與愛護

2009-03-12

Cloud Computing

2009-03-13

Performance Analysis

iSCSI

Virtualization

2009-03-04

Cloud Computing

2009-03-16

  • [備忘] 給小朋友玩的 Wormux,一個免費的遊戲。在遊戲中控制有趣的動物用搞笑的武器進行戰鬥。

DRBL Agent

Virtualization

  • P2V (Physical to Virtual)

Mobile

3G/3.5G 網卡

2009-03-17

  • Samoa這個小國的國旗跟台灣國旗還真像啊!!
    • http://upload.wikimedia.org/wikipedia/commons/thumb/3/31/Flag_of_Samoa.svg/800px-Flag_of_Samoa.svg.png
  • [備忘] 檢查 Linux 作業系統版本 - from rider
    • lsb_release -a 可以顯示所採用的 Distribution 版本。不過一定要加 -a 喔,不然有些 Distribution 會只顯示"No LSB modules are available."
      jazz@drbl:~$ lsb_release -a
      No LSB modules are available.
      Distributor ID: Debian
      Description:    Debian GNU/Linux 5.0 (lenny)
      Release:        5.0
      Codename:       lenny
      
    • 縱使是在 Debian Lenny 用 debootstrap 產生出來的 Ubuntu intrepid 也可以識別喔。
      root@drbl:~# mkdir intrepid
      root@drbl:~# debootstrap intrepid intrepid/
      root@drbl:~# chroot intrepid/
      root@drbl:/# lsb_release -a
      No LSB modules are available.
      Distributor ID: Ubuntu
      Description:    Ubuntu 8.10
      Release:        8.10
      Codename:       intrepid
      

Virtualization

Cloud Computing

Apache + Mono = ASP.NET on Linux

Network : VPN (Virtual Private Network)

2009-03-18

Autotools

  • TOSSUG 的 Autotools 教學 - GNU build system 是 GNU project 做出來的一套工具,可以幫助軟體在多個 UNIX-like 的系統上執行,而成為跨平台的軟體。它是 GNU 工具鏈的一部分, 由 GNU Autoconf, GNU Automake 和 GNU Libtool 組合而成。

Green Computing

OpenID

  • 最初在 sourceforge 上找到的兩個專案
    • Prasi - Protocol for Remote Authentication and Shared Information
    • SimpleID - a simple, personal OpenID provider written in PHP.
    • T-OpenID - 用 Python 寫的 OpenID server + Firefox OpenID extension

3G/3.5G

  • 因為專案需要,去台灣大哥大辦了 3G 網卡,雖然有先做了一下功課,確定 NU MU-Q101 3.5G 無線網卡 可以支援 Linux,也發現當 Q101 接上 Windows 時,有 EeePC 目錄裡出現 deb 安裝檔。由於我不是要在 EeePC 上用,所以不能直接裝隨著 Q101 附帶的 deb 安裝檔,而必須要靠傳統的做法,用 wvdial 去撥號。
  • 做法:
    1. 首先先用 lsusb 去查 vendor id 跟 product id - 先決條件: 安裝 usbutils 套件
      root@wsu-admin:~# apt-get install usbutils
      root@wsu-admin:~# lsusb
      Bus 001 Device 002: ID 0408:ea02 Quanta Computer, Inc.
      Bus 001 Device 001: ID 0000:0000
      
    2. 好在 Debian Etch 並沒有很主動地幫我掛載 Q101 為 USB 硬碟,所以我不用卸載 USB 硬碟。如果在 Ubuntu 底下,或者有發現 dmesg 出現新的外接式硬碟,那可能就要用 umount 的方式卸載 USB 硬碟,並且下指令把 Q101 轉換成 USB Modem。參考,要注意的是 usb1 的 1 是代表 Bus 001 而 1-2 代表 Bus 001 的 Device 002。似乎 Product ID 如果是 ea02 的話,就是正常 USB Modem 的 ID。
      root@wsu-admin:~# echo "suspend" > /sys/bus/usb/devices/usb1/1-2/power/level
      
      插上3.5G 網路卡之前,先將usb_storage 模組移除掉。
      modprobe -r usb_storage
      如果一直移不掉的話,那麼用強迫它:
      rmmod -f [...]
      
    3. 用 modprobe usbserial 加上 vendor id 與 product id 參數,來驅動 Q101 數據機
      root@wsu-admin:~# modprobe usbserial vendor=0x0408 product=0xea02
      
    4. 安裝 wvdial 並用 wvdialconf 來跑數據機偵測 (第一次安裝 wvdial 會跑 wvdial 但是如果要重新偵測的話,就得用 wvdialconf 了)
      root@wsu-admin:~# apt-get install wvdial
      root@wsu-admin:~# wvdialconf
      
      (... 略 ...)
      
      Found a modem on /dev/ttyUSB0.
      Modem configuration written to /etc/wvdial.conf.
      ttyUSB0<Info>: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
      ttyUSB2<Info>: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
      ttyUSB3<Info>: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
      
    5. 預設產生出來的 /etc/wvdial.conf 並無法正常連線,所以必須重新設定撥號等資訊。參考
      [Dialer Defaults]
      Phone = *99#
      Username = username
      Password = passwd
      Stupid Mode = 1
      Dial Command = ATDT
      Check Def Route = on
      Dial Attempts = 3
      Modem = /dev/ttyUSB0
      Baud = 460800
      Init2 = ATZ
      Init3 = ATQ0 V1 E0 S0=0 &C1 &D2 +FCLASS=0
      Init4 = AT+CGDCONT=1, "IP","Internet"
      ISDN = 0
      Modem Type = Analog Modem
      New PPPD = yes
      
    6. 跑一隻 script 來重新設定 Q101 - [問題] 目前還沒有辦法每次撥號都成功,也還沒找到方法怎麼停掉撥號網路。
      root@wsu-admin:~# cat start_q101
      #!/bin/bash
      echo "停用 Q101"
      modprobe -r usbserial
      sleep 3
      echo "重新啟動 Q101"
      modprobe usbserial vendor=0x0408 product=0xea02
      sleep 5
      echo "確認 Q101 已啟動"
      lsusb
      sleep 10
      echo "重新搜尋 Q101 所在 USB 位置....並設定 /etc/wvdial"
      wvdialconf
      echo "啟動 wvdial 進行撥號...."
      wvdial &
      
    7. 使用 ddclient 來更新 DynDNS.org 的動態 DNS 服務。它會要你輸入 DynDNS 的帳號、密碼跟網址。若設定正確,使用 ddclient 就會進行更新。
      root@wsu-admin:~# apt-get install ddclient
      root@wsu-admin:~# ddclient
      SUCCESS:  updating xxxx.dyndns.org: good: IP address set to xxx.xxx.xxx.xxx
      

2009-03-19

  • 10:30-11:30 主任至中群業務訪談

Xen VNC

  • 基本步驟請參考使用 DRBL 部署 Xen 虛擬叢集
  • [備忘] 從 xm console 跳離的快速鍵為 CTRL + ]
  • [狀況] 發現一個小小的問題,xen-tools 其實是採用 dom0 的 kernel 跟 initrd.img,所以 debootstrap 也是拷貝 dom0 的 /lib/modules/。加上如果我們要求 xen-tools 把 domU 的 image 檔案系統改為 reiserfs,而 dom0 自己是使用 ext3,會因為 dom0 initrd.img 沒有加入 reiserfs 的支援而致使 domU 開機時無法掛載 root filesystem。
  • 在 Lenny x86_64 上的安裝步驟
    lenny:~# echo "loop max_loop=255" >> /etc/modules
    lenny:~# apt-get install xen-hypervisor-3.2-1-amd64 linux-image-2.6.26-1-xen-amd64 xen-tools libc6-xen bridge-utils lsb-release
    lenny:~# update-grub
    lenny:~# reboot
    --------- Boot with "Xen 3.2-1-amd64 / Debian GNU/Linux, kernel 2.6.26-1-xen-amd64" ---------
    lenny:~# lsb_release -a
    No LSB modules are available.
    Distributor ID: Debian
    Description:    Debian GNU/Linux 5.0 (lenny)
    Release:        5.0
    Codename:       lenny
    lenny:~# uname -a
    Linux lenny 2.6.26-1-xen-amd64 #1 SMP Sat Jan 10 20:39:26 UTC 2009 x86_64 GNU/Linux
    --------- "Install DRBL, configure DRBL services and client settings" ---------
    lenny:~# wget http://drbl.nchc.org.tw/GPG-KEY-DRBL
    lenny:~# apt-key add GPG-KEY-DRBL
    lenny:~# echo "deb http://free.nchc.org.tw/drbl-core drbl stable" > /etc/apt/sources.list.d/drbl-sources.list
    lenny:~# apt-get update
    lenny:~# apt-get install drbl
    lenny:~# /opt/drbl/sbin/drblsrv -i
    
    (... skip ...)
    
    *****************************************************.
    Trying to upgrade some necessary packages if available...
    *****************************************************.
    In ayo repository, searching the latest  kernel ...
    The latest kernel in the ayo repository is linux-image-2.6.26-1-openvz-amd64
    There are 2 kernels available for clients, which one do you prefer ?
    [1]: kernel 2.6.26-1-xen-amd64 x86_64 (from this DRBL server)
    [2]: linux-image-2.6.26-1-openvz-amd64 (from apt repository)
    [1]
    
    (... skip ...)
    
    lenny:~# /opt/drbl/sbin/drblpush -i
    
    --------- "Configure Xend" --------- 
    lenny:~# vi /etc/xen/xend-config.sxp
    lenny:~# /etc/init.d/xend restart
    --------- "Create Xen Image" --------- 
    lenny:~# xen-create-image -dir /home/xen --dist lenny --kernel /boot/vmlinuz-2.6.26-1-xen-amd64 --initrd /boot/initrd.img-2.6.26-1-xen-amd64 --hostname lenny1 --dhcp --mirror http://free.nchc.org.tw/debian
    --------- "Enable Xen Image VNC ports" --------- 
    lenny:~# echo "vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncdisplay=1' ]" >> /etc/xen/lenny1.cfg
    lenny:~# xm create lenny1.cfg
    lenny:~# xm list
    Name                                        ID   Mem VCPUs      State   Time(s)
    Domain-0                                     0   357     1     r-----    106.4
    lenny1                                       3   128     1     -b----      8.7
    lenny:~# netstat -nap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 0.0.0.0:5901            0.0.0.0:*               LISTEN      2682/qemu-dm
    
    • xend-config.sxp

      old new  
      136136# two fake interfaces per guest domain.  To do things like this, write 
      137137# yourself a wrapper script, and call network-bridge from it, as appropriate. 
      138138# 
      139 (network-script network-dummy) 
       139#(network-script network-dummy) 
      140140 
      141141# The script used to control virtual interfaces.  This can be overridden on a 
      142142# per-vif basis when creating a domain or a configuring a new vif.  The 
       
      151151# If you are using only one bridge, the vif-bridge script will discover that, 
      152152# so there is no need to specify it explicitly. 
      153153# 
      154 (vif-script vif-bridge) 
       154#(vif-script vif-bridge) 
      155155 
      156156 
      157157## Use the following if network traffic is routed, as an alternative to the 
       
      162162 
      163163## Use the following if network traffic is routed with NAT, as an alternative 
      164164# to the settings for bridged networking given above. 
      165 #(network-script network-nat) 
      166 #(vif-script     vif-nat) 
       165(network-script network-nat) 
       166(vif-script     vif-nat) 
      167167 
      168168 
      169169# Dom0 will balloon out when needed to free memory for domU. 
       
      184184# The interface for VNC servers to listen on. Defaults 
      185185# to 127.0.0.1  To restore old 'listen everywhere' behaviour 
      186186# set this to 0.0.0.0 
      187 #(vnc-listen '127.0.0.1') 
       187(vnc-listen '0.0.0.0') 
      188188 
      189189# The default password for VNC console on HVM domain. 
      190190# Empty string is no authentication. 

2009-03-20

  • 怎麼在 i386 機器上編譯 amd64 的 Debian packages
    apt-cross - retrieve, build and install libraries for cross-compiling
    dpkg-cross - tools for cross compiling Debian packages
    

Hadoop

  • [備忘] 查 DFS 狀態的指令
    ~$ /opt/hadoop/bin/hadoop dfsadmin -report
    
  • [問題] DFS 的 StorageID 是怎麼產生的?為何有時候沒辦法產生 StorageID??
  • [備忘] 電腦教室的 IP 22 跟 30 應該是對應兩台講師電腦。
    Host pc122 (192.168.100.22) appears to be up.
    Host pc130 (192.168.100.30) appears to be up.
    

2009-03-21

Debian

  • dbconfig-common - common framework for packaging database applications
    • 如果 deb 套件會使用到 SQL 資料庫的話,可以相依這個套件,然後透過 dbconfig-common 來做資料庫的設定。
    • 參考打包範例 webcalendar

Web Service

  • [備忘] Apache 要啟用 .htaccess 的話,必須在設定中加上
        AllowOverride ALL
    
  • [備忘] 有些網頁還是維持 Big5 的字集,如果做轉換不方便的話,可以在 Apache 設定檔中,針對該目錄加入
        AddDefaultCharset Big5
    

Active Directory / LDAP / PHP

function ldap_auth($adhost, $port, $uid_field, $basedn, $binddn, $passwd, $userid, $userpasswd) {
  global $msg, $db, $default_prefix, $default_prefix_id ;
  $ds = @ldap_connect($adhost, $port) ;           // must be a valid LDAP server!
  if ($ds) {
    $r = @ldap_bind($ds, $binddn, $passwd);
    if(!$r){ alert_err("binding failed !!"); }
    // Search usrname entry
    $sr = @ldap_search($ds, $basedn, "(".$uid_field."=".$userid.")");
    $user_arr = @ldap_get_entries($ds, $sr) ;
    //echo print_r($user_arr) ; exit ;
    if ($user_arr["count"] == "1") {
      $user_binddn = $user_arr[0]["dn"] ;
      $ub = @ldap_bind($ds, $user_binddn, $userpasswd) ;
      if(!$ub) { alert_err($msg["ad_passwd_err"]);       }
    } else { alert_err($msg["ad_search_err"]) ; }
    ldap_close($ds);
    return true ;
  } else {
    alert_err("Unable to connect to LDAP server") ;
  }

2009-03-23

  • [專案] 台北捷運內湖線軟體測試 @ 內湖機廠

2009-03-24

  • 補假 - 幫莊前院長搬家
  • jserv 演講
  • 國研季刊 訪問 - 科技貢獻獎 DRBL/Clonezilla 團隊

2009-03-25

  • 雲端運算基礎課程預演

Debian

2009-03-26

  • 雲端運算基礎課程預演

Linux

File System

DRBL

  • 要清除 DRBL 相依的套件,不能暴力法砍掉 /opt/drbl、/tftpboot、/etc/drbl,否則一些已經安裝的套件,會因為已安裝而無法在執行 /opt/drbl/sbin/drblsrv -i 時被重新安裝。另外,64位元環境下,下 /opt/drbl/sbin/drblpush -i 都會有這個訊息。
    cp: `/lib64/ld-linux-x86-64.so.2' and `/tftpboot/node_root/lib64/ld-linux-x86-64.so.2' are the same file
    
  • 由於 64 位元的 DRBL Client 會需要 /emul/ia32-linux/lib/ 才能執行 ntfsclone 因此必須把 /emul/ia32-linux/lib/ 拷貝到 /tftpboot/node_root
    jazz@drbl:/tftpboot/node_root$ sudo tar zcvf emul.tar.gz /emul/ia32-linux/lib/
    jazz@drbl:/tftpboot/node_root$ sudo tar zxvf emul.tar.gz
    

2009-03-30

  • Hadoop 與 DRBL 整合時,常遇到 storageID 無法識別的困擾,遇到這種問題的時候,就直接給定 hostname 當 storageID 就可以看到全部的 DataNode 都加進 HDFS 了
    • 首先,為了日後重開機以後,維持 NameNode 的 namenodeID 不變,我們把 namenode 的資料存在 /home/hdfsadm 中。修改 /etc/hadoop/hadoop-site.xml 的 dfs.name.dir 來達成這個目標。至於原本安裝 hadoop 套件時設定的 localhost 則應該要改成 DRBL 對內的 IP 位址(這裡以 192.168.100.254 為例)。另外,也把 /etc/hadoop/slaves 修改成目前 DRBL Client 的 IP 範圍。
      jazz@drbl:~$ cat /etc/hadoop/hadoop-site.xml
      <?xml version="1.0"?>
      <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
      
      <!-- Put site-specific property overrides in this file. -->
      
      <configuration>
        <property>
          <name>fs.default.name</name>
          <value>192.168.100.254:9000</value>
          <description>
            The name of the default file system. Either the literal string
            "local" or a host:port for NDFS.
          </description>
        </property>
        <property>
          <name>mapred.job.tracker</name>
          <value>192.168.100.254:9001</value>
          <description>
          The host and port that the MapReduce job tracker runs at. If
          "local", then jobs are run in-process as a single map and
          reduce task.
          </description>
        </property>
        <property>
          <name>dfs.name.dir</name>
          <value>/home/hdfsadm/dfs/name</value>
          <description>
            Determines where on the local filesystem the DFS name node
            should store the name table.  If this is a comma-delimited list
            of directories then the name table is replicated in all of the
            directories, for redundancy.
          </description>
        </property>
      </configuration>
      jazz@drbl:~$ cat /etc/hadoop/slaves
      192.168.100.1
      192.168.100.2
      ...
      192.168.100.30
      
    • 接著以 dcs 的功能執行 re-deploy 好讓每一個 nodes 的設定同步。然後只做一次 namenode 格式化,以後就不需要再格式化了。再用 dcs 做 DRBL Client 的 reboot 或 Wake-on-LAN。
      jazz@drbl:~$ sudo /opt/drbl/sbin/dcs
      jazz@drbl:~$ sudo /opt/hadoop/bin/hadoop namenode -format
      jazz@drbl:~$ sudo /opt/drbl/sbin/dcs
      
    • 最後,用 start-all.sh 與 stop-all.sh 確認已停掉目前正在執行的 Hadoop 執行緒。用 dsh 把每台 DRBL Client 目前 /tmp 目錄下的 dfs storageID 是正確的。
      hdfsadm@drbl:~$ /opt/hadoop/bin/start-all.sh
      hdfsadm@drbl:~$ /opt/hadoop/bin/stop-all.sh
      hdfsadm@drbl:~$ dsh -a "echo \"storageID=\$(hostname)\" >> /tmp/hadoop-hdfsadm/dfs/data/current/VERSION"
      hdfsadm@drbl:~$ /opt/hadoop/bin/start-all.sh
      

DRBL-Hadoop-Live

  • 預設執行 /opt/drbl/sbin/create-drbl-live-by-pkg
    /opt/drbl/sbin/create-drbl-live -l en -d lenny -p xfce -k iceweasel-l10n-zh-tw x-ttcidfont-conf ttf-arphic-newsung scim-chewing scim-tables-zh im-switch mlterm mlterm-im-scim discover1 xresprobe mdetect grandr boinc-client dnsutils bind9-host syslogd gparted ntfsprogs hfsutils hfsprogs jfsutils xfsprogs xfsdump reiserfsprogs reiser4progs parted 
    ntfs-3g dosfstools mtools lvm2 mbr -b unstable -e experimental
    

2009-03-31

  • [備忘] NameNode 一定要在本機下 hadoop namenode -format 如果 dfs.name.dir 預設放在 /tmp 底下的話
  • [備忘] Job Tracker 必須在 Job Tracker 的節點上跑 start-mapred.sh 才能啟動。start-all.sh 如果不是在 Job Tracker 的節點上跑,會看不到 50030 的頁面。

2009-04-01

User Interface / Prototype Design

Cloud Computing

2009-04-02

  • COSA 會員大會暨理監事改選

File System

Cloud Computing

2009-04-03

  • [DRBL] 中群電腦教室 Multicast 支援測試
  • [陽明] F-Motif 網頁撰寫

Cloud Computing

  • 3Tera to Offer Five9s Cloud SLA - 對於企業來說,穩定度是第一考量,所以 SLA (Service Level Agreement) 是十分重要的議題。要達到 99.999% 的穩定度,不是一件簡單的事情,或許也是一些雲端運算服務公司將面臨的重大營運考驗。

2009-04-05

Debian

Git 版本控制

File System

Cloud Computing

Hadoop

Virtualization

  • ConVirt goes 1.0! - ConVirt 一套虛擬機器管理介面(GUI,但似乎沒有 Web 介面),有 deb 套件喔!!

I/O Virtualization

2009-04-06

  • 演講準備 - 蒐集 HPC, Cloud Computing, Map/Reduce 與生物資訊相關運用參考資料
  • Octave as Cloud Service - Octave 是一套類似 Matlab 的自由軟體,其實這個專案的 idea 挺不錯的,教學上如果多採用 Octave 的話,就不會造成學校或實驗室在 Matlab 授權/非法侵權的問題。當然我覺得如果熟悉網頁設計跟 VNC 這個服務應該不難做出來才對。

Clustering / Distributed Computing / Bioinformatics

  • Dapper - The Distributed and Parallel Program Execution Runtime
    • 在 SourceForge 的 Clustering Topic 軟體中,Ranking 算蠻高的。
  • ProActive - Open Source middleware (OW2 consortium) for parallel, distributed, multi-core computing. - 法國的一個專案,目的似乎在簡化建立平行/分散/多核心叢集的工作
  • Gridder - 基於 Globus 的 Web Service Portlet ... 跟 Grid Portal 很像 :p
  • glideinWMS - The glidein based WMS

Open Source : Bioinformatics

  • C++ Bio Sequence Library - C++ 版本的序列分析函式庫
  • Bio-SPICE - Biological Simulation Program for Intra- and Inter-Cellular Evaluation
    • 在電子電機領域,SPICE 是非常重要的一套模擬軟體。Bio-SPICE 應該是一套希望在生物方面佔有一席之地的模擬軟體。
  • BioEra is DSP visual designer that can be used to create interfaces between human being and a machine with using bio signals like EEG, QEEG, HEG, EMG, ECG, GSR, EOG, visual/sound entrainment and others. - BioEra? 跟腦科學應該有蠻強的關聯性,主要功能是在做訊號處理。
  • NCBI Viewer - 新的官方網站 - NCBI
  • Bioinformatics Organization 又找到好幾個生物資訊的自由軟體專案

Hadoop / MapReduce

Cloud Computing and Science

2009-04-07

  • 交大 彭文志 助理教授 今年 Data Mining 課程採用 Hadoop 做作業
  • 測試 Cloudera 的 debian package
  • 從教材點閱率來看,知道這份資料的人還是不多呀 :p

MapReduce

Hadoop

2009-04-08

  • [海資] 計畫討論
  • xfsprogs 3.0.0 debian package Makefile debug

2009-04-09

  • [陽明] 生物資訊運算叢集 DRBL 環境建置

Cloud Computing

Neural Network

2009-04-10

  • xPUD - 以前就覺得 penk 的 PUD 設計得不錯,很乾淨簡潔,有時間來看一下他的mkxpud怎麼寫的。

OpenID / OAuth

Python / Comet / Orbited

2009-04-13

  • [陽明] 安裝 R ape 套件,剛開始的錯誤訊息是找不到 stdio.h, stdlib.h, math.h 這些,所以必須裝 libc6-dev 才會有這些檔案。另外,編譯過程中有遇到一些錯誤(找不到 -lgfortran 跟 -llapack),是因為相依 gfortran 跟 liblapack-dev。
    libc6-dev: /usr/include/bits/stdio.h
    libc6-dev: /usr/include/stdlib.h
    libc6-dev: /usr/include/math.h
    
    liblapack-dev: /usr/lib/liblapack.a
    
    gfortran-4.3: /usr/lib/gcc/x86_64-linux-gnu/4.3/libgfortran.a
    
    • [備忘] 安裝步驟:
      # apt-get install libc6-dev gfortran liblapack-dev
      # wget http://cran.r-project.org/src/contrib/gee_4.13-13.tar.gz
      # R CMD INSTALL gee_4.13-13.tar.gz
      # wget http://cran.r-project.org/src/contrib/nlme_3.1-90.tar.gz
      # R CMD INSTALL nlme_3.1-90.tar.gz
      # wget http://cran.r-project.org/src/contrib/lattice_0.17-22.tar.gz
      # R CMD INSTALL lattice_0.17-22.tar.gz
      # wget http://cran.r-project.org/src/contrib/ape_2.3.tar.gz
      # R CMD INSTALL ape_2.3.tar.gz
      
  • FirePHP - 搭配 Server-Side 的語法,可以在 Firefox 的 FirePHP 擴充套件上顯示 DEBUG Log 資訊。
  • 曾跟 Cloudera 的 Christophe 提過翻譯錄影的字幕,不過不確定 Vimeo 是否有支援,需要評估一下。另外,除了 YouTube 以外,還有很多支援字幕的網站,如: dotSUB

Parallel : MPI Bindings

  • 當然 Erlang 被視為比 MPI 更容易實作分散/平行化的一種語言,這裡有兩篇參考文章12

Bioinformatics HPC

eyeOS

2009-04-14

  • Hadoop 叢集
    • 升級至 Lenny
    • 重新蒐集 MAC Address 讓 hostname 盡量與 KVM 順序相仿
    • 安裝 Power Management ,由於機房有限制單一插座總電流不得大於 12 安培,因此不能插滿八個電源孔。
    • [消防/資安] Power KVM 的電源線也必須注意可容納的電流上限。
hostname hadoop107 hadoop108 hadoop109 hadoop110 hadoop hadoop111 hadoop112
KVM 9 10 11 12 13 14 15
Power KVM 1G 2A 2B 2C 2D 2E 2F
hostname hadoop106 hadoop105 hadoop104 hadoop103 hadoop102 hadoop101
KVM 6 5 4 3 2 1
Power KVM 1F 1E 1D 1C 1B 1A

Hadoop

  • 從 Y!TW 蔡奕楷 12/06 的 Hadoop - Open source grid computing platform 演講投影片,看到一個有趣的指令叫 hod,回想起先前在 Hadoop 官方網站上看到的 Hadoop On Demand,簡單瞄了一下文件,HOD 主要是用 Python 寫的格網叢集佈署工具,用 Torque 或 Maui 當資源管理(Resource Manager)和排程器(Scheduler)。雖然文件裡寫著 Virtual Hadoop Cluster,不過沒有看到虛擬化技術的需求跟描述,因此應該僅僅只是在實體叢集中,切割部分節點來組成一個 Hadoop 叢集。

Virtualization

MapReduce

  • 持續蒐集一些 MapReduce 不同語言的實作....

HBase / CouchDB

2009-04-15

  • DRBL Server NFS 效能調校技巧
    /etc/default/nfs-kernel-server
    # Number of servers to start up
    RPCNFSDCOUNT=25
    
    # Runtime priority of server (see nice(1))
    RPCNFSDPRIORITY=0
    
  • [內部課程] Xen 虛擬化叢集建置與管理
  • [計畫] 投稿 LinuxCon 2009 developer session presentation
  • [計畫] DRBL Hadoop 叢集設定
  • [專案] 從 /proc/ioports 可以理解機器的 I/O 位址分配情形
    jazz@drbl:~$ cat /proc/ioports
    0000-001f : dma1
    0020-0021 : pic1
    0040-0043 : timer0
    0050-0053 : timer1
    0060-0060 : keyboard
    0064-0064 : keyboard
    0070-0073 : rtc0
    0080-008f : dma page reg
    00a0-00a1 : pic2
    00c0-00df : dma2
    00f0-00ff : fpu
    0170-0177 : 0000:00:1f.2
      0170-0177 : ata_piix
    01f0-01f7 : 0000:00:1f.2
      01f0-01f7 : ata_piix
    0290-029f : pnp 00:01
      0290-0294 : pnp 00:01
    0376-0376 : 0000:00:1f.2
      0376-0376 : ata_piix
    0378-037a : parport0
    03c0-03df : vga+
    03f2-03f5 : floppy
    03f6-03f6 : 0000:00:1f.2
      03f6-03f6 : ata_piix
    03f7-03f7 : floppy DIR
    03f8-03ff : serial
    0400-047f : 0000:00:1f.0
      0400-0403 : ACPI PM1a_EVT_BLK
      0404-0405 : ACPI PM1a_CNT_BLK
      0408-040b : ACPI PM_TMR
      0410-0415 : ACPI CPU throttle
      0428-042f : ACPI GPE0_BLK
      0460-047f : iTCO_wdt
    0480-04bf : 0000:00:1f.0
    04d0-04d1 : pnp 00:01
    0500-051f : 0000:00:1f.3
      0500-051f : i801_smbus
    0800-087f : pnp 00:01
    0880-088f : pnp 00:01
    0cf8-0cff : PCI conf1
    c000-cfff : PCI Bus 0000:01
      c000-c01f : 0000:01:00.0
        c000-c01f : e1000e
      c100-c11f : 0000:01:00.1
        c100-c11f : e1000e
    d000-dfff : PCI Bus 0000:02
      d000-d0ff : 0000:02:05.0
        d000-d0ff : r8169
    e000-e01f : 0000:00:1d.0
      e000-e01f : uhci_hcd
    e100-e11f : 0000:00:1d.1
      e100-e11f : uhci_hcd
    e200-e21f : 0000:00:1d.2
      e200-e21f : uhci_hcd
    e300-e31f : 0000:00:1d.3
      e300-e31f : uhci_hcd
    e400-e407 : 0000:00:02.0
    f000-f00f : 0000:00:1f.2
      f000-f00f : ata_piix
    
  • Map of Science - 各類科學學門的關聯圖
    • http://www.lanl.gov/news/albums/science/PLOSMapOfScience.jpg

Virtualization

Cloud Computing

  • CITTIO - 一間以 Cloud Monitoring 為訴求的公司,目前有開放出Zeppelin這套 Cloud Management System。
  • Annelidous - The flexible Cloud Management Framework (CMF) - 還在開發中的雲端運算管理架構

2009-04-16

  • [專案] FreeDOS 下的 DEBUG ... 測試 Watch Dog Timer 或 GPIO 要做組語測試的好工具
  • [備忘] 要編譯包含 asm 的程式碼(Ex. 有 include <asm/io.h> 的原始碼)需要安裝 linux-kernel-headerslinux-libc-dev(lenny 以後版本)

DRBL

  • [待測試] Xen Live CD 2.0build script (ISO Generator) - 瞭解 isolinux 是如何下參數啟動 xen hypervisor 呢?? 一樣是靠 mboot.c32 嗎??
    • 經過簡單的原始碼目錄追蹤,發現它是用 grub 來當 ISO 開機的 boot loader 因此就簡單許多。
    • 在 ISO Generator 的 TODO 裡提到:最好把相對應的 script 整合進 live-helper 裡,那以後就不需要自己維護不同的版本。這確實是比較好的做法,或者包一個相依 live-helper 的 live-helper-xen 套件也不錯。drbl-live 跟 clonezilla-live 目前也是用 live-helper ,可以朝類似的目標前進。
  • [想法] 每次 DRBL Server 作小升級,都會忘記要跑 re-deploy,想說為什麼不能每次只要有跑 apt-get 就像 localepurge 一樣都會去執行對應的 script 呢?? 今天研究了一下,原來作法並不難,只要在 /etc/apt/apt.conf.d/ 中放一個 script 就可以了。
    localepurge: /etc/apt/apt.conf.d/99-localepurge
    
  • [改良] 擺一隻 99drbl 在 /etc/apt/apt.conf.d/ 就可以在每次 apt-get install 之後,每次幫忙跑 re-deploy
    # cat > /etc/apt/apt.conf.d/99drbl << EOF
    DPkg
    {
    Post-Invoke {"if [ -x /opt/drbl/sbin/drblpush ] && [ $(ps w -p "$PPID" | grep -c remove) != 1 ]; then /opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf ; else exit 0; fi";};
    };
    EOF
    

Debian

xPUD

2009-04-17

Debian

Virtualization

2009-04-18

2009-04-19

  • 洪瑞珍三明治 中山店 vs 自由店 PK (圖)
  • Using the sed Editor - sed 跟 awk 在一些場合還蠻常用的。簡單瞄過一次指令,才發現原來還有多重過濾這一招啊!!學起來!! (這個範例是把 sample_one 這個檔案裡,遇到 two 那一行的 1 換成 2, 把 three 那一行的 1 換成 3)
    $ sed '
    > /two/ s/1/2/
    > /three/ s/1/3/' sample_one
    

Hadoop

  • 想說奇怪,為什麼用 hadoop fs 沒辦法改權限。原來要用 hadoop dfs ... (昏) - 參考 waue 的說明

Trac 0.11

  • 由於把系統從 Etch 升級到 Lenny, Python 環境因而從 2.4 升級到 2.5, Trac 從 0.10 升級到 0.11, 不管是 trac 舊的設定檔以及 plugin 都不管用了。只好從頭把 Trac Plugin 重裝一次。
  • 設定檔的部分:先用 trac-admin testbed initenv 產生一個全新的範本目錄,然後用 vimdiff 比對有哪些新參數要加進去。
  • Plugin 部分:
    • 首先要注意的是 Trac 0.11 已經把 TracAccountManager 跟 TracWebAdmin 納入,因此不可以再裝,否則會有一堆錯誤。
    • Graphviz Plugin - 用 graphviz 語法畫圖的擴充套件
      $ w3m "http://trac-hacks.org/changeset/latest/graphvizplugin/0.11-0.7.4?old_path=/&filename=graphvizplugin/0.11-0.7.4&format=zip"
      $ unzip unzip graphvizplugin_0.11-0.7.4-r5537.zip
      $ cd graphvizplugin/0.11-0.7.4
      graphvizplugin/0.11-0.7.4$ sudo python setup.py bdist_egg
      graphvizplugin/0.11-0.7.4$ sudo easy_install dist/graphviz-0.7.4-py2.5.egg
      
    • WikiInclude - 讓用 [[WikiInclude(WikiStart)]] 語法來包含其他 Wiki 頁面中的內容
      $ wget "http://trac-hacks.org/raw-attachment/wiki/WikiIncludePlugin/0.11.versions.tbz2" -O wikiincludeplugin-0.11.tar.gz
      $ tar jxvf wikiincludeplugin-0.11.tar.gz
      $ cd 0.11
      0.11$ cat > setup.py << EOF
      from setuptools import setup
      
      PACKAGE = 'WikiInclude'
      VERSION = '0.2'
      DESCRIPTION = 'Page include plugin for Trac Wiki'
      
      setup(name=PACKAGE,
            version=VERSION,
            packages=['wikiinclude'],
            entry_points={'trac.plugins': ['wikiinclude.wikiinclude=wikiinclude.wikiinclude']})
      EOF
      0.11$ sudo python setup.py bdist_egg
      0.11$ sudo easy_install dist/WikiInclude-0.2-py2.5.egg
      
    • TracRedirect - 用 [[redirect(網址)]] 語法來作頁面自動轉址
      $ svn co http://svn.ipd.uka.de/repos/javaparty/JP/trac/plugins/redirect-0.11/
      $ cd redirect-0.11/
      redirect-0.11$ sudo python setup.py bdist_egg
      redirect-0.11$ sudo easy_install dist/TracRedirect-0.11.3.dev_r3272-py2.5.egg
      
    • Svnauthz File Administration Plugin - 用來管理誰有權限讀取 SVN 目錄的擴充套件
      $ svn co http://trac-hacks.org/svn/svnauthzadminplugin/0.11/ svnauthzadminplugin-0.11
      $ cd svnauthzadminplugin-0.11
      svnauthzadminplugin-0.11$ sudo python setup.py bdist_egg
      svnauthzadminplugin-0.11$ sudo easy_install dist/SvnAuthzAdminPlugin-0.1.2._Moved.to.Trac.0.11_-py2.5.egg
      
  • 過去習慣會修改的字型大小
    • /usr/share/pyshared/trac/htdocs/css/trac.css

      old new  
      11body { background: #fff; color: #000; margin: 10px; padding: 0; } 
      22body, th, td { 
      3  font: normal 12px Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif; 
       3 font: normal 16px Verdana,Arial,'Bitstream Vera Sans',Helvetica,sans-serif; 
      44} 
      55h1, h2, h3, h4 { 
      66 font-family: Arial,Verdana,'Bitstream Vera Sans',Helvetica,sans-serif; 
  • 以前的 template 也失效了,要改用 site.html 重新定義 - 參考 Site Appearance

2009-04-21

  • [備忘] 由於自己常有使用 .vimrc 的習慣。大多數都是進 vim 之後打 :set sts=2 , :set si , :set ai , :set bg=dark , :mkv! 產生 .vimrc 檔,再自行加上 syntax on 到最後一行。先前就遇過這個詭異的狀況,當升級 vim 時,只要啟動 syntax on 就會出現類似這個錯誤訊息:
    處理 /usr/share/vim/vim64/syntax/syntax.vim 時發生錯誤:
    行   42:
    E216: 無此群組或事件: filetypedetect BufRead 
    
    • 今天參考了摩托學園的討論才恍然大悟,原來是 runtimepath 沒有改,造成路徑找不到的窘境。最簡單的方法就是把 .vimrc 砍掉重作,不然就是要把 .vimrc 的 runtimepath 設定改成目前的系統 vim 路徑補上去。
  • [人格分析] MBTI 職業性格測試
    分析:您的性格類型是「INFP」( 哲學家 )
    
      理想主義者,忠於自己的價值觀及自己所重視的人。外在的生活與內在的價值觀配合,有好奇心,很快看到事情的可能與否,
    能夠加速對理念的實踐。試圖瞭解別人、協助別人發展潛能。適應力強,有彈性;如果和他們的價值觀沒有牴觸,往往能包容他人
    。INFP把內在的和諧視為高於其他一切。他們敏感、理想化、忠誠,對於個人價值具有一種強烈的榮譽感。他們個人信仰堅定,有
    為自認為有價值的事業獻身的精神。INFP型的人對於已知事物之外的可能性很感興趣,精力集中於他們的夢想和想像。他們思維開
    闊、有好奇心和洞察力,常常具有出色的長遠眼光。在日常事務中,他們通常靈活多變、具有忍耐力和適應性,但是他們非常堅定
    地對待內心的忠誠,為自己設定了事實上幾乎是不可能的標準。INFP型的人具有許多使他們忙碌的理想和忠誠。他們十分堅定地完
    成自己所選擇的事情,他們往往承擔得太多,但不管怎樣總要完成每件事。雖然對外部世界他們顯得冷淡緘默,但INFP型的人很關
    心內在。他們富有同情心、理解力,對於別人的情感很敏感。除了他們的價值觀受到威脅外,他們總是避免衝突,沒有興趣強迫或
    支配別人。INFP型的人常常喜歡通過書寫而不是口頭來表達自己的感情。當INFP型的人勸說別人相信他們的想法的重要性時,可能
    是最有說服力的。INFP很少顯露強烈的感情,常常顯得沉默而冷靜。然而,一旦他們與你認識了,就會變得熱情友好,但往往會避
    免浮淺的交往。他們珍視那些花費時間去思考目標與價值的人。
    
    您適合的領域有:創作性、藝術類、教育研究、諮詢類等
    

Perl

  • [專案] libcrypt-ssleay-perl - 讓 Perl 的 LWP 支援 HTTPS 協定所需的套件。
  • [備忘] perldebtut - Perl debugging tutorial 官方文件
    • 由於以往寫 Perl 的程式都只會用 print 把變數印出來,好觀察到底判斷式寫得正不正確,正規表示法所擷取出來的內容到底是不是自己想要的。不過今天花了一整天 Debug 某一段程式邏輯,輸入的資料量又不少,有時候還真的蠻想要有 step trace 的功能。寫 C 可以用 gdb 作 debugger,那 Perl 呢?? 答案是加一個 -d 參數下去跑。
    • The Perl Debugger (Programming Perl 3rd Edition)
  • Visual Perl - ActiveState ends development of dynamic language plug-ins for Microsoft Visual Studio
  • ddd 可以對 perl 程式除錯, 用 ddd --perl 起動 ddd 來對 perl 程式除錯,或者在 preference 設 perl 模式

DRBL

  • puppet 是一套用來佈署叢集設定檔的工具。不過....從東京大學IRT研究機構(Information and Robot Technology Research Initiative)的叢集管理實務經驗顯示:還挺吃記憶體的

Cloud Computing

2009-04-22

  • 讓 phpmyadmin 可以預設顯示欄位內容 UTF-8 中文字,在 PHP 的 MySQL 資料庫連結階段,可以加入 SET NAMES "utf-8" 就可以確保字集一致性,而毋庸修改 MySQL Server 的字集設定。
    // 連結資料庫
    $link = mysql_connect($mysql_host, $mysql_user, $mysql_password) or die(mysql_error() );
    mysql_select_db($mysql_database, $link) or die(mysql_error() );
    mysql_query("SET NAMES 'utf8'");
    

Open Source

Virtualization

Cloud Computing

  • Ubuntu 9.04版公開下載支援企業建立內部網雲運算
    • 看到關鍵字沒?! 好多熟悉的字眼啊!!
    • 和 Amazon Elastic Compute Cloud(EC2) 相容
    • 和 聖塔巴巴拉大學 (UCSB) 合作重新實作網雲框架 - Eucalyptus Project
    • 以最新 KVM 功能提升虛擬化
    • 增加 Advanced Message Queue Protocol (AMQP) 支援 - Rabbit MQ

File System : BTFS ( Butter File System )

File System : NFSv4 / pNFS

  • Storage De-Duplication Awareness in NFS - 由 NetApp? 的 M. Eisler 所提出的 NFSv4 Internet-Draft - 最初我是在找支援 De-Duplicate 的 File System 有哪些,因為在虛擬化這一類環境,大多數的檔案是重複的,如何透過 File System 來減少浪費,就是增加容量可用率的一大關鍵。NetApp? 目前看來是這方面的翹楚,先前看 ITHome 的報導就有提過 A-SIS 的實作可以讓虛擬化教學環境節省相當多儲存空間,因為每個使用者所採用的虛擬環境有九成都是雷同的。去年組內也有在研究 pNFS 跟 GPFS-WAN,目前隨意搜尋了一下,看起來 pNFS 跟我們目前採用的 Lustre 設計上是十分雷同的,因此 pNFS 跟 NFSv4 倘若變成標準,是否會對整個平行/分散式檔案系統的生態造成影響,真的就是要壓寶了。從商業的角度來看,照過去微軟的成功模式(重點技術置入作業系統->幹掉競爭對手),Lustre 的社群若無法成功內建到 Linux Kernel,縱使效能叫好,但也很難像過去 NFSv3 那樣普及。加上 SUN 被 Oracle 買走之後,對於 Lustre 社群所造成的衝擊,跟 Linux Kernel 走得比較近的 pNFS (patch) 或許逐漸會挾帶過去 NFSv3 的知名度,成為下一代大家儲存裝置所選用的檔案系統 (ie. NFSv4 + pNFS)。
  • 支援 pNFS 的商業公司
  • pNFS 的實際入門實作
  • pNFS 最初的效能問題研究 - 卡內基美隆大學
  • http://osr507doc.sco.com/en/PERFORM/graphics/NFS.gif
  • http://www.javvin.com/pics/cifs.gif
  • 上圖是 NFS 與 CIFS 的架構圖,讀自pNFS、NFS 和 QFS 的共同特點是什麼? (共通特點居然是..."OpenSolaris都支援"....昏...)

2009-04-23

趨勢

2009-04-24

Hadoop

File System : Lustre

Linux Programming

2009-04-25

Ticket System

  • OTRS - Open Ticket Request System - 有中文支援喔!!

HPC for Bioinformatics

2009-04-026

2009-04-27

  • 雲端運算基礎課程

2009-04-28

  • 雲端運算基礎課程

DRBL

  • 測試 Michael Smith 的 Clonezilla SE Web UI
    • 測試環境: Debian Lenny
      $ lsb_release -a
      Distributor ID: Debian
      Description:   Debian GNU/Linux 5.0.1 (lenny)
      Release:     5.0.1
      Codename:    lenny
      
    • 基本套件相依:根據 README 文件,需要 php-gd, php-mysql, oddjobd, mysql-server, apache, drbl/clonezilla
      $ sudo apt-get install php5-gd php5-mysql mysql-server drbl
      
    • 其中 oddjob 因為是 Redhat 的人開發的,所以目前仍需要額外自行下載安裝,我用 checkinstall 來產生 deb 套件。在 ./configure 過程中發現相依一些套件包含 D-Bus-1 , SELinux Header, libxml-2.0, libpam0g-dev 套件裡的 /usr/include/security/pam_modules.h 跟 python2.5-dev 裡的 /usr/include/python2.5/Python.h (用 apt-file 去找)
      $ sudo apt-get install libdbus-1-dev libxml2-dev libselinux1-dev libpam0g-dev python2.5-dev
      $ wget http://people.redhat.com/nalin/oddjob/oddjob-0.29.1-1.tar.gz
      $ tar zxvf oddjob-0.29.1-1.tar.gz
      $ cd oddjob-0.29.1-1/
      ~/oddjob-0.29.1-1$ ./configure
      ~/oddjob-0.29.1-1$ sudo apt-get install checkinstall
      ~/oddjob-0.29.1-1$ checkinstall
      
      checkinstall 1.6.1, Copyright 2002 Felipe Eduardo Sanchez Diaz Duran
                 This software is released under the GNU GPL.
      
      *****************************************
      **** Debian package creation selected ***
      *****************************************
      
      This package will be built according to these values:
      
      0 -  Maintainer: [ jazz@drbl ]
      1 -  Summary: [ The oddjob package provides a means for unprivileged applications ]
      2 -  Name:    [ oddjob-0.29.1 ]
      3 -  Version: [ 1 ]
      4 -  Release: [ 1 ]
      5 -  License: [ GPL ]
      6 -  Group:   [ checkinstall ]
      7 -  Architecture: [ amd64 ]
      8 -  Source location: [ oddjob-0.29.1-1 ]
      9 -  Alternate source location: [  ]
      10 - Requires: [  ]
      11 - Provides: [ oddjob-0.29.1 ]
      
      Enter a number to change any of them or press ENTER to continue:
      
      ~/oddjob-0.29.1-1$ sudo dpkg --info oddjob-0.29.1_0.29.1-1nchc_amd64.deb
       Package: oddjob-0.29.1
       Priority: extra
       Section: optional
       Installed-Size: 768
       Maintainer: Jazz Yao-Tsung Wang
       Architecture: amd64
       Version: 0.29.1-1nchc
       Depends: libdbus-1-dev, libxml2-dev, libselinux1-dev, libpam0g-dev, python2.5-dev
       Provides: oddjob-0.29.1
       Description: invoke and control applications by issuing requests using the D-Bus
        The oddjob package provides a means for unprivileged applications
        to invoke and take limited control of privileged applications by
        issuing requests using the D-Bus system message bus.
      

Hadoop

  • 測試 Cloudera 的 Hadoop Debian Package
    ~# lsb_release -a
    Distributor ID: Ubuntu
    Description:   Ubuntu 8.10
    Release:     8.10
    Codename:     intrepid
    
    ~# cat > /etc/apt/sources.list.d/hadoop.list << EOF
    deb http://archive.cloudera.com/debian intrepid contrib
    EOF
    
    ~# apt-get update
    ~# apt-get install hadoop
    ~# /opt/drbl/sbin/drblsrv -i
    ~# /opt/drbl/sbin/drblpush -i
    
  • 編輯 DRBL 上的 hadoop-site.xml
    ~# cat > /etc/hadoop/conf/hadoop-site.xml << EOF
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    
    <!-- Put site-specific property overrides in this file. -->
    
    <configuration>
      <property>
        <name>fs.default.name</name>
        <value>hdfs://192.168.166.254:9000/</value>
        <description> </description>
      </property>
      <property>
        <name>mapred.job.tracker</name>
        <value>192.168.166.254:9001</value>
        <description>  </description>
      </property>
      <property>
        <name>hadoop.tmp.dir</name>
        <value>/var/run/hadoop/${user.name}</value>
        <description> </description>
      </property>
    </configuration>
    EOF
    
  • 啟動 Namenode, Secondary Namenode, Jobtracker 在 DRBL Server 並且用 drbl-client-service 指令讓每個 DRBL Client 預設都當 Task Tracker 跟 Datanode。最後執行 re-deploy
    ~# update-rc.d hadoop-namenode defaults
    ~# update-rc.d hadoop-secondarynamenode defaults
    ~# update-rc.d hadoop-jobtracker defaults
    ~# /etc/init.d/hadoop-namenode start
    ~# /etc/init.d/hadoop-secondarynamenode start
    ~# /etc/init.d/hadoop-tasktracker start
    ~# /opt/drbl/sbin/drbl-client-service tasktracker on
    ~# /opt/drbl/sbin/drbl-client-service datanode on
    ~# /opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf
    

2009-04-29

  • 國家海洋資料庫及資訊網建置計畫說明會

2009-04-30

Cloud Computing

  • abiCloud - Enterprise open source cloud computing platform 號稱是企業級的開放源碼雲端平台
    • 看它的 DEMO 影片可以學習到原來一個雲端平台的組成,所需的功能還真不是普通的多啊~
    • Abiquo 這間公司我先前還有看過在 FON 上的應用,所以應該說這間公司不僅在中介軟體(Middleware)上著墨不少,目前也已經準備進軍雲端平台。

2009-05-01

Debian / Ubuntu

  • 使用 apt-p2p 來更新系統 - 確實如果有大水管的 mirror site 會比 P2P 來得便捷,反正最後還是卡在自己的 last mile,在某些情況下,P2P 確實可以比較快(特別是"內容"夠吸引人的時候,軟體套件吸引人的程度應該還沒有多媒體高 *^_^* )。

Cloud Computing

2009-05-02

  • 以前得過大專學生參與專題研究計畫,看了一下統計,我得獎的那一年(民88年)申請件數並不多 :)

產學合作 / 科專計畫 /

Open Source

  • Check Your AppLinux Standard Base (LSB) 是 Linux Foundation 正在推的兩套標準,目的就是希望讓程式可以在不同的 Linux 發行版本(Distribution)都可以容易變成套件。也就是透過 !OpenSUSE 提出的 Build Service 來產生不同 CPU 架構、不同發行版本的套件。
  • RoundCube - 由於 OpenWebMail 已經比較不活躍了,開始又有新的聲音在談支援 IMAP 的 Web Mail 系統。 RoundCube 是其中一套。至於像被 Yahoo! 買走的 Zimbra 又是另外一套整合性更高的系統。

2009-05-03

“Your work is going to fill a large part of your life, and the only way to 
be truly satisfied is to do what you believe is great work. And the only way 
to do great work is to love what you do.” --Steve Jobs, 2005 Stanford Commencement

「工作會占去你生活一大部分,而要獲得真正的充實感,唯一的方法就是去做你認為了不起的事。要做到
了不起的事唯一之道就是要愛上自己做的事情。」——史蒂夫‧賈伯斯 2005年史丹佛大學畢業典禮演說

2009-05-04

  • S.M.A.R.T 原則:
    • Specific(具體考核)
    • Measurable(可計算目標、可量化考量)
    • Attainable(目標得有挑戰性,但也一定要能達成)
    • Relevant(工作目標與職責間的關連性)
    • Time-bounding(規定目標達成的時間)
  • 「SQ3R」是美國俄亥俄州州立大學心理學教授羅賓遜(F. P. Robinson)一九四六年提出的一套閱讀策略,在美國高中廣泛使用。
    • 綜覽(Survey)
    • 發問(Question)
    • 閱讀(Read)
    • 背誦(Recite)
    • 復習(Review)

Standard

  • HTML5 提議新增 datagrid 元件語法 - 蠻期待的,畢竟 Excel 堪稱在產業界中使用最頻繁的軟體,如果瀏覽器可以對資料表支援更好,相信是 Web Application 之福。

Open Source

  • Adopt a Line of Miro Code! - Miro 是一套用來彙整 Podcast 的軟體,最近提出希望每人認養 3 行原始碼的活動。我個人覺得這是個有趣的想法,也可能是未來自由軟體的發展模式之一。

Cloud Computing

Virtualization

  • Creating A Fully Encrypted Para-Virtualised Xen Guest System Using Debian Lenny - 虛擬化的一個潛在危險是如果實體機器的帳號外洩,那所有在上面的虛擬機器都可能會面臨資料被竊取的風險。這篇文章介紹如何針對 Xen DomU 進行加密。
  • Xen Live Migration Of An LVM-Based Virtual Machine With iSCSI On Debian Lenny - 過去 DRBL 要實現無碟 Windows 的時候考慮過兩種方案,其一是 iSCSI,另外則是目前採用的 AoE。iSCSI確實可以提供更抽象的儲存空間,也帶來許多好處,如:跨網域(只要在 Internet 上都可以透過 iSCSI ID 找到)。因此拿 iSCSI 來當 Xen 的儲存空間,要達成 Live Migration 有它的好處。不過我是有點懷疑效能是不是有比其他檔案系統來得快啦~

jQuery

Web Service

職場技能

2009-05-04

  • 由於 Xen Hypervisor 不希望原生 Linux Graphics Driver 在 DomU 上跑,因此必須靠 bypass 的方式讓 DomU 可以經由 Dom0 進行 GPU 計算。
    • 更白話地說,就是 DomU 上沒辦法裝跟 PCI 裝置有關的驅動程式
    • Xen DomU 與 Dom0 之間的溝通管道有 Xenstore 、 Xen-Bus 、 Event Channel 三種。
  • 用 OpenISR 來達成 GPU Suspend / Resume 的目標
    • OpenISR - The Internet Suspend/Resume (ISR) project

2009-05-05

Cloud Computing

  • Cloudy issues - 這個作者提出一個觀點,他認為這是個"Data motion"的時代,也就是雲端運算其實會花掉很多時間再資料搬移上,縱使大家都把資料共同放在雲端上,還是有可能需要不斷地搬移。那麼花在資料的搬入搬出的成本跟時間,與計算所耗費的成本與時間相比,是否值得?這或許也將是雲端運算的商業模式與使用模式該仔細精算的小細節。

Hadoop

File System : Lustre

  • Lustre User Group 2009 影片大賞 - 議程
投影片 影片 備註
Keynote, Peter Bojanic 影片 講述 Lustre 的未來規劃(Roadmap)
Lustre Scalability, Eric Barton 影片 談 Lustre 的可擴充性
Making Movies with Lustre, John Leedham, Daire Byrne, James Rose 影片 把 Lustre 用在影片特效製作上,非常具有說服力的應用實例
Lustre Recovery, Robert Read 影片 Lustre 備援機制
Lustre in a WAN Environment, James Hofmann and Dardo Kleiner 影片 談 Lustre 在跨網域的環境下,如何佈署
Monitoring I/O Performance on Lustre, Andrew Uselton, NERSC 影片 談 Lustre I/O 效能監控

VNC and SSH Client

  • 要讓使用者容易使用異地的機器,有兩種做法,一種是提供桌面環境,另一種則是提供命令列環境。桌面環境目前的實作方法,一種是 VNC 、 RDP 或 NX 遠端桌面,另一種則是興起中的 WebOS。至於 SSH Client 當然大多數是 stand alone application,或者只有 Java Applet 可以鑲嵌在網頁中。
  • wade 找到一個 zterm 是支援 UTF-8 特別寫給中文使用者的專案。
  • 至於純使用網頁的命令列環境有 anytermajaxerm
  • 先前就有找到 Flashlight-VNC 這個 Flash 版的 VNC Viewer 不過似乎要先解決 Flash 跨網站的 Policy 問題。
  • airVNC*是另一個基於 Flashlight-VNC 的 Adobe AIR 實作,它的特點是一次可以看到多個 VNC 連線視窗,或許將來可以運用在 DRBL 的概念展示上。

Mobile Computing

2009-05-06

File System

Open Source

Git 版本控制

Bioinformatics

Cloud Computing

  • Hadoop Summit '09
    • Genetic Sequence Analysis in the Clouds
      • They will present initial results from their use of MapReduce to meet these challenges.
      • They will also speculate on the future of cloud computing technologies in the life sciences.
    • 講者 Jimmy Lin 的論文發表還蠻多元的,我還蠻喜歡他用分類的方式來表現哪篇論文跟哪個領域有關,看來真是一個跨領域的高手。
  • PHP 開發框架 Zend 將支援 Amazon EC2
  • Ubuntu CEO:軟體只是獲取服務的工具
    「轉變成服務是大勢所趨,未來的世界裡,軟體只是獲取服務的工具。」
    
    「就像1990年代的HTTP所做的事,相互獨立的網路系統現在可以透過這項協定合輕易串連。
     雲端運算的精神是伺服器整合,但虛擬化仍然是廠商自己做自己的虛擬化。雲端運算在
     伺服器面的效益是提供極大的擴充性。」
    
                                 - Mark Shuttleworth, Ubuntu CEO
    
  • YouTube揭露Google資料中心全貌

Mobile Computing

職場技能

2009-05-07

  • Alexa 是流量統計的網路服務,今天無意間玩了一下中心的流量統計,發現三個有趣的現象:
    • 其一:搜尋關鍵字 - Clonezilla, Clonezilla Live, 再生龍, drbl, co-life 進榜前十大
    • 其二:流量在12月、1月、4月出現高峰,都恰巧是 Clonezilla Live 釋出新版的時間點,關聯性頗高。
    • 其三:我架設的 http://sensor6.nchc.org.tw 佔中心 6% 的流量,應該是研考會"台灣看透透"的連結威力。
  • [趨勢] ANL 常會有一些特殊的統計圖表,這裡就是一張關於民生相關技術在美國被採用的百分比跟時間的對應關係。很有意思的是彩色電視機、微波爐、錄放影機、手機、電腦、網際網路的成長趨勢都非常快速,而且曲率非常接近。
    • http://www.isgtw.org/images/2009/catlett_adoptionrate.jpg

Bioinformatics

Programming

D-Bus

  • 最近在測試來自 teenmania.org 的 Michael Smith 撰寫的 Snapshot for Clonezilla。它的底層是透過 D-Bus 讓網頁可以送程式給 oddjobd 來達成執行特定指令的目的。其實概念都很相近,不管是採用 Apache ActiveMQ 或 Python 的 Orbited 等,都算是 Message-Oriented Middleware (MoM) 的一種。差別只在於 D-Bus 嚴格講起來算 IPC 只用在本機的訊息傳遞,而其他技術可以有一個獨立的 Broker 來轉送訊息(適用在 M-to-N 訊息傳遞)。
  • D-Bus Tutorial
  • http://dbus.freedesktop.org/doc/diagram.png

Embedded

  • 昨天就看到 Debian Developer "Aurelien Jarno" 寫說要改用 Embedded GLIBC (EGLIBC) 來取代現行的 glibc。大概看了一下 FAQ 跟 maintainer 都是來自嵌入式的重量級大廠(Ex.Montavista, Wind River, etc)。大家第一個疑惑一定是 EGLIBC 跟 uClibc 的差異,嚴格講起來 EGLIBC 的目的是為了維護針對嵌入式裝置,特別是 PowerPC 與 MIPS 架構的 C 函式庫進行維護,因為官方 glibc 只希望維護 x86 架構的部分。Debian 向來以支援多種 CPU 架構聞名,更是做 Embedded 移植的最佳選擇( NAS / Wireless AP 改機者的最愛 ),為了後續在產生跨 CPU 架構的套件維護上,改採 EGLIBC 勢必會有其優勢。官方網站提到了幾點 EGLIBC 與 uClibc 的重點差異:
    • Binary Compatible : uClibc is designed to be source compatible with GLIBC, but it is not binary compatible. - 意思就是縱使 Debian 全面改採 ELIBC 也不需要全部改用 ELIBC 重編跟 C 相依的套件,這就是 Binary Compatible。
    • MMU Support - uClibc supports uClinux, whereas EGLIBC will likely only work on GNU/Linux systems with an MMU. - uClibc/uClinux 的特點是可以移植到 Non-MMU 的 CPU 架構,而 EGLIBC 則針對具備 MMU 的 CPU 架構。
    • Development Status - uClibc is available today, and is already shipping on a large number of systems. EGLIBC is a new project. - uClibc 已經很成熟了,也已經移植到非常多嵌入式裝置;而 EGLIBC 才剛開始,所以穩定度上可能還有一些缺陷。
  • Debian 也向 Embedded 看齊!換上 EGLIBC!

Networking

  • cdpr is a nifty little command which speaks the Cisco Discovery Protocol, allowing you to learn interesting things from your network.
    • 蠻有趣的套件,還可以查出接在哪一個 swicth 上的哪個 port。
      jazz@drbl:~$ sudo apt-get install cdpr
      jazz@drbl:~$ sudo cdpr
      cdpr - Cisco Discovery Protocol Reporter
      Version 2.2.1
      Copyright (c) 2002-2006 - MonkeyMental.com
      
      1. eth0 (No description available)
      2. eth1 (No description available)
      3. eth2 (No description available)
      4. any (Pseudo-device that captures on all interfaces)
      5. lo (No description available)
      Enter the interface number (1-5):1
      Using Device: eth0
      Waiting for CDP advertisement:
      (default config is to transmit CDP packets every 60 seconds)
      Device ID
        value:  ********.nchc.org.tw
      Addresses
        value:  140.110.***.***
      Port ID
        value:  GigabitEthernet0/48
      

職場技能

  • 反擊的智慧-25個逆轉情勢的說話術
    想在爭論上贏得勝利,最簡單的方法就是:增加說話次數,減少對方說話機會。
    
                       - 《反擊的智慧--——25個逆轉情勢的說話術》
    

2009-05-08

  • 拉票喔!! SourceForge 2009 Community Choice Awards

File System : Lustre

  • Lustre 2.0 Alpha 已經釋出了。下載點:
  • 在 Lustre User Meeting 2009 的議程中,Peter Bojanic 提到了 Lustre 的 Roadmap,我比較注意的兩點是:(1) Write Back Cache 跟 (2) pNFS exports
  • 目前全球 HPC 前十大有七個採用 Lustre 1.6 版本。而 I/O 最高紀錄保持者為 190 GB/s,這也意味著先前測試到 2 GB/s 算是小 case 啦!!
  • 1.6 版將於 2010 四月停止維護,因此想要玩的可以開始轉換到 1.8 了。

Linux Programming

  • [專案] 在 Windows 底下常用的 inportb() 跟 outportb(),在 Linux 底下可以用 port I/O (有很多種 outb(), outw(), outl(), outsb(), outsw(), outsl(), inb(), inw(), inl(), insb(), insw(), insl() ) 來實現。而在 VxWorks 則用 sysInByte() 跟 sysOutByte() 來實現
    static int outportb(unsigned int port, unsigned int val, int size)
    {
      static int iopldone = 0;
    
    #ifdef DEBUG
      printf("outportb(0x%04x)<=0x%02x\n", port, val);
    #endif
    
      if (port > 1024) {
        if (!iopldone && iopl(3)) {
          fprintf(stderr, "iopl(): %s\n", strerror(errno));
        return 1;
        }
        iopldone++;
      } else if (ioperm(port,size,1)) {
        fprintf(stderr, "ioperm(%x): %s\n", port, strerror(errno));
        return 1;
      }
    
      if (size == 4)
        outl(val, port);
      else if (size == 2)
        outw(val&0xffff, port);
      else
        outb(val&0xff, port);
      return 0;
    }
    
    static int inportb(unsigned int port, int size)
    {
      static int iopldone = 0;
      unsigned int val=0;
    
      if (port > 1024) {
        if (!iopldone && iopl(3)) {
          fprintf(stderr, " iopl(): %s\n", strerror(errno));
          return 0;
        }
        iopldone++;
      } else if (ioperm(port,size,1)) {
        fprintf(stderr, " ioperm(%x): %s\n", port, strerror(errno));
        return 0;
      }
    
      if (size == 4) {
        val=inl(port);
    #ifdef DEBUG
        printf("Read_port:(0x%04x)=>0x%08x\n", port, val);
    #endif
      } else if (size == 2) {
        val=inw(port);
    #ifdef DEBUG
        printf("Read_port:(0x%04x)=>0x%04x\n", port, val);
    #endif
      } else {
        val=inb(port);
    #ifdef DEBUG
        printf("Read_port:(0x%04x)=>0x%02x\n", port, val);
    #endif
      }
      return(val);
    }
    

Fast Boot

2009-05-09

  • 國家實驗室退場機制 國研院6月底完成評估
    (中央社記者田裕斌台北7日電)國家實驗研究院新任院長陳文華今天表示,國研院目前已開始檢討,
    評估過去5年各中心績效達成情況,預計6月底會有具體結果。陳文華強調,國研院的確有整合的必要。
    
    行政院長劉兆玄今年初在全國科技會議時表示,需建立國研院轄下各國家實驗室的退場機制。陳文華
    表示,目前對於新設中心的進度完全停擺,且開始檢討各中心定位,不是每個領域都要設立中心。
    
    國研院副院長吳光鐘也說,各中心 1個月前已先進行自評,看過去 5年是否符合預期目標,並提出
    中心退場的影響與整併的看法,下周會請國內相關專家學者進行院內初評,結束後再送國科會複評,
    預計 6月底前完成。
    
    98-05-07
    

Open Source

Linux BIOS / CoreBoot

Cloud Computing

Bioinformatics, Cluster, Grid and Cloud

Web Service : Comet

2009-05-11

Open Source

Bioinformatics / R-Project

Cloud Computing

  • 雲端防毒保安全 病毒木馬殺很大
    以趨勢科技(Trend)的雲端保全(security in the cloud)電腦防毒服務為例,該公司建立一大型的雲端反毒資料庫,
    以及主動搜尋和消滅病毒的相關策略及運算技術,提供使用者防毒軟體外另一層的防護機制。趨勢科技董事長張明正表示,
    In-the-cloud 時代已經來臨,趨勢科技推展的軟體服務化(Software As A Service),結合雲端技術加以應用,未來
    在網路環境與使用者習慣上,透過遠端控管即可處理客戶端龐大資料量來達成最佳服務效果。
    
    資安業者 Panda Security 近日則釋出 Panda Cloud Antivirus 測試版,提供全球第一個以雲端為基礎的免費防毒
    服務,使用者所下載的用戶端軟體對系統效能的影響只有傳統防毒軟體的一半,有效降低電腦記憶體的使用率。
    
    • 先前一直跟 waue 在討論為什麼線上掃毒算是雲端運算的一種,其實這幾間公司也一直沒有很明確地交代"How it works?"。就我自己的觀點來看,如果運算跟資料不是在雲端平台上進行掃毒運算,那就不能稱之為「雲端運算」。根據上文的一些猜測,這些服務很有可能是一種代理程式(Proxy),也就是當發現有下載行為時,先幫你下載到雲端平台去過濾,確定無病毒感染後才下載到本地端。那麼安裝這樣的用戶端程式有什麼好處呢?? (1) 如果有人下載過,那它也不用再算一次。充分發揮雲端運算所謂"群眾的力量",下載率越高的檔案跟網址,就不會重複進行病毒掃描。(某種程度來說,這也是綠色運算,因為從此不用每台機器都重複針對同一個檔案做病毒掃描。但如果真是這樣做,第二的問題將是:為什麼你相信他幫你下載的檔案是沒有病毒的?這好像跟為什麼你相信它掃描的結果是對的,是個有點吊詭的問題。) (2) 針對已經存在本地端的舊檔案或本地端產生的新檔案,才進行病毒掃描,因此運算負載相對就比漫無目的地全面掃描來得有意義多了。
  • 歐巴馬政府 IT 預算重點改變
    • 過去兩年多,從跟業界互動的過程中,體會到不少關於財務方面的事情。原來要當一個大老闆,就是在時機不好的時候也得敢投資敢衝,不舉債玩大的,就別想賺到更多錢。我漸漸領悟到,經濟成長率建構在交易的頻繁度上,實質上每個人所擁有的錢並沒有變多或變大,而是花得越來越多,花得越來越頻繁,這樣整體經濟就會好轉。這陣子在觀察雲端運算趨勢時,早已發覺到美國這半年來似乎投注了非常多資金在 IT 上。我個人相信,這就像物理能階的概念,這一波歐巴馬政府所帶動的長期資訊建設,將連帶驅使美國資訊產業走向下一個新紀元,而美國也將因為政府的大額舉債,逐漸恢復經濟活力,恢復強國之姿。而近期美股第一波獲利應該會在資訊相關產業爆發。

Web Service

OGF 26

自助旅行

Embedded

  • Qi(氣) - a lightweight replacement for the uBoot bootloader.

職場技能

  • 別以中國當假想敵,健康看待兩岸「新同事關係」
    肯上進、很有企圖心、踏實肯幹,是台資企業對中國年輕工作人普遍的評價。這樣的特質,來自於艱苦的生存環境。
    相形下,台灣年輕人比較重視自我實現的部分,價值比較多元,對工作的價值就相當堅持均衡與健康。
    台灣年輕人所反映出的「多元思考、創意或靈活度」,正是與大陸青年最不同的地方。
    
    台灣年輕人應該跳脫「台灣人優勢」與「被大陸人取代」的兩極化思考模式,重新看待兩岸「新同事關係」的競爭變貌。
    

2009-05-12

  • 電腦教室A、B安裝第二張網卡
    • [狀況] 電腦教室A有三台電腦無法開啟電源
    • [解決] 03 -> 機殼內電源排線脫落,接上後(O),25 -> 小澤圓換電源線後(O),17 ->小澤圓換電源線後(O)
講師
222112110201
242314130403
2625
16150605
28271817
0807
302920191009
  • [狀況] 電腦教室B有一台電腦無法開啟電源(X),有一台一直開進 Windows(?),最後一排目前沒有蒐集 MAC 用來擺故障的電腦。
  • [解決] 兩台皆網路線脫落,接上後(O)
講師
    
  
    
    
  • PC/ADV電腦王58期 玩軟體 114頁 PC、Mac雙頻備份王 - Ghost、True Image閃一邊,國產再生龍完全應用

Hadoop

Network: VLAN (Virtual Local Area Network)

WebDAV

  • 為了同步不同的行動裝置或桌上型電腦,大家通常都會有網路硬碟的需求,當然也就會有類似像 DropBoxUbuntu One 這樣的服務。當然我自己過去還蠻常用 WebDAV 來當網路硬碟,因為 Apache 本身就有 mod_dav 的模組,可以很簡單地架設起來,此外 80 埠也通常不會被擋。過去遇到的問題是中文檔名字集的困擾,也就是 Windows 2000 或 Windows XP 掛載網路磁碟時,採用的是 Big5 編碼,而用 http 連線時,如果設定成 UTF-8 就會看到一堆亂碼。不過大多數的情況下,WebDAV 是同時被 Linux, Mac, Windows 預設支援的協定之一。
  • How To Set Up WebDAV With MySQL Authentication On Apache2 (Debian Lenny)
  • How To Set Up WebDAV With Apache2 On Debian Lenny - Page 2 - 過去常會遇到的問題,原來只要在網址加上 :80 的 port 設定,就可以正確記住帳號密碼了!!
  • cadaver - command-line WebDAV client - 在 Debian 底下的指令列掛載 WebDAV 工具

2009-05-13

職場技能

2009-05-14

  • [專案] 陽明生物資訊叢集設定
    • [狀況一] 機房無線網路訊號斷斷續續,無法用筆電進行網路安裝
    • [狀況二] 新機器的網卡需要韌體支援,網路安裝時要求插入內含 bnx2-06-4.0.5.fw 的 USB 儲存裝置,來提供該檔案。該檔案可從 non-free 的 firmware-bnx2 套件中取得。
      ~$ dpkg -S .fw
      firmware-bnx2: /lib/firmware/bnx2-09-4.0.5.fw
      firmware-bnx2: /lib/firmware/bnx2-06-4.0.5.fw
      
    • [狀況三] 縱使 DRBL Server 安裝了新的韌體,還是無法正常讓該主機透過 DRBL 開機。
  • MMS 下載工具
    • mimms - mms (e.g. mms://) stream downloader
    • mplayer - movie player for Unix-like systems
      $ mplayer -cache 2048 -dumpfile test.wmv -dumpstream mms://A.B.C.D
      

Virtualization

  • 今天本想在 64 位元的 Debian 上用 debootstrap 跟 chroot 安裝第二個 32 位元的 Debian,不過卡在 NFS Kernel Server 上,因此看樣子要在一般的 chroot 環境下跑第二個系統是有點困難的。當然這也許是虛擬化的另一種用途,當在找 rpmstrap 時,找到一個可以拿來產生 Xen DomU Image 的工具 - rinse,在 Debian 上是有套件的。

2009-05-15

  • [專案] 台北捷運內湖線通車前軟體測試: (1) WSU 升級至 1.0.0 版本 (2) NMS 加入 WLC 狀態資訊。

2009-05-18

Open Source : Database

Cloud Computing

Virtualization

  • Xen-ARM - 可以在 Goldfish (QEMU 0.82 based Android emulator) 上跑 Xen

2009-05-18

  • [備忘] ubuntu 下,flash 亂碼的修正
    • sudo gedit /etc/fonts/conf.d/49-sansserif.conf ,將兩個「sans-serif」改成「sans serif」即可
  • 範例程式
  • 投影片
  • (1) 下載 Google App Engine SDK
  • (2) 安裝 Eclipse (非必要)
    $ wget http://googleappengine.googlecode.com/files/google_appengine_1.1.5.zip
    $ unzip google_appengine_1.1.5.zip
    $ sudo apt-get install sun-java6-jdk eclipse
    
  • (3) 安裝 Pydev (非必要)
  • (4) 申請 Google App Engine Key - http://appengine.google.com/ - 步驟參考
  • (5) 下載課程範例程式
    $ cd google_appengine
    google_appengine$ wget http://trac.nchc.org.tw/grid/raw-attachment/wiki/Reading/GAE.zip
    google_appengine$ unzip GAE.zip
    
  • 關於 app.yaml
    • Google App Engine 的設定檔 app.yaml 裡面是靠標準表示法來表示 (1) 觸發網址 (2) 對應的目錄(static_dir)/檔案(static_files)/程式(Script) (3) 本機端硬碟目錄/檔案/程式
    • 範例說明
  • 關於 cron.yaml
    • Goolge App Engine 目前已經有支援排程,相關語法可參考範例說明

2009-05-19

  • [專案] 陽明生物資訊計算叢集設定
    • 上次遇到 firmware-bnx2 的問題,在 Debian Lenny 上無法正常重建網路開機環境,因此改用 Ubuntu 9.04 進行網路安裝,過程很順利。
    • 硬碟 I/O 很慢的主因是有做硬體 RAID,而且持續在做 SYNC 的動作,因此只要把 RAID 卡關掉就可以比較快速地開進作業系統。
    • 參考Lustre on Debian,在 Ubuntu 9.04 上編譯 Lustre 核心模組。
    • [失敗] 因為 Lustre 目前官方只支援到 2.6.22,因此無法 patch 產生 2.6.28 的核心模組。
      ~$ sudo apt-get update
      ~$ sudo apt-get install linux-patch-lustre lustre-source linux-source kernel-package
      ~$ cd /usr/src
      /usr/src$ sudo tar jxvf linux-source-2.6.28.tar.bz2
      /usr/src$ cd linux-source-2.6.28/
      /usr/src/linux-source-2.6.28$ sudo cp /boot/config-2.6.28-11-generic .config
      /usr/src/linux-source-2.6.28$ sudo make oldconfig
      /usr/src/linux-source-2.6.28$ sudo su
      /usr/src/linux-source-2.6.28# tar jxvf ../lustre.tar.bz2
      /usr/src/linux-source-2.6.28# export CONCURRENCY_LEVEL=3
      /usr/src/linux-source-2.6.28# make-kpkg clean
      /usr/src/linux-source-2.6.28# make-kpkg --rootcmd fakeroot --added-patches=lustre --initrd --append-to-version "-lustre-1.6.5.1-4" --revision=20090519 kernel_image
      
    • 安裝 JDK
      ~$ sudo apt-get install sun-java6-jdk
      
    • 安裝 R 及 Bioconductor
      ~$ sudo apt-get install r-base
      ~$ sudo R
      > source("http://www.bioconductor.org/biocLite.R")
      > biocLite()
      Warning messages:
      1: In install.packages(pkgs = pkgs, repos = repos, dependencies = dependencies,  :
        dependency ‘Matrix’ is not available
      2: In install.packages(pkgs = pkgs, repos = repos, dependencies = dependencies,  :
        installation of package 'IRanges' had non-zero exit status
      3: In install.packages(pkgs = pkgs, repos = repos, dependencies = dependencies,  :
        installation of package 'Biostrings' had non-zero exit status
      
    • 第一個錯誤是找不到 r-cran-matrix 套件,這裡用暴力法安裝所有在 apt 套件庫裡的 R 相關套件(除了 rjava 外)
      ~$ sudo apt-get install `apt-cache search --names-only "^r-cran" | awk '{ print $1 }' | grep -v "r-cran-rjava" `
      
    • 裝好之後,重裝一次 Bioconductor 就沒有錯誤了。
      ~$ sudo apt-get install r-base
      ~$ sudo R
      > source("http://www.bioconductor.org/biocLite.R")
      > biocLite()
      > library()
      Packages in library '/usr/local/lib/R/site-library':
      
      affy                    Methods for Affymetrix Oligonucleotide Arrays
      affydata                Affymetrix Data for Demonstration Purpose
      affyio                  Tools for parsing Affymetrix data files
      affyPLM                 Methods for fitting probe-level models
      affyQCReport            QC Report Generation for affyBatch objects
      annaffy                 Annotation tools for Affymetrix biological
                              metadata
      annotate                Annotation for microarrays
      AnnotationDbi           Annotation Database Interface
      Biobase                 Biobase: Base functions for Bioconductor
      Biostrings              String objects representing biological
                              sequences, and matching algorithms
      DynDoc                  Dynamic document tools
      gcrma                   Background Adjustment Using Sequence
                              Information
      genefilter              genefilter: methods for filtering genes from
                              microarray experiments
      geneplotter             Grapics related functions for Bioconductor
      GO.db                   A set of annotation maps describing the entire
                              Gene Ontology
      hgu95av2.db             Affymetrix Human Genome U95 Set annotation data
                              (chip hgu95av2)
      IRanges                 Low-level containers for storing sets of
                              integer ranges
      KEGG.db                 A set of annotation maps for KEGG
      limma                   Linear Models for Microarray Data
      marray                  Exploratory analysis for two-color spotted
                              microarray data
      matchprobes             Basic infrastructure for using oligonucleotide
                              microarray reporter sequence information for
                              preprocessing and quality assessment
      multtest                Resampling-based multiple hypothesis testing
      preprocessCore          A collection of pre-processing functions
      ROC                     utilities for ROC, with uarray focus
      RSQLite                 SQLite interface for R
      simpleaffy              Very simple high level analysis of Affymetrix
                              data
      vsn                     Variance stabilization and calibration for
                              microarray data
      xtable                  Export tables to LaTeX or HTML
      
      Packages in library '/usr/lib/R/site-library':
      
      abind                   Combine multi-dimensional arrays
      acepack                 ace() and avas() for selecting regression
                              transformations
      adapt                   adapt -- multidimensional numerical integration
      bayesm                  Bayesian Inference for
                              Marketing/Micro-econometrics
      bitops                  Functions for Bitwise operations
      cairoDevice             Cairo-based cross-platform antialiased graphics
                              device driver.
      car                     Companion to Applied Regression
      caTools                 Tools: moving window statistics, GIF, Base64,
                              ROC AUC, etc.
      chron                   Chronological objects which can handle dates
                              and times
      coda                    Output analysis and diagnostics for MCMC
      combinat                combinatorics utilities
      date                    Functions for handling dates
      DBI                     R Database Interface
      Design                  Design Package
      eco                     R Package for Ecological Inference in 2x2
                              Tables
      effects                 Effect Displays for Linear, Generalized Linear,
                              Multinomial-Logit, and Proportional-Odds Logit
                              Models
      fArma                   ARMA Time Series Modelling
      fAsianOptions           EBM and Asian Option Valuation
      fAssets                 Rmetrics - Assets Selection and Modelling
      fBasics                 Rmetrics - Markets and Basic Statistics
      fBonds                  Bonds and Interest Rate Models
      fCalendar               Chronological and Calendarical Objects
      fCopulae                Rmetrics - Dependence Structures with Copulas
      fEcofin                 Economic and Financial Data Sets
      fExoticOptions          Exotic Option Valuation
      fExtremes               Rmetrics - Extreme Financial Market Data
      fGarch                  Rmetrics - Autoregressive Conditional
                              Heteroskedastic Modelling
      fImport                 Rmetrics - Economic and Financial Data Import
      fMultivar               Multivariate Market Analysis
      fNonlinear              Nonlinear and Chaotic Time Series Modelling
      fOptions                Basics of Option Valuation
      fPortfolio              Rmetrics - Portfolio Selection and Optimization
      fRegression             Regression Based Decision and Prediction
      fSeries                 Financial Time Series Objects
      fTrading                Technical Trading Analysis
      fUnitRoots              Trends and Unit Roots
      fUtilities              Function Utilities
      gdata                   Various R programming tools for data
                              manipulation
      genetics                Population Genetics
      getopt                  C-like getopt behavior.
      gmaps                   Wrapper and auxilliary functions for maps
                              package to work with grid graphics system.
      gmodels                 Various R programming tools for model fitting
      gplots                  Various R programming tools for plotting data
      gregmisc                Greg's Miscellaneous Functions
      gtools                  Various R programming tools
      haplo.stats             Statistical Analysis of Haplotypes with Traits
                              and Covariates when Linkage Phase is Ambiguous
      hdf5                    HDF5
      Hmisc                   Harrell Miscellaneous
      its                     Irregular Time Series
      jit                     Just-in-time compiler for the R language
      latticeExtra            Extra Graphical Utilities Based on Lattice
      lme4                    Linear mixed-effects models using S4 classes
      lmtest                  Testing Linear Regression Models
      lpSolve                 Interface to Lp_solve v. 5.5 to solve
                              linear/integer programs
      mapdata                 Extra Map Databases
      mapproj                 Map Projections
      maps                    Draw Geographical Maps
      MatchIt                 MatchIt: Nonparametric Preprocessing for
                              Parametric Casual Inference
      Matrix                  Sparse and Dense Matrix Classes and Methods
      MCMCpack                Markov chain Monte Carlo (MCMC) Package
      misc3d                  Miscellaneous 3D Plots
      mnormt                  The multivariate normal and t distributions
      MNP                     R Package for Fitting the Multinomial Probit
                              Model
      multcomp                Simultaneous Inference in General Parametric
                              Models
      mvtnorm                 Multivariate Normal and t Distributions
      nws                     R functions for NetWorkSpaces and Sleigh
      polspline               Polynomial spline routines
      pscl                    Political Science Computational Laboratory,
                              Stanford University
      psy                     Various procedures used in psychometry
      qtl                     Tools for analyzing QTL experiments
      quadprog                Functions to solve Quadratic Programming
                              Problems.
      qvalue                  Q-value estimation for false discovery rate
                              control
      Rcmdr                   R Commander
      RColorBrewer            ColorBrewer palettes
      Rcpp                    Rcpp R/C++ interface package
      relimp                  Relative Contribution of Effects in a
                              Regression Model
      rggobi                  Interface between R and GGobi
      rgl                     3D visualization device system (OpenGL)
      Rglpk                   R/GNU Linear Programming Kit Interface
      RGtk2                   R bindings for Gtk 2.8.0 and above
      Rmetrics                Rmetrics - Financial Engineering and
                              Computational Finance
      Rmpi                    Interface (Wrapper) to MPI (Message-Passing
                              Interface)
      RMySQL                  R interface to the MySQL database
      robustbase              Basic Robust Statistics
      ROCR                    Visualizing the performance of scoring
                              classifiers.
      RODBC                   ODBC Database Access
      rpvm                    R interface to PVM (Parallel Virtual Machine)
      RQuantLib               R interface to the QuantLib library
      Rserve                  Binary R server
      rsprng                  R interface to SPRNG (Scalable Parallel Random
                              Number Generators)
      RUnit                   R Unit test framework
      sandwich                Robust Covariance Matrix Estimators
      sm                      Smoothing methods for nonparametric regression
                              and density estimation
      sn                      The skew-normal and skew-t distributions
      snow                    Simple Network of Workstations
      strucchange             Testing, Monitoring and Dating Structural
                              Changes
      timeDate                Rmetrics - Chronological and Calendarical
                              Objects
      timeSeries              Rmetrics - Financial Time Series Objects
      tkrplot                 TK Rplot
      tseries                 Time series analysis and computational finance
      urca                    Unit root and cointegration tests for time
                              series data
      VGAM                    Vector Generalized Linear and Additive Models
      XML                     Tools for parsing and generating XML within R
                              and S-Plus.
      Zelig                   Everyone's Statistical Software
      zoo                     Z's ordered observations
      
      Packages in library '/usr/lib/R/library':
      
      base                    The R Base Package
      boot                    Bootstrap R (S-Plus) Functions (Canty)
      class                   Functions for Classification
      cluster                 Cluster Analysis Extended Rousseeuw et al.
      codetools               Code Analysis Tools for R
      datasets                The R Datasets Package
      foreign                 Read Data Stored by Minitab, S, SAS, SPSS,
                              Stata, Systat, dBase, ...
      graphics                The R Graphics Package
      grDevices               The R Graphics Devices and Support for Colours
                              and Fonts
      grid                    The Grid Graphics Package
      KernSmooth              Functions for kernel smoothing for Wand & Jones
                              (1995)
      lattice                 Lattice Graphics
      MASS                    Main Package of Venables and Ripley's MASS
      methods                 Formal Methods and Classes
      mgcv                    GAMs with GCV smoothness estimation and GAMMs
                              by REML/PQL
      nlme                    Linear and Nonlinear Mixed Effects Models
      nnet                    Feed-forward Neural Networks and Multinomial
                              Log-Linear Models
      rpart                   Recursive Partitioning
      spatial                 Functions for Kriging and Point Pattern
                              Analysis
      splines                 Regression Spline Functions and Classes
      stats                   The R Stats Package
      stats4                  Statistical Functions using S4 Classes
      survival                Survival analysis, including penalised
                              likelihood.
      tcltk                   Tcl/Tk Interface
      tools                   Tools for Package Development
      utils                   The R Utils Package
      
  • 額外加裝 R ape 套件 - 參考步驟 (nlme, lattice 均有新版)
    # apt-get install libc6-dev gfortran liblapack-dev
    # wget http://cran.r-project.org/src/contrib/gee_4.13-13.tar.gz
    # R CMD INSTALL gee_4.13-13.tar.gz
    # wget http://cran.r-project.org/src/contrib/nlme_3.1-91.tar.gz
    # R CMD INSTALL nlme_3.1-91.tar.gz
    # wget http://cran.r-project.org/src/contrib/lattice_0.17-25.tar.gz
    # R CMD INSTALL lattice_0.17-25.tar.gz
    # wget http://cran.r-project.org/src/contrib/ape_2.3.tar.gz
    # R CMD INSTALL ape_2.3.tar.gz
    
  • 加裝 Intel C++ Compiler for Linux - 先註冊要序號,然後下載 IA-32 與 IA-64 的版本。這次裝的 Ubuntu 9.04 是用 i686 32 位元版本,因此這次先裝 IA-32 版本。
    • [備忘] 安裝前建議先裝 libstdc++5 的套件,否則會有找不到 libstdc++.so.5 的訊息。
      # apt-get install libstdc++5
      
  • 測試讓 Lenny 產生內含 bnx2-06-4.0.5.fw 的 DRBL initrd.pxe 核心。
    • 手動修改 initrd-pxe.2.6.26-2-amd64.img
      # cd /tftpboot/nbi_img
      /tftpboot/nbi_img# mv initrd-pxe.2.6.26-2-amd64.img initrd-pxe.2.6.26-2-amd64.img.gz
      /tftpboot/nbi_img# gunzip initrd-pxe.2.6.26-2-amd64.img.gz
      /tftpboot/nbi_img# mkdir temp
      /tftpboot/nbi_img# cd temp
      /tftpboot/nbi_img/temp# cpio -i < ../initrd-pxe.2.6.26-2-amd64.img
      /tftpboot/nbi_img/temp# mkdir lib/firmware
      /tftpboot/nbi_img/temp# cp /lib/firmware/* lib/firmware/
      /tftpboot/nbi_img/temp# find . | cpio -H newc -o | gzip -9 > ../initrd-pxe.2.6.26-2-amd64.img
      
    • [參考] 修改 initrd 之後,發生錯誤
      cpio 有很多種格式,用來開機的要用 cpio -H newc -o,必須用 newc 格式才可以正常開機
      

Virtualization

Mobile Computing

  • 同步機制一直是行動裝置一個極為關鍵的需求,無論是否採用雲端運算,大家還是希望可以自己保有自己的私人資料在行動裝置上。最近 Synthesis AG 釋出開放原始碼的 libsynthesis 可以讓開發者在 Linux 平台上撰寫自己的 SyncML-DS (SyncML Data Sync) 應用程式。還在 Moblin 的 Git 上維護了一份原始碼。-- 相關新聞

生活常識

2009-05-20

  • [專案] 陽明生物資訊計算叢集設定
    • 狀況:由於作業系統是在硬體 RAID 啟動狀態下安裝的,因此每當重開,系統又會回歸到原始狀態,故需要重新安裝。
    • 安裝 pre-built lustre package - http://www.pdsi-scidac.org/repository/debian/
      bio:~# echo "deb http://www.pdsi-scidac.org/repository/debian testing main" > /etc/apt/sources.list.d/lustre.list
      bio:~# apt-get update
      bio:~# apt-get install pdsi-scidac-keyring
      bio:~# apt-get install linux-image-2.6.22.19-lustre-686 lustre-modules-2.6.22.19-lustre-686 lustre-utils 
      
    • 安裝 firmware-bnx2
      bio:~# apt-get install firmware-bnx2
      
    • 解析 firmware-bnx2 安裝前與安裝後的 initrd.img 差異
      bio:~$ mkdir -p temp temp2
      bio:~$ cd temp
      bio:~/temp$ cat /boot/initrd.img-2.6.22.19-lustre-686.bak | gunzip | cpio -i
      27903 block
      bio:~/temp$ cd ../temp2
      bio:~/temp2$ cat /boot/initrd.img-2.6.22.19-lustre-686 | gunzip | cpio -i
      28313 blockss
      bio:~/temp2$ cd ..
      bio:~$ diff -r temp temp2
      只在 temp2/lib 存在:firmware
      只在 temp2/lib/udev 存在:firmware.agent
      bio:~$ ls temp2/lib/firmware/
      bnx2-06-4.0.5.fw  bnx2-09-4.0.5.fw
      bio:~$ cat temp2/lib/udev/firmware.agent 
      
      #!/bin/sh -e
      #
      # firmware loader agent
      #
      
      cd /lib/udev/
      . ./hotplug.functions
      
      if [ ! -e /sys/$DEVPATH/loading ]; then
          mesg "/sys/$DEVPATH/ does not exist"
          exit 1
      fi
      
      for DIR in $FIRMWARE_DIRS; do
          [ -e "$DIR/$FIRMWARE" ] || continue
          echo 1 > /sys/$DEVPATH/loading
          cat "$DIR/$FIRMWARE" > /sys/$DEVPATH/data
          echo 0 > /sys/$DEVPATH/loading
          exit 0
      done
      
      # the firmware was not found
      echo -1 > /sys/$DEVPATH/loading
      
      debug_mesg "Cannot find the $FIRMWARE firmware"
      exit 1
      
    • 其中 firmware.agent 是屬於 udev 套件
      bio:~$ dpkg -S firmware.agent
      udev: /lib/udev/firmware.agent
      
    • 手工打造支援 firmware-bnx 的 initrd-pxe.2.6.22.19-lustre-686.img
      • 首先要先瞭解 drblsrv-offline 所產生的 initrd-pxe.2.6.22.19-lustre-686.img 與系統產生的 initrd.img-2.6.22.19-lustre-686 有何差別
        bio:~$ uname -a
        Linux bio 2.6.22.19-lustre-686 #2 SMP Tue Aug 26 00:01:59 UTC 2008 i686 GNU/Linux
        bio:~$ sudo /opt/drbl/sbin/drblsrv-offline -s `uname -r`
        bio:~$ mkdir -p temp temp2
        bio:~$ cd temp
        bio:~/temp$ cat /boot/initrd.img-2.6.22.19-lustre-686 | gunzip | cpio -i
        bio:~/temp$ cd ..
        bio:~$ cd temp2/
        bio:~/temp2$ cat /tftpboot/nbi_img/initrd-pxe.2.6.22.19-lustre-686.img | gunzip | sudo cpio -i
        
      • 光是從 diff -r temp temp2 的結果來看,兩者的差異很大。而 firmware.agent 在系統產生的 initrd.img 中,是透過 udev 的 rules 被執行的。
        bio:~/temp$ grep firmware.agent * -r --color
        etc/udev/rules.d/80-drivers.rules:SUBSYSTEM=="firmware",				RUN+="firmware.agent"
        
      • 從以上資訊,大致上可以猜出為什麼使用 DRBL 產生的 initrd-pxe.img 會無法取得 firmware,因為 bnx2 這個核心模組並不會自動去檔案系統裡去找 /lib/firmware 裡有沒有需要的檔案。而是透過 udev 去執行 firmware.agent 把 /lib/firmware 裡的檔案塞到 /sys/$DEVPATH/data 去。因此如果要讓 initrd-pxe.img 也支援這樣的機制,有兩種作法,第一種 initrd-pxe.img 全面改用 udev,第二種是自己補拷貝 /sys/$DEVPATH/data 那一段。
      • 附帶值得一提的是我在 Debian Lenny 的 2.6.26-2-amd64 核心模組上看到 firmware-class 這個奇特的模組。看樣子 Linux 核心對於這些非公開的韌體處理方式目前仍處於混亂的局面。
        jazz@hadoop:~$ lsb_release -a
        No LSB modules are available.
        Distributor ID:	Debian
        Description:	Debian GNU/Linux 5.0.1 (lenny)
        Release:	5.0.1
        Codename:	lenny
        jazz@hadoop:~$ uname -a
        Linux hadoop 2.6.26-2-amd64 #1 SMP Fri Mar 27 04:02:59 UTC 2009 x86_64 GNU/Linux
        jazz@hadoop:~$ lsmod | grep bnx2
        bnx2                   63496  0 
        firmware_class         12544  1 bnx2
        jazz@hadoop:~$ sudo modinfo firmware_class
        [sudo] password for jazz: 
        filename:       /lib/modules/2.6.26-2-amd64/kernel/drivers/base/firmware_class.ko
        license:        GPL
        description:    Multi purpose firmware loading support
        author:         Manuel Estrada Sainz
        depends:        
        vermagic:       2.6.26-2-amd64 SMP mod_unload modversions
        
      • 關於 bnx2 到底怎麼知道自己需要的韌體檔案呢?? 答案藏在 modinfo 裡,有 firmware 的參數會紀錄相關資訊。
        jazz@hadoop:~$ sudo modinfo bnx2
        filename:       /lib/modules/2.6.26-2-amd64/kernel/drivers/net/bnx2.ko
        firmware:       bnx2-09-4.0.5.fw
        firmware:       bnx2-06-4.0.5.fw
        version:        1.7.5
        license:        GPL
        description:    Broadcom NetXtreme II BCM5706/5708 Driver
        author:         Michael Chan <mchan@broadcom.com>
        srcversion:     AA4F7411285F32C5C55775A
        alias:          pci:v000014E4d0000163Asv*sd*bc*sc*i*
        alias:          pci:v000014E4d00001639sv*sd*bc*sc*i*
        alias:          pci:v000014E4d000016ACsv*sd*bc*sc*i*
        alias:          pci:v000014E4d000016AAsv*sd*bc*sc*i*
        alias:          pci:v000014E4d000016AAsv0000103Csd00003102bc*sc*i*
        alias:          pci:v000014E4d0000164Csv*sd*bc*sc*i*
        alias:          pci:v000014E4d0000164Asv*sd*bc*sc*i*
        alias:          pci:v000014E4d0000164Asv0000103Csd00003106bc*sc*i*
        alias:          pci:v000014E4d0000164Asv0000103Csd00003101bc*sc*i*
        depends:        firmware_class
        vermagic:       2.6.26-2-amd64 SMP mod_unload modversions 
        parm:           disable_msi:Disable Message Signaled Interrupt (MSI) (int)
        
    • [想法] 在 firemware.agent 裡加入 debug_msg 看執行的實際時機跟路徑,就可以瞭解它是怎麼餵 firmware 檔案給 bnx2 模組。
    • [機制] 要追蹤核心開機資訊,可以查 /var/log/kern.log 。先決條件是有打開 rsyslogd
      • 修改前的 kern.log
        May 20 21:05:49 bio kernel: [    3.846723] Broadcom NetXtreme II Gigabit Ethernet Driver bnx2 v1.7.5 (April 29, 2008)
        May 20 21:05:49 bio kernel: [    3.846723] ACPI: PCI Interrupt 0000:39:02.0[A] -> GSI 18 (level, low) -> IRQ 18
        May 20 21:05:49 bio kernel: [    3.846723] firmware: requesting bnx2-06-4.0.5.fw
        May 20 21:05:49 bio kernel: [    4.054384] eth0: Broadcom NetXtreme II BCM5706 1000Base-T (A2) PCI-X 64-bit 100MHz found at mem e2000000, IRQ 18, node addr 00:1a:64:60:25:b2
        May 20 21:05:49 bio kernel: [    4.054384] sata_svw 0000:38:0e.0: version 2.3
        May 20 21:05:49 bio kernel: [    4.055558] ACPI: PCI Interrupt 0000:39:03.0[A] -> <6>ACPI: PCI Interrupt 0000:38:0e.0[A] -> GSI 10 (level, low) -> IRQ 10
        May 20 21:05:49 bio kernel: [    4.055558] GSI 17 (level, low) -> IRQ 17
        May 20 21:05:49 bio kernel: [    4.055558] firmware: requesting bnx2-06-4.0.5.fw
        
    • [改法] 在 firmware.agent 裡加進 DEBUG 資訊
      • firmware.agent

        old new  
        1212fi 
        1313 
        1414for DIR in $FIRMWARE_DIRS; do 
         15    mesg "[DEBUG] FIRMWARE_DIRS = $FIRMWARE_DIRS" 
        1516    [ -e "$DIR/$FIRMWARE" ] || continue 
         17    mesg "[DEBUG] firmware = $DIR/$FIRMWARE" 
         18    mesg "[DEBUG] echo 1 > /sys/$DEVPATH/loading" 
        1619    echo 1 > /sys/$DEVPATH/loading 
         20    mesg "[DEBUG] cat "$DIR/$FIRMWARE" > /sys/$DEVPATH/data" 
        1721    cat "$DIR/$FIRMWARE" > /sys/$DEVPATH/data 
         22    mesg "[DEBUG] echo 0 > /sys/$DEVPATH/loading" 
        1823    echo 0 > /sys/$DEVPATH/loading 
        1924    exit 0 
        2025done 
    • [結果] 耍寶了!! 2.6.22 的核心模組根本就不會要 firmware :(
      jazz@bio:~$ sudo modinfo bnx2
      [sudo] password for jazz: 
      filename:       /lib/modules/2.6.22.19-lustre-686/kernel/drivers/net/bnx2.ko
      version:        1.5.11
      license:        GPL
      description:    Broadcom NetXtreme II BCM5706/5708 Driver
      author:         Michael Chan <mchan@broadcom.com>
      srcversion:     31FD34F2725D1F250205072
      alias:          pci:v000014E4d0000163Asv*sd*bc*sc*i*
      alias:          pci:v000014E4d00001639sv*sd*bc*sc*i*
      alias:          pci:v000014E4d000016ACsv*sd*bc*sc*i*
      alias:          pci:v000014E4d000016AAsv*sd*bc*sc*i*
      alias:          pci:v000014E4d000016AAsv0000103Csd00003102bc*sc*i*
      alias:          pci:v000014E4d0000164Csv*sd*bc*sc*i*
      alias:          pci:v000014E4d0 000164Asv*sd*bc*sc*i*
      alias:          pci:v000014E4d0000164Asv0000103Csd00003106bc*sc*i*
      alias:          pci:v000014E4d0000164Asv0000103Csd00003101bc*sc*i*
      depends:        
      vermagic:       2.6.22.19-lustre-686 SMP mod_unload K7 
      parm:           disable_msi:Disable Message Signaled Interrupt (MSI) (int)
      
    • 測試 Lustre - 參考 3D 果蠅腦實驗叢集 Lustre 效能測試安裝紀錄(by rider/rock), GTD Cloud Lustre 的指令
      • 把 DRBL Server 當 MDT 與 MGS,並拿第二顆硬碟當 Metadata 存放的空間。
        bio:~$ sudo mkfs.lustre --fsname=bio --mdt --mgs /dev/sdb1
        bio:~$ sudo mkdir -p /mnt/mdt
        bio:~$ sudo mount -t lustre /dev/sdb1 /mnt/mdt/
        
      • 把 DRBL Client 當 OST,並把兩顆硬碟都貢獻出來當儲存空間。
        bio102:~$ sudo mkfs.lustre --fsname=bio --ost  --mgsnode=bio@tcp0 /dev/sda
        bio102:~$ sudo mkfs.lustre --fsname=bio --ost  --mgsnode=bio@tcp0 /dev/sdb
        bio103:~$ sudo mkfs.lustre --fsname=bio --ost  --mgsnode=bio@tcp0 /dev/sda
        bio103:~$ sudo mkfs.lustre --fsname=bio --ost  --mgsnode=bio@tcp0 /dev/sdb
        bio104:~$ sudo mkfs.lustre --fsname=bio --ost  --mgsnode=bio@tcp0 /dev/sda
        bio104:~$ sudo mkfs.lustre --fsname=bio --ost  --mgsnode=bio@tcp0 /dev/sdb
        bio105:~$ sudo mkfs.lustre --fsname=bio --ost  --mgsnode=bio@tcp0 /dev/sda
        bio105:~$ sudo mkfs.lustre --fsname=bio --ost  --mgsnode=bio@tcp0 /dev/sdb
        
        bio102:~$ sudo mkdir -p /mnt/ost/
        bio103:~$ sudo mkdir -p /mnt/ost/
        bio104:~$ sudo mkdir -p /mnt/ost/
        bio105:~$ sudo mkdir -p /mnt/ost/
        
        bio102:~$ sudo mount -t 
        
      • [狀況] 無法連上 MGS
        mount.lustre: mount /dev/sda at tcp:/datafs at /mnt/ost failed:  Input/output error
        Is the MGS running?
        
      • [原因] lnet 的網路設定錯誤(應該用 DRBL 對內的網路, 而非對外的網路)
        $ sudo lctl list_nids
        192.168.1.13@tcp0
        
      • [參考] http://lists.lustre.org/pipermail/lustre-discuss/2007-July/003647.html
      • [參考] Lustre 1.6 管理手冊 第二章 Understanding Lustre Networking
      • [參考] 文傑所使用的指令都是歸屬在 1.6 版以後才有的 Mount Configuration
      • [解法] 用 ip2nets 參數指定不同網段給不同 nids
        bio:~# modprobe lnet ip2nets="tcp0(eth0),tcp1(eth1) 192.168.1.13,192.168.129.1"
        bio:~# lctl
        lctl > network up
        lctl > list_nids
        192.168.1.13@tcp
        192.168.129.1@tcp1
        
      • [備忘] 停用 lnet 的方法
        # lctl network unconfigure
        # lctl modules | awk '{print $2}' | xargs rmmod ### 註: 必須停止 network 跟 lustre 才可以做這樣的動作
        

2009-05-21

Open Source

  • The Future Is BIOS and Browsers
    • 這個人的觀點道出年初我就覺得有兩個關鍵技術很重要,一個是 BIOS-based OS,也就是像放在 EeeBox 上的 SplashTop 或者 Phoenix HyperSpace,其二是 Mobile Browser,目前我是十分期待 Mobile Firefox - Fennc,這兩個技術將是『雲端運算(Cloud Computing)』與『行動運算(Mobile Computing)』的關鍵技術。
  • 部落格輔助教學 未來趨勢之一
    • 前年,我們希望將 motion, wordpress-mu, Red5 整合成 edublog,其實某種程度上就是希望把生態格網、視訊格網與部落格相結合,形成教學上所需的多人部落格環境。

Cloud Computing

jQuery

  • jQuery vs MooTools
    • 先前在看一些效能評比時,就已經有注意到 MooTools? 這一套 Javascript Framework 了。不過就如同這篇評比寫的,兩者最初設計的哲學不同,因此並無法取代對方,各有擅長之處。能夠善用各自的優點,才能好好駕馭這些工具。

Mobile Computing

職場技能

2009-05-22

  • [專案] 陽明生物資訊叢集設定
    • (1) 每個節點都需要載入核心模組 ldiskfs 與 lnet,作法是加入 /etc/modules。
      # /etc/modules: kernel modules to load at boot time.
      loop
      usbkb
      lustre
      ldiskfs
      lnet
      
    • (2) 幫 DRBL Server 設定 lnet 的網路參數,作法是在 /etc/modprobe.d/ 加上 lnet 的 options 參數
      bio:~# cat > /etc/modprobe.d/lnet  << EOF
      options lnet ip2nets="tcp(eth1) 192.168.129.1"
      EOF
      
    • (3) 幫 DRBL Client 設定 lnet 的網路參數
      bio02:~# echo "options lnet networks=tcp" > /etc/modprobe.d/lnet
      
    • (4) 確認每一台節點都已經載入 ldiskfs 與 lnet 核心模組
      ~# lsmod | grep ldiskfs
      ~# lsmod | grep lnet
      
    • (5) 確認 lnet 網路參數正確
      ~# lctl network up
      ~# lctl list_nids
      
    • (6) 在 DRBL Server 上啟動 MDT/MGS 節點
      bio:~# mkfs.lustre --reformat --fsname=bio --mdt --mgs /dev/sdb1
      bio:~# mkdir -p /mnt/mdt
      bio:~# mount -t lustre /dev/sdb1 /mnt/mdt
      
    • (7) 啟動 OST 節點
      bio102:~# mkfs.lustre --reformat --fsname=bio --ost --mgsnode=192.168.129.1@tcp /dev/sda
      bio102:~# mkfs.lustre --reformat --fsname=bio --ost --mgsnode=192.168.129.1@tcp /dev/sdb
      bio102:~# mkdir -p /mnt/ost
      bio102:~# mount -t lustre /dev/sda /mnt/ost/
      bio102:~# mount -t lustre /dev/sdb /mnt/ost/
      
  • cdpr - 一套可以拿來查 Cisco Switch 型號跟網路線接在哪一個埠(Port)的工具 - 有 debian 套件

Cloud Computing

Web Service

  • ECMAScript 5 Objects and Properties
    • Javascript 在網頁應用的重要性越來越高了,新的 ECMAScript 標準看起來對於物件導向的支援稍微更好了些,另外就是類似 Hash key-value 的一些功能。

生活/職場

2009-05-23

  • Pre-OGF26
    • 台北(TPE)-紐華克(EWR)

2009-05-24

  • Pre-OGF26
    • 紐華克(EWR)-洛利(RDU)

2009-05-25

  • Pre-OGF26
  • [專案] 安裝 MPICH2, Rmpi
    ~# wget http://www.mcs.anl.gov/research/projects/mpich2/downloads/tarballs/1.0.8p1/mpich2-1.0.8p1.tar.gz
    ~# tar zxvf mpich2-1.0.8p1.tar.gz
    ~# cd mpich2-1.0.8p1
    ~/mpich2-1.0.8p1# ./configure CFLAGS="-fPIC" CXXFLAGS="-fPIC" FFLAGS="-fPIC" prefix=/opt/mpich2
    ~/mpich2-1.0.8p1# make; make install
    
    ~# wget http://www.stats.uwo.ca/faculty/yu/Rmpi/download/linux/Rmpi_0.5-7.tar.gz
    ~# R CMD INSTALL Rmpi_0.5-7.tar.gz --configure-args=--with-mpi=/opt/mpich2
    

Open Source

Parallel Computing

Cloud Computing

Mobile Computing

Web Service

  • PHP 中 5 個常用的常數
    1. __LINE__   顯示程式文件中的該行程式行號。
    2. __FILE__   程式檔的完整路徑和檔案名,如果用在於include的外部檔案中,則返回被include的檔案名。
    3. __FUNCTION__ 執行的函數名稱,自 PHP 5 起本常數返回該函數被定義時的名字(區分大小寫)。
    4. __CLASS__   執行的類別名稱,自 PHP 5 起本常數返回該類被定義時的名字(區分大小寫)。
    5. __METHOD__  執行的類別方法名稱,返回該方法被定義時的名字(區分大小寫)。
    

職場技能 / Life

2009-05-26

  • OGF 26 Day 1

Cloud Computing

2009-05-27

Power / Battery

Web Service

職場技能

  • 10個提醒,讓你管理老闆更有效率!
  • 時間效率學:時間管理≠效率管理
    效率管理包含下述四種管理的藝術與技術:目標管理、時間管理、方法管理和心態管理。
    
    過於聰明的人,將密密麻麻行事曆的表面忙碌,視為個人的工作成就,實際上卻是一事無成;
    內斂老實的人,雖無法一鳴驚人,但持續穩定又踏實地努力工作一陣子後,卻會創造出讓人驚豔的工作成效。
    
  • 《FBI教你讀心術》眼睛不會說謊?腳才是!
    當情況良好時,我們會朝喜愛的一方──包括那些讓我們感覺美好的人──暴露出腹面。當情況不對時、關係有變化、或甚至討論的話題是我們不喜歡的,我們就會採取腹面抗拒──移動或偏身轉開。
    

2009-05-28

  • OGF26

Virtualization

Cloud Computing

2009-05-29

  • Post-OGF26

File System