<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>tar -zxvf.com</title>
	
	<link>http://www.tarzxvf.com</link>
	<description>Beware the Bigfoot!</description>
	<lastBuildDate>Wed, 29 Jul 2009 22:11:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/tarzxvf" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Hello world!</title>
		<link>http://www.tarzxvf.com/hello-world</link>
		<comments>http://www.tarzxvf.com/hello-world#comments</comments>
		<pubDate>Wed, 29 Jul 2009 21:08:28 +0000</pubDate>
		<dc:creator>pascal</dc:creator>
				<category><![CDATA[diversos]]></category>

		<guid isPermaLink="false">http://www.tarzxvf.com/?p=3</guid>
		<description><![CDATA[Tive alguns problemas com o wordpress no novo servidor, estou restaurando o backup!
Update 29/Jul/18:41 &#8211; Blog está em 90%, falta alguns detalhes! A sim, eu troquei o tema!
]]></description>
			<content:encoded><![CDATA[<p>Tive alguns problemas com o wordpress no novo servidor, estou restaurando o backup!</p>
<p>Update 29/Jul/18:41 &#8211; Blog está em 90%, falta alguns detalhes! A sim, eu troquei o tema!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tarzxvf.com/hello-world/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mudando de hosting!</title>
		<link>http://www.tarzxvf.com/mudando-de-hosting</link>
		<comments>http://www.tarzxvf.com/mudando-de-hosting#comments</comments>
		<pubDate>Mon, 27 Jul 2009 23:02:20 +0000</pubDate>
		<dc:creator>pascal</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://tarzxvf.com/?p=432</guid>
		<description><![CDATA[Julho meio parado aqui no blog, não que ele seja realmente muito ativo, mas esse mês em particular foi menos. Mas tem uma explicação, eu precisava transferir o blog da Bluehost para a Dreamhost, fiz a transferência do conteúdo a cerca de 10 dias, mas ficou pendente o domínio, dessa forma, optei por não atualizar [...]]]></description>
			<content:encoded><![CDATA[<p align='justify'>Julho meio parado aqui no blog, não que ele seja realmente muito ativo, mas esse mês em particular foi menos. Mas tem uma explicação, eu precisava transferir o blog da Bluehost para a Dreamhost, fiz a transferência do conteúdo a cerca de 10 dias, mas ficou pendente o domínio, dessa forma, optei por não atualizar o blog para não ter que replicar na Dreamhost! ( aka. preguiça mórbida ) </p>
<p align='justify'>Teve outros motivos relacionados a trabalho mas isso deixo para um próxima post. O blog agora está na <a href="http://www.dreamhost.com">dreamhost</a>, e caso alguém note algo faltando por favor me avise. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.tarzxvf.com/mudando-de-hosting/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uso da CPU (por núcleo) em Python ou parseando o /proc/stat</title>
		<link>http://www.tarzxvf.com/uso-da-cpu-por-nucleo-em-python-ou-parseando-o-procstat</link>
		<comments>http://www.tarzxvf.com/uso-da-cpu-por-nucleo-em-python-ou-parseando-o-procstat#comments</comments>
		<pubDate>Thu, 09 Jul 2009 01:30:55 +0000</pubDate>
		<dc:creator>pascal</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[/proc/]]></category>
		<category><![CDATA[HowToPython]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://tarzxvf.com/?p=417</guid>
		<description><![CDATA[Título alternativo: How to get CPU usage per core with python
Teste de indexação do google  
Mais um post para a série &#8220;Parseando o /proc&#8221; [1]. Dessa vez sem motivo explícito, apenas diversão!
Ambientes de testes:
Ubunto c/ 1 núcleo e Python 2.6 
Ubunto c/ 2 núcleos e Python 2.6 
CentOS c/ 4 núcleos e Python 2.4. [...]]]></description>
			<content:encoded><![CDATA[<p>Título alternativo: <strong>How to get CPU usage per core with python</strong><br />
Teste de indexação do google <img src='http://www.tarzxvf.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Mais um post para a série &#8220;Parseando o /proc&#8221; [<a href="http://tarzxvf.com/netstat-em-python-ou-parsendo-o-procnettcp">1</a>]. Dessa vez sem motivo explícito, apenas diversão!</p>
<p>Ambientes de testes:</p>
<li>Ubunto c/ 1 núcleo e Python 2.6 </li>
<li>Ubunto c/ 2 núcleos e Python 2.6 </li>
<li>CentOS c/ 4 núcleos e Python 2.4. </li>
<p>Comparei os resultados através do <a href="http://tarzxvf.com/ferramentas-top-like">htop</a> e obtive uma proximidade alta nos valores, as diferenças se dão provavelmente pelo momento e duração da medição!</p>
<p>Quem puder testar em ambientes com mais núcleos ou uso intensivo da CPU e comparar com as ferramentas do sistema por favor me de um feedback</p>
<p>E quem rir da qualidade do meu inglês nos comentários eu vou banir o ip! <img src='http://www.tarzxvf.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p417code2'); return false;">View Code</a> PYTHON</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4172"><td class="code" id="p417code2"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># [ reference ]</span>
<span style="color: #808080; font-style: italic;"># Detect number of cpus</span>
<span style="color: #808080; font-style: italic;"># http://www.boduch.ca/2009/06/python-cpus.html</span>
<span style="color: #808080; font-style: italic;"># Get cpu usage (But this example is not working 100%)</span>
<span style="color: #808080; font-style: italic;"># http://ubuntuforums.org/showpost.php?p=853257&amp;postcount=4</span>
&nbsp;
INTERVAL = <span style="color: #ff4500;">2</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> CPUUsage:
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #008000;">self</span>.<span style="color: black;">cores</span> = <span style="color: #008000;">self</span>.<span style="color: black;">detectCPUs</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> createCoreArray<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        cores = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">cores</span><span style="color: black;">&#41;</span>:
            cores.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> cores
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> detectCPUs<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">hasattr</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>, <span style="color: #483d8b;">&quot;sysconf&quot;</span><span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">sysconf_names</span>.<span style="color: black;">has_key</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;SC_NPROCESSORS_ONLN&quot;</span><span style="color: black;">&#41;</span>:
                ncpus = <span style="color: #dc143c;">os</span>.<span style="color: black;">sysconf</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;SC_NPROCESSORS_ONLN&quot;</span><span style="color: black;">&#41;</span>
                <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">isinstance</span><span style="color: black;">&#40;</span>ncpus, <span style="color: #008000;">int</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">and</span> ncpus <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">0</span>:
                    <span style="color: #ff7700;font-weight:bold;">return</span> ncpus
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #ff4500;">1</span> <span style="color: #808080; font-style: italic;"># Default</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> getTimeList<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        core = <span style="color: #008000;">self</span>.<span style="color: black;">createCoreArray</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
        statFile = <span style="color: #008000;">file</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;/proc/stat&quot;</span>, <span style="color: #483d8b;">&quot;r&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #008000;">self</span>.<span style="color: black;">cores</span> == <span style="color: #ff4500;">1</span>:
            statFile.<span style="color: #dc143c;">readline</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># this FOR will split lines from proc/stat for every active core</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> cid <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">cores</span><span style="color: black;">&#41;</span>:
            <span style="color: #808080; font-style: italic;"># when have just one core, split a different range</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.<span style="color: black;">cores</span> == <span style="color: #ff4500;">1</span>:
                core<span style="color: black;">&#91;</span>cid<span style="color: black;">&#93;</span> = statFile.<span style="color: #dc143c;">readline</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot; &quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span>:<span style="color: #ff4500;">7</span><span style="color: black;">&#93;</span> <span style="color: #808080; font-style: italic;"># 2:6</span>
            <span style="color: #ff7700;font-weight:bold;">else</span>:
                core<span style="color: black;">&#91;</span>cid<span style="color: black;">&#93;</span> = statFile.<span style="color: #dc143c;">readline</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot; &quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span>:<span style="color: #ff4500;">6</span><span style="color: black;">&#93;</span> <span style="color: #808080; font-style: italic;"># 1:5</span>
        statFile.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># convert all itens in splited list from STR to INT for every core</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>core<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">for</span> cid <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">cores</span><span style="color: black;">&#41;</span>:
                core<span style="color: black;">&#91;</span>cid<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span> = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>core<span style="color: black;">&#91;</span>cid<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># return the core list now with INT values inside their cpu values</span>
        <span style="color: #808080; font-style: italic;"># like this: ([core,1,values],[core,2,values],[core,3,values])</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> core
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> deltaTime<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>,interval<span style="color: black;">&#41;</span>:
        coreT1=<span style="color: #008000;">self</span>.<span style="color: black;">createCoreArray</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        coreT2=<span style="color: #008000;">self</span>.<span style="color: black;">createCoreArray</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># get core TIME 1 state per core</span>
        coreT1 = <span style="color: #008000;">self</span>.<span style="color: black;">getTimeList</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #808080; font-style: italic;"># wait X seconds to get new state core</span>
        <span style="color: #dc143c;">time</span>.<span style="color: black;">sleep</span><span style="color: black;">&#40;</span>interval<span style="color: black;">&#41;</span>
        <span style="color: #808080; font-style: italic;"># get core TIME 2 state per core</span>
        coreT2 = <span style="color: #008000;">self</span>.<span style="color: black;">getTimeList</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;">#Get the diference of coreT2.item[i] and coreT1.item[i] for every core</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>coreT1<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">for</span> cid <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">cores</span><span style="color: black;">&#41;</span>:
                coreT2<span style="color: black;">&#91;</span>cid<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span> -= coreT1<span style="color: black;">&#91;</span>cid<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> coreT2
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> Usage<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        core = <span style="color: #008000;">self</span>.<span style="color: black;">createCoreArray</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        cpuUsage = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
&nbsp;
        core = <span style="color: #008000;">self</span>.<span style="color: black;">deltaTime</span><span style="color: black;">&#40;</span>INTERVAL<span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">for</span> cid <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">cores</span><span style="color: black;">&#41;</span>:
            <span style="color: #808080; font-style: italic;"># sum of user,system and nice usage</span>
            tmp_use = core<span style="color: black;">&#91;</span>cid<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> + core<span style="color: black;">&#91;</span>cid<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>+core<span style="color: black;">&#91;</span>cid<span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span>
            <span style="color: #808080; font-style: italic;"># 100.00 * usage / sum of usage + idle + waiting</span>
            usage = <span style="color: #483d8b;">&quot;%.2f&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">100.00</span> <span style="color: #66cc66;">*</span> tmp_use<span style="color: black;">&#41;</span> / <span style="color: #008000;">sum</span><span style="color: black;">&#40;</span>core<span style="color: black;">&#91;</span>cid<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
            cpuUsage.<span style="color: black;">append</span><span style="color: black;">&#40;</span>usage<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> cpuUsage
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&quot;__main__&quot;</span>:
    <span style="color: #808080; font-style: italic;"># Show usage per core</span>
    <span style="color: #808080; font-style: italic;">#print CPUUsage().Usage()</span>
&nbsp;
    x = <span style="color: #ff4500;">0</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> item <span style="color: #ff7700;font-weight:bold;">in</span> CPUUsage<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">Usage</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
        x = x + <span style="color: #ff4500;">1</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;CPU[%s]: %s&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span><span style="color: #008000;">str</span><span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span>,<span style="color: #008000;">str</span><span style="color: black;">&#40;</span>item<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.tarzxvf.com/uso-da-cpu-por-nucleo-em-python-ou-parseando-o-procstat/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Como impedir a execução de scripts em pastas no servidor</title>
		<link>http://www.tarzxvf.com/como-impedir-a-execucao-de-scripts-em-pastas-no-servidor</link>
		<comments>http://www.tarzxvf.com/como-impedir-a-execucao-de-scripts-em-pastas-no-servidor#comments</comments>
		<pubDate>Wed, 08 Jul 2009 02:21:48 +0000</pubDate>
		<dc:creator>pascal</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://tarzxvf.com/?p=413</guid>
		<description><![CDATA[RemoveHandler .py
Precisei disso para impedir a execução dos arquivos .py em uma pasta de um servidor, enquanto eu tentava por chute quase acertei a sintaxe  
De qualquer forma, basta colocar no .htaccess e está resolvido.
E aqui achei várias dicas que podem ser úteis um dia!
]]></description>
			<content:encoded><![CDATA[<blockquote><p>RemoveHandler .py</p></blockquote>
<p>Precisei disso para impedir a execução dos arquivos .py em uma pasta de um servidor, enquanto eu tentava por chute quase acertei a sintaxe <img src='http://www.tarzxvf.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>De qualquer forma, basta colocar no .htaccess e está resolvido.</p>
<p>E <a href="http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/">aqui</a> achei várias dicas que podem ser úteis um dia!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tarzxvf.com/como-impedir-a-execucao-de-scripts-em-pastas-no-servidor/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>As vezes a ciência não vê o óbvio</title>
		<link>http://www.tarzxvf.com/as-vezes-a-ciencia-nao-ve-o-obvio</link>
		<comments>http://www.tarzxvf.com/as-vezes-a-ciencia-nao-ve-o-obvio#comments</comments>
		<pubDate>Mon, 06 Jul 2009 04:11:24 +0000</pubDate>
		<dc:creator>pascal</dc:creator>
				<category><![CDATA[diversos]]></category>
		<category><![CDATA[Humor]]></category>

		<guid isPermaLink="false">http://tarzxvf.com/?p=406</guid>
		<description><![CDATA[Fim de semana fui visitar minha mãe e voltei para casa de carona com um amigo. No meio da viajem paramos para tomar um caldo de cana, e na tv passava um programa no Discovey Channel que falava sobre a redução do apetite sexual dos astronautas quando no espaço.
Os cientistas teorizaram que isso se deve [...]]]></description>
			<content:encoded><![CDATA[<p align='justify'>Fim de semana fui visitar minha mãe e voltei para casa de carona com um amigo. No meio da viajem paramos para tomar um caldo de cana, e na tv passava um programa no Discovey Channel que falava sobre a redução do apetite sexual dos astronautas quando no espaço.</p>
<p align='justify'>Os cientistas teorizaram que isso se deve provavelmente a queda no nível de testosterona dos astronautas. Então meu amigo me olhou, e deu uma explicação que pra mim fez mais sentido:</p>
<blockquote><p>&#8220;Eles provavelmente perdem a vontade de fazer sexo pelo fato de serem <strong>NERDS, NO ESPAÇO</strong>&#8220;</p></blockquote>
<p>É, as vezes a ciência não vê o óbvio!  <img src='http://www.tarzxvf.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.tarzxvf.com/as-vezes-a-ciencia-nao-ve-o-obvio/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ferramentas top-like</title>
		<link>http://www.tarzxvf.com/ferramentas-top-like</link>
		<comments>http://www.tarzxvf.com/ferramentas-top-like#comments</comments>
		<pubDate>Wed, 24 Jun 2009 03:28:54 +0000</pubDate>
		<dc:creator>pascal</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[processos]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[virtualização]]></category>

		<guid isPermaLink="false">http://tarzxvf.com/?p=360</guid>
		<description><![CDATA[OK, então você usa linux e conhece o &#8216;top&#8216;, item básico no repertório de qualquer sysadmin, que permite acompanhar algumas informações sobre a carga do sistema e processos. Essa ferramenta antiga e poderosa, é de uma idéia tão simples porem tão prática, que ganhou um termo para designar ferramentas semelhantes, ferramentas &#8220;top-like&#8220;. 
Para se enquadrar [...]]]></description>
			<content:encoded><![CDATA[<p align = 'justify'>OK, então você usa linux e conhece o &#8216;<strong>top</strong>&#8216;, item básico no repertório de qualquer sysadmin, que permite acompanhar algumas informações sobre a carga do sistema e processos. Essa ferramenta antiga e poderosa, é de uma idéia tão simples porem tão prática, que ganhou um termo para designar ferramentas semelhantes, ferramentas &#8220;<strong>top-like</strong>&#8220;. </p>
<p>Para se enquadrar em uma ferramenta top-like o candidato tem que:</p>
<li>ser baseado em curses</li>
<li>ter atualizações em intervalos pré-definidos</li>
<li>ter formato tabulado</li>
<li>e opcionalmente permitir interação com os objetos analisados</li>
<p align = 'justify'>Fiz uma lista com 16 <strong>ferramentas top-like</strong> disponíveis no Ubuntu 9.04. Enquanto fazia a pesquisa, encontrei pelo menos mais meia dúzia sem pacotes para o ubuntu, e se for considerar as que eu <strong>não encontrei</strong> esse número deve subir consideravelmente.</p>
<p><span id="more-360"></span></p>
<p><strong>Segue a lista:</strong></p>
<p><strong>htop</strong> &#8211; Sem dúvida a mais famosa das ferramentas top-like, implementa algumas capacidades extras ao top, como cores, capacidade de scroll horizontal e vertical, e uma melhor interação sobre os processos listados.</p>
<p><strong>iotop</strong> &#8211; Ferramenta que exibe informações de I/O para cada processo. As informações exibidas são: swapin, leitura e escrita em disco e I/O geral com o sistema.<br />
<img height = '350' src="http://www.tarzxvf.com/blogfiles/img/2009/iotop.png" alt="iotop" /></p>
<p><strong>itop</strong> &#8211; Monitora as interrupções de sistema, basicamente um parser em /proc/interrupts</p>
<p><strong>atop</strong> &#8211; Monitor para recursos do sistema. Exibe swap, rede, disco, cpu, atividade de processos entre outros. Achei pouco intuitivo.</p>
<p><strong>sntop</strong> &#8211; &#8220;Pinga&#8221; uma lista de hosts e indica se estão ativos ou inativos. Deve ser configurado em /etc/sntoprc. Ferramenta bem legal mais meio bugada.<br />
<img src="http://www.tarzxvf.com/blogfiles/img/2009/sntop.png" alt="sntop" /></p>
<p><strong>mtop, mytop</strong> &#8211; Ferramentas que monitoram as querys e o desempenho do banco de dados mysql. Infelizmente o mtop quebrou minha instalação, aparentemente ele tentou instalar a versão 5.0 em cima da versão 5.1 que tenho rodando.</p>
<p><strong>apachetop</strong> &#8211; Mostra informações sobre o apache, tais como: requisições por segundo, bytes por segundo e as URLs mais populares sendo exibidas. Creio que o pacote esteja com problema no ubuntu 9.04 64 bits, pois gera um um buffer overflow quando tento executa-lo.</p>
<p><strong>ptop</strong> &#8211; Semelhante ao mtop, mas específico para o postgres.</p>
<p><strong>dnstop</strong> &#8211; Exibe informações sobre o tráfego de DNS da rede.</p>
<p><strong>virt-top</strong> &#8211; Exibe informações de sistemas virtualizados: cpu, memoria, uptime. Pode monitorar qualquer sistema de virtualização baseado no <a href="http://libvirt.org/">libvirt</a>, como o Xen e o KVM.<br />
<img height = '350' src="http://www.tarzxvf.com/blogfiles/img/2009/virt-top.png" alt="virt-top" /></p>
<p><strong>iptstate</strong> &#8211; Exibe informações sobre conexões feitas por clientes que passam pelo seu firewall/gateway. É basicamente um netstat que monitora as conexões tratadas pelo iptables. Depende do módulo CONNTRACK.</p>
<p><strong>iftop, pktstat, jnettop</strong> &#8211; Exibem informações de consumo da rede, cada qual com sua peculiaridade. A imagem mostra o pkstat.<br />
<img height = '250' src="http://www.tarzxvf.com/blogfiles/img/2009/pktstat.png" alt="pktstat" /></p>
<p><strong>nethogs</strong> &#8211; Exibe informações de rede, mas ao invés de quebrar o tráfego por protocolo, o nethogs exibe o consumo de banda por processo. Bem interessante.<br />
<img height = '300' src="http://www.tarzxvf.com/blogfiles/img/2009/nethogs.png" alt="nethogs" /><br />
</br><br />
</br></p>
<p>Por hoje é isso, mas fique ligado! Assim que possível vou escrever um artigo mais aprofundado sobre duas ou três das ferramentas listadas.</p>
<p>Ah, e se você conhece mais ferramentas top-like, sinta-se a vontade para compartilhar nos comentários. <img src='http://www.tarzxvf.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.tarzxvf.com/ferramentas-top-like/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Meme Speedtest</title>
		<link>http://www.tarzxvf.com/meme-speedtest</link>
		<comments>http://www.tarzxvf.com/meme-speedtest#comments</comments>
		<pubDate>Wed, 10 Jun 2009 18:17:14 +0000</pubDate>
		<dc:creator>pascal</dc:creator>
				<category><![CDATA[diversos]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://tarzxvf.com/?p=357</guid>
		<description><![CDATA[Esse meme está rolando em muitos planetas. Fiquei curioso e resolvi brincar!
Aí está o resultado.

]]></description>
			<content:encoded><![CDATA[<p>Esse meme está rolando em muitos planetas. Fiquei curioso e resolvi brincar!<br />
Aí está o resultado.</p>
<p><img alt="" src="http://www.speedtest.net/result/492930378.png" title="speedtest" class="aligncenter" width="300" height="135" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tarzxvf.com/meme-speedtest/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Acontecimentos bizarros!</title>
		<link>http://www.tarzxvf.com/acontecimentos-bizarros</link>
		<comments>http://www.tarzxvf.com/acontecimentos-bizarros#comments</comments>
		<pubDate>Tue, 09 Jun 2009 18:06:30 +0000</pubDate>
		<dc:creator>pascal</dc:creator>
				<category><![CDATA[diversos]]></category>
		<category><![CDATA[Humor]]></category>
		<category><![CDATA[Segurança]]></category>

		<guid isPermaLink="false">http://tarzxvf.com/?p=347</guid>
		<description><![CDATA[A volta do twitter vivo
Ontem a noite acessando meu e-mail, encontro uma mensagem nova com o título: &#8221; Nelson Abu S. R. Jr is now following you on Twitter! &#8220; Aí eu pensei, que legal, ganhei um seguidor no twitter!
Momento de silêncio&#8230; ( o tico acordando o teco )
Pera aí, eu não tenho twitter.
Fui clicando [...]]]></description>
			<content:encoded><![CDATA[<p><strong>A volta do twitter vivo</strong></p>
<p align='justify'>Ontem a noite acessando meu e-mail, encontro uma mensagem nova com o título:<em> &#8221; Nelson Abu S. R. Jr is now following you on Twitter! &#8220;</em> Aí eu pensei, que legal, ganhei um seguidor no twitter!
<p>Momento de silêncio&#8230; ( o tico acordando o teco )</p>
<p>Pera aí, eu não tenho twitter.</p>
<p align='justify'>Fui clicando e descubro isso: http://twitter.com/smilecaolho. Pois é, ao que tudo indica, em Março de 2007 eu criei uma conta no Twitter, eu não sei exatamente por que fiz isso, até onde me lembro eu acho o twitter um serviço meio sem propósito, mas eu fiz. Nesse caso vou encarar isso como um sinal do Deus dos Ateus, e experimentar novamente essa naba!
<p><strong>Hd fantasma</strong></p>
<p align='justify'>Resumo da ópera, formatei meu antigo desktop, botei o Ubuntu Server 9.04 e agora ele virou um Gateway que está compartilhando a Internet com os vizinhos. Desde que fiz isso, quase toda noite quando ia dormir ouvia um barulho baixinho &#8211; mas irritante &#8211; vindo do HD do &#8220;Servidor&#8221;.</p>
<p align='justify'> Só ontem fui descobrir o que era! Eu havia me esquecido de trocar a porta do sshd, e toda noite recebia milhares de tentativas de conexão provenientes de máquinas comprometidas na Internet. E cada tentativa era registrada em /var/log/auth.log causando o barulho baixinho e irritante.</p>
<p>Porta trocada, hd novamente silencioso, e agora posso arrumar outra desculpa para minha insônia.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tarzxvf.com/acontecimentos-bizarros/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Netstat em Python ou parsendo o /proc/net/tcp</title>
		<link>http://www.tarzxvf.com/netstat-em-python-ou-parsendo-o-procnettcp</link>
		<comments>http://www.tarzxvf.com/netstat-em-python-ou-parsendo-o-procnettcp#comments</comments>
		<pubDate>Sun, 07 Jun 2009 20:57:07 +0000</pubDate>
		<dc:creator>pascal</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[HowToPython]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://tarzxvf.com/?p=335</guid>
		<description><![CDATA[Na tarde de sábado eu precisava pegar as portas abertas no servidor, da forma mais Real Time possível.  Primeira idéia? Naturalmente, foi parsear o resultado do netstat e ‘grepar’ o LISTEN ou OUÇA, mas depois imaginei que beber diretamente da fonte pudesse fazer o negócio andar mais rápido. Pesquisa daqui, pesquisa dali, aparentemente o netstat [...]]]></description>
			<content:encoded><![CDATA[<p align='justify'>Na tarde de sábado eu precisava pegar as portas abertas no servidor, da forma mais Real Time possível.  Primeira idéia? Naturalmente, foi parsear o resultado do netstat e ‘grepar’ o LISTEN ou OUÇA, mas depois imaginei que beber diretamente da fonte pudesse fazer o negócio andar mais rápido. Pesquisa daqui, pesquisa dali, aparentemente o netstat pega suas informações dos arquivos em /proc/net.</p>
<p align='justify'>Após umas horinhas consegui o protótipo inicial do código que preciso. Mas durante a caminhada perdi o foco e acabei brincando um pouco mais com o /proc/net/tcp, no fim tinha um netstat simplificado feito em Python.</p>
<p align='justify'>Então se alguém algum dia precisar recuperar informações de conexões ao estilo netstat aí está o código:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p335code4'); return false;">View Code</a> PYTHON</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p3354"><td class="code" id="p335code4"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Criado por Ricardo Pascal, qualquer dúvida ou</span>
<span style="color: #808080; font-style: italic;"># contribuição mande para  'pascal.linux' no gmail!</span>
<span style="color: #808080; font-style: italic;"># Pode usar a vontade só lembre-se de citar a autoria ;)</span>
<span style="color: #808080; font-style: italic;"># Agradecimento ao pessoal do #python-br na freenode.</span>
<span style="color: #808080; font-style: italic;"># A galera lá sempre ajuda.</span>
&nbsp;
PROC_TCP = <span style="color: #483d8b;">&quot;/proc/net/tcp&quot;</span>
STATE = <span style="color: black;">&#123;</span>
	    <span style="color: #483d8b;">'01'</span>:<span style="color: #483d8b;">'ESTABLISHED'</span>,
	    <span style="color: #483d8b;">'02'</span>:<span style="color: #483d8b;">'SYN_SENT'</span>,
	    <span style="color: #483d8b;">'03'</span>:<span style="color: #483d8b;">'SYN_RECV'</span>,
	    <span style="color: #483d8b;">'04'</span>:<span style="color: #483d8b;">'FIN_WAIT1'</span>,
	    <span style="color: #483d8b;">'05'</span>:<span style="color: #483d8b;">'FIN_WAIT2'</span>,
	    <span style="color: #483d8b;">'06'</span>:<span style="color: #483d8b;">'TIME_WAIT'</span>,
	    <span style="color: #483d8b;">'07'</span>:<span style="color: #483d8b;">'CLOSE'</span>,
	    <span style="color: #483d8b;">'08'</span>:<span style="color: #483d8b;">'CLOSE_WAIT'</span>,
	    <span style="color: #483d8b;">'09'</span>:<span style="color: #483d8b;">'LAST_ACK'</span>,
	    <span style="color: #483d8b;">'0A'</span>:<span style="color: #483d8b;">'LISTEN'</span>,
	    <span style="color: #483d8b;">'0B'</span>:<span style="color: #483d8b;">'CLOSING'</span>
	<span style="color: black;">&#125;</span>
&nbsp;
tcp_FH = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>PROC_TCP,<span style="color: #483d8b;">'r'</span><span style="color: black;">&#41;</span>
content = tcp_FH.<span style="color: black;">readlines</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
content.<span style="color: black;">pop</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># remove header</span>
tcp_FH.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> hex2dec<span style="color: black;">&#40;</span>s<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>s,<span style="color: #ff4500;">16</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> ip<span style="color: black;">&#40;</span>s<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>hex2dec<span style="color: black;">&#40;</span>s<span style="color: black;">&#91;</span><span style="color: #ff4500;">6</span>:<span style="color: #ff4500;">8</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> +<span style="color: #483d8b;">&quot;.&quot;</span>+ <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>hex2dec<span style="color: black;">&#40;</span>s<span style="color: black;">&#91;</span><span style="color: #ff4500;">4</span>:<span style="color: #ff4500;">6</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> +<span style="color: #483d8b;">&quot;.&quot;</span>+ \
	    <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>hex2dec<span style="color: black;">&#40;</span>s<span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span>:<span style="color: #ff4500;">4</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> +<span style="color: #483d8b;">&quot;.&quot;</span>+ <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>hex2dec<span style="color: black;">&#40;</span>s<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span>:<span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> remove_empty<span style="color: black;">&#40;</span><span style="color: #008000;">list</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: black;">&#91;</span>x <span style="color: #ff7700;font-weight:bold;">for</span> x <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">list</span> <span style="color: #ff7700;font-weight:bold;">if</span> x <span style="color: #66cc66;">!</span>=<span style="color: #483d8b;">''</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> get_list<span style="color: black;">&#40;</span>c<span style="color: black;">&#41;</span>:
    result = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
    result.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'ID'</span>,<span style="color: #483d8b;">'IP'</span>,<span style="color: #483d8b;">'PORT'</span>,<span style="color: #483d8b;">'rIP'</span>,<span style="color: #483d8b;">'rPORT'</span>,<span style="color: #483d8b;">'STATS'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> lines <span style="color: #ff7700;font-weight:bold;">in</span> content:
	line_array = remove_empty<span style="color: black;">&#40;</span>lines.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">' '</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
	line = <span style="color: black;">&#91;</span>line_array<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>, line_array<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">':'</span><span style="color: black;">&#41;</span>, \
		line_array<span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;:&quot;</span><span style="color: black;">&#41;</span>,line_array<span style="color: black;">&#91;</span><span style="color: #ff4500;">3</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span>
&nbsp;
	line = <span style="color: black;">&#91;</span>line<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>, ip<span style="color: black;">&#40;</span>line<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>, hex2dec<span style="color: black;">&#40;</span>line<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>, \
		ip<span style="color: black;">&#40;</span>line<span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>, hex2dec<span style="color: black;">&#40;</span>line<span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>, STATE<span style="color: black;">&#91;</span><span style="color: black;">&#40;</span>line<span style="color: black;">&#91;</span><span style="color: #ff4500;">3</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span>
&nbsp;
	result.<span style="color: black;">append</span><span style="color: black;">&#40;</span>line<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> result
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">'__main__'</span>:
    <span style="color: #ff7700;font-weight:bold;">for</span> lines <span style="color: #ff7700;font-weight:bold;">in</span> get_list<span style="color: black;">&#40;</span>content<span style="color: black;">&#41;</span>:
	<span style="color: #ff7700;font-weight:bold;">print</span> lines</pre></td></tr></table></div>

<p><em>PS. Quando eu tiver tempo eu refaço a cama de gato que ta ali na função get_list() e ip().</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tarzxvf.com/netstat-em-python-ou-parsendo-o-procnettcp/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Python WebServer, frameworks e derivados!</title>
		<link>http://www.tarzxvf.com/python-webserver-frameworks-e-derivados</link>
		<comments>http://www.tarzxvf.com/python-webserver-frameworks-e-derivados#comments</comments>
		<pubDate>Wed, 03 Jun 2009 22:12:52 +0000</pubDate>
		<dc:creator>pascal</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[webserver]]></category>
		<category><![CDATA[wsgi]]></category>

		<guid isPermaLink="false">http://tarzxvf.com/?p=330</guid>
		<description><![CDATA[
SimpleHTTPServer
BaseHTTPServer
wsgi
WebOb
Aspen
PEP:333
Olha que legal, basicamente o meu problema!!
Static (Olha que legal, basicamente resolve o meu problema!!)
Albatross
Spyce
CherryPY e/ou StandaloneWSGI Server

Imagino que no final vou acabar usando o Standalone WSGI Server (engine do CherryPy) com a solução apresentada no Static. Mas até lá continuo fazendo meus testes com o CherryPy mesmo.
]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://docs.python.org/library/simplehttpserver.html">SimpleHTTPServer</a></li>
<li><a href="http://docs.python.org/library/simplehttpserver.html">BaseHTTPServer</a></li>
<li><a href="http://docs.python.org/library/wsgiref.html">wsgi</a></li>
<li><a href="http://pythonpaste.org/webob/file-example.html">WebOb</a></li>
<li><a href="http://www.zetadev.com/software/aspen/">Aspen</a></li>
<li><a href="http://www.python.org/dev/peps/pep-0333/">PEP:333</a></li>
<li><a href="http://stackoverflow.com/questions/499084/minimal-standalone-distributable-cross-platform-web-server">Olha que legal, basicamente o meu problema!!</a></li>
<li><a href="http://lukearno.com/projects/static/">Static</a> (Olha que legal, basicamente resolve o meu problema!!)</li>
<li><a href="http://www.object-craft.com.au/projects/albatross/">Albatross</a></li>
<li><a href="http://spyce.sourceforge.net/">Spyce</a></li>
<li><a href="http://www.cherrypy.org/wiki/CherryPyDownload">CherryPY e/ou StandaloneWSGI Server</a></li>
</ul>
<p>Imagino que no final vou acabar usando o Standalone WSGI Server (engine do CherryPy) com a solução apresentada no Static. Mas até lá continuo fazendo meus testes com o CherryPy mesmo.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tarzxvf.com/python-webserver-frameworks-e-derivados/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
