<?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>Everlinux's Blog &#187; LPI</title>
	<atom:link href="http://everlinux.com/blog/category/lpi/feed" rel="self" type="application/rss+xml" />
	<link>http://everlinux.com/blog</link>
	<description>Sempre vivendo, aprendendo e blogando... :)</description>
	<lastBuildDate>Fri, 30 Jul 2010 18:13:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Dicas para Certificação (LPI/Mandriva)</title>
		<link>http://everlinux.com/blog/2009/01/28/dicas-para-certificacao-lpimandriva</link>
		<comments>http://everlinux.com/blog/2009/01/28/dicas-para-certificacao-lpimandriva#comments</comments>
		<pubDate>Wed, 28 Jan 2009 20:52:13 +0000</pubDate>
		<dc:creator>Tiago Cruz</dc:creator>
				<category><![CDATA[Certificação]]></category>
		<category><![CDATA[Dicas]]></category>
		<category><![CDATA[LPI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mandriva]]></category>

		<guid isPermaLink="false">http://www.everlinux.com/blog/?p=233</guid>
		<description><![CDATA[Recentemente migrei meu desktop corporativo de um Dell Optiplex 755 para um HP Compaq dx7400 (6144 KB de cache size, animal!) e achei um arquivo texto perdido no meu /home que pode ser útil para mais alguém. São algumas dicas que reuní na época em que estava estudando para tira a certificação &#8220;Mandriva Conectiva PRO [...]]]></description>
			<content:encoded><![CDATA[<p>Recentemente migrei meu desktop corporativo de um <a href="http://www.dell.com/content/products/productdetails.aspx/optix_755?c=us&#038;l=en&#038;s=bsd&#038;cs=04">Dell Optiplex 755</a> para um <a href="https://h20285.www2.hp.com/estore/families.aspx?co=brz&#038;chassis=desktop&#038;value=22&#038;p_family_id=119&#038;family_id=760">HP Compaq dx7400</a> (6144 KB de cache size, animal!) e achei um arquivo texto perdido no meu /home que pode ser útil para mais alguém.</p>
<p>São algumas dicas que reuní na época em que estava estudando para tira  a certificação &#8220;<em>Mandriva Conectiva PRO Certified Linux Instructor</em>&#8220;, porém o material também serve para estudantes da LPI.</p>
<p>São vários lembretes e exemplos de coisas simples que eu sempre acabo esquecendo no dia-a-dia, portanto espero que tenha alguma utilidade online :-p</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#################################################</span>
<span style="color: #666666; font-style: italic;"># Shell</span>
<span style="color: #007800;">a</span>=tiago; <span style="color: #007800;">b</span>=tiago
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$a</span> = <span style="color: #007800;">$b</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;string igual&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">c</span>=<span style="color: #000000;">10</span>; <span style="color: #007800;">d</span>=<span style="color: #000000;">10</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$c</span> <span style="color: #660033;">-eq</span> <span style="color: #007800;">$d</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;integer igual&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#################################################</span>
<span style="color: #666666; font-style: italic;"># LVM</span>
- PV <span style="color: #7a0874; font-weight: bold;">&#40;</span>Physical Volume<span style="color: #7a0874; font-weight: bold;">&#41;</span>: pvcreate <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb1 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sbd2
- VG <span style="color: #7a0874; font-weight: bold;">&#40;</span>Volume Group<span style="color: #7a0874; font-weight: bold;">&#41;</span>: vgcreate vg00 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb1 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb2
- LV <span style="color: #7a0874; font-weight: bold;">&#40;</span>Logical Volume<span style="color: #7a0874; font-weight: bold;">&#41;</span>: lvcreate <span style="color: #660033;">-L200M</span> <span style="color: #660033;">-nlvteste</span> vg00
- FileSystem: mke2fs <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>vg00<span style="color: #000000; font-weight: bold;">/</span>lv_teste
- Montar: <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>vg00<span style="color: #000000; font-weight: bold;">/</span>lv_teste <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>lvm
&nbsp;
PG -<span style="color: #000000; font-weight: bold;">&gt;</span> VG -<span style="color: #000000; font-weight: bold;">&gt;</span> LV</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># RAID</span>
Redundant Array of Inexpensive Disks - RAID0 e Linear não tem redundância
Hot Spare: Disco reserva ja existente que entra automaticamente.
Hot Swap: Discos que podem ser substituidos <span style="color: #ff0000;">&quot;on the fly&quot;</span> sem parar a maquina.</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#################################################</span>
<span style="color: #666666; font-style: italic;"># Uso do sed</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>tiago <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s,foda,muito bobo,g'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Uso do find</span>
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-type</span> f <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'*.sh'</span> <span style="color: #660033;">-exec</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-l</span> <span style="color: #ff0000;">' tr '</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> \;
&nbsp;
<span style="color: #666666; font-style: italic;"># Uso do awk</span>
<span style="color: #c20cb9; font-weight: bold;">ps</span> aux <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">' '</span> <span style="color: #ff0000;">'{print $8}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-n</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">uniq</span> <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-n</span>
<span style="color: #c20cb9; font-weight: bold;">ifconfig</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> HWaddr <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span> <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #ff0000;">'{print $5}'</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">##################################################</span>
<span style="color: #666666; font-style: italic;"># PAM</span>
required: resultado apresentado após todos os módulos da classe
requisite: se falhar, os demais módulos da classe não são executados
sufficient: se retorna com sucesso, os demais módulos da classe não são executados
optional: seu resultado não importante no processo de autenticação
&nbsp;
auth: autenticação
account: contas e autorização
<span style="color: #c20cb9; font-weight: bold;">passwd</span>: senhas
session: ambiente</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">##################################################</span>
<span style="color: #666666; font-style: italic;"># While</span>
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>home <span style="color: #660033;">-type</span> <span style="color: #660033;">-d</span> <span style="color: #660033;">-perm</span> <span style="color: #000000;">1777</span> <span style="color: #660033;">-print</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> i; <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #007800;">$i</span> <span style="color: #660033;">-mtime</span> +<span style="color: #000000;">5</span> <span style="color: #660033;">-exec</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> \;
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Parametro</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;$#&quot;</span> <span style="color: #660033;">-lt</span> <span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Uso: $0 &lt;arquivo a procurar&gt; &lt;arquivos.rpm&gt;&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># For</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">*</span>.zip; <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #c20cb9; font-weight: bold;">tar</span> cvf - <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #660033;">-9c</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;../<span style="color: #780078;">`basename $i .zip`</span>.tar.gz&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">##################################################</span>
<span style="color: #666666; font-style: italic;"># Serviços</span>
chkconfig <span style="color: #660033;">--add</span> httpd
chkconfig <span style="color: #660033;">--level</span> <span style="color: #000000;">2</span> httpd off
&nbsp;
<span style="color: #666666; font-style: italic;"># Processos (ps aux)</span>
d = espera <span style="color: #7a0874; font-weight: bold;">&#40;</span>IO<span style="color: #7a0874; font-weight: bold;">&#41;</span>
r = executando <span style="color: #7a0874; font-weight: bold;">&#40;</span>runnable<span style="color: #7a0874; font-weight: bold;">&#41;</span>
s = espera <span style="color: #7a0874; font-weight: bold;">&#40;</span>sleeping<span style="color: #7a0874; font-weight: bold;">&#41;</span>
t = parado <span style="color: #7a0874; font-weight: bold;">&#40;</span>traced<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #c20cb9; font-weight: bold;">w</span> = paginando
x = morto
z = zundi <span style="color: #7a0874; font-weight: bold;">&#40;</span>defunct<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">##################################################</span>
<span style="color: #666666; font-style: italic;"># Syslog</span>
- Multiplos categorias.prioridade separada por ponto-e-virgula:
kern.err;mail.warning                   <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>teste.log
&nbsp;
-  Prioridade: Todos os erros menos os de email:
<span style="color: #000000; font-weight: bold;">*</span>.err;mail.none                         <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>teste.log
&nbsp;
- Nomes de usuário, se logados
<span style="color: #000000; font-weight: bold;">*</span>.emerg                                         root,joao,maria
&nbsp;
- Maquina da rede
mail.<span style="color: #000000; font-weight: bold;">*</span>                                          <span style="color: #000000; font-weight: bold;">@</span>maillogger
&nbsp;
Prioridade      <span style="color: #666666; font-style: italic;">#       Descrição</span>
none            <span style="color: #000000;">0</span>       Não envia mensagens
debug           <span style="color: #000000;">1</span>       Mensagens de depuração
info            <span style="color: #000000;">2</span>       Mensagens informativas
notice          <span style="color: #000000;">3</span>       Mensagens que merecem atenção
warning         <span style="color: #000000;">4</span>       Mensagens de advertencia
err             <span style="color: #000000;">5</span>       Mensagens de erro
crit            <span style="color: #000000;">6</span>       Situação crítica, erro de hardware
alert           <span style="color: #000000;">7</span>       Alerta, corrigir imediatamente
emerg           <span style="color: #000000;">8</span>       Emergencia, pane no sistema
<span style="color: #000000; font-weight: bold;">*</span>               <span style="color: #000000;">1</span>       Todas, mesmo que debug</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">##################################################</span>
<span style="color: #666666; font-style: italic;"># Agendamento</span>
at <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">updatedb</span> <span style="color: #000000;">17</span>:00
<span style="color: #666666; font-style: italic;"># Listagem</span>
atq
<span style="color: #666666; font-style: italic;"># Remove</span>
atrm <span style="color: #000000;">3</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Crontab</span>
minuto  - hora  - dia mes - mes - dia semana - usuario - comando
<span style="color: #000000;">42</span>         <span style="color: #000000;">4</span>        <span style="color: #000000;">1</span>        <span style="color: #000000; font-weight: bold;">*</span>          <span style="color: #000000; font-weight: bold;">*</span>       root    renice <span style="color: #660033;">-19</span> <span style="color: #c20cb9; font-weight: bold;">run-parts</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cron.monthly
&nbsp;
dia semana: <span style="color: #000000;">0</span> ou <span style="color: #000000;">7</span> eh domingo, segunda eh <span style="color: #000000;">1</span>
&nbsp;
<span style="color: #000000;">1</span>-<span style="color: #000000;">5</span>     = <span style="color: #000000;">1</span> a <span style="color: #000000;">5</span>
<span style="color: #000000;">1</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">7</span> = numero <span style="color: #000000;">1</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">5</span> e <span style="color: #000000;">7</span>
<span style="color: #000000; font-weight: bold;">*/</span><span style="color: #000000;">5</span>     = de <span style="color: #000000;">5</span> em <span style="color: #000000;">5</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Converter arquivo</span>
mencoder ballmer_developers.flv <span style="color: #660033;">-ovc</span> xvid <span style="color: #660033;">-xvidencopts</span> <span style="color: #007800;">fixed_quant</span>=<span style="color: #000000;">5</span> <span style="color: #660033;">-oac</span> mp3lame <span style="color: #660033;">-lameopts</span> <span style="color: #007800;">br</span>=<span style="color: #000000;">128</span> <span style="color: #660033;">-o</span> ballmer_developers.avi</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://everlinux.com/blog/2009/01/28/dicas-para-certificacao-lpimandriva/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  everlinux.com/blog/category/lpi/feed ) in 0.76586 seconds, on Jul 30th, 2010 at 8:37 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Jul 30th, 2010 at 9:37 pm UTC -->