jQuery vs MooTools

一篇 MooTools 開發者寫的文章,本來的標題是要比較 jQuery 和 MooTools 的不同,結果說著說著後半部都在解釋 Javascript 的 prototypal inheritance 跟 MooTools 的 Class 物件…

跟標題有關的內容,作者的立場是「jQuery 主要在加強開發者 handle DOM 的能力,MooTools 的目標則是在擴充 Javascript 程式語言本身。選對用途的話,兩個都是很棒的東西。你甚至可以兩個都用!」雖說是 MooTools 的作者之一,但這樣的評價算持平而且中肯。

我自己呢,也是從 MooTools 跳槽到 jQuery,所以兩個都算用過。倒是使用 MooTools 的時期,我對 Javascript 程式語言的了解沒有到那種程度,沒有感受到 MooTools 真正的威力… 也直到了看了 othree 借我的那本書和這篇文章,才有了完整的了解。

我想我以後會用 jQuery 寫網站程式,如果用到比較複雜的邏輯需要借重繼承關係的時候,再把 MooTools Core 的 function 一個一個複製進來用吧(還好 MooTools 可以拆XD)。

一句話做結:學海無涯

Install Ubuntu with access to GRUB only

在 BIOS 被鎖住、沒有光碟機也無法從 USB 開機的情況下安裝 Ubuntu Linux 的方法。

技術筆記,有需要再看。

The following method is what I work out when installing Ubuntu on a computer with following constraint:

  • BIOS is locked, so no booting from CD-ROM nor external USB drives, or
  • the CD-ROM drive itself is absent, and you don’t have a USB drive at hand.

Requirement:

  • Network access.
  • Target computer need to have GRUB already on board with access to it (It’s possible to install it from Windows/DOS but please have the files ready before you reboot.)
  • Access to boot partition (try recovery mode, i.e. append the word “single” after current kernel; if successful you can work directly from there)

In short, we would like to drop two files into the boot partition, and ask GRUB to boot it. After that the partition itself can be safely wipe out since files is used only in booting process.

Steps:

  1. Boot the machine
  2. Grab (wget) Miniual CD and Alternative Installer CD iso images
  3. Mount each of them, i.e. mount -o loop blah.iso /tmp/iso
  4. Copy /tmp/iso/initrd.gz from mini.iso to /boot/mini
  5. Copy /tmp/iso/installer/vmlinuz from alternative.iso to /boot/mini
  6. Reboot the machine, press Esc to enter grub boot menu.
  7. Press e to edit one of the entries
  8. Press e to edit the line begin with the word “kernel”. Change the kernel to /boot/mini/vmlinuz. Remove all kernel options.
  9. Press e to edit the line begin with the word “initrd”. Change the initrd image path to /boot/mini/initrd.gz
  10. Press b to boot.
  11. You should see Minimal Installer shows up. Minimal Installer will ask you what favor of Ubuntu you would like.

Why it works?

  • We need GRUB because BIOS is locked.
  • We need vmlinuz kernel from alternative installer because GRUB cannot access iso directly and minimal iso image doesn’t comes with a kernel.
  • We need initrd.gz from minimal installer because the alternative installer one checks existance of alternative installer CD-ROM (and data integrity of it)

On the security aspect, if you don’t want people tempering with your Linux box, lock BIOS, lock GRUB boot list, remove pre-installed single user boot menu entries, and attach an actual lock on the machine case. But then you are solely responsible to remember all the passwords you have set; no one can save you (without breaking anything) if you forget the password.

That’s all. Have fun with it.

Stellarium 0.10.1 與其他

Stellarium 出 0.10.1 了!這次把 0.10.0 beta 版的一堆 bug 修好,另外加上了很重要的兩個功能:

  • 全新的腳本 (script) 語言引擎,自動化控制 Stellarium 秀星空。
  • 單鍵自動下載安裝額外星表,快速將程式升級成最多兩億顆星星的星圖程式(當然,電腦的記憶體要足夠,但是已經有改善了。)

中文增強包的部份,剛剛也把對應的版本放上去了,版號設為 0.1.7。

來 review 一下這篇文章寫的事情後來做了多少:

  • 第一項:無效了,因為新功能。
  • 第二項:有輾轉聯絡到鹿林天文台林宏欽台長(感謝陳文屏老師),他很慷慨的把他以前做過的地景給了我,並囑咐非商業用途可以自由應用。全景是用首頁有貼的那些全景做的,所以沒有地平面以下的資訊。我有空會再放上來。
  • 第六項:業餘天文研討會我有去亂入一下,滿有趣的呢說。

就這樣囉,enjoy 閃亮亮的 Stellarium 新版吧~