2004-12-29

Blogger 創始人離開 Google

Blogger創始人離開Google
CNET新聞專區:Paul Festa  06/10/2004

Google證實,該公司網誌(blog)部門的創始人即將離職。

Evan Williams 1999年推出Pyra Labs,協助掀起一波網誌熱潮。以他的招牌作風,Williams透過網誌,把他即將自Google離職的消息公諸於世。

他在4日的聲明中寫道:「沒錯,我即將離開我的嬰兒(或者現在應該已長成青少年了?)。我受僱於Google的日子到周五(1日)為止。」

Google在2003年2月收購Pyra Labs時,接收了Blogger服務。當時,網誌已颳起一陣旋風,眾人熱烈討論網誌的發展潛力,例如能吸引死忠的網友不時回網站造訪,甚至可能有利可圖。

買下Blogger後,Google把加值服務改成不收費,並翻新該網站的門面。

當初收購Blogger完全以Google股票支付,而Google推出首次公開發行股票(IPO)後市值暴增,使得Google創辦人頓時成為億萬富豪,想必Williams如今也擁有足夠的錢,至少好一陣子可以不必工作。

他在網誌中寫道,雖然他覺得創辦新公司的點子不錯,但在再度創業之前,他想休息一段時間。

Williams接受訪問時表示,自從被Google收購以來,Blogger的規模至少已擴大為原先的兩倍,甚至是三倍。併入Google之前,Blogger擁有100萬名用戶。

離職前,Williams已預料到外人可能揣測他的離職象徵這起收購案失敗,因此預先消毒,否認自已對Google懷有任何不滿。

「離職純粹是我個人的決定,」Williams寫道:「他們甚至提議讓我在Google公司內部創立新的部門,如果我願意的話。總歸一句,我離職的理由不是別的,完全是個性使然。我一向堅持獨立自主性,即使未必對我最有利......假如我選擇要受雇於人,我會選擇為Google工作。只是那基本上與我的本性格格不入。」(唐慧文)


2004-12-21

C 語言,好用嗎?

翻譯整理:pigprince

在前不久舉行的一次關於計算機產業的發佈會上,Ken Thompson,Dennis Ritchie 和Brian Kernighan承認了由他們創建的Unix操作系統和C語言是來源於20年前的一個精心炮製的愚人節遊戲! Thompson是在不久以前在UnixWorld軟件開發論壇上說的這番話:

「在1969年,AT&T剛剛完成一個和GE還有Honeywell公司合作的項目--Multics,那時候我和Brian 也剛剛接觸一個由瑞士ETH實驗室的Nicklaus教授創建的PASCAL語言的一個早期版本,我們當時就對它的簡潔樸素和強大留下了深刻的印象。 Denis正好讀完了《Bored of the Rings》這本書,它實際上是《Lord of the Rings》三部曲的一個拙劣的模仿,只不過是為了玩,我們決定對Multics和PASCAL也進行一番模仿。我和Dennis負責操作環境,模仿 Multics來重新設計一個新系統,設計的宗旨是盡可能的使系統顯得神秘而複雜,讓使用者不斷地感到受挫,又重新起了一個名,叫作UNIX。然後 Dennis和Brian對一個叫作『A語言』的東西開展了一番工作,它實際上是對PASCAL語言的一個扭曲。當我們發現竟然有人嘗試用A語言開發真正的程序,我們馬上在A語言中又增加了一些更加含義模糊的東西,並把它升級為B語言,之後是BCPL,直到最後的C語言。在我們得到了以下的語法表達之後我們停止了,
for(;P("\n"),R=;P("|"))for(e=C;e=;P("_"+(*u++/8)%2))P("| "+(*u/4)%2);

