2007年12月24日 星期一

終於通過了 LPIC Level 1的考試

過了!終於通過了 LPIC Level 1的考試了!
接下來呢?

呼?先休息一陣子吧!

2007年12月22日 星期六

從ubuntu到Debian

http://freesf.tnc.edu.tw/docs/debian/ch-preface.zh-tw.html#s-officialdoc

Debian linux可以算是既遵守GNU精神,而又不具商業化氣息的作業系統了。
加上它效能的穩定性高,安全性夠。用來作Server是相當不錯的選擇!
雖然不比商業化的linux 版本,Red Hat來得通俗,處處看得到Hack文件。

但linux作業系統的市場運作模式,讓我們還是能找到一個規範,
去了解它,使用它,管理它。

就我目前使用ubuntu的心得看來,
Debian的套件管理,實在要較RPM系統要來得先進多了!

嘿嘿!朋友,先別和我爭孰優孰劣。用了就知道啦!

LPIC Level 1 102 考古題 之二

Question 1/33
What command will remove a loaded kernel module?
Choose the best answer.
a.delmod
b.modrm
c.modkill
d.rmmod
e.depmod

answer:d


Question 2/33
Which file is used by modprobe to get the information, what kernel module is
needed by a particular other kernel module?
Choose the best answer.
a./etc/modules.dep
b./etc/modules.conf
c./lib/modules/$(uname -r)/modules.dep
d./lib/modules/$(uname -r)/modules.conf
e./lib/modules/$(uname -r)/modules.needed

answer:c

Question 3/33
You have just loaded a new version of the kernel source and installed it
into /usr/src/kernelnew. In /usr/src/kernelold are the
sources of your old kernel. Before configuring the new kernel you want to get as much
configuration information as possible from the old kernel to the new one.
What file will you copy from kernelold to kernelnew to archieve this?
Choose the best answer.
a.Makefile
b.kernel.dat
c.kernel.conf
d..config
e..kernelconf

answer:a

Question 4/33
Which file contains the main log of the system?
Choose the best answer.
a./var/mesg
b./var/log
c./var/log/mesg
d./var/log/messages
e./var/messages

answer:d

Question 5/33
What is the main configuration file for the init program?
Choose the best answer.
a./etc/init.conf
b./etc/system.conf
c./etc/inittab
d./etc/init/configure
e./etc/runlevel.conf

answer:c

Question 6/33
Which command will you use to send jobs to printers?
Choose the best answer.
a.lpd
b.lpr
c.lpc
d.lpq
e.print

answer:b

Question 7/33
What command will you use to submit a printjob to a remote printer on a
windows machine?
Choose the best answer.
a.wlpr
b.wprint
c.smbclient
d.samba
e.sambaprint

answer:c ?

Question 8/33
What is the command to built a new manpage index database?
Choose the best answer.
a.updatedb
b.updatemandb
c.mandb-update
d.mandb
e.mkindex

answer:e

Question 9/33
The file _____________ is displayed by getty befor the login message.
(Please enter full path and filename)
Type the answer.

answer:/etc/issue

Question 10/33
How can you assign the content of the enviroment variable PATH to the
enviroment variable MYPATH in the bash shell?
Choose the best answer.
a.MYPATH=PATH
b.MYPATH=$PATH
c.$MYPATH=PATH
d.$MYPATH=$PATH
e.let MYPATH=$PATH

answer:b

Question 11/33
You define an alias in your shell: alias cp="cp -i" but now you want to use
the original cp command. How can you remove the alias?
Choose the best answer.
a.alias cp=
b.alias cp=builtin cp
c.unalias cp
d.rmalias cp
e.delalias cp

answer:c

Question 12/33
Which statement about the following line is true?

[ -x /usr/sbin/daemon ] && /usr/sbin/daemon

Choose the best answer.
a./usr/sbin/daemon will be executed if it exists and is executable
b.The daemon will be executed with it's own path as parameter
c.This is a recursive call to daemon
d.This isn't a valid command

answer:a

Question 13/33
User foo has left our company and you want to remove his account and all his
files in his homedirectory. Which of the following commands will do this?
Choose the best answer.
a.rm -rf /home/foo
b.userdel -r foo
c.killuser foo
d.deluser -r foo
e.kill -HOME foo

answer:b

Question 14/33
What command shows you, what groups you belong to?
Choose the best answer.
a.whatgrp
b.whatgroup
c.group
d.groups
e.grps

answer:d

Question 15/33
You want to change from old /etc/passwd format to the modern and more save
shadow password system. What command can you use for that purpose?
Choose the best answer.
a.mkshadow
b.shadow
c.sh_create
d.sh-create
e.pwconv

