2007年8月29日 星期三

一封關於考LPIC level1的信

政達兄,你好!
很高興自己的文件對你有所幫助。
對於考LPIC,我個人也還在努力當中,
剛過101,準備衝102。

以我考101的心得,覺得如果你可以把模擬試考到80,90的話,
那麼你的實力應該是沒什麼問題的。
但是坦白說,101用背多分的方式還可以,
而102就應該在實務上多練習,那麼你的應考能力才會有提昇!

至於你的問題,我認為答案是usbmgr和hotplug這兩個。
不知道問題有無描述說是單選還是複選?
因為linux 核心到2.6之後,usb的支援相當高了,
很少要user自行偵測!不過2.4就要傷腦筋了。
而我在硬體方面不太行,也許答案不是很正確。

對了,順道提一下我的考試論點!
因為LPIC是資格考,70%以上就及格了。
所以如果有某部份你覺得自己很弱!
不妨以背考古題的方式應對。
當然,能貫通搞懂是最好,
但LPIC範圍算是很廣,很難全面搞懂到精通。

像我考101時,就覺得硬體方面要放棄了!
因為我現在用來練習的ubuntu,
根本很多之前考過的設定和指令都不再沿用了。
但還好檔案權限、基本指令、管線重導等部份,
觀念够強,可以來補弱的部份。

考試嘛!有時還是要用經濟的觀點,有所取捨的!

最後祝你考試順利!
我們共同勉勵囉!

bullock 2007/08/30




在 2007/8/29,y_cdlu@tsmc.com 撰寫:
>
> Dear 大大:
>
> 之前有在網路上看到你的部落格發表的一些題目非常有用
> 我最近想考lpic level1
> 有去巨匠補完習,也把鳥哥的私房菜讀過二次
> 做testing測驗近10幾次...現在有8成可以pass
> 請問還有什麼建議對去考level 1呢?
>
> 另有一題詢問
> which of the following programs could be used to load necessary modules
> when the system detects a newly connected USB-device?
> a.usb-plug
> b.hotplug
> c.usb-dyn
> d.usbmgr
> e.usbmanager
>
> 謝謝 ^^
>
> Leo Lu(Cheng-Da Lu 呂政達)
> Fab6 Manufacturing Information Technology Department
> Taiwan Semiconductor Manufacturing Company, Ltd.
> 1,Nan-Ke North Rd., Tainan Science Park Tainan, Taiwan 741-44, R.O.C
> Tel: 886-6-5052000 #8459
>
>

2007年8月25日 星期六

用ubuntu玩魔獸世界

http://metamuse.blogspot.com/2007/04/ubuntu-704-wow-world-of-warcraft.html

之前有玩魔獸世界,但把作業系統換成ubuntu之後,就從魔獸世界消失了一陣子。
自從看到這篇文章之後,我才重拾在艾澤拉斯的冒險。哈哈哈

linux無所不能啊!

實作一次後,也對wine的運行有一點概念。
也許我有不少遊戲可以再拿出回味了!
不過wine跑IE似乎不對勁,雖然IE4linux這個東東,有時還不錯用。

2007年8月24日 星期五

《Tux福音》繁中譯文

原簡體中文,我把它整理成繁體中文。
原簡體中文作者:劉安轍 Angelo's blog

Gospel of Tux unearthed

《Tux福音》出土

Every generation has a mythology. Every millenium has a doomsday cult. Every legend gets the distortion knob wound up until the speaker melts. Archeologists at the University of Helsinki today uncovered what could be the earliest known writings from the Cult of Tux, a fanatical religious sect that flourished during the early Silicon Age, around the dawn of the third millenium AD...

每一代都有神話。 每千年都有邪教。每個傳說都會遭受扭曲直到傳講人逐漸消逝。
今天考古學家在赫爾辛基大學發現了可能是源自Tux信徒的最早文獻。
那個曾經在第三個千年初的硅時代鼎盛一時的教派……

譯註:
1.文中的專用名詞均以加粗字體標註。
2. doomsday cult,經常在一些以末世崇拜為主體的教派中出現,我譯為邪教。
明顯這個詞在下文有所指。


The Gospel of Tux (v1.0)
《Tux福音》(1.0版)
In the beginning Turing created the Machine.

初,圖靈創造了機器。

And the Machine was crufty and bodacious, existing in theory only. And von Neumann looked upon the Machine, and saw that it was crufty. He divided the Machine into two Abstractions, the Data and the Code, and yet the two were one Architecture. This is a great Mystery, and the beginning of wisdom.

而這些混沌自負的機器只存在於理論中。 馮·諾依曼注視著機器,洞察了它的混沌。
將他們抽離為數據和代碼兩部分,卻使其仍並行在同一結構下。這是真理,智慧的發祥。

譯註:
1.Mystery,《聖經》中指上帝創造的真理。


And von Neumann spoke unto the Architecture, and blessed it, saying, "Go forth and replicate, freely exchanging data and code, and bring forth all manner of devices unto the earth." And it was so, and it was cool. The Architecture prospered and was implemented in hardware and software. And it brought forth many Systems unto the earth.

馮·諾依曼驅動輪椅來到結構面前,施以祝福:“前進!去複制。自由交換數據和代碼,將形形色色的設備帶個世人。”如此,很酷。
結構在軟硬件中皆尊崇契約,他道路亨通,將許多系統帶給世人。

譯註:
1.馮·諾依曼的最後工作是在輪椅上完成的,所以用spoke一詞。
2. prospered:《聖經》中指在上帝的指引下,事有所成。中文常作“道路亨通”



The first Systems were mighty giants; many great works of renown did they accomplish. Among them were Colossus, the codebreaker; ENIAC, the targeter; EDSAC and MULTIVAC and all manner of froody creatures ending in AC, the experimenters; and SAGE, the defender of the sky and father of all networks. These were the mighty giants of old, the first children of Turing, and their works are written in the Books of the Ancients. This was the First Age, the age of Lore.

第一代系統都是巨人,業績彪炳。其中包括“譯碼者”Colossus;“砲手”ENIAC;EDSAC和MULTIVAC。
“實驗者”AC、“天盾”“网絡之父”SAGE則成為了這些偉大事物的最後一代。
這些威猛的古代巨人,是圖靈的第一批孩子。他們的事蹟被記錄在《聖經》的《先民》中。
這就是第一個時代,教誨的時代。

譯註:
1.文中早期計算機的別稱都來自其用途。
2.Lore:指在上帝或先民的教誨下獲得的知識。



Now the sons of Marketing looked upon the children of Turing, and saw that they were swift of mind and terse of name and had many great and baleful attributes. And they said unto themselves, "Let us go now and make us Corporations, to bind the Systems to our own use that they may bring us great fortune." With sweet words did they lure their customers, and with many chains did they bind the Systems, to fashion them after their own image. And the sons of Marketing fashioned themselves Suits to wear, the better to lure their customers, and wrote grave and perilous Licenses, the better to bind the Systems. And the sons of Marketing thus became known as Suits, despising and being despised by the true Engineers, the children of von Neumann.

行銷之子們在圖靈孩子的身上發現了敏捷的思維,樸素的名稱。 當然還有那些崇高卻危害到他們的品格。
“我們成立自家的公司吧,虜獲系統,榨取財富。”
他們一邊用甜言蜜語誘導消費者,一邊妄自修改被他們捆綁起來的系統。
為了讓消費者無法自拔,他們推出套裝;為了令系統身陷囹圄,他們寫下險惡的許可協議。
欺世盜名的行銷之子對程序員投諸輕蔑的目光。 當然,身為馮·諾依曼的孩子,程序員也未曾將他們放在眼裡。


And the Systems and their Corporations replicated and grew numerous upon the earth. In those days there were IBM and Digital, Burroughs and Honeywell, Unisys and Rand, and many others. And they each kept to their own System, hardware and software, and did not interchange, for their Licences forbade it. This was the Second Age, the age of Mainframes.

這些系統和他們所在的公司充斥世道。 那時有IBM和Digital,Burroughs和Honeywell,Unisys和Rand等等。
無論軟件還是硬件都自成一派,並且用許可協議加以控制,阻擾相互之間的連通。
這,便是第二個時代,大型機的時代。


Now it came to pass that the spirits of Turing and von Neumann looked upon the earth and were displeased. The Systems and their Corporations had grown large and bulky, and Suits ruled over true Engineers. And the Customers groaned and cried loudly unto heaven, saying, "Oh that there would be created a System mighty in power, yet small in size, able to reach into the very home!" And the Engineers groaned and cried likewise, saying, "Oh, that a deliverer would arise to grant us freedom from these oppressing Suits and their grave and perilous Licences, and send us a System of our own, that we may hack therein!" And the spirits of Turing and von Neumann heard the cries and were moved, and said unto each other, "Let us go down and fabricate a Breakthrough, that these cries may be stilled."

圖靈和馮·諾依曼的聖靈失望地審視過往。 系統和他們的公司變得碩大無朋,套裝軟件支配著真正的程序員。
消費者籲通天際:“創造一台體積小巧卻功能強大的系統吧!讓它走入千家萬戶。”
程序員同樣哭訴:“望有賢者,從套裝和險惡的協議中拯救我們,並賜予自主系統,我們必當致力於斯!”
圖靈和馮·諾依曼的聖靈被這些哭喊觸動,不約而同地說道:“我們下界去創造突破,平息世人的怨訴。”


And that day the spirits of Turing and von Neumann spake unto Moore of Intel, granting him insight and wisdom to understand the future. And Moore was with chip, and he brought forth the chip and named it 4004. And Moore did bless the Chip, saying, "Thou art a Breakthrough; with my own Corporation have I fabricated thee. Though thou art yet as small as a dust mote, yet shall thou grow and replicate unto the size of a mountain, and conquer all before thee. This blessing I give unto thee: every eighteen months shall thou double in capacity, until the end of the age." This is Moore's Law, which endures unto this day.

一日,Intel的摩爾被圖靈和馮·諾依曼的聖靈賜予洞見未來的賢能。隨即創造了4004芯片。
摩爾祝福道:“汝當與賜爾生命之公司同道,實現突破。此刻你細如微塵,他日終將累土成山,傾覆過往。
每十八個月你的產量將會翻番,這就是我對你的祝福。”這也是延續至今的摩爾定律。




And the birth of 4004 was the beginning of the Third Age, the age of Microchips. And as the Mainframes and their Systems and Corporations had flourished, so did the Microchips and their Systems and Corporations. And their lineage was on this wise:

4004的誕生,標誌著第三個時代——微芯片時代的到來。
它的系統和公司會創造如同大型機的繁榮。其家世:


Moore begat Intel. Intel begat Mostech, Zilog and Atari. Mostech begat 6502, and Zilog begat Z80. Intel also begat 8800, who begat Altair; and 8086, mother of all PCs. 6502 begat Commodore, who begat PET and 64; and Apple, who begat 2. (Apple is the great Mystery, the Fruit that was devoured, yet bloomed again.) Atari begat 800 and 1200, masters of the game, who were destroyed by Sega and Nintendo. Xerox begat PARC. Commodore and PARC begat Amiga, creator of fine arts; Apple and PARC begat Lisa, who begat Macintosh, who begat iMac. Atari and PARC begat ST, the music maker, who died and was no more. Z80 begat Sinclair the dwarf, TRS-80 and CP/M, who begat many machines, but soon passed from this world. Altair, Apple and Commodore together begat Microsoft, the Great Darkness which is called Abomination, Destroyer of the Earth, the Gates of Hell.

Moore創造了Intel.。Intel創造了Mostech, Zilog和Atari。 Mostech創造了6502,而Zilog創造了Z80。
Intel同樣創造了8800——Altair之父;以及8086——所有PC之母。
6502創造了Commodore——PET和64之父;以及Apple——(Apple)2之父.
(Apple是個真理,另一方面它也是一個貪婪的水果) Atari創造了800和1200——最終被Sega和Nintendo擊垮的遊戲的先師。
Xerox創造了PARC.。 Commodore和PARC創造了Amiga ——美術的創造者;
Apple和PARC創造了Lisa——Macintosh和iMac之父. Atari和PARC創造了已然逝去的音樂製造者ST;
Z80創造了小巧的Sinclair ,TRS-80和CP/M,他們繼而創造了很多機器。 但是很快這個時代就結束了。
Altair,Apple和Commodore共同創造了Microsoft這個可憎的無盡黑暗,滅世者,地獄之門。

譯註:
1. begat,除了創造還有……之父的意思,這裡並非真的創造,而是強調傳承脈絡。
2. Abomination,《聖經》可憎之物的通稱,包括倉鼠、豬等等。
3. Gates,門,同樣是比爾·蓋茨的姓氏。



Now it came to pass in the Age of Microchips that IBM, the greatest of the Mainframe Corporations, looked upon the young Microchip Systems and was greatly vexed. And in their vexation and wrath they smote the earth and created the IBM PC. The PC was without sound and colour, crufty and bogacious in great measure, and its likeness was a tramp, yet the Customers were greatly moved and did purchase the PC in great numbers. And IBM sought about for an Operating System Provider, for in their haste they had not created one, nor had they forged a suitably grave and perilous License, saying, "First we will build the market, then we will create a new System, one in our own image, and bound by our Licence." But they reasoned thus out of pride and not wisdom, not for seeing the wrath which was to come.