現代的程序員們竟然會試著使用允許這樣的聲明的語言,這簡直超乎我們的想像。我們當時真的是想把這些東西賣給蘇聯,好讓他們的計算機科學水平倒退20年。你想像一下在AT&T和其它的美國公司開始試著使用Unix和C時我們的驚異。這使他們用了20年,只不過用在了使用建立在60年代的一個拙劣的技術模仿的基礎上的專門技術和一些應用。但是我們對Unix和C程序員堅韌不拔的精神也留下了深刻的印象,我和Brian還有Dennis則在這麼多年裡一直在Apple機上使用PASCAL語言,我們對這種混亂的結果感到了深深的負罪感,混亂和那些濫程序就是起源於在當時我們愚蠢的惡作劇!」
一些主要的Unix和C的廠商和用戶,包括AT&T、Microsoft、Hewlett-Packard、GTE、 NCR和DEC等等這一次拒絕對此發表見解,有一家PACAL和C語言開發工具的業界領先廠商(產品包括流行的Turbo Pascal,Turbo C和Turbo C++等) 聲明說他們實際上已經在多年以前就有一些察覺,並宣佈今後將繼續增強他們的PASCAL產品,並立刻暫停他們在C產品上的遠期投入;一個IBM公司發言人則對這件事大笑不止,以至於不得不推遲了一個關乎RS-6000的命運的新聞發佈會;而ETH學院的教授, PASCAL,Modula 2和Oberon結構語言的創建者Wirth教授只是說P. T. Barnum是正確的。
和這個事件相關的大抵可信的資料來源說明,不久將有一個相似的招供可能來自於William Gates,是關於MS-DOS和Windows操作環境,還有就是IBM的發言人開始否認虛擬機(VM)也是一個惡作劇式的拙劣的玩意兒。

2004-12-20

The C programming language

The C programming language: "Creators admit Unix & C hoax

In an announcement that has stunned the computer industry, Ken Thompson, Dennis Ritchie and Brian Kernighan admitted that the Unix operating system and C programming language created by them is an elaborate April Fools prank kept alive for over 20 years. Speaking at the recent UnixWorld Software Development Forum, Thompson revealed the following:

'In 1969, AT&T had just terminated their work with the GE/Honeywell/AT&T Multics project. Brian and I had just started working with an early release of Pascal from Professor Nichlaus Wirth's ETH labs in Switzerland and we were impressed with its elegant simplicity and power. Dennis had just finished reading 'Bored of the Rings', a hilarious National Lampoon parody of the great Tolkien 'Lord of the Rings' trilogy. As a lark, we decided to do parodies of the Multics environment and Pascal. Dennis and I were responsible for the operating environment. We looked at Multics and designed the new system to be as complex and cryptic as possible to maximize casual users' frustration levels, calling it Unix as a parody of Multics, as well as other more risqu? allusions. Then Dennis and Brian worked on a truly warped version of Pascal, called 'A'. When we found others were actually trying to create real programs with A, we quickly added additional cryptic features and evolved into B, BCPL and finally C.

We stopped when we got a clean compile on the following syntax:
for(;P('\n'),R--;P('|'))for(e=C;e--;P('_' (*u /8)%2))P('|' (*u/4) %2);

To think that modern programmers would try to use a language that allowed such a statement was beyond our comprehension! We actually thought of selling this to the Soviets to set their computer science progress back 20 or more years. Imagine our surprise when AT&T and other US corporations actually began trying to use Unix and C! It has taken them 20 years to develop enough expertise to generate even marginally useful applications using this 1960's technological parody, but we are impressed with the tenacity (if not common sense) of the general Unix and C programmer. In any event, Brian, Dennis and I have been working exclusively in Pascal on the Apple Macintosh for the past few years and feel really guilty about the chaos, confusion and truly bad programming that have resulted from our silly prank so long ago."

Major Unix and C vendors and customers, including AT&T, Microsoft, Hewlett-Packard, GTE, NCR, and DEC have refused comment at this time. Borland International, a leading vendor of Pascal and C tools, including the popular Turbo Pascal, Turbo C and Turbo C++, stated they had suspected this for a number of years and would continue to enhance their Pascal products and halt further efforts to develop C. An IBM spokesman broke into uncontrolled laughter and had to postpone a hastily convened news conference concerning the fate of the RS-6000, merely stating 'VM will be available Real Soon Now'. In a cryptic statement, Professor Wirth of the ETH institute and father of the Pascal, Modula 2 and Oberon structured languages, merely stated that P. T. Barnum was correct.

In a related late-breaking story, usually reliable sources are stating that a similar confession may be forthcoming from William Gates concerning the MS-DOS and Windows operating environments. And IBM spokesmen have begun denying that the Virtual Machine (VM) product is an internal prank gone awry.

[COMPUTERWORLD 1 May]
[contributed by Bernard L. Hayes]

2004-12-08

Linux FTP 的架設