answer:e

Question 16/33
Where can you configure the behavior of the syslog daemon?
Choose the best answer.
a./var/log/syslog.conf
b./var/log/syslogd.conf
c./etc/syslog.conf
d./etc/syslogd.conf
e./var/lib/syslogd/configure

answer:c

Question 17/33
What actions can be configured in the logrotate configuration file?
Choose every correct answer.
a.Mail old logs to a given address before deleting them
b.Compress rotated logfiles
c.Keep an amount of old messages in the newly generated logfile
d.Move rotated logs to a different location
e.Send a mail to root after every rotating

answer:b c e

Question 18/33
What file(s) can be used to permit or deny particular users to use the
cron-system?
Choose the best answer.
a./etc/hosts.allow and /etc/hosts.deny
b./etc/cron.allow and /etc/cron.deny
c./etc/cron/allow and /etc/cron/deny
d./etc/cronuser
e.Only root may use cron, so no settings are possible


answer:b



Question 19/33
What happens with the output of a command which is run by at by a
particular user?
Choose the best answer.
a.It will be written into the file /var/log/at
b.It will be written into the file /var/log/at_username
c.It will be written into the file at.out in the users home directory
d.It will be written to /dev/null
e.It will be mailed to the user

answer:e ?

Question 20/33
How many backup levels are provided by dump?
Choose the best answer.
a.2
b.3
c.5
d.10
e.20

answer:d 0-9

Question 21/33
What is a NTP server?
Choose the best answer.
a.Network Transfer Protocol - a fileserver
b.Network Time Protocol - a server which offers exact time settings
c.NT-Protocol - a Win-NT server
d.Net Talk Protocol - a chat server

answer:b

Question 22/33
Which service works usually on port 139 ?
Choose the best answer.
a.nntp
b.netbios-ssn
c.pop3
d.snmp
e.imap

answer:b

Question 23/33
Which segmentation is correct for Class C addresses ?
Choose the best answer.
a.1 byte network address, 3 byte host address
b.2 byte network address, 2 byte host address
c.3 byte network address, 1 byte host address

answer:c

Question 24/33
The CIDR mask /28 is in dotted quad notation 255.255.255._____
Type the answer.

answer:240

Question 25/33
You get the IP-address 191.123.234.168/29 from your ISP. What is your
broadcast address in dotted quad?
Type the answer.

answer:191.123.234.175

Question 26/33
The file /etc/_____________ contains the information, in which order
IP-address resolutions should be proceeded.
Type the answer.

answer:resolv.conf

Question 27/33
Which of the following protocols can be used to authenticate a ppp client to
a ppp server?
Choose every correct answer.
a.chat
b.CHAP
c.PPP-AUTH
d.PAP
e.pppd

answer:b d

Question 28/33
What is the configuration file for inetd?
Choose the best answer.
a.~/.inetd.conf
b.~/.inetdrc
c./etc/inetdrc
d./etc/inetd.conf
e./etc/inetd.options

answer:d

Question 29/33
The user bob of your local system wants to read all his local mail at home.
He now asks you to forward his mail to his regular email address. What do
you do?
Choose the best answer.
a.change /etc/mail/forward
b.change /etc/sendmail.fw
c.change /etc/sendmail.forward
d.change /home/bob/.forward or show bob how to change it
e.change /home/bob/.sendmail.cf or show bob how to change it

answer:d

Question 30/33
How can you mount a NFS share?
Choose the best answer.
a.use nfsmount hostname target
b.use mount hostname:/absolute/path target
c.use nfsmount hostname sharename target
d.use mount hostname sharename target
e.NFS shares can not be mounted

answer:b

Question 31/33
What command is used to create key pairs for the ssh daemon?
Choose the best answer.
a.sshkeygen
b.ssh-keygen
c.mksshkeys
d.makekey
e.mkkeys

answer:b

Question 32/33
What syslog facility does the linux firewall use?
Choose the best answer.
a.auth
b.authpriv
c.security
d.kern
e.firewall

answer:d

Question 33/33
What is a true statement about the file /etc/nologin?
Choose the best answer.
a.It contains a list of users who may not login
b.It contains a list of users who may login
c.If it exists no user can login
d.If it exists no user except the root user can login

answer:d

一份網路上的考古題 LPIC 102

這份考題是一位也有興趣考LPIC的朋友給的,
本來是要相互切磋,討論用的,
卻因為我前一陣子工作繁忙給忽略了。
真是對不起這位有心人!