大型機和IBM的時代結束了,這些公司對年青微系統怒目而視。為了還以顏色他們創造了IBM PC。
這個笨重的傢伙沒有聲音和色彩,混沌而自負。 儘管如此,還是有很多消費者購買。
IBM在尋找一個操作系統供應商,出於倉卒他們來不及自主開發一個,但這卻不妨礙他們制定險惡的協議:
“首先,我們會控制市場。然後再在自家的協議下創造一個想要的系統。”
這不智的決定當然不是因為吸取了教訓,而是出於自大。

譯註:
1. for seeing,原文為forseeing,應為筆誤。


And IBM came unto Microsoft, who licensed unto them QDOS, the child of CP/M and 8086. (8086 was the daughter of Intel, the child of Moore). And QDOS grew, and was named MS-DOS. And MS-DOS and the PC together waxed mighty, and conquered all markets, replicating and taking possession thereof, in accordance with Moore's Law. And Intel grew terrible and devoured all her children, such that no chip could stand before her. And Microsoft grew proud and devoured IBM, and this was a great marvel in the land. All these things are written in the Books of the Deeds of Microsoft.

IBM找到了微軟,拿到CP/M和8086(8086是Intel之女,摩爾的孩子)之子——QDOS的授權。隨後他被命名為MS-DOS,並與PC一同征服了市場。
然而他們無論複製還是統轄市場,依舊遵循著摩爾定律。
Intel變得同樣可怕,在沒有任何阻攔的情況下她竟然吞噬了自己所有的孩子。
而成長起來的微軟也吞噬了IBM。
作為世上的奇蹟,這一切被記錄在《聖經》的《微軟之書》中。



In the fullness of time MS-DOS begat Windows. And this is the lineage of Windows: CP/M begat QDOS. QDOS begat DOS 1.0. DOS 1.0 begat DOS 2.0 by way of Unix. DOS 2.0 begat Windows 3.11 by way of PARC and Macintosh. IBM and Microsoft begat OS/2, who begat Windows NT and Warp, the lost OS of lore. Windows 3.11 begat Windows 95 after triumphing over Macintosh in a mighty Battle of Licences. Windows NT begat NT 4.0 by way of Windows 95. NT 4.0 begat NT 5.0, the OS also called Windows 2000, The Millenium Bug, Doomsday, Armageddon, The End Of All Things.

時機成熟,MS-DOS便創造了Windows,Windows世系:CP/M創造了QDOS。 QDOS創造了DOS 1.0。 DOS 1.0以Unix的方式創生了DOS 2.0。
DOS 2.0以PARC和Macintosh為依托創造了Windows 3.11。 IBM和微軟創造了OS/2——Windows NT和Warp之父,最後一個遵從教誨的操作系統。
在於Macintosh的許可證爭鬥獲勝之後Windows 3.11創造了Windows 95。Windows NT有依托Windows95創造了NT 4.0 。
NT 4.0創造了NT 5.0,這個操作系統也被稱作Windows 2000。這萬千的蠹蟲,是末日,是哈米吉多頓,是萬物的終結!

譯註:
1.Bug,計算機中常用於指代程序缺陷,為了配合文意譯作蠹蟲。
2. Armageddon,哈米吉多頓。 《聖經》中預言的末世戰場,善惡終極交鋒於此。



Now it came to pass that Microsoft had waxed great and mighty among the Microchip Corporations; mighter than any of the Mainframe Corporations before it had it waxed. And Gates heart was hardened, and he swore unto his Customers and their Engineers the words of this curse:

微軟在微芯片公司中迅速膨脹,比過去的任何一個大型機公司都凶狠。
蓋茨心智冷酷,詛咒消費者和程序員道:



"Children of von Neumann, hear me. IBM and the Mainframe Corporations bound thy forefathers with grave and perilous Licences, such that ye cried unto the spirits of Turing and von Neumann for deliverance. Now I say unto ye: I am greater than any Corporation before me. Will I loosen your Licences? Nay, I will bind thee with Licences twice as grave and ten times more perilous than my forefathers. I will engrave my Licence on thy heart and write my Serial Number upon thy frontal lobes. I will bind thee to the Windows Platform with cunning artifices and with devious schemes. I will bind thee to the Intel Chipset with crufty code and with gnarly APIs. I will capture and enslave thee as no generation has been enslaved before. And wherefore will ye cry then unto the spirits of Turing, and von Neumann, and Moore? They cannot hear ye. I am become a greater Power than they. Ye shall cry only unto me, and shall live by my mercy and my wrath. I am the Gates of Hell; I hold the portal to MSNBC and the keys to the Blue Screen of Death. Be ye afraid; be ye greatly afraid; serve only me, and live."

“馮·諾依曼的孩子們,聽著。我知道,你們的祖先曾經向上天祈求憐憫只因被IBM和那些大型機公司所奴役。
現在我告訴你們,我比之前的任何公司都強大。把你們從許可中解救出來?
不,我只會用數倍於你們先人的許可束縛爾等。將協議刻在你們心上,將序列號寫在你們額葉里。
我要用詭計和孤僻的設計把你們束縛在 Windows平台下,
我要用混沌的代碼和劣質的程序接口把你們捆綁在Intel芯片集上。我要加倍的奴役你們。
你們幹嗎不向圖靈、馮·諾依曼哭訴?
對,還有那個摩爾。他們聽不到,我比他們都要強大。你們只能向我啜泣,在我的仁慈和狂暴中生存。
我是地獄之門,把守著MSNBC的入口和死亡藍屏的鑰匙。
恐懼吧,戰栗吧。只有服侍我,才能苟活下去!”


譯註:
1.這一段裡蓋茨像一個說話吞音的古代魔王,給人的感覺不像《聖經》中的撒旦,或者路西法。
而和更像好萊塢電影裡的古代惡魔,公式化而且低智慧。
2. frontal lobe,額葉,人腦中負責邏輯思考等重要功能的部分。“把序列號寫入額葉”的意思就是讓消費者尊崇微軟的邏輯。



And the people were cowed in terror and gave homage to Microsoft, and endured the many grave and perilous trials which the Windows platform and its greatly bodacious Licence forced upon them. And once again did they cry to Turing and von Neumann and Moore for a deliverer, but none was found equal to the task until the birth of Linux.

人們在恫嚇下臣服於微軟,忍受著Windows平台諸多險惡的折磨,並且不斷的被這自負的協議所束縛。
大家再次祈求圖靈、馮·諾依曼和摩爾的救贖,然而卻無人勝任。 一切直到Linux出現。

譯註:
1. trials,在這裡指的是強加給用戶的操作習慣。



These are the generations of Linux:
Linux世家:

SAGE begat ARPA, which begat TCP/IP, and Aloha, which begat Ethernet. Bell begat Multics, which begat C, which begat Unix. Unix and TCP/IP begat Internet, which begat the World Wide Web. Unix begat RMS, father of the great GNU, which begat the Libraries and Emacs, chief of the Utilities. In the days of the Web, Internet and Ethernet begat the Intranet LAN, which rose to renown among all Corporations and prepared the way for the Penguin. And Linus and the Web begat the Kernel through Unix. The Kernel, the Libraries and the Utilities together are the Distribution, the one Penguin in many forms, forever and ever praised.

SAGE創造了TCP/IP之父ARPA,和Ethernet之父Aloha。Bell創造了Multics——C語言和Unix之父。 Unix和TCP/IP創造了萬維網之父Internet。
Unix創造了GNU之父RMS,而偉大的GNU是公用事業的首領,它創生了Libraries和Emacs。絡的時代, Internet和Ethernet創造了Intranet LAN。
在公司中聞名遐邇的Intranet LAN為企鵝的出現做好了鋪墊。 萊納斯和网絡通過Unix創造了Kernel。
將Libraries和Utilities結合便是Distribution,通過這些渠道一隻企鵝的形像明朗起來,這是一個值得永世驕傲的創舉。


譯註:
1. Utilities,是共用事業的縮寫,或指諸多共用事業。
第二次由於和Libraries這個涵蓋十分寬泛的詞一同出現,所以沒有翻譯。
2. Distribution,是指GNU自由文檔許可,這應該是作者對其的簡稱。
3.這裡的企鵝,是一個開源和Linux的意象並不是特指Tux。不要忘記,這是一篇啟示文學。


Now in those days there was in the land of Helsinki a young scholar named Linus the Torvald. Linus was a devout man, a disciple of RMS and mighty in the spirit of Turing, von Neumann and Moore. One day as he was meditating on the Architecture, Linus fell into a trance and was granted a vision. And in the vision he saw a great Penguin, serene and well-favoured, sitting upon an ice floe eating fish. And at the sight of the Penguin Linus was deeply afraid, and he cried unto the spirits of Turing, von Neumann and Moore for an interpretation of the dream.

當時世上有一個名為赫爾辛基的地方,那裡住著一個名叫李納斯·托沃茲的年青學者。
他是一個虔誠的人,一個RMS的信徒並能受到圖靈,馮·諾依曼和摩爾強大的精神感召。
一天他在沉思著(諾依曼提出的)結構,恍惚間墜入幻境。
在幻境中他看到一隻碩大的企鵝,它平靜、姿態優美的坐在冰川上吃魚。
面對企鵝李納斯感到徹骨的恐惑,他向圖靈、諾依曼和摩爾的聖靈哭訴,祈求開釋。


譯註:
1.RMS,是Richard M. Stallman的縮寫。
即理查德·M·斯多曼,自由軟件運動的創始人。 他被認為是開源人士的精神領袖和圖靈等人的精神繼承者。
RMS的縮寫形式已被普遍使用。




And in the dream the spirits of Turing, von Neumann and Moore answered and spoke unto him, saying, "Fear not, Linus, most beloved hacker. You are exceedingly cool and froody. The great Penguin which you see is an Operating System which you shall create and deploy unto the earth. The ice-floe is the earth and all the systems thereof, upon which the Penguin shall rest and rejoice at the completion of its task. And the fish on which the Penguin feeds are the crufty Licensed codebases which swim beneath all the earth's systems. The Penguin shall hunt and devour all that is crufty, gnarly and bobacious; all code which wriggles like spaghetti, or is infested with blighting creatures, or is bound by grave and perilous Licences shall it capture. And in capturing shall it replicate, and in replicating shall it document, and in documentation shall it bring freedom, serenity and most cool froodiness to the earth and all who code therein."

夢中,圖靈、馮·諾依曼和摩爾的聖靈為他開解:“不要怕,李納斯——最可愛的黑客。
你沉著幹練。你所見的碩大企鵝是將由你創造,並惠及世人的操作系統。
冰川是那些現存的系統,上面的企鵝頤心於它所完成的使命。
嘴裡的魚是那些只能在現存系統下游走的低賤的許可協議。企鵝會獵殺所有這些混沌,冗餘,自負的生物。
這些虛以委蛇的代碼,或是在麻木的人手中滋生,或是攜帶著險惡的協議,它們都將被捕獲。
而只有那些在獲取時可以自主複製,複製時能加以改動,並且能自由修改的代碼,才能給世人帶去絕妙安逸的生活。”


譯註:
1.cool,froody,都不是書面用語,這段兩詞都是同時出現,所以我將它們引申翻譯。
2. spaghetti,意大利細麵條,這裡是說代碼沒有調理、編寫時敷衍了事。
並且形容其面目可憎,故而使用“虛以委蛇”一詞。



Linus rose from meditation and created a tiny Operating System Kernel as the dream had foreshewn him; in the manner of RMS, he released the Kernel unto the World Wide Web for all to take and behold. And in the fulness of Internet Time the Kernel grew and replicated, becoming most cool and exceedingly froody, until at last it was recognised as indeed a great and mighty Penguin, whose name was Tux. And the followers of Linus took refuge in the Kernel, the Libraries and the Utilities; they installed Distribution after Distribution, and made sacrifice unto the GNU and the Penguin, and gave thanks to the spirits of Turing, von Neumann and Moore, for their deliverance from the hand of Microsoft. And this was the beginning of the Fourth Age, the age of Open Source.

從冥思中醒來的李納斯,遵循夢的啟示創造了一個精巧的操作系統核心。
以RMS之名,他將這個核心釋放到了萬維網上,以便所有人都可以獲取。
在豐富的因特網時代它不斷的成長、複製。 至酷,至炫。 最終成為一隻健碩強大的企鵝——Tux。
李納斯的追隨者托庇在這個Kernel以及Libraries、Utilities之下,不斷地安裝分發。
他們對企鵝和GNU作出貢獻,對聖靈們報以感激,只為脫離了微軟的魔爪。 這,便是第四個時代的開始,開源的時代。



Now there is much more to be said about the exceeding strange and wonderful events of those days; how some Suits of Microsoft plotted war upon the Penguin, but were discovered on a Halloween Eve; how Gates fell among lawyers and was betrayed and crucified by his former friends, the apostles of Media; how the mercenary Knights of the Red Hat brought the gospel of the Penguin into the halls of the Corporations; and even of the dispute between the brethren of Gnome and KDE over a trollish Licence. But all these things are recorded elsewhere, in the Books of the Deeds of the Penguin and the Chronicles of the Fourth Age, and I suppose if they were all narrated they would fill a stack of DVDs as deep and perilous as a Usenet Newsgroup.

那時誕生了很多值得記錄的佳音和咄咄怪事。比如:微軟如何通過套件策動一場對企鵝進攻,卻在萬聖節前夜破產;
蓋茨如何陷入律師的困境同時被他過去的盟友——Media的使徒出賣並送上絞架;
貪婪的Red Hat爵士如何將企鵝推進公司的深淵;以及Gnome和KDE如何手足相殘。
凡此種種都被記載在《聖經》的《企鵝之書》和《四代記》中。
我想,如果將它們全部寫下來,足夠裝滿一堆DVD。如同Usenet新聞組一樣深邃而危險。