鳥哥的Linux與ADSL的私房菜- 簡易 vsftpd 伺服器設定
(為了怕這個網頁將來不見,把部分文件拷貝如下)

以 Tarball 安裝
 
要以 Tarball 安裝,當然得先下載 Tarball 的檔案了!vsftpd 的官方網站下載點為:
ftp://vsftpd.beasts.org/users/cevans/
您可以自行找尋自己喜歡的版本來安裝。我這裡以 1.2.0 這一版來安裝 vsftpd 在我的 Mandrake 9.0 上面喔!(註:如果是 Red Hat 的系統,原本就有 vsftpd 了,所以使用 RPM 安裝比較好!至於其他沒有提供 vsftpd RPM 檔案的 distribution 就可以使用 Tarball 咯!)

  1. 下載與解壓縮:
    [root@test root]# wget > ftp://vsftpd.beasts.org/users/cevans/vsftpd-1.2.0.tar.gz
    [root@test root]# cd /usr/local/src
    [root@test root]# tar -zxvf /root/vsftpd-1.2.0.tar.gz
    [root@test root]# cd vsftpd-1.2.0/
    # 在這個目錄下有個 INSTALL 與 README 請務必察看喔!

  2.  
  3. 開始編譯與安裝
    # vsftpd 預設安裝的路徑為:
    # 所有可執行檔放置在 /usr/local/sbin 裡面;
    # man page 放置在 /usr/local/man/man5 與 /usr/local/man/man8
    # 若 super daemon 為 xinetd 時,會複製一份啟動檔案到 /etc/xinetd.d 去!
    [root@test vsftpd-1.2.0]# make
    # 編譯的過程可能有 warning 的訊息,只要不是 Error 就可以不理他!
    [root@test vsftpd-1.2.0]# make install
    [root@test vsftpd-1.2.0]# cp vsftpd.conf /etc
    # 將 PAM 身份認證模組給他放進去系統裡面!
    [root@test vsftpd-1.2.0]# cp RedHat/vsftpd.pam /etc/pam.d/vsftpd
    # 建立 ftp 這個使用者以及他的家目錄:
    # 若本來就存在 ftp 這個使用者,那就不需要進行新增!
    [root@test vsftpd-1.2.0]# useradd -M ftp -d /var/ftp
    [root@test vsftpd-1.2.0]# mkdir -p /var/ftp
    [root@test vsftpd-1.2.0]# chown root:root /var/ftp
    [root@test vsftpd-1.2.0]# chown 755 /var/ftp
    # 建立 vsftpd 需要的特殊目錄
    [root@test vsftpd-1.2.0]# mkdir -p /usr/share/empty

  4.  
  5. 如果需要移除時:
    # 如果想要移除 vsftp 時,可以這樣做
    [root@test vsftpd-1.2.0]# rm /usr/local/sbin/vsftpd
    [root@test vsftpd-1.2.0]# rm /usr/local/man/man5/vsftpd.conf.5
    [root@test vsftpd-1.2.0]# rm /usr/local/man/man8/vsftpd.8
    [root@test vsftpd-1.2.0]# rm /etc/xinetd.d/vsftpd
    [root@test vsftpd-1.2.0]# rm /etc/vsftpd.conf
    # 因為剛剛安裝只有安裝這幾個檔案而已說!所以啦, vsftpd 真的是挺安全的說!

  6.  
  7. 測試:
    # 先確認一下 xinetd.d 有沒有問題再說:
    [root@test root]# vi /etc/xinetd.d/vsftpd
    service ftp
    {
    socket_type = stream
    wait = no
    user = root
    server = /usr/local/sbin/vsftpd
    log_on_success += DURATION USERID
    log_on_failure += USERID
    nice = 10
    disable = no
    }
    [root@test root]# /etc/rc.d/init.d/xinetd restart
    [root@test root]# ftp localhost
    ftp localhost
    Connected to localhost.
    220 (vsFTPd 1.2.0)
    530 Please login with USER and PASS.
    530 Please login with USER and PASS.
    KERBEROS_V4 rejected as an authentication type
    Name (localhost:root): anonymous
    # 這樣就表示 vsftpd 已經可以正確的啟動了,不過因為我們還沒有設定好
    # /etc/vsftpd.conf ,所以會有無法登入的問題!沒關係,
    # 等一下設定好就 OK 了!

 