102考題複習
000.Every kernel module should exactly fit the kernel for which it is
compiled. What command can you use to change the current working
directory to the directory where the modules for the running kernel are
stored? (單選)
a. cd /lib/modules/$(getkernelid)
b. cd /lib/modules/$(uname -r)
c. cd /lib/modules/$(uname -a)
d. cd $(uname --kerneldir)
e. cd $(uname --moduledir)
Ans: b (我猜的)
没錯!uname -r 很好用,
有時你會看到有的人是用倒斜線來進行命令代換,
像是你要查你現在OS所用到的模組,其相依性如何,就是記錄在 /lib/modules/`uname -r`/modules.dep 裡頭哦。

001.You can give options to the kernel (複選)
a. using the append-command in /etc/lilo.conf
b. using the options-command in /etc/lilo.conf
c. appending the options to the kernel name while using the bootmanager
d. using the chopt command while running the system
e. writing the desired options to /proc/kernel
Ans: a . c

002.What is the effect of the command init S ? (單選)
a. The system will be rebooted
b. The system will be shut down
c. The system will change into single user mode
d. The system will change into normal multi user mode
e. There is no runlevel S, runlevels are numbers
Ans: c (我猜的)
在我比較熟悉的RedHat版本中,runlevel 1和s或S,都是進到single單人模式。


003. Which command is used to show the contents of a printer queue?
(Enter just the command, no path and options)
Ans: lpq


004. You are printing with lpr. Which parameter do you use to select a
particular printer? (單選)
a. -p
b. -P
c. --printer
d. -q
e. -Q
Ans: a



005. What command offers you information about a standard Linux-tool?
(複選)
a. man
b. info
c. help
d. whatis
e. howto
Ans: a . b (我猜的)

不會用linux,找男人(man)就對了!
man這個指令,其實是用來看壓縮過後的檔案,
不信你去看/usr/share/man/man1裡頭的檔案,都是gz結尾,没錯吧。
別以為把他們解壓縮了,就是你用man看到的內容,man還藏了機關的。
想把man到的內容存下來慢慢看的話,可以用以下指令:
man bash | col -b > bash.man.txt
那個bash.man.txt,我相信才是你要用的資料檔案,
建議還是線上看啦,印出來的話,很浪費墨水和紙的。

還有info,它是比較複雜一點的使用查詢介面。比man強大,會用的話,也是有不少參考資訊。
而linux指令的使用說明,也可以在一個指令後給 (--help) 選項查。
但help也是一個指令,主要是提供bash內建指令的簡單說明。
如果你問我,那些指令是bash內建的指令?
哇哩咧!你直接打help指令看看吧!因為我一時也說不清...

至於那些非內建的指令,可以用whatis來查它的簡單使用說明。
真的很簡單!剛開始用linux的人,也許可以看看吧!
還有一個apropos指令。可以給字串當參數,讓它去找whatis的資料庫?
但使用時機,我就不太清楚了。

另外要補充的是:
man -f 等於是指令whatis
man -k 等於是指令apropos

所以以上選項,除了howto没有用以外,都是可以用來查詢linux指令用法。
我選a b c d


006. Which file is displayed directly after logging in on a text
console? (單選)
a. /etc/issue
b. /etc/login.txt
c. /etc/motd
d. /etc/messg
e. /etc/welcome
Ans: c

要登入時,會先看到/etc/issue這個檔案內容,轉換成的提示。
登入後,看到的就是/etc/motd了。
其他的選項...不管它。


007. Writing a shellscript you want to check if the file foobar exists
and is writable by the user who runs the script. Which of
the following test commands will check this? (單選)
a. test -e foobar
b. test -r foobar
c. test -b foobar
d. test -w foobar
e. test -f foobar
Ans: d

Man TEST
-b FILE FILE exists and is block special
-c FILE FILE exists and is character special
-d FILE FILE exists and is a directory
-e FILE FILE exists
-f FILE FILE exists and is a regular file
-g FILE FILE exists and is set-group-ID
-G FILE FILE exists and is owned by the effective group ID
-h FILE FILE exists and is a symbolic link (same as -L)
-k FILE FILE exists and has its sticky bit set
-L FILE FILE exists and is a symbolic link (same as -h)
-O FILE FILE exists and is owned by the effective user ID
-p FILE FILE exists and is a named pipe
-r FILE FILE exists and read permission is granted
-s FILE FILE exists and has a size greater than zero
-S FILE FILE exists and is a socket
-t FD file descriptor FD is opened on a terminal
-u FILE FILE exists and its set-user-ID bit is set
-w FILE FILE exists and write permission is granted
-x FILE FILE exists and execute (or search) permission is granted