譯註:
1. crucified,指在十字街上釘死。 是長時間以來深受歐洲人喜愛的死刑執行方法。
但是我如果用漢語直譯出來很容易讓人聯想到基督,這不符合文中蓋茨的形象。 故而用絞架替換。
2.本段涉及很多1998年的重要事件。其中包括:《萬聖節文件》事件;美政府訴微軟壟斷案;
Red Hat公司接納商業投資並擬定1999年發行股票;Gnome和KDE在開源社區內部展開爭鬥。



Now may you code in the power of the Source; may the Kernel, the Libraries and the Utilities be with you, throughout all Distributions, until the end of the Epoch. Amen.

開源代碼賜予你力量,Kernel ,Libraries和Utilities將與常你同在,
惠及所有發行版,直到時代終結。 阿門。

2007年8月23日 星期四

野豬爸爸之歌

《文明4》的亮點非常多,這篇文章主要介紹它的經典背景音樂,以及它對世界各地音樂的絕佳運用。
各類古典名曲的在不同遊戲時代的搭配,讓《文明4》不但從遊戲內容上給人教益,也從音樂上讓我們回味了那一首首世界名曲。

首先要提的就是,剛進入《文明4》主菜單後的那首《Baba Yetu》,這首歌的來源是非洲東岸的斯瓦西里族(swahili)的祈禱歌,這首歌前半部分顯得比較零散,象徵了文明起源時期的蒙昧。
文明之火隨著時間流逝日趨旺盛,整首音樂也變得大氣磅礴起來,更融合了一部分地中海音樂的特色。 當然,之所以選擇非洲風格的音樂,和人類起源於非洲也有很大關係。

文明4》整個遊戲分為五個時代:古典時代、中古、文藝復興、工業時代和現代。
古典時代共有四支曲子,既有部落風格的打擊樂,也有東方風格的管樂,基本上傳承了《文明3》的風格,和遊戲一開始文明發軔階段的史情十分配合。
下面專門談另外四個時代的音樂。

中古時代共有20首聖曲。 其中包括在1623年,教皇烏爾班八世授命作曲家格里戈里奧?阿勒格里(Gregorio Allegri)所譜寫的《彌賽亞》(a Miserere)九重唱樂曲中的一隻。
以及悠遠凝煉的《聖母瑪利亞》(Santa Maria)笛曲。 還有十五世紀宗教音樂家布魯梅爾(Antoine Brumel)的作品《榮耀經》(Gloria),音樂家歐克根(Johannes Ockeg)的《垂憐經》(Kyrie)。
曾讓貝多芬為之著迷的意大利音樂家帕萊斯特里那(Giovanni P.Palestrina)的《信經》(Credo)等四首音樂。
此外,還有三首清唱的《聖詠》(Chant)。 這些宗教歌曲,無論在遊戲中還是遊戲外,都讓人聽了之後感到心靈為之澄明。

文藝復興時期共有十九首音樂。 其中莫扎特有慢板、行板、小夜曲三首,貝多芬的快板、行板、小夜曲三首,以及巴赫的十三首。
巴赫的13首中包括《巴赫勃蘭登堡協奏曲》,以及他的廣板和變奏曲等等。 工業時代的音樂緊接文藝復興,包括貝多芬的三首小提琴協奏曲,以及勃拉姆斯的《匈牙利舞曲》。
而德沃夏克的《美國交響曲》和《斯拉夫組曲》放在這個時代顯得十分貼切。 除了這些之外,還有俄羅斯19世紀音樂家里姆斯基?科薩科夫(Rimsky Korsakov)的《天方夜譚》交響曲。
而聖桑(Saint Saens)的快板放在這個朝氣蓬勃的時代更顯得讓人精神振奮。
這些名曲在藝術上的成就,根本不用我說,我只能說,《文明4》在遊戲中非常恰當的設置了它們播放的時間和頻率,使得玩家總是在世界名曲中進行遊戲。

進入現代之後,《文明4》的音樂風格給人一種落寞、陰沉的感覺,這和人類文明在現代遇到的各種問題,以及迷茫不無關係。
當你聽到德國作曲家理查德?瓦格納管弦樂《帕西法兒》(Parsifal)中憂傷悲涼的選段時,再看看被自己改變得不成樣子的全球地貌,心裡面什麼滋味呢?
現代音樂中居然還有一大段《華麗自動鋼琴曲》(Grand Pianola),重複重複再重複的曲調給人帶來一種莫名的煩躁感,也在一定程度上配合了現代社會人類文明工業化後的單調現狀。
此外,還有曾為紀念“911”死難者而創作樂曲《靈魂的轉移》獲2003年普利策音樂獎的作曲家約翰?亞當斯(John Adams)的交響樂《和聲》(Harmonielehre)。

--轉貼自 <<文明4音乐赏析——戏说野猪爸爸之歌>>--



Baba yetu yetu, uliye
Mbinguni yetu yetu, amina!
Baba yetu yetu, uliye
Jina lako litukuzwe.

吾父,在天堂中創造,阿門!
吾夫,汝名即聖。


《文明4》序曲《Baba Yetu》歌詞第一段


Baba Yetu歌詞:
<中文大意>
願人尊你的名為聖
願你的國降臨
願你的旨意行在地上如同在天上

我們日用的飲食今日賜給我們
免我們的債
如同我們免了人的債
不叫我們遇見試探
救我們脱離凶惡

因為國度、權柄、榮耀全是你的
直到永遠
阿門!


原文:
CHORUS
Baba yetu, yetu uliye
Mbinguni yetu, yetu, amina!
Baba yetu, yetu, uliye
Jina lako litukuzwe.
(x2)

Utupe leo chakula chetu
Tunachohitaji utusamehe
Makosa yetu, hey!
Kama nasi tunavyowasamehe
Waliotukosea usitutie
Katika majaribu, lakini
Utuokoe, na yule, milelea milele!

CHORUS

Ufalme wako ufike utakalo
Lifanyike duniani kama mbinguni. (Amina)

CHORUS

Utupe leo chakula chetu
Tunachohitaji utusamehe
Makosa yetu, hey!
Kama nasi tunavyowasamehe
Waliotukosea usitutie
Katika majaribu, lakini
Utuokoe, na yule, simama mwehu

Baba yetu, yetu, uliye
Jina lako litukuzwe.
(x2)


英文:

CHORUS
Our Father, Jesus, who art
in Heaven. Amen!
Our Father, Jesus
Hallowed be thy name.
(x2)

Give us this day our daily bread,
Forgive us of
our trespasses
As we forgive others
Who tresspass against us
Lead us not into temptation, but
deliver us from Evil, and you are forever and ever!

CHORUS

Your kingdom come, your will be done
On Earth as it is in Heaven. (Amen)

CHORUS

Give us this day our daily bread,
Forgive us of
our trespasses
As we forgive others
Who tresspass against us
Lead us not into temptation, but
deliver us from Evil, and you wake the dead (?)

Our Father, Jesus who art...
Hallowed be thy name.
(x2)



女聲合唱
wuwuwuwu
嗚嗚嗚嗚

男聲
Baba yetu yetu, uliye
爸爸野豬野豬力耶
Mbinguni yetu yetu, amina!
本姑娘野豬野豬阿明那
Baba yetu yetu, uliye
爸爸野豬野豬力耶
Jina lako litukuzwe.
估計那拉愛你脫褲子耶

女聲
Baba yetu yetu, uliye
爸爸野猪野猪力耶爸爸野豬野豬力耶
Mbinguni yetu yetu, amina!
本姑娘野猪野猪阿明那本姑娘野豬野豬阿明那
Baba yetu yetu, uliye
爸爸野猪野猪力耶爸爸野豬野豬力耶
Jina lako litukuzwe.
估計那拉愛你脫褲子耶

(意譯
Our Father, who art in Heaven. Amen!
天父,在天之父。阿門!
Our Father, Hallowed be thy name.
天父,願世人皆頌聖名。 )

快板快板

Utupe leo chakula chetu
我吐不來吃苦拉吃野兔
Tunachohitaji utusamehe
屠美屠日黑塔基圖抹黑耶
Makosa yetu, hey! Makosa yetu, hey!
馬褲塞野豬,嗨
Kama nasi tunavyowasamehe
卡馬那賽屠哪有薩馬黑耶
Waliotukosea usitutie
挖土四野我圖死主體
Katika majaribu, lakini
卡提耶馬甲來不拉企業
Utuokoe, na yule, milelea milele!
OTAKU耶,哪有理,迷離離那迷離離!

(意譯
Give us this day our daily bread,
賜我今日之食天天皆然。
Forgive us of our trespasses
免我之罪,
As we forgive others who tresspass against us
若我之於他人。
Lead us not into temptation, but deliver us from Evil,
指引我遠離誘惑,救贖我於邪惡,
and you are forever and ever!
願祢不朽永存! )

合唱合唱
Baba yetu yetu, uliye
爸爸野豬野豬力耶
Mbinguni yetu yetu, amina!
本姑娘野豬野豬阿明那
Baba yetu yetu, uliye
爸爸野豬野豬力耶
Jina lako litukuzwe.
估計那拉愛你脫褲子耶

慢板合唱

Ufalme wako ufike utakalo
我发霉我哭你给我大法螺我發霉我哭你給我大法螺
Lifanyike duniani kama mbinguni (Amina!)
立法你的土地阿里巴巴鸣鼓 阿明那!立法你的土地阿里巴巴鳴鼓阿明那!

(意譯
Thy kingdom come,
願祢的天國降臨,
thy will be done on Earth as it is in Heaven. (Amen)
願你的旨意行於世間。 (阿門))

女聲
Baba yetu yetu, uliye
爸爸野豬野豬力耶
Mbinguni yetu yetu, amina!
本姑娘野豬野豬阿明那
Baba yetu yetu, uliye
爸爸野豬野豬力耶
Jina lako litukuzwe.
估計那拉愛你脫褲子耶

快板

Utupe leo chakula chetu
我吐不來吃苦拉吃野兔
Tunachohitaji utusamehe
屠美屠日黑塔基圖抹黑耶
Makosa yetu, hey! Makosa yetu, hey!
馬褲塞野豬,嗨
Kama nasi tunavyowasamehe
卡馬那賽屠哪有薩馬黑耶
Waliotukosea usitutie
挖土四野我圖死主體
Katika majaribu, lakini
卡提耶馬甲來不拉企業
Utuokoe, na yule, simama mwehu
OTAKU耶,哪有理,司馬馬呀黑幕胡!

(意譯
Give us this day our daily bread,
賜我今日之食天天皆然。
Forgive us of our trespasses
免我之罪,
As we forgive others who tresspass against us
若我之於他人。
Lead us not into temptation, but deliver us from Evil,
指引我遠離誘惑,救贖我於邪惡,
and you wake the dead
願您喚醒俗世)

女聲
Baba yetu yetu, uliye
爸爸野豬野豬力耶
Jina lako litukuzwe.
估計那拉愛你脫褲子耶
Baba yetu yetu, uliye
爸爸野豬野豬力耶
Jina lako litukuzwe.
估計那拉愛你脫褲子耶

(意譯
Our Father, Hallowed be thy name.
天父,願世人皆頌聖名!)

2007年8月21日 星期二

freeciv文明帝國

為了考LPIC level 1,
己經看書看到快起笑了!
偶而消遣一下,無妨吧!

最近又再回温文明帝國這個遊戲。
席德梅爾的文明帝國系列,實在是策略遊戲的經典啊!

文明帝國的wiki

freeciv的wiki

在linux也有類似的遊戲哦!
不過要玩,得先費一番功夫把它安裝起來。

http://www.freeciv.org/index.php/Freeciv


ubuntu比較方便些,用它內建的套件安裝介面。
應用程式->添加和刪除
再用搜尋的欄位填入"freeciv",找到後進行安裝,就可以了。

台灣ubuntu社群的介紹。
http://www.ubuntu.org.tw/modules/newbb/viewtopic.php?topic_id=2099&forum=10

大陸ubuntu社群,延伸介紹。
http://forum.ubuntu.org.cn/about40583.html&sid=2178f99bd0375a8617ad8864f3355aaa

linux十大精選遊戲原文
http://techgage.com/article/top_10_free_linux_games

有幾篇文件,玩civ3參考用。
不然玩不過電腦!
http://www.jijiao.com.cn/yxfh/slg/civ/civ3/index.htm

http://www.jijiao.com.cn/yxfh/slg/civ/civ3/00000040.htm

玩civ3有個小小心得,
就是難度高時,你的科技研發和大奇觀建設,一定拼不過電腦。
只好用武力強取豪奪的方式了,
所以一開始要把科技研發的經費調小,娛樂部份調大。
然後想辦法造出較多的兵力,去打電腦的城市。
除了搶奇觀外,再以外交手段索取科技,
等到你確認地圖占够大了,通常電腦也弱了不少。
再來全力衝科技研發!
才有機會拉高得分,得到高的評價。

2007年8月15日 星期三

LPIC模擬考Q&A

下面的題目都是我在進行模擬考時,
覺得自己比較沒把握解答,擷取下來的!
打算日後做成答題參考用的筆記。

將會慢慢把答案和解題心得補上,
如有錯誤請網路上的高手們給予指正,謝謝!

要討論的話,我的電子信箱是bullock0425@gmail.com

OK,進入主題吧!

+------------------------------------------------------------------------+