安裝的過程真的是很簡單,不過, vsftpd.conf 這個檔案放置的地點在 RPM 與 Tarball 則可能有點不一樣,需要給他特別留意呢!例如 Red Hat 9 預設放置在 /etc/vsftpd/vsftpd.conf ,而 Tarball 則預設放置在 /etc/vsftpd.conf 裡面說!

-------------------------------------------------------------------
最簡單的 vsftpd.conf 設定
 
如果您很懶的去設定 vsftpd 的話,那麼可以使用很簡單的設定值來規劃您的 FTP 伺服器。底下就是 Red Hat 9 的預設 vsftpd 的設定值,您可以使用這樣的設定值來啟動您的 FTP 伺服器即可。這樣的設定值有幾個用處:
 
任何在 /etc/vsftpd.ftpusers 裡面的使用者帳號均無法使用 vsftpd 喔!
開放 anonymous 與 實體用戶 登入 vsftpd ;
實體用戶登入主機時,可以跳至任何具有登入權限的目錄當中(沒有 chroot );
使用 port 20 作為主動連線時的 ftp-data 傳送埠口;
利用 /etc/hosts.allow(deny) 來管理登入權限;
當 Client 上傳/下載檔案時,該資訊會記錄在 /var/log/vsftpd.log 裡面;
其他的設定均已預設值來規範(如被動式 port number 等等)。
  [root@test root]# vi /etc/xinetd.d/vsftpd
service ftp
{
socket_type = stream
wait = no
user = root
server = /usr/local/sbin/vsftpd
server_args = /etc/vsftpd.conf
# 上面這個請依照您的主機環境來設定!尤其是 server_args 請設定您的
# vsftpd.conf 所在目錄的完整檔名(含目錄名稱)!
log_on_success += DURATION USERID
log_on_failure += USERID
nice = 10
disable = no
}
[root@test root]# vi /etc/vsftpd/vsftpd.conf # (或 /etc/vsftpd.conf)
# 關於主機與安全性的設定
use_localtime=YES
dirmessage_enable=YES
connect_from_port_20=YES
xferlog_enable=YES
xferlog_std_format=YES
pam_service_name=vsftpd
tcp_wrappers=YES
# 關於 anonymous 的設定
anonymous_enable=YES
# 關於 real user 的設定
local_enable=YES
write_enable=YES
local_umask=022
userlist_enable=YES
# 以上設定值的意義請往前翻到 vsftpd.conf 設定值的意義 章節去察看!
[root@test root]# /etc/rc.d/init.d/xinetd restart
 
這樣您的最簡易的 FTP 伺服器就已經設定完成了!簡單的很吧!而且還相當的安全呢!
 

-------------------------------------------------------------------
針對僅有開放實體用戶登入的設定
 
好了,這裡我們再使用其他的設定值來修正我們的 vsftpd.conf 這個設定檔。因為開放 anonymous 畢竟不太安全,所以我們將 anonymous 的登入權限關閉,並且僅讓 real user (實體用戶) 登入我們的 vsftpd 時,要如何設定呢?我的要求如下:
 