008. Writing a shellscript you want to check if the file foobar exists
and is writable by the user who runs the script. Which of
the following test commands will check this? (單選)
a. test -e foobar
b. test -r foobar
c. test -b foobar
d. test -w foobar
e. test -f foobar
Ans: d (我猜的)

009. What command can you use to remove an existing group named foo? (單選)
a. rmgrp foo
b. delgrp foo
c. delgroup foo
d. remove --group=foo
e. groupdel foo

群組管理指令:
gpasswd
groupadd
groupdel
groupmod
groups
newgrp
chgrp

還有嗎?我再查查...
選 e


010. You want to change from old /etc/passwd format to the modern and
more save shadow password system. What command can you use for that
purpose? (單選)
a. mkshadow
b. shadow
c. sh_create
d. sh-create
e. pwconv
Ans: e (我猜的)

没錯!回復呢?用pwunconv

011. What command can be used to moitor the file /var/log/messages, to
see newly incoming messages? (單選)
a. tail -l /var/log/messages
b. tail -f /var/log/messages
c. tail -w /var/log/messages
d. cat /var/log/messages | tail -f
e. tail -10 /var/log/messages
Ans: a (我猜的)

這題要選b,這個指令若是管理linux的話,會很常用到。要背起來。

012. Enter the command (without path and options) to display information
about a given kernel module?
Ans: modinfo


013. Which file is used by modprobe to get the information, what kernel
module is needed by a particular other kernel module? (單選)
a. /etc/modules.dep
b. /etc/modules.conf
c. /lib/modules/$(uname -r)/modules.dep
d. /lib/modules/$(uname -r)/modules.conf
e. /lib/modules/$(uname -r)/modules.needed
Ans: c (我猜的)
這題在上面有提過了,選 c 没錯。
/etc/modules.conf則是設定開機時硬體需要載入的模組。


014. After compiling a new kernel on a PentiumII System, where will you
find the new kernel file? (單選)
a. /usr/src/linux
b. /usr/src/linux/kernel
c. /usr/src/linux/arch/i386/boot
d. /usr/src/linux/arch/i486/boot
e. /usr/src/linux/arch/i586/boot
Ans: c (我猜的)

015. What command can you use to read the kernel bootup messages? (Just
the command, no options)
Ans:

016. The command ____________ -r shows the release number of the
currently working kernel
Ans:

017. You have just loaded a new version of the kernel source and
installed it into /usr/src/kernelnew. In /usr/src/kernelold are the
sources of your old kernel. Before configuring the new kernel you want
to get as much configuration information as possible from the old kernel
to the new one. What file will you copy from kernelold to kernelnew to
archieve this?
a. Makefile
b. kernel.dat
c. kernel.conf
d. .config
e. .kernelconf
Ans:

018. Which file contains the main log of the system?
a. /var/mesg
b. /var/log
c. /var/log/mesg
d. /var/log/messages
e. /var/messages
Ans:d

019. How can you get informations about all manpages concerning a
command named foo?
a. apropos foo
b. whatis foo
c. man foo
d. list foo
e. which foo
Ans:

020. Which file is displayed directly after logging in on a text
console?
a. /etc/issue
b. /etc/login.txt
c. /etc/motd
d. /etc/messg
e. /etc/welcome
Ans:

021. You get a mail from user bart, in which he tells you, that he can't
execute a self written shell-script named foo. This script is placed in
the directory /home/bart and the user's current working directory is
/home/bart, too. The ls -l command shows the script and the user has
execute permission. What would probably be the reason of the problem?
a. A user may not execute scripts inside his home-directory
b. The PATH-variable don't includes the . entry
c. A normal user may not execute shellscripts anywhere
d. The enviroment-variable EXEC is not set
e. An error inside the script
Ans:

022. Which statement about the following line is true?
[ -x /usr/sbin/daemon ] && /usr/sbin/daemon
a. /usr/sbin/daemon will be executed if it exists and is executable
b. The daemon will be executed with it's own path as parameter
c. This is a recursive call to daemon
d. This isn't a valid command
Ans:

023. You have just loaded a new version of the kernel source and
installed it into /usr/src/kernelnew. In /usr/src/kernelold are the
sources of your old kernel. Before configuring the new kernel you want
to get as much configuration information as possible from the old kernel
to the new one.
What file will you copy from kernelold to kernelnew to archieve this?
a. Makefile
b. kernel.dat
c. kernel.conf
d. .config
e. .kernelconf
Ans:d (我猜的)

024. Which command will you use to control printers?
a. lpd
b. lpr
c. lpic
d. lpc
e. plp
Ans:d (我猜的)