Question 001
You want to install a RPM packet file foobar.rpm on a debian system. What
command would you use to convert the rpm-file into debian deb format?
Choose the best answer.
a.alien --to-deb foobar.rpm
b.rpmtodeb foobar.rpm
c.rpm2deb foobar.rpm
d.pcktconv --to-deb foobar.rpm
e.pcktconv -o foobar.deb foobar.rpm

answer:a

LPIC考試不再分什麼RPM和DEB套件管理系統了!
兩個都要會,在deb套件管理上,要把rpm融入,就要利用alien指令。
但還有更進階的方式和相關know-how,再找吧!

+------------------------------------------------------------------------+

Question 002
Which command would you use to check the signature of a rpm packet?
Choose the best answer.
a.rpmcheck filename
b.rpm -c filename
c.rpm --checksig filename
d.rpm -q --checksig filename
e.rpm --pgpcheck filename

answer:c

RPM檢查認證key

+------------------------------------------------------------------------+

Question 003
What command is used to reconfigure a formerly installed debian packet.
Enter just the name without path and options.
Type the answer.

answer:dpkg-reconfigure

+------------------------------------------------------------------------+

Question 004
Many server-processes allow the root-user to force them to read their
configfiles while running. How is this done?
Choose the best answer.
a.Use the reconf command
b.Send them the SIGPIPE signal
c.Send them the SIGCONF signal
d.Send them the SIGHUP signal
e.Use the ps command

answer:d

出個進階的題目,當我修改/etc/syslog.conf之後,如何重啓syslogd這個daemon?
#killall -SIGHUP syslogd
或是用kill
#kill -SIGHUP `cat /var/run/syslogd.pid`
倒斜線裡的cat指令,意義是要找出syslogd的pid(Process ID)。
killall 給daemon名稱,而kill要給process-ID或是job-ID,就這麼簡單!

+------------------------------------------------------------------------+

Question 005
Which statements concerning the tool renice are true?
Choose every correct answer.
a.A normal user may only change the nice values of his own processes.
b.A normal user can decrease the nice value of his own processes.
c.Once a nice value is increased, a normal user may not decrease it, even if it is his own process.
d.root can change the nice-values of all processes of one user with a single command.
e.renice allows a normal user to fasten his processes.

answer:a c d

nice的使用邏輯,我把它拿來和把目錄設Sticky Bit的概念比較,
同樣是root最大,能任意改任意user的file,process。而一般user只能對自己的file,process動手腳。
nice命令,一般user只能改大value值,nice值愈大,執行權愈後面!
root可以指定nice值從-20到19。預設值是10。
如何看nice值?當你執行top或`ps -l`時,NI那一欄(第八欄)就是了!

`ps -l | grep command_file_name`
若是以上那個方式擷取出來的資訊,則要看第七個空白之後的那個欄位(第八欄)!

我來出個題目:
用root來執行以下命令,
`nice --60 vi &`
會有什麼結果?
因為nice命令也可以讓一般使用帳號執行,
所以用root執行和用非root執行,結果是有差別的!
以一般非root帳號執行的話,是會有錯誤訊息的,因為一般帳號只能給正值(從0開始)。
只有root才能給-20到19,值愈小執行的優先等級愈高!
但,不是只能給-20到19嗎?給-60也行嗎?
嘿嘿,命令的確可以執行!但不能指定到-60,它還是給最高的執行權-20,OK。

談到nice命令,就不能略過renice命令了。
看一下renice的man-page,renice是重新指定nice value的指令,
令我困惑的是,renice居然能重新指定的nice value,是從-20到20!
可是經我實機操作的結果,`renice 20 process-ID`還是只能給到19,而不是20。
奇也怪哉!到底是-20到20?還是-20到19?
還望善心人士解我疑惑!善哉!善哉!

+------------------------------------------------------------------------+

Question 006
In the directory /home/foo exists a file named bar which is a symbolic link
to the file foobar in the same directory, created with the command
ln -s foobar bar
If you would copy the link to /tmp using the command
cp -d /home/foo/bar /tmp
what would happen?
Choose the best answer.
a.The destination /tmp/bar is a symbolic link to /tmp/foobar
b.The destination /tmp/bar is a symbolic link to /home/foo/foobar
c.The destination /tmp/bar is a regular file with the same content as /home/foo/foobar
d.The destination /tmp/bar is a hardlink using the same inode as /home/foo/foobar
e.The destination /tmp/bar is a hardlink using the same inode as /home/foo/bar

answer:a

這題有陷阱,有人會選b,中招!
因為`ln -s foobar bar`,是以相對路徑的方法來建symbolic link,
你如果用`ln -s /home/foo/bar /home/foo/foobar`,用絶對路徑來建立,
再以`ls -l`,可以看出和題目出題的那個連結的差異。

`cp -d`的用法,是不會修正你原始的連結路徑的,
所以這題會產生一個失效的連結!

+------------------------------------------------------------------------+

Question 29/34
In the directory /home/foo exists a file named bar which is a symbolic link
to /etc/services. If you would copy the link to /tmp using the command
cp -d /home/foo/bar /tmp
what would happen?
Choose the best answer.
a.The destination /tmp/bar is a symbolic link to /home/foo/bar
b.The destination /tmp/bar is a symbolic link to /etc/services
c.The destination /tmp/bar is a regular file with the same content as /etc/services
d.The cp command would ask you whether to create a link or a file
e.Nothing. The cp-command is not made for copying links.

answer:b

同上題的解題觀念,
所以當我們要建symbolic link時,最好以絶對路徑來建!
以避免日後變成失效的連結。
而cp指令的用法,以及option的使用時機,最好不要等閒視之。像-r,-s等意義!

+------------------------------------------------------------------------+

Question 007
What is a X-client
Choose the best answer.
a.a computer which uses the X11 Protocol to communicate
b.a computer which uses a super-computer to run applications which are displayed on the local screen
c.a program which is dispayed on a graphical screen of an X Server
d.a computer which offers displaying on its screen
e.a computer with a graphical user interface using X11

answer:c

我對X-window一直沒輒,但有個重要觀念一定要有,
什麼是X-server?什麼是X-client?
X-server是指掌管秀出執行程式,軟體的電腦。
主要是硬體的設定,xf86config(CLI模式)和XF86Setup(GUI模式),
都是要搞定一個叫XF86config的設定檔!
而X-client是指一個程式,或軟體,成功執行時會在X-server秀出來。
所以只要提到X-server,就和硬體聯想在一起;X-client就往軟體,程式聯想就八九不離十 了!

+------------------------------------------------------------------------+

Question 008

In which file will you find a listing of all used DMA-channels of

your computer?

Type the answer.

answer:/proc/dma

+------------------------------------------------------------------------+



Question 009

What is the meaning of the SCSI-Address 1,5,0 ?

Choose the best answer.

a.The fifth device on the first SCSI-cable is deactivated

b.The device with SCSI-ID 5 on the second SCSI-Bus, LUN 0

c.A SCSI-1 device on Bus 0 with the SCSI ID 5

d.The first device on the fifth bus with LUN 0

e.This isn't a valid SCSI address


answer:b

這題比較怪,我找幾本書都沒提到這樣的標示方式!
但總算是出現有良心的linux同好,挖了答案出來。
那三個數字分別是channel,ID,LUN。
回答b應該錯不了!


+------------------------------------------------------------------------+


Question 010

Which of the following commands could be used to detect the kind of USB

controler of your computer?

Choose the best answer.

a.getusbinfo

b.usbinfo

c.usb-info

d.usb_info

e.lspci


answer:e

嘿嘿!我說任何考試總是會有幾題是設陷阱給人跳,不給考滿分的!
沒有usb,info什麼什麼的,但是有scsi_info這個指令,
而比較常令人迷惑的是,USB這種東東,居然是和pci扯上關係!
據我實作經驗,/proc/pci這個檔案在比較新的linux版本上,己經不見了,但是有lsusb這個指令。
很糟!其實像XFree86之類的設定方法,也都不常見了,
但考試還是會提到,感覺怪怪的!

+------------------------------------------------------------------------+



Question 011

Which statements concerning the program gunzip are true?

Choose every correct answer.

a.After decompressing a file with gunzip, the compressed file is removed

b.gunzip is a replacement for tar

c.gunzip is a replacement for cpio

d.gunzip is just a link to gzip

e.gunzip is used to extract files from a zip archive


answer:a d e

gzip和gunzip到底算不算孿生兄弟?
原本是不干我的事的,只要會用來壓、解檔案,就可以了。
但遇到考試要考!那可就意義不同了!
基本上,他們的man-page是同一個,而有的linux版本,你可以用`ls -il /bin/gzip /bin/gunzip`,
得出他們的inode根本就是同一個,也就是說這兩個指令是hard-link的檔案!
也有一些版本,gunzip是gzip的soft-link。
但也有的linux版本不是同inode,但檔案大小一樣!
而你可以用 `gzip -d` 來代替gunzip。
種種跡象顯示,他們應該是孿生兄弟沒錯!甚至於我懷疑,連zcat也和他們是一夥的。
所以,選d應該是錯不了吧。

還有,gzip和gunzip只能對檔案處理。
不能對目錄,但是可以針對一個目錄,做裡頭所有檔案的處理。`gzip -r dir_name`就會把dir_name目錄下所有檔案壓成.gz。
而指令處理完,會把原來的檔案刪除掉。除非是用重新導向的方式,才有可能保留原始檔案。`cat file_name | gzip > file_name.gz`

有些考題會考tar和gzip的合併使用,如:
`tar cf - file1 file2 | gzip > tar_file.gz`
`gzip -d tar_file.gz | tar xf -`
上面那個減號是有意義的,不可省略,要注意!

+------------------------------------------------------------------------+



Question 012

You want to deinstall a deb packet foobar from your system. What would be a

proper command?

Choose every correct answer.

a.remove foobar

b.remove foobar.deb

c.dpkg -r foobar

d.dselect foobar

e.apt-get remove foobar

answer:c e

在debian套件管理中,dpkg是最主要的程式,其他什麼apt-get,dselect...都是由dpkg再發展出來的。
dselect是要啓動文字介面的套件管理模式, 是不能直接指定套件名稱的。aptitue己經取代dselect了!


+------------------------------------------------------------------------+


Question 013

Which command would you use to get a list of all files inside the rpm-packet

foobar.rpm in /home/bob?

Choose the best answer.

a.rpm -ql /home/bob/foobar.rpm

b.rpm -ql -p /home/bob/foobar.rpm

c.rpm -l /home/bob/foobar.rpm

d.rpm -l -p /home/bob/foobar.rpm


answer:b

rpm是RED-HAT Package Manager的簡稱,目前linux的套件管理,主要分兩大流派,有debian系列和redhat系列。
rpm有-i install模式,-e erase移除模式,-q query查詢模式,-U Upgrade昇級模式,-V or-y驗證模式。
本題的題意是要針對foobar.rpm做套件內容的查詢,
因為是查詢模式,所以-q一定少不了,選項c和d一定不能選。
而題目指定了單一套件,所以也一定會有-p這個option,再加個l就是詳細列出囉!

總之,rpm和deb的套件管理,都是變化很多很雜的指令,多操作才能熟悉,
不過,幸運的是,LPIC101目前的考古題,好像還不會考太複雜。希望實地考也是如此!


+------------------------------------------------------------------------+


Question 014

Which command is NOT usable to install debian packages?

Choose the best answer.

a.dpkg

b.dselect

c.apt-get

d.dinst


answer:d

沒這個指令的!用bash指令的tab補全方式去查就能確定了!


+------------------------------------------------------------------------+


Question 11/34

How can you describe the function of the following commands?

foo | bar >> foobar

Choose the best answer.

a.The command foo redirects its output to the command bar, which writes its output to foobar. If foobar exists, it will be overwritten.

b.The command foo redirects its output to the command bar, which writes its output to foobar. If foobar exists, the results will be appended.

c.The command bar gets its input from the file foo and writes its output to foobar. If foobar exists, it will be overwritten.

d.The command bar gets its input from the file foo and writes its output to foobar. If foobar exists, the results will be appended.

e.The command foo writes its output to the file bar. If this file exists foo writes into the file foobar instead.


answer:d

在一堆亂七八糟的符號中,搞清楚那個是command,那個是file,
而什麼狀況是會create file,什麼狀況是append file!
遇到tee和xargs這樣特殊處理standard input(就是本來會秀在螢幕的訊息)的指令,要小心哪!

+------------------------------------------------------------------------+



Question 13/34

What would the following command result in?

echo $(date +%H:%M) > file

Choose the best answer.

a.The string "date +%H:%M" will be written into the file

b.The content of the variable named "date +%H:%M" will be written into the file

c.The content of the variable named after the current time (Hours:Minutes) will be written into the file

d.The current time (Hours:Minutes) will be written into the file

e.This isn't a valid command


answer:d

這題很冷門,考的是命令代換的技巧!
$(command --option arguments) = `command --option arguments`
是倒引號哦,一般鍵盤的位置會在Esc鍵的下方,注意!我重申一次,不是單引號,是倒引號!
題目若是出成:
echo `date +%H:%M` > file
會是相同的結果!

+------------------------------------------------------------------------+



Question 15/34

What command allows you to extract particular columns out of a textfile (just the command - no options)?

Type the answer.

answer:cut?

這題英文好的人就很容易答題了,但是LPIC就是這樣,因為linux是外國人發明的東東,所以要搞懂,就一定要會英文!
我的英文好像也是因為學linux才變得比較好的,因為man-page大部份是英文,沒得商量。
不過我很疑惑,linux不是芬蘭人Linus Torvalds發明的嗎?為什麼不是什麼芬蘭文,德文?
還好不是,不然,我們就慘了!芬蘭文?聽都沒聽過?怎麼玩linux啊!