使用台灣本地的時間而不是 GMT 時間;
所有在 /etc/passwd 裡面出現的實體帳號均能登入 vsftpd 主機;
但是系統帳號 (如 root 等, UID 小於 500 的帳號)均不能使用 vsftpd ;
而且由於 badbird 與 nogoodbird 這兩個帳號使用者比較不乖,我要讓這兩個使用者被關在自己的家目錄當中(chroot);
並且限制資料的傳輸速度為 100 Kbytes/second;
當使用者進入 /home 這個目錄時,顯示:『一般使用者家目錄』的字樣在 Client 端的螢幕上;
使用者可以進行上傳、下載以及修改檔案等等動作。
  1. 基礎設定檔
    [root@test root]# vi /etc/vsftpd/vsftpd.conf (或 /etc/vsftpd.conf)
    # 關於主機與安全性的設定
    use_localtime=YES
    dirmessage_enable=YES
    xferlog_enable=YES
    connect_from_port_20=YES
    pam_service_name=vsftpd
    tcp_wrappers=YES
    # 關於 anonymous 的設定
    anonymous_enable=NO
    # 關於 Real User 的設定
    local_enable=YES
    write_enable=YES
    local_umask=022
    chroot_list_enable=YES
    chroot_list_file=/etc/vsftpd.chroot_list
    userlist_deny=YES
    userlist_file=/etc/vsftpd.user_list
    local_max_rate=100000
    # 以上設定值的意義請往前翻到 vsftpd.conf 設定值的意義 章節去察看!

  2.  
  3. 限制實體用戶在自己的家目錄內 (chroot) 的設定檔
    [root@test root]# vi /etc/vsftpd.chroot_list
    badbird
    nogoodbird
    # 沒有寫到這個檔案內的其他用戶,就可以離開自己的家目錄,
    # 而到其他目錄裡面去瀏覽了!

  4.  
  5. 以 PAM 模組限制某些帳號無法登入主機的設定:
    [root@test root]# vi /etc/pam.d/vsftpd
    # 會發現這樣的字句:
    auth ..... file=/etc/vsftpd.ftpusers ....
    # 那個 file=.. 後面接的檔名就是以 PAM 模組抵擋的帳號內容了!
    [root@test root]# vi /etc/vsftpd.ftpusers
    # 底下列出的帳號將無法使用 vsftpd 喔!與 wu ftp 的 /etc/ftpusers 相同功能
    root
    bin
    daemon
    adm
    lp
    sync
    shutdown
    halt
    mail
    news
    uucp
    operator
    games
    nobody

  6.  
  7. 以 userlist_file 抵擋某些帳號的登入:
    # 事實上,這個功能與上面的 PAM 功能相似啦!只是 PAM 是外掛的,而
    # 這個設定是 vsftpd 預設提供的就是了!
    [root@test root]# vi /etc/vsftpd.user_list
    # 這個檔案的設定與上面 /etc/vsftpd.ftpusers 相同即可!
    root
    bin
    daemon
    adm
    lp
    sync
    shutdown
    halt
    mail
    news
    uucp
    operator
    games
    nobody

  8.  
  9. 設定進入目錄時,顯示的訊息:
    [root@test root]# vi /home/.message
    一般使用者家目錄

  10.  
  11. 重新啟動 xinetd 囉!
    [root@test root]# /etc/rc.d/init.d/xinetd restart

 
上面的設定裡面有很多重複的地方,比方說 /etc/vsftpd.ftpusers 與 /etc/vsftpd.user_list 就是重複的設定了!不過,這樣是比較安全啦!因為 PAM 模組是外掛的程式,而另一個檔案則是 vsftpd 提供的功能!但是請特別留意,因為很多使用者可能會一不小心僅修改了其中一個檔案,另一個檔案則忘記修訂,會很麻煩喔! ^_^!至於也是重點之一的 /etc/vsftpd.chroot_list 就可以將使用者限制在他們自己的家目錄內了!設定上很容易吧!附帶說明,上面的檔名都與 vsftpd.conf 的設定有關!
 
看過了上面關於實體用戶的設定之後,咦!那麼如何讓 root 可以登入 vsftpd 主機呢?!呵呵!就是將 /etc/vsftpd.ftpusers 與 /etc/vsftpd.user_list 這兩個檔案裡面的 root 拿掉就可以啦!不過,本人可是不建議這麼搞的喔!



    DSP Lab 架站記錄 20041208

    前兩天在全新的 server 上,裝上 Fedoro core 2(暴力的把所有套件都裝進去),之後啟動了 Apache 和 Mysql。下載安裝了 PhpMyAdmin,測試 PHP 運作正常後,就把 Xoops2 架上去了。安裝過程裡 浪遊者之愛玩電腦 提供了不少幫助,不過,比起其他自由軟體的台灣官方網站,這個站似乎少了些安裝教學文件,不知道是不是因為站長出書的關係,這些撇步都放到書裡去賣了(開放軟體免費歸免費,知識還是要錢的啊)。不過好在還有 google 和許多前輩分享的經驗,還是暴力的把這個站架起來了。

    以下是一些碰到問題的 solution:

    • Xoops Mail 的設定:
      進入→ 系統管理員選單 → 系統管理 → 系統設定 → 郵件設定
      或是
      PHP 寄信:修改 php.ini 檔,SMTP = 我的ISP的SMTP
      sendmail_from = 我的mail


    • Xoops 轉頁會出現亂碼的問題
      在 /etc/httpd/conf/httpd.conf 裡
      加一句 AddDefaultCharset Off