025. What does the following entry from /etc/printcap means?
lp|lp1:\
:sd=/var/spool/lp:\
:rm=foo:\
:rp=bar:
a. This is a local Printer known as lp or lp1 with metric foo and
postscript filter bar.
b. This is a remote printer known as lp on the local machine and as lp1
on the remote machine.
c. This is a remote printer on host foo and there known as bar
d. This is a local printer which is accessable by the hosts foo and bar
e. This is a remote printer on host bar
Ans:c (我猜的)

026. The file _____________ is displayed by getty befor the login
message.
(Please enter full path and filename)
Ans: /etc/log/message (我猜的)

027. You have written a shellscript in /usr/local/bin/myscript. The
script is executable by all users. But every time when you start it, the
following error occurs: bash: myscript: No such file or directory. What
is likely to be the reason?
a. The /usr/local/bin directory is not in the PATH variable
b. You don't have read permission to myscript
c. Shellscripts are not binaries, so don't place them in a bin directory
d. You made a mistake (typo) in the #!/bin/bash line
e. You have to compile the script
Ans:b (我猜的)

028. The file /etc/syslog.conf contains the following line: *.crit
/var/log/warn
a. The syslog daemon reads its rules for all facilities with priority
"crit" or any higher priority out of the file /var/log/warn
b. All messages of all facilities with priority "crit" are written into
the file /var/log/warn
c. The file /var/log/warn contains a list of all errors which are
defined as critical
d. The syslog daemon reads its rules for all facilities with priority
"crit" out of the file /var/log/warn
e. All messages of all facilities with priority "crit" or any higher
priority are written into the file /var/log/warn
Ans: e

029. The file /etc/syslog.conf contains the following line: *.=crit
/var/log/warn
Ans: a (同上題)

030. Which criteria can be used in the logrotate configuration file to
determine when a logfile should be rotated? (複選)
a. hourly rotating
b. daily rotating
c. weekly rotating
d. monthly rotating
e. filesize
Ans:a.b.c.d (我猜的)

031. What elements may be used in a crontab file besides the scheduling
command? (複選)
a. Declaration of shell variables
b. Declaration of aliases
c. Declaration of functions
d. Declaration of a pre-exec script
e. Declaration of a post-exec script
Ans: b.c (我猜的)

032. You downloaded a file boot.img which contains the image of a
bootdisk. How can you transfer this file to a floppy disk so the disk is
bootable?
a. Mount the floppy and copy it with cp
b. Mount the floppy and copy it with rawrite
c. Use "restore boot.img > /dev/fd0"
d. Use "dd if=boot.img of=/dev/fd0"
e. Use "dd if=/dev/fd0 of=boot.img"
Ans:d (我猜的)

033. You want to set the system time, so you use the command "date
MMDDhhmm". All seems fine but after the next reboot the system time is
wrong again. What is the reason?
a. The date-command is called by an init-script which sets the wrong
time every time you boot linux
b. The date-command just sets the system time, not the cmos clock
c. Your cmos-clock runs to slow due to low battery status
d. You have to adjust the bogomips settings of your computer
Ans: b (我猜的)

034. Which service works usually on port 119 ?
a. nntp
b. http
c. pop3
d. snmp
e. imap
Ans: a

035. What is the dotted quad address of the localnet?
Ans: 192.168.1.0

036. Your network has a network address of 172.16.170.0/23. What are
valid host addresses in your network? (複選)
a. 172.16.171.0
b. 172.16.170.255
c. 172.16.171.255
d. 172.16.171.171
e. 172.16.170.0
Ans: b.d.e (我猜的) [a.c都是特殊位址]

037. You want to set the default route of your linux box to the gateway
192.168.0.1. What command do you use?
a. route add default 192.168.0.1
b. route -add default 192.168.0.1
c. route add default gw 192.168.0.1
d. route add gw 192.168.0.1
e. route add default -gw 192.168.0.1
Ans: c (我猜的)

038. What program can be used to establish a ppp connection?
a. ppp-up
b. ppp-connect
c. ppp-dial
d. wvdial
e. dial
Ans: b (我猜的)

039. You want to change from inetd to xinetd. What is necessary to do,
so that the settings from inetd can be used by xinetd?
a. Nothing, xinetd and inetd use the same configuration file
b. Rename the file /etc/inetd.conf to /etc/xinetd.conf
c. The file syntax is totaly different, so you have to write a new configuration file
d. Use the script xconv.pl, included with xinetd
e. Use the script xindet-convert, included with xinetd
Ans: d

040. What is the name of the main apache configuration file (just the name, no path)?
Ans: httpd.conf

041. What command is used to create key pairs for the ssh daemon?
a. sshkeygen
b. ssh-keygen
c. mksshkeys
d. makekey
e. mkkeys
Ans: b