+------------------------------------------------------------------------+


Question 16/34

What would be the result of the following command?

cp *.* /tmp

Choose the best answer.

a.All files in the current directory would be copied to /tmp

b.All files in the current directory, which have exactly one dot (.) inside their names would be copied to /tmp

c.All files in the current directory, which have one or more dots (.) anywhere inside their names but not at the beginning would be copied to /tmp

d.All files in the current directory, which have one or more dots (.) inside their names

- but neither at the begining nor at the end of the name would be copied to /tmp



e.This is a DOS-command - it has no meaning under Linux


answer:c

萬用字元和常規表示式,是兩種類似但不完全相同的東西!
找檔案是用萬用字元,而找檔案內容就用常規表示式,這是我個人的心得,不知道對不對?
*.*是M$-DOS的東西,因為M$-DOS才有副檔名的命名規定,unix-like沒有副檔名這種硬性的命名規定,
你有時會看到.tar .gz .bz ...之類的檔案,是方便判斷檔案的內容,好方便去使用對應的指令來處理它!
不然,你用file這個指令也可以判斷檔案性質的。
在M$-DOS系統下,cp *.*會拷貝當前目錄的所有檔案,但對unix-like系統則否!
因為以萬用字元的定義來看,*.*會處理到所有檔名中間至少要有一個dot(.)的檔案,
但*.*應該包括.*啊,為什麼我還是要選c?
我說過,LPIC總是會有幾題是埋伏陷阱的,這題我就認為是。
因為就unix-like系統來說,dot(.)開頭的檔案,通常代表的是應該被隱藏起來的設定檔,
cp命令是不會拷貝到隱藏檔的!嘿!沒蓋你,我真的有實機操作過,就是這樣!


+------------------------------------------------------------------------+


Question 18/34

What command sends signals to processes (just the command - no options)?

Type the answer.

answer:kill

很多人考過真正的LPIC101後,都覺得和模擬考差很多!
因為摸擬考很少考指令的option,但真的考試會出含option的題目。
所以那些以為把模擬考作熟背熟就會過的LPIC101的人,就掛在一些option不熟的題目上。
kill指令可以送SIGNAL給process,但是SIGNAL有幾種,怎麼送?
嘿!有些難度了吧!

`kill -l`可以檢視可用的訊號有幾種,真要殺掉一個行程的作法有好幾種。
`kill -s 9 process-ID`
`kill -9 process-ID`
`kill -s SIGKILL process-ID`

`kill -SIGKILL process-ID`
`kill -sigkill process-ID`
`kill -KILL process-ID`
怎樣,眼花撩亂了吧!我也快搞不清楚了。
小心那個減號,是有意義的,要是數字9前沒有減號,那是代表行程9而不是訊號KILL 9,小心小心!

還有,kill和killall是用法很相似的指令!也要注意一下!雖然大部份考題是針對kill來出。


+------------------------------------------------------------------------+


Question 19/34

Which statements concerning the tool renice are true?

Choose every correct answer.

a.A normal user may only change the nice values of his own processes.

b.A normal user can decrease the nice value of his own processes.

c.Once a nice value is increased, a normal user may not decrease it, even if it is his own process.

d.root can change the nice-values of all processes of one user with a single command.

e.renice allows a normal user to fasten his processes.


answer:a c d
這題好像重複了,我得篩選一下這個筆記內容了。找一下前面吧。




Question 20/34

What means the following construct inside a regular expression?

[^A-Z][!A-Z]

Choose the best answer.

a.The starting of a line, followed by an uppercase letter, followed by a non uppercase letter.

b.Either the starting of a line or an uppercase letter followed by a non uppercase letter.

c.A non uppercase letter followed by either an ! or an uppercase letter

d.A non uppercase letter at the beginning of a word followed by a non uppercase letter.

e.An uppercase letter at the beginning of a word followed by a non uppercase letter.


answer:c

什麼時候用萬用字元,什麼時候用常規表示式?
是很多考LPIC101的人,會搞混的部份。
我簡單給一個規則,有錯的話,請糾正我!
「萬用字元用在找檔案名稱,常規表示式用在處理檔案的內容。」
所以find指令會配合的是萬用字元,而grep和sed是配合常規表示式。

小心!「^」「*」「?」「.」「!」,這些符號在兩套規則中的意義差很多。一定要區分清楚!




Question 25/34

How could you generate a report of the user quota of /home?

Choose the best answer.

a.repquota /home

b.quotarep /home

c.quota --report /home

d.edquota /home

e.quotaed /home



answer:a




Question 31/34

What is a X-client

Choose the best answer.

a.a computer which uses the X11 Protocol to communicate

b.a computer which uses a super-computer to run applications which are displayed on the local screen

c.a program which is dispayed on a graphical screen of an X Server

d.a computer which offers displaying on its screen

e.a computer with a graphical user interface using X11

answer:c





Question 32/34

Most linux systems offer a display manager runlevel. What statement about

this runlevel is true?

Choose the best answer.

a.X11 can be started using startx in this runlevel

b.X11 can be started using xinit in this runlevel

c.X11 is started automaticly for user root

d.X11 is started automaticly an offers a login window

e.This runlevel has nothing to do with X11



answer:d




Question 1/34
Which of the following statements are true?
Choose every correct answer.
a.The LBA-mode of a harddisk is used to turn on DMA or UDMA
b.A harddisk with more than 1024 cylinders should be used in LBA-mode
c.A harddisk with more than 1.2 GByte capacity can only be used in LBA-mode
d.LBA-mode does not change the capacity of a harddisk
e.A harddisk with more than 1024 cylinders can't be mounted without LBA-mode

answer:b d

Question 3/34
You detect a VIA USB controler in your computer. Which USB module would you
load to use this controler?
Choose the best answer.
a.usb-via
b.usb-ohci
c.usb-uhci
d.usb-intel
e.usb-compaq

answer:c


Question 7/34
You have just installed the new program foobar manually. This program uses
shared libraries, which are installed to /usr/local/foobar/lib.
What is neccesary to do after the installation so that the libraries can be
used?
Choose the best answer.
a.restart your computer
b.run ldconfig
c.edit /etc/ld.so.conf to add the new library path and then run ldconfig
d.edit /etc/ld.so.conf to add the new library path and then run ld.so
e.create symbolic links from every library in /usr/local/foobar/lib to /usr/lib

answer:c

有一個檔案叫ld.so.cache!
是執行完ldconfig之後,才把lo.so.conf的設定更新至ld.so.cache。
還有一個指令叫ldd。什麼時候用得到?
且讓我屁一下,同樣的,有錯請各位大德,來信糾正!請一定要糾正我,OK!
因為我的理想是要推廣linux給學校、家庭、小企業等...使用。
要是我搞錯了,也許將來我教出來的使用者的觀念也會跟著錯,
所以一定要糾正我,不然,後果不堪設想啊!

ldd指令是用來查詢你現在所用的函式庫有那些。


Question 8/34
You want to deinstall a rpm packet foobar from your system. What would be a
proper command?
Choose the best answer.
a.remove foobar
b.remove foobar.rpm
c.rpm remove foobar
d.rpm -e foobar
e.deinstall foobar


Question 9/34
Which command would you use to list all rpm-packets installed on your
system?
Choose the best answer.
a.rpm --all
b.rpm --show-all
c.rpm -q all
d.rpm -qa
e.rpm -la


Question 12/34
How could you describe the following commandline?
foo & bar & foobar
Choose the best answer.
a.The commands foo, bar and foobar are started in the background.
b.The command foo is processed. If it results without error, then bar and foobar are processed.
c.The command foo is processed. If it results without error, then bar will be processed. If bar results without error, foobar will be processed.
d.The commands foo, bar and foobar are processed one after another.
e.The commands foo and bar are started in the background, foobar is started in the foreground


Question 14/34
The textfile foo has got 30 lines of text. How could you extract the lines
11 to 20 to STDOUT?
Choose every correct answer.
a.tail -n 20 | head -n 10 foo
b.tail -n 20 foo | head -n 10
c.head -n 20 foo | tail -n 10
d.head -n 20 | tail -n 10 foo
e.extract -l 11-20 foo


Question 16/34
What would the following command result in?
cp /home/foo/bar /home/bar/foo /foo
Choose the best answer.
a.The files /home/foo/bar, /home/bar/foo, and /foo are copied into the current directory
b.The file /home/foo/bar is copied into the directorys /home/bar/foo and /foo
c.The files /home/foo/bar and /home/bar/foo are copied together in the file /foo
d.The files /home/foo/bar and /home/bar/foo are copied into the directory /foo
e.This isn't a valid commandline


Question 18/34
How could you try to stop a hung process which refuses to accept keyboard input?
Choose every correct answer.
a.Ctrl-C
b.Ctrl-S
c.kill -9 PID
d.kill PID
e.ipcsend SIGKILL PID


Question 19/34
What tool could you use to change the nice value of a running process?
Choose every correct answer.
a.ps
b.top
c.nice
d.renice
e.setpriority


Question 20/34
Which of the following regular expressions fits all words, starting with an
uppercase letter and ending with an d (using grep)?
Choose the best answer.
a.[A-Z]*d
b.[A-Z].*d
c.[A-Z]..d
d.\b[A-Z]*d\b
e.\b[A-Z].*d\b


Question 21/34
What statement concerning the following wildcard is correct?
[A-Z]\*
Choose the best answer.
a.All files beginning with an uppercase letter followed by one *
b.All files beginning with an non numeric letter
c.All files beginning with an uppercase letter followed by the backslash
d.All files without numbers in their names
e.All files beginning with one of the letters A, Z or -


Question 22/34
How many extended partitions could you create on one physical harddisk?
Choose the best answer.
a.1
b.3
c.4
d.16
e.64


Question 23/34
Which command shows you, how much space in Kilobytes is available on all mounted
partitions?
Choose the best answer.
a.df --free_space
b.du
c.df -k
d.free
e.fdisk


Question 24/34
You want your users to be able to mount the CD-Rom on /dev/hdc. What is the
right way to enable them?
Choose the best answer.
a.Change the file permissions of /dev/hdc so that all users can write to this file.
b.Add the SUID-Bit to the /bin/mount command
c.Add the appropriate usernames to /etc/mountusers
d.Add the entry "user,noauto" to the options of the filesystem in /etc/fstab
e.Add the entry "may_mount(/dev/hdc)" into the users line inside /etc/passwd


Question 25/34
How could you get the information, what kind of quota is activated for user
foo?
Choose the best answer.
a.repquota foo
b.repquota --user foo
c.quota foo
d.quota --user foo
e.quotainfo foo


Question 26/34
What is the meaning of the sticky bit applied to a directory?
Choose the best answer.
a.Everybody may read the content of the directory
b.A user with write permission in this directory may not create any file there.
c.A user with write permission in this directory may not remove any file inside the directory if he is not the owner of the file to remove.
d.Any user may remove files inside this directory, even if he is not the owner of the file to remove.
e.Nothing. The sticky bit is only used for regular files.


Question 27/34
What would be the default file permission modes for new files
if you set umask to 027 ?
Choose the best answer.
a.755
b.640
c.720
d.027
e.750


Question 29/34
Which of the following statements are true?
Choose every correct answer.
a.A hardlink uses the same inode than it's original file.
b.Hardlinks may be used for files and directories on the same partition
c.Hardlinks can't point to directories
d.A hardlink has to be in the same directory than it's original file
e.A hardlink may reference any file on the whole system


Question 30/34
Which directory contains the essential commands needed on bootup?
Choose the best answer.
a./usr/bin
b./bin
c./etc
d./boot
e./lib


Question 31/34
What is a X-client
Choose the best answer.
a.a computer which uses the X11 Protocol to communicate
b.a computer which uses a super-computer to run applications which are displayed on the local screen
c.a program which is dispayed on a graphical screen of an X Server
d.a computer which offers displaying on its screen
e.a computer with a graphical user interface using X11


Question 32/34
You want to connect a X11-Terminal to your Server. But everytime you try to
connect, your terminal screen keeps black. What files on the server would you
edit to solve the problem?
Choose every correct answer.
a./etc/X11/XF86Config
b./etc/X11/xdm/x-terminals
c./etc/X11/xdm/xdm-config
d./etc/X11/xdm/Xwilling
e./etc/X11/xdm/Xaccess

Question 1/34
Which harddisks should be used in LBA-mode?
Choose the best answer.
a.Harddisks with more than 1024 cylinders
b.Harddisks with more than 1.2 GByte
c.Harddisks capable of UDMA66
d.IDE-harddisks which are used as master
e.IDE-harddisks which are used as slave


Question 2/34
You want to install a ISA-Plug and Play Card into your computer. Which step is
necessary to use this card with Linux?
Choose the best answer.
a.Nothing, Linux is able to use such cards without any configuration
b.Enter the hardware parameters in /etc/pnp
c.Use isapnp and pnpdump
d.Enter the correct settings in /etc/pnp.conf
e.Linux is not able to use Plug and Play Cards


Question 6/34
You want to compile and install a GNU software package, but you want to
change the default installation target. Which file would you edit?
Choose the best answer.
a.config.h
b.targets
c.configure
d.Makefile
e..config


Question 7/34
You have just installed the new program foobar manually. This program uses
shared libraries, which are installed to /usr/local/foobar/lib.
What is neccesary to do after the installation so that the libraries can be
used?
Choose the best answer.
a.restart your computer
b.run ldconfig
c.edit /etc/ld.so.conf to add the new library path and then run ldconfig
d.edit /etc/ld.so.conf to add the new library path and then run ld.so
e.create symbolic links from every library in /usr/local/foobar/lib to /usr/lib


