2009/07/30

[Linux][Ubuntu] 再來一次, 9.04 的 madwifi

Ubuntu 9.04 新版釋出,我的 NB 還是不能好好的使用我的 atheros 無線網卡。所以要去抓 madwifi 的 code 回來重新處理:
svn co http://svn.madwifi-project.org/madwifi/trunk madwifi
cd madwifi
make
sudo make install


P.S 做這項動作,應該至少要有 build-essential 之類的相關套件才可以。

[Linux][Ubuntu] 登入 Windows Domain Server

在 Windows 上面, MIS 會用登入網域控制台的方式來控制底下的機器,或著甚至是這個身分認定來做檔案權限的控管﹑應用程式權限的控管之類的,所以如果沒有登入網域,就會有很多服務不能用。也因此半年前,我的 Ubuntu Linux 是被縮編到 virtualbox 底下,透過 nat/bridge 才連得上網路。

不過 likewise 的出現給了 Linux 上面的使用者一些登入網域使用服務的「希望」。
官方網址可以看這邊,目前是可以很順利的登入 domain server ,這樣就不會一天到晚被擋下來又唉唉叫。�唉

順道一提的是, likewise 需要 root 權限才能跑,所以安裝過後要用把 likewise-winbindd 的服務打開,有需要修改的時候,也是用 sudo likewise-open-gui 的方式去修改。
sudo aptitude install likewise-open-gui
likewise-winbindd
sudo /etc/init.d/likewise-open start
likewise-winbindd

2009/07/16

[Linux] 操作手冊的操作手冊

呃,說來諷刺,我們總是會叫某些新手在認識 linux 的第一步,就是要會自已看 man page ,看說明手冊。因為說明手冊上面總會留下很多可以使用這個指令的相關資訊,甚至有些還寫到了範例去,所以要熟悉一個指令,不能不先參考過它的 man page 。

man page 通常是這樣使用的:
man test
TEST(1) User Commands TEST(1)

NAME
test - check file types and compare values

SYNOPSIS
test EXPRESSION
test

[ EXPRESSION ]
[ ]
[ OPTION

DESCRIPTION
Exit with the status determined by EXPRESSION.

--help display this help and exit

--version
output version information and exit

但是,有時我們會在 man 後面再加上 -a ﹑ -2 -3 之類的數字,這些數字是什麼意思呢?
其實我們回到起初,就是一個很好玩的操作:「看操作手冊的操作手冊」
意即下:
man man
你就可以在「操作手冊的操作手冊裡」看到,這些數字所代表的意涵:
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conven‐
tions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]

2009/07/02

[Programming] Chrome 不合群 Javascript 不好寫。

話說 Google 大神出了自已的 Browser 的事情大家都知道,它的名字叫克隆美.. (是這樣唸嗎?)
好吧,還是用英文 chrome 好了。這個東西號稱可以跑得比 Firefox 跟 愛姨 快,不過相容性就沒有那麼好了。

這兩天在做多國語言的工作的時候才突然發現到,原來 chrome 在做 DOM createElement 如果是 script 的時候會出問題。不能動態新增 js 的片段。

意即:
var head = document.getElementsByTagName('head').item(0);
var script = document.createElement('script');
script.src = "a.js";
script.type = 'text/javascript';
head.insertBefore(script, head.childNodes[0]);

這段在 chrome 是沒有用的,但是在愛姨跟 Firefox 上面還是有用。(這樣就有 70% 的達成率了)

那?要新增 js 的片段怎麼辦?
用回最簡單的方式吧~
document.write

這個解法當然只有 60 分,勉強可以用啦。

[Windows] git-bash 底下的工具

因為工作轉到 Windows 平台上的關係,所以很多工具改到 Windows 上面運作,跟著在 TortoiseGit 底下使用 git-bash 來維護自己的專案原始碼。結果就是裝了前面提過的 auto-hotkey 使用熱鍵來提昇自己的平台操作速度; 但除了 hotkey...