042. What search option is used by the find program to find files with
SUID bit set?
a. -suid
b. -sbit
c. -perm
d. -security
e. -bit

選 c
試試 find /bin -perm +4000 -exec ls -l {} \;

LPIC Level 1 102 考古題

以下是我在準備LPIC 102時上 http://www.linux-praxis.de/lpisim 考的題目。
我把它留下來當考古題用。
基本上,這個網站若是你可以考到80分上下,我覺得實力就算是可以了。
但是千萬不要以為這裡的題目可以用來「背多分』的話,那可就大錯特錯了。
由於LPIC考的範圍廣,觀念的題目我認為比較重要。

考題的答案,我會陸續補上來.
並加上我的一些見解.

Question1/33
What command will remove a loaded kernel module?
Choose the best answer.
a.delmod
b.modrm
c.modkill
d.rmmod (v)
e.depmod

Question2/33
Which file is used by modprobe to get the information, what kernel module is
needed by a particular other kernel module?
Choose the best answer.
a./etc/modules.dep
b./etc/modules.conf
c./lib/modules/$(uname-r)/modules.dep (v)
d./lib/modules/$(uname-r)/modules.conf
e./lib/modules/$(uname-r)/modules.needed

Question3/33
You want to built a new kernel from your own. After installing the kernel
sources the next step is to configure the kernel. What command inside the
kernel directory can you use to configure the kernel?
Choose every correct answer.
a.make config (v)
b../configure
c.make menuconfig (v)
d.make xconfig (v)
e.make configure

Question4/33
What command can you use to read the boot messages of the kernel?
Choose the best answer.
a.read boot
b.cat /var/log/kernellog
c.kmem
d.dmesg (v)
e.kmesg

Question5/33
You want to activate graphical login on your Linux box so everybody can use
a secure X11. What can you do to start this service immediatly?
Choose the best answer.

a.Switch to the displaymanager runlevel (v)
b.Start the klogin program
c.Start the xlogin program
d.Start the xdm program
e.Enter the number of the displaymanager runlevel in the entry of the default runlevel in /etc/inittab.

Question6/33
Which command will you use to look at the print queues?
Choose the best answer.

a.lpd
b.lpr
c.lpq (v)
d.qpd
e.lpic

Question7/33
You are printing with lpr. Which parameter do you use to select a particular
printer?
Choose the best answer.

a.-p
b.-P (v)
c.--printer
d.-q
e.-Q

Question8/33
How can you get informations about all manpages concerning a command named
foo?
Choose the best answer.

a.apropos foo (v)
b.whatis foo
c.man foo
d.list foo
e.which foo

Question9/33
Which file is displayed directly after logging in on a text console?
Choose the best answer.

a./etc/issue
b./etc/login.txt
c./etc/motd (v)
d./etc/messg
e./etc/welcome

Question10/33
You've defined an enviroment variable FOO with the content "bar" and now you
want to start a new shell typing "bash". What of the following is neccesary
to ensure, that the variable FOO has its content "bar" also in the new
shell?
Choose the best answer.

a.Nothing,the content of a variable is automaticly inherited to the later shells.
b.You have to open the shell with a leading dot (. bash)
c.You have to type the command "export FOO" before you start the new shell. (v)
d.It is impossible to have the same variable in different shells.
e.You have to type the command "import FOO" after you've started the new shell.

Question11/33
Which files in the users home directory are read by a login shell (bash)?
Choose every correct answer.

a.~/.bash_profile (v)
b.~/.bashrc (v)
c.~/.bash_login (v)
d.~/.profile
e.~/.bash.profile

Question12/33
Writing a shellscript you want to check if the file foobar exists and is
readable by the user who runs the script. Which of
the following test commands will check this?
Choose the best answer.

a.test -e foobar
b.test -X foobar
c.test -r foobar (v)
d.test -b foobar
e.test -f foobar

Question13/33
User foo has left our company and you want to remove his account and all his
files in his homedirectory. Which of the following commands will do this?
Choose the best answer.

a.rm -rf /home/foo
b.userdel -r foo (v)
c.killuser foo
d.deluser -r foo
e.kill -HOME foo

Question14/33
What command can you use to remove an existing group named foo?
Choosethe best answer.

a.rmgrp foo
b.delgrp foo
c.delgroup foo
d.remove --group=foo
e.groupdel foo (v)

Question15/33
What program converts old /etc/passwd files to shadow password
system?(just the name without path and options)
Type the answer.

pwconv

Question16/33
You want all messages from the kernel with a priority of "warn" or higher
to be displayed on your 10th virtual terminal. What line in /etc/syslog.conf
guarantees this?
Choose the best answer.