Question 10/34
What set of scripts is included in a debian packet?
Choose the best answer.
a.install,configure,deinstall,deconfigure
b.preinst,postinst,prerm,postrm
c.install,configure,libinst,libconf
d.checklib,checkdep,checkfree,checkspace


Question 13/34
What would the following command result in?
cp $(find . -size -12k) /tmp
Choose the best answer.
a.The file with the name stored in the variable "find . -size -12k" will be copied to /tmp
b.All files in the current directory which are smaller than 12 KByte will be copied to /tmp
c.All files in the current directory and in all included subdirectories
which are smaller than 12 KByte will be copied to /tmp.
d.All files in the current directory and in all included subdirectories
which are smaller than 12 KByte will be copied to /tmp.
The directorie structure will be copied, too.
e.This isn't a valid command


Question 16/34
You have to move the whole directory-tree /home/foo to /oldusers. What
command would you use?
Choose the best answer.
a.move /home/foo /oldusers
b.mv /home/foo /oldusers
c.mv -r /home/foo /oldusers
d.mv -R /home/foo /oldusers
e.cp --move /home/foo /oldusers


Question 18/34
How could you get a list of all running processes?
Choose every correct answer.
a.ps
b.ps ax
c.getprocess
d.top
e.down


Question 19/34
Which statements are true?
Choose every correct answer.
a.A nice value reaches from 0 to 20
b.Only root can use negative nice values
c.A less nice value means higher priority
d.Nice-values can be changed with the ps-command
e.An even nice-value means high, an odd value low priority


