<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux, MySQL, PhP, Perl... &#187; LPI</title>
	<atom:link href="http://linux.bgsnow.com/category/linux-professional-institute/feed" rel="self" type="application/rss+xml" />
	<link>http://linux.bgsnow.com</link>
	<description></description>
	<lastBuildDate>Fri, 18 Jun 2010 16:30:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Having fun with /dev/console</title>
		<link>http://linux.bgsnow.com/having-fun-with-devconsole.php</link>
		<comments>http://linux.bgsnow.com/having-fun-with-devconsole.php#comments</comments>
		<pubDate>Tue, 14 Oct 2008 17:46:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[LPI]]></category>

		<guid isPermaLink="false">http://linux.bgsnow.com/?p=101</guid>
		<description><![CDATA[While wondering how to direct output to my console I come upon a funny thing. Under Ubuntu 8.04.1 try sudo cat /dev/console and just watch (if you can) I know it is stupid but this is just another outdated thing which is questioned in the current LPI exam Anyway, according to some sources output directed [...]]]></description>
			<content:encoded><![CDATA[<p>While wondering how to direct output to my console I come upon a funny thing. Under Ubuntu 8.04.1 try sudo cat /dev/console and just watch (if you can) <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I know it is stupid but this is just another outdated thing which is questioned in the current LPI exam <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Anyway, according to <em>some </em>sources output directed to /dev/console should be shown on the xconsole session <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This should be especially useful when debugging applications. Presumably, if you know the facility and the priority of the debugging messages, you could direct them through syslog to the console.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux.bgsnow.com/having-fun-with-devconsole.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LPIC-1 (LPI 102) Syslog Cheatsheet</title>
		<link>http://linux.bgsnow.com/lpic-1-lpi-102-syslog-cheatsheet.php</link>
		<comments>http://linux.bgsnow.com/lpic-1-lpi-102-syslog-cheatsheet.php#comments</comments>
		<pubDate>Sun, 12 Oct 2008 19:56:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[LPI]]></category>

		<guid isPermaLink="false">http://linux.bgsnow.com/?p=88</guid>
		<description><![CDATA[It is very probable that each LPIC-1 102 exam contains a twisted question about the neglected syslog. Here are some configuration options taken from 'man syslog' to get us pass through: mail.*;mail.!=info       /var/log/mail - this means that all messages from the mail facility with any priority but 'info' will be logged in the file /var/log/mail [...]]]></description>
			<content:encoded><![CDATA[<p>It is very probable that each LPIC-1 102 exam contains a twisted question about the neglected syslog.</p>
<p>Here are some configuration options taken from 'man syslog' to get us pass through:</p>
<p><em>mail.*;mail.!=info       /var/log/mail</em> - this means that all messages from the mail facility with any priority but 'info' will be logged in the file <em>/var/log/mail</em></p>
<p><em>news.info;news.!crit     /var/log/news</em> - all messages from news.info (including) to  news.crit  (excluding)  would be logged to the <em>/var/log/news</em> file.</p>
<p><em>mail.!debug</em> - putting only this on a line means to skipp all mail messages but the ones for debugging</p>
<p><em>*.*            @example.org </em>- this means to redirect all messages to example.org</p>
<p><em>kern.=debug              |/usr/adm/debug </em>- route only kernel debugging messages to the debug pipe</p>
]]></content:encoded>
			<wfw:commentRss>http://linux.bgsnow.com/lpic-1-lpi-102-syslog-cheatsheet.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LPIC-1 102 Documentation Cheatsheet</title>
		<link>http://linux.bgsnow.com/lpi-1-102-documentation-cheatsheet.php</link>
		<comments>http://linux.bgsnow.com/lpi-1-102-documentation-cheatsheet.php#comments</comments>
		<pubDate>Sun, 12 Oct 2008 09:24:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[LPI]]></category>

		<guid isPermaLink="false">http://linux.bgsnow.com/?p=75</guid>
		<description><![CDATA[man -aw [subject] - shows the files corresponding to all entries for a subject. man -k = apropos - searchs name and detail description man -f = whatis - searches one line summaries Man sections 1   Executable programs or shell commands 2   System calls (functions provided by the kernel) 3   Library calls (functions within program [...]]]></description>
			<content:encoded><![CDATA[<p><strong>man -aw [subject]</strong> - shows the files corresponding to all entries for a subject.<br />
<strong>man -k = apropos </strong>- searchs name and detail description<br />
<strong>man -f = whatis</strong> - searches one line summaries</p>
<p>Man sections<br />
1   Executable programs or shell commands<br />
2   System calls (functions provided by the kernel)<br />
3   Library calls (functions within program libraries)<br />
4   Special files (usually found in /dev)<br />
5   File formats and conventions eg /etc/passwd<br />
6   Games<br />
7   Miscellaneous (including macro  packages  and  conventions), e.g. man(7), groff(7)<br />
8   System administration commands (usually only for root)</p>
<p>Man searches the $MANPATH for its entries. Usually these entries are stored in gz format in /usr/man/ (or /usr/share/man/). Uses the $PAGER variable to present the output.</p>
<p><strong>/etc/issue</strong> - shows text on console when you log in locally<br />
<strong>/etc/issue.net</strong> - shows text on console when you log in remotely<br />
<strong>/etc/motd</strong> - moto of the day - displays on all logins</p>
<p>You can search for help online (stupid):</p>
<p>- The linux documentation project<br />
- Online guides<br />
- Vendor sites<br />
- Mailing lists</p>
]]></content:encoded>
			<wfw:commentRss>http://linux.bgsnow.com/lpi-1-102-documentation-cheatsheet.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LPIC-1 102 Printing Cheatsheet</title>
		<link>http://linux.bgsnow.com/lpic-1-102-printing-cheatsheet.php</link>
		<comments>http://linux.bgsnow.com/lpic-1-102-printing-cheatsheet.php#comments</comments>
		<pubDate>Sun, 12 Oct 2008 07:47:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[LPI]]></category>

		<guid isPermaLink="false">http://linux.bgsnow.com/?p=66</guid>
		<description><![CDATA[One of the most unpleasant topics in LPIC-1 (LPI 102) is the one about printing. That's why I have prepared the following must-know cheatsheet about the exam. /etc/printcap - the file which describes the available printers and their options. Used by the main spooling daemon. Important options: if=input_filter lp=printer_device lf=log_file mx=max_size sd=spool_directory /var/spool/lpd/lpi - the [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most unpleasant topics in LPIC-1 (LPI 102) is the one about printing. That's why I have prepared the following must-know cheatsheet about the exam.</p>
<p><em>/etc/printcap</em> - the file which describes the available printers and their options. Used by the main spooling daemon. Important options:</p>
<p>if=input_filter<br />
lp=printer_device<br />
lf=log_file<br />
mx=max_size<br />
sd=spool_directory</p>
<p><em>/var/spool/lpd/lpi</em> - the spooling directory for a sample printer called 'lpi'. It contains all the queued print jobs and control files for the lpi printer.</p>
<p><strong>lpq [Options] [Users] [job id]</strong></p>
<p># lpq -Plpi - show the queued jobs for the lpi printer</p>
<p><strong>lprm [-Pprinter name] [users] [job id] </strong>- remove printer jobs</p>
<p><strong>lpc [command] [printer name] [job id]</strong> - printing control</p>
<p># lpc help<br />
Commands may be abbreviated.  Commands are:<br />
abort   enable  disable help    restart status  topq    ?<br />
clean   exit    down    quit    start   stop    up</p>
<p># lpc topq lpi 102 - move print job 102 to the top of the queue for the lpi printer</p>
<p># lpc disable lpi - disallow new jobs to be queued for the lpi printer. Allow the ones already queued to be completed.</p>
<p>Here is the ultimate printing command <strong>'lpr -Plpi -J "LPI test print" -#2 -m -p -q -r lpi.txt</strong>' - this means to use the printer lpi, to name the job "LPI test print", to make 2 copies of it, send mail upon completion, to make it in Pretty format, to queue it for later and finali to remove the file when done.</p>
<p>lpstat -s = lpstat -d -c -v - Display default printer, all available printers and classes</p>
<p>lpstat -p = lpc status - check printers' statuses</p>
<p>Use <strong>cupsenable</strong> and <strong>cupsdisable</strong> to enable and disable a printer.</p>
<p># lp -i 16 -n 5 - change the number of copies to 5 for job id 16</p>
<p>Filters are used to convert generic data to printable data:<br />
<strong>Raw data -&gt; Post Script (PDL format) -&gt; Ghost Script (Printer specific data) -&gt; Printer</strong></p>
<p>To use a Samba printer you need to:<br />
1. use smbprint input filter<br />
2. Have a .config file with in the spool directory defining server, service and password.</p>
<p><strong>CUPS uses MIME types to determine the correct filter for a file.</strong></p>
<p>lpadmin -x [printer name / printer class] - deletes a printer / class.</p>
<p>A <strong>printer class</strong> is responsible for properly distributing the jobs to a group of printers.</p>
]]></content:encoded>
			<wfw:commentRss>http://linux.bgsnow.com/lpic-1-102-printing-cheatsheet.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More LPI 102 Stuff</title>
		<link>http://linux.bgsnow.com/more-lpi-stuff.php</link>
		<comments>http://linux.bgsnow.com/more-lpi-stuff.php#comments</comments>
		<pubDate>Mon, 06 Oct 2008 18:48:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[LPI]]></category>

		<guid isPermaLink="false">http://linux.bgsnow.com/?p=39</guid>
		<description><![CDATA[While making tests from http://www.penguintutor.com/cgi-bin/quiz/index.pl?&#38;style=default (an excellent resource for preparing for the exam) I have come upon a few mistakes. Here is one of them: --------------------------------------------------------------------------------------- Name: passer        Question: 21 / 25 Ref No: linuxquiz_0047 Which line below could be a valid line in the /etc/group file? The users: john, stewart and fred should [...]]]></description>
			<content:encoded><![CDATA[<p>While making tests from http://www.penguintutor.com/cgi-bin/quiz/index.pl?&amp;style=default (an excellent resource for preparing for the exam) I have come upon a few mistakes. Here is one of them:</p>
<p>---------------------------------------------------------------------------------------</p>
<div id="stats">
<p>Name: passer        Question: 21 / 25</p></div>
<h3>Ref No: linuxquiz_0047</h3>
<div id="question">
<p>Which line below could be a valid line in the /etc/group file? The users: john, stewart and fred should all be members of the finance group. Select the most appropriate answer.</p>
<form action="score.pl">
<input name="style" type="hidden" value="default" />
<input name="answer" type="radio" value="0" /> finance:x:503:john,stewart,fred</p>
<input name="answer" type="radio" value="1" /> 503:finance:x:john,stewart,fred</p>
<input name="answer" type="radio" value="2" /> finance:503:x:john,stewart,fred</p>
<input name="answer" type="radio" value="3" /> john,stewart,fred:finance:x:503</p>
</form>
<p><br class="clearboth" /></div>
<div id="answer">
<p><span class="reviewwrong">Incorrect</span></p>
<p>Your answer:</p>
<p>finance:x:503:john,stewart,fred</p>
<p>Correct answer:</p>
<p>The correct answer is <strong>finance:503:x:john¸stewart¸fred</strong>.</p>
<p><strong>Well, this is obviously wrong <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  My answer is the correct one <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </strong>Here is a great reference from one of my favorite Linux sites:</p>
<p>http://www.cyberciti.biz/faq/understanding-etcgroup-file/</p>
<p>---------------------------------------------------------------------------------------</p></div>
<div>
<p>You might also wonder what means '<strong>quaded decimal netmask in CIDR notation</strong>'. If you just take a look at 192.168.0.22<strong>/24, </strong>it is what /24 stands for <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <strong>Subnetting</strong> is more likely the term you are acquainted with and you could easily recall the basic rules from the following chart taken from Wikipedia:</p>
<div class="wp-caption alignnone" style="width: 549px"><img title="Subnetting" src="http://upload.wikimedia.org/wikipedia/en/6/6e/Subnetting.png" alt="Subnetting" width="539" height="220" /><p class="wp-caption-text">Subnetting</p></div>
<p>---------------------------------------------------------------------------------------</p>
<div>
<p>Another thing that really bothers me is that there is no 'breakfast' time for the 'at' command while there is 'teatime'. This command does take some funky input <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>---------------------------------------------------------------------------------------<br />
Also, there is one less popular file called /etc/sysconfig/network. I just wonder how could I have missed it until now <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I guess that's one thing 'setup' changes automatically for you:</p>
<p>NETWORKING=yes<br />
FORWARD_IPV4=yes<br />
HOSTNAME=linux.bgsnow.com<br />
GATEWAY=192.168.0.1<br />
GATEWAYDEV= eth3</p>
<p>---------------------------------------------------------------------------------------</p>
<p>Playing with <strong>logger</strong> <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This is another simple program which logs messages to the default syslog file. For example, on my box:</p>
<p>terry@:~$ logger<br />
zaaeeeebi<br />
i am the biggest hacker in the world <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>terry@:~$</p>
<p><em>on my other console:</em></p>
<p>terry@:~$ tail -f /var/log/messages<br />
Oct  6 19:39:41 a2 -- MARK --<br />
Oct  6 19:45:16 a2 kernel: [ 5171.047451] gnome-screensav[593]: segfault at 00000200 eip b7f4cb9d esp bfe87d90 error 4<br />
Oct  6 19:59:41 a2 -- MARK --<br />
Oct  6 20:19:41 a2 -- MARK --<br />
Oct  6 20:39:41 a2 -- MARK --<br />
Oct  6 20:59:41 a2 -- MARK --<br />
Oct  6 21:19:41 a2 -- MARK --<br />
Oct  6 21:39:41 a2 -- MARK --<br />
Oct  6 21:59:41 a2 -- MARK --<br />
Oct  6 22:17:16 a2 terry: asdasd<br />
Oct  6 22:18:11 a2 terry: zaaeeeebi<br />
Oct  6 22:18:20 a2 terry: i am the biggest hacker in the world <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Oct  6 22:18:20 a2 terry:</p>
<p>terry@:~$</p>
<p>Probably logger is not the command you are going to use every day but it seems to be quite popular for the LPI 102 exam. Googling for it will render endless number of irrelevant results so you better check its man page.</p>
<p>---------------------------------------------------------------------------------------</p>
<p>Freaking admins with <strong>shutdown -k</strong></p>
<p>I guess the inventor of shutdown has a good sense of humor and wants to provide an easy way for the community to freak admins by sending bogus shutdown messages <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  When you have a new admin, make sure he / she is logged on a system and issue:</p>
<p>root@a2:/home/terry# shutdown -k 1 u suck and i 0wn u, little tward. everything is deleted and shutting down!</p>
<p>Broadcast message from terry@a2<br />
(/dev/pts/1) at 22:43 ...</p>
<p>The system is going down for maintenance IN ONE MINUTE!<br />
u suck and i 0wn u, little tward. system is deleted and shutting down!<br />
root@a2:/home/terry#</p>
<p>This is the so called psychological training for new guys to get used to the rough reality <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It may also help you pass the LPI exam and answer the twisted questions about the shutdown command <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ))</div>
<p>---------------------------------------------------------------------------------------</p>
<p>Now another funny thing - the well know <strong>init</strong> command has an option to reload its configuration (don't tell me you haven't reloaded the init configuration without rebouting). It is taken again from PenguinTutor:</p>
<h3>Ref No: linuxquiz_0028</h3>
<div id="question">
<p>What command is used to reload the /etc/inittab file after it has been updated? Choose the most appropriate answer:</p>
<form action="score.pl">
<input name="style" type="hidden" value="default" />
<input name="answer" type="radio" value="0" /> /sbin/init q</p>
<input name="answer" type="radio" value="1" /> /sbin/init r</p>
<input name="answer" type="radio" value="2" /> /sbin/init s</p>
<input name="answer" type="radio" value="3" /> /sbin/init 6<br />
</form>
<p> <br class="clearboth" /></div>
<div id="answer">
<p><span class="reviewnotanswered">Not Answered</span></p>
<p>Your answer:</p>
<p>No answer</p>
<p>Correct answer:</p>
<p>The correct command is <strong>/sbin/init q</strong>. The r option is not a valid option for the init command. The s option will change to single user mode, and the 6 option will reboot the system. The option q is the most appropriate as it reloads the configuration file without rebooting the server.</div>
<p>One thing is that according to the only documentation I find 'q' is for quite, suppressing the errors...</p>
<p><em>oot@a2:/home/terry# init --help<br />
Usage: init [OPTION]...<br />
Process management daemon.</p>
<p>Options:<br />
-q, --quiet                 reduce output to errors only<br />
-v, --verbose               increase output to include informational messages<br />
--help                  display this help and exit<br />
--version               output version information and exit</p>
<p>This daemon is normally executed by the kernel and given process id 1 to denote its special status.  When executed by a user process, it will actually run<br />
/sbin/telinit.</p>
<p>Report bugs to &lt;upstart-devel@lists.ubuntu.com&gt;</em></p>
<p>Another funny thing is that there are many other undocumented options such as:</p>
<p>root@a2:/home/terry# init a<br />
root@a2:/home/terry# init b<br />
root@a2:/home/terry# init c<br />
root@a2:/home/terry# init d<br />
init: illegal runlevel: d<br />
Try `init --help' for more information.</p>
<p>If you guessed that a, b and c (just like q) did nothing, you guessed it right <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I hope there is no such a stupid question on the exam <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>---------------------------------------------------------------------------------------</p></div>
]]></content:encoded>
			<wfw:commentRss>http://linux.bgsnow.com/more-lpi-stuff.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LPI 117-102 Practice test with answers and explanations</title>
		<link>http://linux.bgsnow.com/lpi-117-102-practice-test-with-answers-and-explanations.php</link>
		<comments>http://linux.bgsnow.com/lpi-117-102-practice-test-with-answers-and-explanations.php#comments</comments>
		<pubDate>Sat, 05 Jul 2008 08:28:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[LPI]]></category>

		<guid isPermaLink="false">http://linux.bgsnow.com/?p=15</guid>
		<description><![CDATA[1. By default on which file system the Linux dump command operates? a. EXT2 b. JFS c. XFS d. ReiserFS e. EXT3 Answer: a and e Explanation: It might be considered a bug that the latest version of dump can only handle ext2/3  filesystems. 2. Which single command changes the subnet of a network interface? [...]]]></description>
			<content:encoded><![CDATA[<p>1. By default on which file system the Linux dump command operates?</p>
<p>a. EXT2<br />
b. JFS<br />
c. XFS<br />
d. ReiserFS<br />
e. EXT3</p>
<p>Answer: a and e</p>
<p>Explanation: It might be considered a bug that the latest version of dump can only handle ext2/3  filesystems.</p>
<p>2. Which single command changes the subnet of a network interface?</p>
<p>a. route<br />
b. default<br />
c. netstat<br />
d. ifconfig<br />
e. none of the above</p>
<p>Answer: d. ifconfig allow you to change all parameters of an interface. Here is an example:</p>
<p>ifconfig wlan0 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255</p>
<p>3. Which file system should not be backed up / restored?</p>
<p>a. ext2<br />
b. xfs<br />
c. ext3<br />
d. /home<br />
e. swap</p>
<p>Answer: e. Swap stores temporary information which can be easily recreated.</p>
<p>4. Which directory tree should not be backed up / restored?</p>
<p>a. /tmp<br />
b. /etc<br />
c. /proc<br />
d. /usr<br />
e. /home</p>
<p>Answer: a and c. /tmp stores only temporary files with short life cycle. /proc is dynamically generated by the kernel.</p>
<p>5. What command verifies for syntax errors in /etc/hosts.allow and /etc/hosts.deny?</p>
<p>a. tcpdchk<br />
b. udpdchk<br />
c. netstat<br />
d. iptables<br />
e. setup</p>
<p>Answer: a. tcpdchk checks only for syntax errors the files in question.</p>
<p>6. How can you enable onscreen numbers in a vi (vim) session?</p>
<p>a. set nu<br />
b. se nu<br />
c. set num<br />
d. set +o num<br />
e. set +o nu</p>
<p>Answer: a. and b. It is quite tricky to recognize that set can be used as se for shorter. Unnaturally nu and num are not the same <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>7. How can you set a user's password invalid after 60 days?</p>
<p>a. passwd -x 60 user<br />
b. passwd -e 60 user<br />
c. chage -M 60 user<br />
d. change -m 60 user<br />
e. usermod -f 60 user</p>
<p>Answers: a. and c. You have to study in details the manuals for passwd, chage and usermod. It is imortant to note the differences between these cases:</p>
<p>- a password expires, the user can log in and change it<br />
- a password has expired and the user cannot log in to change it.</p>
<p>8. What is the binary conversion of the IP address 10.0.15.124?</p>
<p>a. 00101001.00000000.00000001.00011101<br />
b. 00001010.00000000.00001111.01111100<br />
c. 00011010.00000000.00001111.01111100<br />
d. 00011010.00000000.00001101.01111100<br />
e. 00001010.00000000.00001111.01101100</p>
<p>Answer: b. Converting decimals to binary should be quite straightforward. Check this link for help:</p>
<p>http://www.wikihow.com/Convert-from-Decimal-to-Binary</p>
<p>9. The file .rhosts when put in a user's home directory specifies:</p>
<p>a. which remote hosts can log in with the user's username without password<br />
b. which remote hosts are known to the ssh server<br />
c. which remote hosts can be accessed with user's username without password<br />
d. which remote hosts are allowed to connect with the user's username<br />
e. none of the above</p>
<p>Answer: a. The answer is pretty self explanatory. You should know that this option is rarely used nowadays because of security concerns.</p>
<p>10. Which file examines ldconfig for paths to libraries?</p>
<p>a. /etc/ld.so.conf<br />
b. /etc/modules.conf<br />
c. /etc/conf.modules<br />
d. /etc/ld.so.cache<br />
e. none of the above</p>
<p>Answer: a. ldconfig examines /etc/ld.so.conf for all paths to libraries. After that /etc/ld.so.cache is generated.</p>
<p>11. Which command will create / update /etc/shadow to md5 compatible?</p>
<p>a. passconv<br />
b. pwconv<br />
c. mdconv<br />
d. passwd<br />
e. sha1sum</p>
<p>Answer: b. It is important to know that pwconv either creates (if there is no /etc/shadow) or updates the file /etc/shadow with the passwords from /etc/passwd (seconf field on each row). Once the password is converted to /etc/shadow, it is deleted from /etc/passwd (substituted with x).</p>
<p>12. Which command (with exact options) was run to produce the following output?</p>
<p>USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND<br />
root      4366  0.0  0.0   1696   516 tty4     Ss+  13:19   0:00 /sbin/getty 384<br />
root      4367  0.0  0.0   1692   516 tty5     Ss+  13:19   0:00 /sbin/getty 384<br />
root      4370  0.0  0.0   1692   512 tty2     Ss+  13:19   0:00 /sbin/getty 384<br />
root      4371  0.0  0.0   1692   516 tty3     Ss+  13:19   0:00 /sbin/getty 384<br />
root      4372  0.0  0.0   1696   520 tty1     Ss+  13:19   0:00 /sbin/getty 384<br />
root      4373  0.0  0.0   1692   516 tty6     Ss+  13:19   0:00 /sbin/getty 384<br />
root      4965  1.5  3.2  38080 32880 tty7     Ss+  13:19   4:49 /usr/bin/X :0 -<br />
terry     6678  3.5  0.3   5748  3096 pts/0    Ss   18:30   0:00 bash<br />
terry     6708  0.0  0.0   2620  1000 pts/0    R+   18:30   0:00 the_command <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Answer: ps au. Make sure you are fully familiar with ps and all of its useful options - from au to auxwf.</p>
<p>13. You wish to copy files overwriting old files. The cp command is aliased with -i (prompt before overwriting). What is the best choice:</p>
<p>a. use cp -f to force to overwriting<br />
b. use the full path to cp /bin/cp to escape the alias<br />
c. use cp -y - to answer yes to all promots<br />
d. use mc<br />
e. first remove the old files and then copy the new ones over</p>
<p>Answer: b . The easiest solution is to use the full path to cp. There is no way to escape the prompts when -i is aliased <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>14. Which command will show the last kernel messages?</p>
<p>a. dmesg<br />
b. tail /var/log/messages<br />
c. lsmod<br />
d. modinfo<br />
e. none of the above</p>
<p>Answer: a and b. The difference is that dmesg shows only kernel messages, while /var/log/messages may log other things too.</p>
<p>15. When you run 'runlevel', the output is 'N 2'. What does it mean?</p>
<p>a. The current runlevel is 2, there is no previous runlevel<br />
b. The current runlevel is N, the previous runlevel is 2.<br />
c. The current runlevel is N 2.<br />
d. The above output is not possible.<br />
e. There is no such command runlevel.</p>
<p>Answer: a. runlevel specifies first the previous runlevel and then the current runlevel. N means there has been no previous runlevel.</p>
<p>16. Your IP is 192.168.0.15 with netmask 255.255.255.192. Which of the following IPs are not part from your network:</p>
<p>a. 192.168.0.44<br />
b. 192.168.0.18<br />
c. 192.168.0.99<br />
d. 192.168.0.244<br />
e. 192.168.0.2</p>
<p>Answer: c and d. By subnetting 255.255.255.192 defines separate networks with 64 hosts (64=256-192. Of course the first IP is used for the network address while the last is for broadcasts). For self-checking purposes, I recommend using sipcalc, a linux console based IP calculator. Here is how the above can be checked with it:</p>
<p>terry@a1:~$ sipcalc -a 192.168.0.15 255.255.255.192</p>
<p>17. How are you going to flush all pring jobs from all queues?</p>
<p>a. lprm -a all<br />
b. lprm -all<br />
c. lprm *<br />
d. lpadmin --remove-all<br />
e. none of the above</p>
<p>Answer: a. Lprm is not very intuitive so make sure to study its manual in details <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>18. How are you going to enable traffic forwarding between two NICs in the kernel configuration?</p>
<p>a. echo 'ip_forward=yes' /etc/network/interfaces<br />
b. echo 'ip_forward=yes' &gt;&gt; /etc/modules.conf<br />
c. echo yes &gt; /proc/sys/net/ipv4/ip_forward<br />
d. echo 1 &gt; /proc/sys/net/ipv4/ip_forward<br />
e. It is not possible to change it on the fly. You have to recompile the kernel with this option checked.</p>
<p>Answer: d. The file /proc/sys/net/ipv4/ip_forward is generated by the kernel at boot time but changes are re-read. Make sure 1 is specified there in order traffic forwarding to work.</p>
<p>19. According to RFC 1918, which of the following networks are private?</p>
<p>a. 10.0.0.0 netmask 255.0.0.0<br />
b. 192.168.0.0 netmask 255.255.0.0<br />
c. 191.168.0.0 netmask 255.255.0.0<br />
d. 172.16.0.0 netmask 255.240.0.0<br />
e. 11.0.0.0 netmask 255.0.0.0</p>
<p>Answers: a, b and c. Make sure to note that 172.16.0.0 has a subnet mask which defines as private all IPs from 172.16.0.0 to 172.31.255.255.</p>
<p>20. Which protocol ping and traceroute depend on?</p>
<p>a. TCP<br />
b. UDP<br />
c. ICMP<br />
d. TCP/IP<br />
e. IPX</p>
<p>Answer: ping and traceroute use ICMP - Internet Control Message Protocol defined in RFC 792</p>
]]></content:encoded>
			<wfw:commentRss>http://linux.bgsnow.com/lpi-117-102-practice-test-with-answers-and-explanations.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