a.kernel.warn /dev/tty10
b.kernel.=warn /dev/tty10
c.kern.warn /dev/tty10 (v)
d.kern.=warn /dev/tty10
e.kern.warn /dev/tty9

Question17/33
What program can be used to guarantee that logfiles do not grow
indefinitely?
Choose the best answer.

a.logrotate (v)
b.logcheck
c.logger
d.syslogd
e.loglimit

Question18/33
What is the difference between cron and anacron?
Choose the best answer.

a.anacron is an old (anachronistic) version of cron
b.cron jobsget lost if the computer isn't running at the given time, anacron jobs don't get lost. (v)
c.cron can only be used by root, anacron can be used by every user
d.anacron can only be used by root, cron can be used by every user
e.there is no difference

Question19/33
The command ___________ -e will open an editor where you can add new cron jobs.
Type the answer.

crontab

Question20/33
You want to make a full backup of the /home directory with cpio. It shall be
stored in the file /var/backup.home.
What is the proper command?
Choose the best answer.

a.find /home | cpio -o > /var/backup.home (v)
b.cpio -if=/home -of=/var/backup.home
c.cpio -f /var/backup.home /home/*
d.cpio -Rf /var/backup.home /home/*
e.cpio -rf /var/backup.home /home/*

Question21/33
What is the effect of the command "date +%M" ?
Choose the best answer.

a.The system time (only minutes) is adjusted using the cmos clock.
b.The current month is written to stdout
c.The current time (only minutes) is written to stdout (v)
d.The system time is adjusted plus one minute.
e.The system date is adjusted plus one month.

Question22/33
Which service works usually on port 22 ?
Choose the best answer.

a.ftp
b.ssh (v)
c.telnet
d.smtp
e.dns

Question23/33
What is the dotted quad address of the localnet?
Type the answer.

127.0.0.0/8

Question24/33
The dotted quad netmask 255.255.255.192 is in CIDR notation
Choosethe best answer.

a./25
b./26 (v)
c./27
d./28
e./29

Question25/33
You get the IP-address 191.123.234.168/29 from your ISP. What is your
network address in dotted quad?
Type the answer.

191.123.234.168


Question26/33
What command is used to set the default route?
Choose the best answer.

a.route (v)
b.setroute
c.gw
d.gateway
e.setgw

Question 27/33
What command is run by pppd after a connection was brought down?
Choose the best answer.

a.ppp-down
b.ip-down (v)
c.ppp-disconnect
d.ppp-offline
e.pppdown

Question 28/33
You want to restrict access to your services, so that only hosts from your
local network 192.168.1.0 can use them. What entries in /etc/hosts.allow and
/etc/hosts.deny will you use?
Choose the best answer.

a."ALL:192.168.1.0" in hosts.allow and "ALL:ALL BUT 192.168.1.0" in hosts.deny (v)
b."ALL:192.168.1." in hosts.allow and "ALL:ALL" in hosts.deny
c."ALL:192.168.1." in hosts.allow and "ALL: NONLOCAL" in hosts.deny
d."ALL:ALL" in hosts.allow and "ALL:LOCAL" in hosts.deny
e."ALL:LOCAL" in hosts.allow and an empty hosts.deny

Question29/33
What is the central configuration file for sendmail?
Choos ethe best answer.

a./etc/sendmail.conf
b./etc/mail/sendmail.conf
c./etc/sendmail.cf (v)
d./etc/mail.co
e./etc/sendmail.co

Question30/33
In what file do you declare, what host may use what directory of our
local linux box using nfs?
Choose the best answer.

a./etc/nfs.conf
b./etc/nfsd.conf
c./etc/nfsexports
d./etc/exports (v)
e./etc/hosts.allow

Question31/33
What is the main configuration file of a BIND8 nameserver?
(just the name without path)
Type the answer.

named.conf

Question32/33
What are the default tables of iptables?
Choose the best answer.

a.input output and forward
a.accept,deny and reject
a.filter,nat and mangle (v)
a.postrouting and prerouting

Question33/33
If the file /etc/nologin exists, no user can login into your system. But
what happens with already logged in users if you create this file?
Choose the best answer.

a.they are automatically logged out
b.they receive a message on their screens that they should log out
c.nothing (v)

考試去

終於和同事敲定了LPIC102的考試日期。
之前由於不知道在我們嘉義也有VUE的考場,還笨笨的想去台中或是台南考。

還好VUE報名系統設計得還不錯,很人性化的把我們可以考試的地點給排出來。
加上Google MAP的功能,嗯!把考試地點也秀出來。

12月24日,就是通過LPI Level 1的日子了。


檢視較大的地圖

2007年12月15日 星期六

在grub開機畫面加入底圖

玩linux有個很有趣的特色是,
網路上總是有各式各樣的玩家提供許許多多的技巧,
只要你願意,linux就可以變成你想要的模樣。

也許也有更多的電腦玩家會說,
在M$ windows的世界裡,我也能改造我的windows啊!
而且更棒更炫!

啊哈!那就是青菜蘿蔔各有所好的因素了。
没什麼好爭的。

這回我想改造的玩意,
是依附在grub裡頭的東東!
grub現在己經是linux通用的開機管理軟體了,
由於功能愈改愈強大,
現在己經能把圖檔嵌入開機的畫面中了。

改造出一個專屬的grub開機畫面,
這個主題應該可以吸引你來學學怎麼做吧。

OK!Just do it.

在 grub 內要達到這個目的,有幾個規則要遵守。
1.圖檔最好限制在 640 x 480 (像素)。
2.顏色最多 14 色,而且檔案格式為是xpm。
3.需經過 gzip 壓縮為 gz 檔
4.圖檔相關設定要加在grub軟體的設定檔,menu.lst 之中

來,讓我用以上的四項規則,一步一步來完成這次的任務吧。

為了示範,我找了張全家福照片。
(看看就好,你應該不會用我的全家福照片吧!)
圖一:

你可以不用管這圖片是什麼檔案格式,但是你一定要把它改成是640 x 480 像素的圖檔!
因為我們使用linux,所以當然用GIMP來改造你的圖檔囉。
改好圖檔的大小後,先把它存成PNG檔案格式。(BMP,JPG,TIF也都行!)
完成規則一。

接著,用convert程式來轉檔,把你之前的PNG圖檔轉成XPM格式。
並且把圖檔的顏色轉到14色,這個限制以內。
指令如下:
bullock@ubuntu:~$ convert -colors 14 myfamily.png myfamily.xpm

在此要注意一點,如果你的系統没有convert指令可用的話,
那麼你就必須安裝 imagemagick 這個套件。
由於我用ubuntu的緣故,所以我安裝套件的指令如下:
bullock@ubuntu:~$ sudo apt-get install imagemagick
到此規則二完成!

bullock@ubuntu:~$ gzip myfamily.xpm
用gzip指令完成規則三!簡單吧。

最後一個規則,
設定好 grub 的 menu.lst 檔案。
由於要讓grub好管理這個新設定,以及這個壓縮過的圖檔。
我們把它放到 /boot/grub/ 和menu.lst 一起。
bullock@ubuntu:~$ sudo cp grubsplash.xpm.gz /boot/grub/

接著編輯 /boot/grub/menu.lst ,將圖檔資料加入。
bullock@ubuntu:~$ sudo vi /boot/grub/menu.lst

加入一行,內容如下:
splashimage (hd0,2)/grub/myfamily.xpm.gz

好了,重新開機檢視你的成果吧。
圖二:(我用Virtual Box抓下來的)

2007年12月4日 星期二

蝴蝶結的打法



蝴蝶結的打法?
没錯,吳大這次要記錄下來的日誌居然是如何打蝴蝶結!



吳大:
我不懂?為什麼我們資訊人員也要學包裝?

主管:
多學一項技能不是很好嗎?有時候你們也可能去賣場支援啊。


吳大:
去支援?不會吧!難道我們資訊設備有問題時,別的部門有可能來支援嗎?本來就是不同的工作內容了,怎麼會要我們去支援賣場呢?

主管:
這是店長的指示,將來你們還要學結帳哩。
反正百貨業就是這樣,包裝,結帳等,都是員工的基本技能,都至少要懂一些就是了。
上完課要考試哦!

吳大:
哇哩咧!考試...
我還没考完LPI呢。

反正就是這樣啦!
上完課,趕緊來惡補一下,怎麼把蝴蝶結搞定吧。
包裝紙的部分是學會了,但奇怪,那個蝴蝶結就是搞不定...
下面是我看過最簡單明解的圖解說明了。
轉貼過來做備忘。

來源:Bonnie & Crafts

以下引文開始:
很簡單的幾個訣竅跟大家分享~
1. 先打個結(注意正反面):

2. 左邊的緞帶抓出耳朵


3.將右邊的緞帶從耳朵前面繞過(記得翻面):


4. 接下來從耳朵後方繞上去(再次翻面):


5. 跟第3個步驟一樣繞到前面(第2個耳朵產生!):


6.把第2個耳朵從剛剛繞的圈圈塞過去:


7. 第2個耳朵也歸位啦!接下來只要拉緊調整就好了~

搜尋此網誌

本站大事記

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

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

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