Question 20/34
The user bertha has marked an important line of one of her textfiles with an
asterix (*). But now she forgot the name of the file. How could you find
this file, assuming it is located in berthas home directory?
Choose the best answer.
a.grep * /home/bertha/*
b.grep \* /home/bertha/*
c.grep "/*" /home/bertha/*
d.grep --key=asterix /home/bertha/*
e.grep 0x2A /home/bertha/*


Question 24/34
Consider a unmounted partition /dev/hdc7 should be mounted on /usr/local.
The following entry in /etc/fstab exists:
/dev/hdc7 /usr/local ext2 defaults 1 2
Which command could you use to mount the filesystem?
Choose every correct answer.
a.mount -l /dev/hdc7
b.mount /dev/hdc7
c.mount /dev/hdc7 /usr/local
d.mount /usr/local
e.mount -V /usr/local


Question 25/34
You want to enable all of your users to use about 20 megabyte of diskspace
in their home-directories and about 5 megabyte in /tmp. What action
concerning the partitioning is necessary?
Choose every correct answer.
a./home and /tmp each have to be on a own partition
b.Use qfdisk instead of fdisk to create disk-quota partitions
c.One partition for /home is enough. You can symlink /tmp to /home later
d.Every partition with userquotas have to have the file quota.user on their root
e.Every partition with userquotas need the entry usrquota in the options-field in /etc/fstab


Question 32/34
You want to connect a X11-Terminal to your Server. But everytime you try to
connect, your terminal screen keeps black. What files on the server would you
edit to solve the problem?
Choose every correct answer.
a./etc/X11/XF86Config
b./etc/X11/xdm/x-terminals
c./etc/X11/xdm/xdm-config
d./etc/X11/xdm/Xwilling
e./etc/X11/xdm/Xaccess
Question 3/34
Which command would you use to set the speed of a serial interface?
Choose the best answer.
a.setbaud
b.setspeed
c.setserial
d.setcom
e.set_comport


Question 6/34
You want to install the tarball foobar.tar.bz2. What command would unpack the
achive?
Choose every correct answer.
a.tar x foobar.tar.bz2
b.untar foobar.tar.bz2
c.tar tzvf foobar.tar.bz2
d.tar xjf foobar.tar.bz2
e.bzcat foobar.tar.bz2 | tar xf -


Question 9/34
You are the system administrator of a RedHat box. After checking your
system, you found a file named foobar. What command would you use to get the
information from which rpm packet this file was installed?
Choose the best answer.
a.rpm -qf foobar
b.rpm -f foobar
c.rpm -l foobar
d.rpm -ql foobar
e.rpm -qL foobar


Question 11/34
How can you describe the function of the following commands?
foo < bar | foobar
Choose the best answer.
a.The command foobar gets its input from the command bar
b.The command foo redirects its output to foobar
c.The command bar writes its output into the file foo
d.The command foo gets its input from the file bar and if its exitcode is not 0, the command foobar will be executed
e.The file foo is written by the command "bar | foobar"


Question 14/34
How could you format the textfile foo so that the max. line-length would be
40 characters?
Choose the best answer.
a.format --width=40 foo
b.fmt -w 40 foo
c.chll 40 foo
d.print --line_length=40 foo
e.cat -width 40 foo


Question 16/34
What would be the result of the following command?
cp *.* /tmp
Choose the best answer.
a.All files in the current directory would be copied to /tmp
b.All files in the current directory, which have exactly one dot (.) inside their names would be copied to /tmp
c.All files in the current directory, which have one or more dots (.) anywhere inside their names
but not at the beginning would be copied to /tmp
d.All files in the current directory, which have one or more dots (.) inside their names -
but neither at the begining nor at the end of the name would be copied to /tmp
e.This is a DOS-command - it has no meaning under Linux


Question 17/34
What is the best way to get a running foreground-job in the background?
Choose the best answer.
a.Kill the job using Ctrl-C and restart it in the background using &
b.Suspend the job using Ctrl-Z and restart it in the background using &
c.Suspend the job using Ctrl-Z and restart it in the background using bg
d.Start another shell from another console (or xterm) and send the job a STBG-signal
e.Simply press Ctrl-&


Question 19/34
The __-command starts processes with less priority.
Choose the best answer.
a.less
b.more
c.nice
d.prior
e.startproc


Question 20/34
The user bertha has marked an important line of one of her textfiles with an
asterix (*). But now she forgot the name of the file. How could you find
this file, assuming it is located in berthas home directory?
Choose the best answer.
a.grep * /home/bertha/*
b.grep \* /home/bertha/*
c.grep "/*" /home/bertha/*
d.grep --key=asterix /home/bertha/*
e.grep 0x2A /home/bertha/*


Question 25/34
How could you generate a report of the user quota of /home?
Choose the best answer.
a.repquota /home
b.quotarep /home
c.quota --report /home
d.edquota /home
e.quotaed /home


Question 27/34
How could you help users to create files with serious file permissions?
Choose the best answer.
a.Teach users how to use chmod
b.Use a serious umask setting in the user's profile
c.Change the user's directory permissions
d.Use cron to change the file permissions of the users files once a day
e.Use replacements for the standard unix tools which create secure files


Question 29/34
How could you detect if the file foo and bar are hardlinked together or not?
Choose the best answer.
a.The command "ls --link foo" shows a list of all files which are hardlinked to foo.
b.The command "ls -i foo bar" shows the used inodes of foo and bar. If they are the same, they are linked together.
c.The command "islink foo bar" shows "yes" if the files are linked together, "no" if not.
d.The command "find . --hardlink foo" shows a list of all files which are hardlinked to foo.
e.There is no way to detect this.


Question 31/34
What program is used to tune the screen settings after installing X11?
Choose the best answer.
a.tuneX
b.xvidtune
c.video
d.vconfig
e.vtune


Question 32/34
Most linux systems offer a display manager runlevel. What statement about
this runlevel is true?
Choose the best answer.
a.X11 can be started using startx in this runlevel
b.X11 can be started using xinit in this runlevel
c.X11 is started automaticly for user root
d.X11 is started automaticly an offers a login window
e.This runlevel has nothing to do with X11
Question 2/34



You create a isapnp.conf file using the pnpdump command. When do you have to
call isapnp to read this file?
Choose the best answer.
a.The first time after you have installed the new card
b.Every time you want to access the card
c.Once a day, using cron
d.Every time you start the computer
e.Never


Question 3/34
Which flag would you use with setserial to enable 115 KBit for a serial port?
Choose the best answer.
a.spd_hi
b.spd_vhi
c.spd_shi
d.spd_warp
e.spd_115


Question 14/34
Which of the following commands could be used to search for a particular
term inside a textfile without opening the file?
Choose every correct answer.
a.grep
b.vi
c.ex
d.less
e.sed

answer:a e


Question 21/34
What command would you use to copy all files inside the current directory
which names end with a number to /tmp
Choose the best answer.
a.cp *[:num:] /tmp
b.cp *[0-9] /tmp
c.cp *.[0-9] /tmp
d.cp [*0-9] /tmp
e.cp ?[0-9] /tmp


Question 23/34
While monitoring the integrity of the filesystems, you detect, that there
are no more free inodes left on the /home partition although there are many
megabytes free space. What could be the reason?
Choose the best answer.
a.This is a typical filesystem error on ext2 partitions.
b.A user has created lots of very small files.
c.The inode table is corrupted.
d.There are lots of cross-linked files.
e.The report of many megabytes free space is wrong due to an overflow of the 32 Bit Free-Space-Variable.


Question 24/34
Consider a mounted partition /dev/hdc7 is mounted on /mnt. Which command
could be used to unmount this filesystem?
Choose every correct answer.
a.umount /dev/hdc7
b.unmount /dev/hdc7
c.umount /mnt
d.unmount /mnt
e.mount -u /dev/hdc7


Question 25/34
You want to enable all of your users to use about 20 megabyte of diskspace
in their home-directories and about 5 megabyte in /tmp. What action
concerning the partitioning is necessary?
Choose every correct answer.
a./home and /tmp each have to be on a own partition
b.Use qfdisk instead of fdisk to create disk-quota partitions
c.One partition for /home is enough. You can symlink /tmp to /home later
d.Every partition with userquotas have to have the file quota.user on their root
e.Every partition with userquotas need the entry usrquota in the options-field in /etc/fstab


Question 29/34
In the directory /home/foo exists a file named bar which is a symbolic link
to /etc/services. If you would copy the link to /tmp using the command
cp -d /home/foo/bar /tmp
what would happen?
Choose the best answer.
a.The destination /tmp/bar is a symbolic link to /home/foo/bar
b.The destination /tmp/bar is a symbolic link to /etc/services
c.The destination /tmp/bar is a regular file with the same content as /etc/services
d.The cp command would ask you whether to create a link or a file
e.Nothing. The cp-command is not made for copying links.


Question 30/34
What would the following command search for?
find . -size 25k
Choose the best answer.
a.All files inside the current directory, which are bigger than 25 KBytes
b.All files inside the current directory, which are smaller than 25 KBytes
c.All files inside the current directory and all included subdirectories, which are bigger than 25 KBytes
d.All files inside the current directory and all included subdirectories, which are smaller than 25 KBytes
e.All files inside the current directory and all included subdirectories, which are exactly 25 KBytes big


Question 32/34
Which file would you edit so that the displaymanager ist started automaticly at boottime?
Choose the best answer.
a./etc/inittab
b./etc/X11/XF86Config
c./etc/X11/xdm/xdm-config
d./etc/X11/xdm/Xsession
e./etc/X11/xdm/Xstartup


Question 3/34
Which command would you use to set the speed of a serial interface?
Choose the best answer.
a.setbaud
b.setspeed
c.setserial
d.setcom
e.set_comport


Question 6/34
Which statements concerning the program gunzip are true?
Choose every correct answer.
a.After decompressing a file with gunzip, the compressed file is removed
b.gunzip is a replacement for tar
c.gunzip is a replacement for cpio
d.gunzip is just a link to gzip
e.gunzip is used to extract files from a zip archive


Question 8/34
You want to install the RPM package file foobar.rpm. This file is located
in /home/bob. Which command would you use to install this file?
Choose the best answer.
a.install /home/bob/foobar.rpm
b.rpminst /home/bob/foobar.rpm
c.rpm -i /home/bob/foobar.rpm
d.rpm -e /home/bob/foobar.rpm
e.instrpm /home/bob/foobar.rpm


Question 10/34
What command would you use to get a list of all installed files coming from
a debian packet named foobar?
Choose the best answer.
a.dpkg -l foobar
b.dpkg -L foobar
c.dpkg -ql foobar
d.dpkg -qL foobar
e.dpkg -q --allfiles foobar


Question 14/34
You want to transport a file named foo from one computer to another. The
only media available for transport are floppy-disks. Unfortunately
the size of the file is about 10 Megabytes. Which of the following commands
could you use to solve the problem?
Choose the best answer.
a.cat --split 1.4M foo
b.splitf 1440k foo
c.split -b 1440k foo
d.cut -b1440k foo
e.chunk --size=1440k -f foo


Question 15/34
What command changes tabs to spaces (just the command - no options)?
Type the answer.
answer:expand


Question 18/34
What command offers you a snapshot of the current processes (just the
command - no options)?
Type the answer.

answer:ps? top?


Question 18/34
What command offers you an ongoing look at processor activity in real
time (just the command - no options)?
Type the answer.

answer:top


Question 23/34
What statement about the du-command is true?
Choose the best answer.
a.Dump User - backups all files owned by the named user.
b.Dos Utility - provides different features to handle DOS-filesystems.
c.Dir User - shows the directorys owned by the named user.
d.Disk Usage - shows the amount of diskspace used by the named directories.
e.DOS to Unix - changes the named DOS cr/lf textfile architecture into the cr Unix architecture


Question 24/34
You want your users to be able to mount the CD-Rom on /dev/hdc. What is the
right way to enable them?
Choose the best answer.
a.Change the file permissions of /dev/hdc so that all users can write to this file.
b.Add the SUID-Bit to the /bin/mount command
c.Add the appropriate usernames to /etc/mountusers
d.Add the entry "user,noauto" to the options of the filesystem in /etc/fstab
e.Add the entry "may_mount(/dev/hdc)" into the users line inside /etc/passwd


Question 26/34
The file foo has a permission mode of -rw-------, is owned by user bar and
belongs to group foobar. Which of the following commands would allow members
of the group foobar to read the file?
Choose every correct answer.
a.chmod o+r foo
b.chmod g+r foo
c.chmod +r foo
d.chmod a+r foo
e.chmod 604 foo


Question 31/34
What is a X-server
Choose the best answer.
a.a computer which offers X11-applications
b.a computer which offers the ability to run X11-applications
c.the program which administrates the graphical IO using the X11 protocol
d.any X11 application
e.the program which manages the window borders/colors

answer:b

Question 33/34
You started an X-application with the parameter -display foo:0 but you get
the message "Can't open display". What is the reason?
Choose the best answer.
a.foo is not known, try it with it's IP-address
b.you have to use foo:1 instead of foo:0
c.you must run the command "xhost foo" before the above command
d.you must run "xhost yourcomputer" on foo before the above command
e.you must be root to display something on other computer's screen

Question 11/34
How can you describe the function of the following commands?
foo | tee bar | foobar
Choose the best answer.
a.The command foo redirects its output to the command tee. After that the command bar redirects its output to the command foobar
b.The command foo writes its output to the file tee; the command bar writes its output to the file foobar
c.The command foo redirects its output to the command tee which writes it into the file bar and sends the same further to the command foobar
d.The command foobar gets its input from the command bar which gets its input from the command foo
e.This isn't a valid commandline


Question 20/34
Which of the following tools could be used to search a textfile for a
particular searchstring without opening it with an interactive editor?
Choose every correct answer.
a.vi
b.sed
c.ed
d.grep
e.find


Question 22/34
What is the Partition System ID of a regular Linux Partition? (just the two digits)

answer:83


Question 25/34
How could you get the information, what kind of quota is activated for user foo?
Choose the best answer.
a.repquota foo
b.repquota --user foo
c.quota foo
d.quota --user foo
e.quotainfo foo


Question 29/34
What would be the result of the following command?
ln /bin /bin2
Choose the best answer.
a.A hardlink /bin2 would be created, referencing the directory /bin
b.A symbolic link /bin2 would be created, referencing the directory /bin
c.A directory /bin2 would be created, which contains hardlinks to every file in /bin
d.A directory /bin2 would be created, which contains symbolic links to every file and subdirectory in /bin
e.Nothing, but an error message


Question 2/34

You create a isapnp.conf file using the pnpdump command. When do you have to

call isapnp to read this file?

Choose the best answer.

a.The first time after you have installed the new card

b.Every time you want to access the card

c.Once a day, using cron

d.Every time you start the computer

e.Never





Question 3/34

Which flag would you use with setserial to enable 115 KBit for a serial port?

Choose the best answer.

a.spd_hi

b.spd_vhi

c.spd_shi

d.spd_warp

e.spd_115







Question 5/34

When do you need to rerun the grub-install command?

Choose every correct answer.

a.After every boot

b.After every modification of the grub configuration file

c.After installing a new kernel with a new name in /boot

d.After overwriting the old kernel in /boot with a new one

e.Only the first time after installing GRUB





Question 7/34

Which programm is used to maintain the file /etc/ld.so.cache?

Choose the best answer.

a.ld.so

b.ldcache

c.ldd

d.ldconfig

e.libconf





Question 8/34

You want to deinstall a deb packet foobar from your system. What would be a proper command?

Choose every correct answer.

a.remove foobar

b.remove foobar.deb

c.dpkg -r foobar

d.dselect foobar

e.apt-get remove foobar





Question 9/34

You are the system administrator of a RedHat box. After checking your

system, you found a file named foobar. What command would you use to get the

information from which rpm packet this file was installed?

Choose the best answer.

a.rpm -qf foobar

b.rpm -f foobar

c.rpm -l foobar

d.rpm -ql foobar

e.rpm -qL foobar







Question 14/34

Which of the following commands could be used to turn all characters inside a

textfile into uppercase without opening the file in an editor?

Choose every correct answer.

a.upcase

b.recode

c.sed

d.tr

e.vi





Question 15/34

What command sorts its input stream in alphabetic order (just the command - no options)?

Type the answer.





Question 18/34

How could you try to stop a hung process which refuses to accept keyboard input?

Choose every correct answer.

a.Ctrl-C

b.Ctrl-S

c.kill -9 PID

d.kill PID

e.ipcsend SIGKILL PID





Question 19/34

What command starts processes with higher or lower priority?

Type the answer.





Question 20/34

Which of the following tools could be used to search a textfile for a

particular searchstring without opening it with an interactive editor?

Choose every correct answer.

a.vi

b.sed

c.ed

d.grep

e.find





Question 22/34

/dev/____ ist the first logical partition of the slave on the second

IDE-channel.

Type the answer.





Question 23/34

Which command shows you, how much space is available on all mounted

partitions?

Choose the best answer.

a.df

b.df --free_space

c.du

d.free

e.fdisk





Question 24/34

You've bought a new harddisk and installed it in your Linux box as master on

the second IDE-channel. After partitioning it into two primary partitions

and creating filesystems on both partitions, you want to ensure, that both

new partitions will be mounted automatically on bootup. What is to do?

Choose the best answer.

a.Add an entry for /dev/hdc1 and /dev/hdc2 to /etc/mtab

b.Add an entry for /dev/hdc to /etc/mtab

c.Add an entry for /dev/hdc1 and /dev/hdc2 to /etc/fstab

d.Add an entry for /dev/hdc to /etc/fstab

e.Nothing. The system looks up all partitions at bootup





Question 25/34

The user foo has got a userquota of 20 megabyte in his home directory. Now

you want to give him 40 megabyte instead. What is to do?

Choose the best answer.

a.Edit the file /home/quota.user with an editor

b.Edit the entry for /home in /etc/fstab

c.Use the command repquota foo

d.Use the command edquota foo

e.Use the command addquota foo 20M





Question 26/34

What is the meaning of the Substitute Group ID Bit applied to a directory?

Choose the best answer.

a.Every file created inside this directory will be owned by the group of the directory instead of the group of the creating user.

b.Every user inside the directory has the rights of the group of the directory.

c.Only members of the group of the directory can create files inside the directory,

even if they otherwise would have the right to write inside the directory.

d.A user with write permission in this directory may not remove any file inside.

e.Nothing. The SGID bit is only used for regular files.





Question 29/34

In the directory /home/foo exists a file named bar which is a symbolic link

to the file foobar in the same directory, created with the command

ln -s foobar bar

If you would copy the link to /tmp using the command

cp -d /home/foo/bar /tmp

what would happen?

Choose the best answer.

a.The destination /tmp/bar is a symbolic link to /tmp/foobar

b.The destination /tmp/bar is a symbolic link to /home/foo/foobar

c.The destination /tmp/bar is a regular file with the same content as /home/foo/foobar

d.The destination /tmp/bar is a hardlink using the same inode as /home/foo/foobar

e.The destination /tmp/bar is a hardlink using the same inode as /home/foo/bar





Question 31/34

Which of the following programs can be used to configure your X-Server?

Choose every correct answer.

a.xconfig

b.xf86config

c.XF86Setup

d.XConfig

e.X11Config





Question 33/34

You started an X-application with the parameter -display foo:0 but you get

the message "Can't open display". What is the reason?

Choose the best answer.

a.foo is not known, try it with it's IP-address

b.you have to use foo:1 instead of foo:0

c.you must run the command "xhost foo" before the above command

d.you must run "xhost yourcomputer" on foo before the above command

e.you must be root to display something on other computer's screen







Question 2/34

You create a isapnp.conf file using the pnpdump command. When do you have to

call isapnp to read this file?

Choose the best answer.

a.The first time after you have installed the new card

b.Every time you want to access the card

c.Once a day, using cron

d.Every time you start the computer

e.Never





Question 3/34

Which flag would you use with setserial to enable 115 KBit for a serial port?

Choose the best answer.

a.spd_hi

b.spd_vhi

c.spd_shi

d.spd_warp

e.spd_115







Question 5/34

When do you need to rerun the grub-install command?

Choose every correct answer.

a.After every boot

b.After every modification of the grub configuration file

c.After installing a new kernel with a new name in /boot

d.After overwriting the old kernel in /boot with a new one

e.Only the first time after installing GRUB





Question 7/34

Which programm is used to maintain the file /etc/ld.so.cache?

Choose the best answer.

a.ld.so

b.ldcache

c.ldd

d.ldconfig

e.libconf





Question 8/34

You want to deinstall a deb packet foobar from your system. What would be a proper command?

Choose every correct answer.

a.remove foobar

b.remove foobar.deb

c.dpkg -r foobar

d.dselect foobar

e.apt-get remove foobar





Question 9/34

You are the system administrator of a RedHat box. After checking your

system, you found a file named foobar. What command would you use to get the

information from which rpm packet this file was installed?

Choose the best answer.

a.rpm -qf foobar

b.rpm -f foobar

c.rpm -l foobar

d.rpm -ql foobar

e.rpm -qL foobar





Question 10/34

What command is used to reconfigure a formerly installed debian packet.

Enter just the name without path and options.

Type the answer.





Question 13/34

What would the following command result in?

cp `find . -size -12k` /tmp

Choose the best answer.

a.The file with the name "find . -size -12k" will be copied to /tmp

b.All files in the current directory which are smaller than 12 KByte will be copied to /tmp

c.All files in the current directory and in all included subdirectories which are smaller than 12 KByte will be copied to /tmp.

d.All files in the current directory and in all included subdirectories which are smaller than 12 KByte will be copied to /tmp.

The directory structure will be copied, too.

e.This isn't a valid command





Question 14/34

Which of the following commands could be used to turn all characters inside a

textfile into uppercase without opening the file in an editor?

Choose every correct answer.

a.upcase

b.recode

c.sed

d.tr

e.vi





Question 15/34

What command sorts its input stream in alphabetic order (just the command - no options)?

Type the answer.





Question 18/34

How could you try to stop a hung process which refuses to accept keyboard input?

Choose every correct answer.

a.Ctrl-C

b.Ctrl-S

c.kill -9 PID

d.kill PID

e.ipcsend SIGKILL PID





Question 19/34

What command starts processes with higher or lower priority?

Type the answer.





Question 20/34

Which of the following tools could be used to search a textfile for a

particular searchstring without opening it with an interactive editor?

Choose every correct answer.

a.vi

b.sed

c.ed

d.grep

e.find





Question 22/34

/dev/____ ist the first logical partition of the slave on the second

IDE-channel.

Type the answer.





Question 23/34

Which command shows you, how much space is available on all mounted

partitions?

Choose the best answer.

a.df

b.df --free_space

c.du

d.free

e.fdisk





Question 24/34

You've bought a new harddisk and installed it in your Linux box as master on

the second IDE-channel. After partitioning it into two primary partitions

and creating filesystems on both partitions, you want to ensure, that both

new partitions will be mounted automatically on bootup. What is to do?

Choose the best answer.

a.Add an entry for /dev/hdc1 and /dev/hdc2 to /etc/mtab

b.Add an entry for /dev/hdc to /etc/mtab

c.Add an entry for /dev/hdc1 and /dev/hdc2 to /etc/fstab

d.Add an entry for /dev/hdc to /etc/fstab

e.Nothing. The system looks up all partitions at bootup





Question 25/34

The user foo has got a userquota of 20 megabyte in his home directory. Now

you want to give him 40 megabyte instead. What is to do?

Choose the best answer.

a.Edit the file /home/quota.user with an editor

b.Edit the entry for /home in /etc/fstab

c.Use the command repquota foo

d.Use the command edquota foo

e.Use the command addquota foo 20M





Question 26/34

What is the meaning of the Substitute Group ID Bit applied to a directory?

Choose the best answer.

a.Every file created inside this directory will be owned by the group of the directory instead of the group of the creating user.

b.Every user inside the directory has the rights of the group of the directory.

c.Only members of the group of the directory can create files inside the directory,

even if they otherwise would have the right to write inside the directory.

d.A user with write permission in this directory may not remove any file inside.

e.Nothing. The SGID bit is only used for regular files.





Question 29/34

In the directory /home/foo exists a file named bar which is a symbolic link

to the file foobar in the same directory, created with the command

ln -s foobar bar

If you would copy the link to /tmp using the command

cp -d /home/foo/bar /tmp

what would happen?

Choose the best answer.

a.The destination /tmp/bar is a symbolic link to /tmp/foobar

b.The destination /tmp/bar is a symbolic link to /home/foo/foobar

c.The destination /tmp/bar is a regular file with the same content as /home/foo/foobar

d.The destination /tmp/bar is a hardlink using the same inode as /home/foo/foobar

e.The destination /tmp/bar is a hardlink using the same inode as /home/foo/bar





Question 31/34

Which of the following programs can be used to configure your X-Server?

Choose every correct answer.

a.xconfig

b.xf86config

c.XF86Setup

d.XConfig

e.X11Config





Question 33/34

You started an X-application with the parameter -display foo:0 but you get

the message "Can't open display". What is the reason?

Choose the best answer.

a.foo is not known, try it with it's IP-address

b.you have to use foo:1 instead of foo:0

c.you must run the command "xhost foo" before the above command

d.you must run "xhost yourcomputer" on foo before the above command

e.you must be root to display something on other computer's screen





Question 3/34
Which flag would you use with setserial to enable 115 KBit for a serial port?
Choose the best answer.
a.spd_hi
b.spd_vhi
c.spd_shi
d.spd_warp
e.spd_115

answer:b

Question 6/34
You want to compile and install a GNU software package, but you want to
change the default installation target. Which file would you edit?
Choose the best answer.
a.config.h
b.targets
c.configure
d.Makefile
e..config

answer:d

Question 7/34
Which programm is used to maintain the file /etc/ld.so.cache?
Choose the best answer.
a.ld.so
b.ldcache
c.ldd
d.ldconfig
e.libconf

answer:d

Question 11/34
How can you describe the function of the following commands?
foo | bar > foobar
Choose every correct answer.
a.The command foobar gets its input from the command bar
b.The command bar writes its output to the file foobar
c.The command foo writes its output to the file bar
d.The command foo redirects its output to the command bar
e.STDIN of foo is connected to STDOUT of bar

answer:b d

Question 12/34
How could you describe the following commandline?
foo || bar
Choose the best answer.
a.The command foo redirect its output to the command bar.
b.The command foo writes its output into the file bar.
c.The command bar is only processed if the command foo leaves without error.
d.The command bar is only processed if the command foo leaves with an error.
e.This isn't a valid commandline

answer:d

Question 14/34
How could you get the number of all accounts on your system, including
administrative and system accounts?
Choose the best answer.
a.numusers -r
b.wc -l /etc/passwd
c.count --lines /etc/passwd
d.userinfo -n
e.userinfo --get_num

answer:b

Question 17/34
How would you suspend a running foreground-job?
Choose the best answer.
a.Ctrl-Z
b.Ctrl-C
c.Ctrl-X
d.Ctrl-S
e.Ctrl-D

answer:a

Question 20/34
How could you display all lines of text from the file foo which are not
empty?
Choose the best answer.
a.grep ".*" foo
b.grep -v ^$ foo
c.grep -v ^\r\n foo
d.grep -v \r\n foo
e.grep -v "[]" foo

answer:b

Question 23/34
What statement about the du-command is true?
Choose the best answer.
a.Dump User - backups all files owned by the named user.
b.Dos Utility - provides different features to handle DOS-filesystems.
c.Dir User - shows the directorys owned by the named user.
d.Disk Usage - shows the amount of diskspace used by the named directories.
e.DOS to Unix - changes the named DOS cr/lf textfile architecture into the cr Unix architecture

answer:d

Question 25/34
How could you generate a report of the user quota of /home?
Choose the best answer.
a.repquota /home
b.quotarep /home
c.quota --report /home
d.edquota /home
e.quotaed /home

answer:a


Question 26/34
What ist the numeric value of the permission mode drwxr-xr-T
Type the answer.

answer: 1754

小心SUID,SGID和Sticky Bit的設定意義!
s,t的大小寫也是有差異的,在我實機操作的心得,
像這一題,o沒給x,卻設定了Sticky Bit,所以`ls -l`的結果,會出現大寫的T。
如果o有給x,那麼會出現t,差異是看得出來的。
所以,我認為如果題目有出現S或T,就是沒有給對應的x權限。
也就是你說,雖然設定了SUID,SGID或是Sticky Bit,但是...無效!
對!你沒看錯,本人宣判無效!
我舉例來說明,你要給一個目錄執行權限o+x,別的使用者才能進入該目錄進行開檔或開子目錄,
沒給x卻設Sticky Bit,別人沒法進去開檔或開子目錄,那不是沒用嗎?
Do you know what I mean?
老師在講,你有沒有在聽!有!Good!那你就有「可能」過了?哈哈!

還有,再強調一下,SUID只對執行檔有效,而Sticky Bit只對目錄有用!
但SGID,是對檔案(執行檔)以及目錄都可以用。切記!切記!


Question 26/34

What permissions need the files /etc/passwd and /etc/shadow?

Choose the best answer.

a.-rw-r--r--/-rw-r--r--

b.-rw-r--r--/-rw-------

c.-rw-rw-rw-/-rw-rw-r--

d.-rwsr--r--/-rw-------

e.-rwxr--r--/-rw------t

answer:b

你有沒發現,玩linux的人,大都知道root是神聖不可「濫用」的!
但為了玩linux,還是「濫用」了root這個身份。因為用root才能玩得比較爽吧!
linux有SUID這個檔案屬性,就是為了不讓root被濫用而產生。
你可以用一般的身份,執行passwd指令來變更你自己的密碼,
就是因為passwd這個命令,它是個可被執行的檔案,
透過設定了SUID,讓它有被非root卻能以root身份來執行的效果。

可是,注意!
題目是問/etc/passwd 和/etc/shadow兩個檔案的權限屬性,應該是長什麼樣子?
和使用passwd命令有啥關係?
哈,我或許是離題了,但我一定會給大家一個交代的,放心。
回歸正題,/etc/passwd是放所有帳號資料的,
而/etc/shadow是把/etc/passwd的密碼欄位再加密而產生的檔案。
在用途上來說,這兩個檔案肯定是給root用(擁有者,群組),當然有給root讀寫的權限。
但要讓一般使用帳號也能查一下帳號資訊,所以/etc/passwd也是要給o+r權限的,
至於/etc/shadow就不必讓一般使用帳號查看了!

看看選項,就b和d能選而己了。
但是,就是有人會自做聰明,像我一開始就是這樣!
把SUID的觀念拿來這個題目用,選了d,大錯特錯!
等我稍微冷靜下來,仔細一瞧...
哇考!/etc/passwd可不是什麼執行檔耶,/usr/bin/passwd才是!
那個小s看起來,好像很誘人,但卻是陷阱一個。
人客啊!你懂了我要強調什麼嗎?
有時出題的人就是賤,挖洞給人跳!愛注意哦!

`ls -l /etc/passwd /etc/shadow /usr/bin/passwd`看看權限的設定,
不一定要背,但root身份的使用觀念,和SUID,SGID,Sticky Bit使用時機,要注意!



Question 27/34
What would be the default file permission modes for new files
if you set umask to 022 ?
Choose the best answer.
a.755
b.644
c.022
d.220
e.550

answer:b

這題在考檔案和目錄的開立基本權限觀念,
檔案是666,目錄是777,經過umask計算,得出你要的解答。
根據很多考試的經驗談,用二進位的算法,要比十進位的算法來得準確。
以下說明:
十進位表示法 = 二進位表示法
1=001
2=010
3=011
4=100
5=101
6=110
7=111

十進位的算法,很簡單就是用減法!
這一題用十進位來算還OK,666-022=644,結束。

但若是用二進位來算,會比較複雜些,但是只要搞懂,
連網路IP的相關運算也可以舉一反三,融會通哦!

二進位的運算,會先做umask值的NOT運算,
於是022即000:010:010,NOT成111:101:101,
然後再和檔案的基本權限666即110:110:110,AND成110:100:100。
而110:100:100再換回十進位表示,即644!嘿,和十進位算法結果同。

乍看之下,好像二進位的運算反而容易讓人迷惑,難解。
但要知道,電腦的運作,就是101010,1和0訊號的組成,
所以二進位這種電腦的語言,是我們這種想要駕馭電腦的人,必須搞懂的。
不然考認證是要幹嘛?用電腦!只要會開機關機,然後會打打字,
動動滑鼠,出問題就叫人來修,不就好了!

會用二進位計算檔案或目錄的權限屬性,絶對是必要的!
若是有個題目是要算umask 033產生的檔案權限,而你是直接以十進位的方式算,得出633就大錯特錯了!
因為033換成二進位是000:011:011,那麼666(110:110:110)去做遮罩運算的結果,
111:100:100 AND 110:110:110 = 110:100:100
換成十進位,還是644!不會是633的!

一定要懂哦!不然你LPIC102別玩了...



Question 30/34
You (as a normal user) have created a new file named foo inside /tmp. But if you try to find
this file using the command
locate foo
there is no result. What is the reason?
Choose the best answer.
a.The /tmp directory is not searched by locate
b.locate only looks for commands inside the searchpath of the shell (PATH)
c.Only the superuser (root) may use locate in /tmp
d.locate only searches the system-database. The command will work after the next run of updatedb.
e.You have no search-permission for /tmp

answer:d

這題在考搜尋檔案的技巧!
主要是強調locate和updatedb這兩個指令的關係。
像whereis指令和which指令這兩個是由PATH來找執行檔,其中whereis還可以找到man-page等文件。
而locate指令是由updatedb程式來控制,決定要去把那些路徑的檔案,建成像資料庫一樣,好方便找檔案。
locate有個觀念!就是你剛新增好一個檔案,用locate是找不到的,
非要執行過updatedb後,才能找到你剛新增的檔案!
而updatedb指令,通常在你的unik-like OS中,己內建排程了,每天都會定時更新一次!
還有,updatedb對soft link的檔案無效!



Question 32/34
Which of the following programs are valid display managers for X11?
Choose every correct answer.
a.xdisplaymanager
b.xdm
c.gtkm
d.gdm
e.kdm
f.fdm

answer: b d e

我看了不少文件,才知道Window Manager(wm)和Display Manager(dm)的差異!
像twm,fvwm,enlightment...是Window Manager(wm),而像KDE以及GNOME是Display Manager(dm)。
KDE和GNOME整合了許多X-client軟體,建構成一套完整的X-window系統,可比美M$ windows、Apple MAC...
而Window Manager(wm)就想成是讓你的X-client AP執行得比較「好看」的一個套件。
相對於Display Manager,Window Manager的層級比較小一些,算是個小套件吧!
目前除了KDE(KDM)和GNOME(GDM)外,還有比較陽春,發展最早最原始的XDM。
所以這題的答案就是xdm,gdm,kdm。這三個。

我再進一步說明,KDM(Display Manager)本身是配合kwm來管理X-client,當然也可以用twm或fvwm等Window Manager。
他們的層次不同,你有概念了嗎!


Question 33/34
You want to run an X-application on your local machine but it should display
itself on the first display-server of foo. The command is
"xapplication -display __________"
(Don't use screennumbers)
Type the answer.

在鳥哥的書中(基礎第二版),有提到X-window的相關技術,以相當陽春的方式來跑X-window。
我簡單說明,我的測試步驟。
首先,我在我己經執行的GNOME中,開啓一個xterm。
用來執行我要在另一個Virtual Console跑的X-window,
因為己經可以跑GNOME,所以在xfree86或是xorg等的設定檔,可以確信是沒問題的!

#X :1 2> /dev/zero &
讓X-server跑起來,如果有錯誤,先把它導不見,不管。
因為我己經有GNOME這個X-window了,
大部份的linux把它跑在tty7(Ctrl+Alt+F7),用的port是6000。
所以我若是跑第二個X-window,可能是tty8(Ctrl+Alt+F8)或tty9(Ctrl+Alt+F9),
甚至是之後的Virtual Console。要看你的linux設計架構!
我是用Ubuntu 7.04 ,而鳥哥是用Fedora Core4。
嗯!確定在tty9,port6001。
看到一個醜醜的畫面,中間一個叉叉,表示有正確套用螢幕和顯示,滑鼠等驅動設定。

因為什麼也沒有,所以我們要切回tty7(Ctrl+Alt+F7)!
繼續...

#xterm -display :1 &
哈,有X-server之後,當然要來個X-client執行看看!
回tty9(Ctrl+Alt+F9),看看執行結果。
嘿嘿,成功跑出一個真的很簡單的terminal畫面。
不過,它就是死板板的,不能移動,也不能變更大小。
OK!回到tty7(Ctrl+Alt+F7),繼續往下走...

#twm -display :1 2> /dev/zero &
給它一個Window Manager,要是有錯誤,也先別管它。
我們用最陽春的twm就好,太複雜的WM套件,反而錯誤更多。
其實這個指令可以在tty9執行,只要別把 -display 參數省略了就好。

有了Window Manager之後,我們總算可以變更xterm的大小了。
這個xterm和其他Virtual Console的效果是同樣的哦!
執行一些指令看看,就和在GNOME環境一模一樣。

按Ctrl+Alt+Backspace就能把這個X-server幹掉,
當然,你幹掉了X-server,X-client也跟著沒有了!

以上三個指令,一定要丢背景執行,不然你的terminal就掛在那裡,沒辦法往下玩了。

說了一大堆,答案到底是什麼?

answer: :0(冒號然後零)

驚!真的嗎?
有人會說,為什麼沒有用foo!Why?
我沒搞懂前,本來是寫 foo :0 (foo空一格再來才是冒號然後零)。
但看過一些文件後,尢其是鳥哥這個範例,我認為是 :0 (冒號然後零)就可以。

細心的人可能有注意到,鳥哥的範例就是在local machine跑的。
而用local machine是不用打主機名稱的。了嗎?

搜尋此網誌

本站大事記

這個部落格(網站)內容以分享LINUX和延伸出的技術文章為主!
特別是為了工作和進修需要,搜集了不少網站連結。
希望對來這裡觀文的朋友們,有提供一些有用的資訊或文章。
但這裡的文章中,也包含個人的心情扎記和隨興言談……
若是當中沒有對上你的口味,請多包涵!

原「琳娜絲與希斯寇的邂逅」,改名為「愛上琳娜絲」!

原「琳娜絲與希斯寇的邂逅」,改名為「愛上琳娜絲」!
--原序文--
就是當LINUX遇上CISCO啦!他們的結合還能作什麼事…不就是讓這個世界的網路,串…串起來啊…不然你們那能上這網站看部落格!