<?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>RafaelXavier &#187; Tech</title>
	<atom:link href="http://www.rafael.xavier.blog.br/category/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rafael.xavier.blog.br</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 21 Oct 2011 19:31:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Quick script to fetch diff history [of a file] using svn</title>
		<link>http://www.rafael.xavier.blog.br/2009/06/02/quick-script-to-fetch-diff-history-of-a-file-using-svn/</link>
		<comments>http://www.rafael.xavier.blog.br/2009/06/02/quick-script-to-fetch-diff-history-of-a-file-using-svn/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 13:38:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.rafael.xavier.blog.br/2009/06/02/quick-script-to-fetch-diff-history-of-a-file-using-svn/</guid>
		<description><![CDATA[If you wanna see the whole history differences of some file in svn repository, you could use this:
$ svndiffhist file
Retrieving releases...
OK (found 17 steps)
## 908:895
diffs...
## 895:890
diffs...
## 890:880
... etc

Where svndiffhist is the following script:

function svndiffhist {
    FILE=$1

    echo -n "Retrieving releases..." &#62;&#38;2
    releases=$( svn log $FILE &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>If you wanna see the whole history differences of some file in svn repository, you could use this:<br />
<code>$ svndiffhist file<br />
Retrieving releases...<br />
OK (found 17 steps)<br />
## 908:895<br />
diffs...<br />
## 895:890<br />
diffs...<br />
## 890:880<br />
... etc<br />
</code></p>
<p>Where svndiffhist is the following script:</p>
<pre>
function svndiffhist {
    FILE=$1

    echo -n "Retrieving releases..." &gt;&amp;2
    releases=$( svn log $FILE | grep '^r[^a-z]' | cut -d " " -f1 |
                cut -dr -f2- )
    num_steps=$( echo $releases | wc -w )
    echo -e "tOK (found "$num_steps" steps)" &gt;&amp;2

    # Sort them in ascrending order
    #releases=$( echo $releases | tr " " "n" | sort -n )
    # Group them as A:B B:C C:D
    releases=$( echo $releases | sed 's/ ([0-9]+)/:1 1/g' )

    for EACH_STEP in $releases; do
        #svn diff -r $EACH_STEP $FILE | gvim -
        echo "## $EACH_STEP" &gt;&amp;2
        svn diff -r $EACH_STEP $FILE
    done
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.rafael.xavier.blog.br/2009/06/02/quick-script-to-fetch-diff-history-of-a-file-using-svn/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A REST client interface for Python</title>
		<link>http://www.rafael.xavier.blog.br/2008/07/15/a-rest-client-interface-for-python/</link>
		<comments>http://www.rafael.xavier.blog.br/2008/07/15/a-rest-client-interface-for-python/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 03:02:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.rafael.xavier.blog.br/2008/07/15/a-rest-client-interface-for-python/</guid>
		<description><![CDATA[The py-restlib: [http://code.google.com/p/py-restlib] is a GNU GPL library that implements a REST client interface for Python.
Here it goes its Getting Started section:
Introduction
Py-restlib is supposed to be a simple REST client interface for python. But, it also claims that writing a python client to communicate with RESTful applications on the Web should be an easy task.
Getting [...]]]></description>
			<content:encoded><![CDATA[<p>The py-restlib: <a href="http://code.google.com/p/py-restlib/" style="text-decoration: none; color: #000000">[http://code.google.com/p/py-restlib</a>] is a GNU GPL library that implements a <a id="Rest_Client_Library">REST client interface for Python.</a></p>
<p>Here it goes its Getting Started section:</p>
<h3>Introduction</h3>
<p>Py-restlib is supposed to be a simple REST client interface for python. But, it also claims that writing a python client to communicate with RESTful applications on the Web should be an easy task.</p>
<h3>Getting Started</h3>
<h4>Download</h4>
<p>Check out the latest release using svn:<br />
<code>svn checkout http://py-restlib.googlecode.com/svn/trunk/ py-restlib</code><br />
svn checkout http://py-restlib.googlecode.com/svn/trunk/ py-restlib</p>
<p>If you want support for translating JSON format into python structures, download <a href="http://pypi.python.org/pypi/python-json/" rel="nofollow">json-py</a> package, and unzip it to json-py subdir.</p>
<h4>Examples</h4>
<p><strong>The REST client</strong></p>
<pre><code>
from restlib import *

users = Resource("http://hostname/api/users")

# List all users (GET /api/users)
users.get()

# List user where id==1 (GET /api/users/1)
users.get(1)

# List user where id==1 &amp;&amp; foo=='bar' (GET /api/users/1?foo=bar)
users.get(1, foo='bar', ...)

# Create a new user (POST /api/users)
users.create(foo='bar', ...)

etc...

# You are also able to use it that way:
api = BaseResource("http://hostname/api")
api.users.get()
api.users.create(foo='bar')
etc...
</code></pre>
<p><strong>The REST server (in this case a Ruby on Rails application)</strong></p>
<pre><code>
class Api::UsersController &lt; ApplicationController
    protect_from_forgery :except =&gt; :create
    # GET /api/users
    def index
        @users = User.find(:all) # FIXME: if param[id] - under construction

        request.format=:json if request.format=:html
        respond_to do |format|
            format.xml {render <img src='http://www.rafael.xavier.blog.br/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> ml =&gt; @users.to_xml}
            format.json {render :json =&gt; @users.to_json}
        end
    end

    # POST /api/users
    def create    # FIXME: under construction
        request.format=:json if request.format=:html
        respond_to do |format|
            format.xml {render <img src='http://www.rafael.xavier.blog.br/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> ml =&gt; params.to_xml}
            format.json {render :json =&gt; params.to_json}
        end
    end
end
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.rafael.xavier.blog.br/2008/07/15/a-rest-client-interface-for-python/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Python POST request</title>
		<link>http://www.rafael.xavier.blog.br/2008/07/14/python-post-request/</link>
		<comments>http://www.rafael.xavier.blog.br/2008/07/14/python-post-request/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 00:28:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.rafael.xavier.blog.br/2008/07/14/python-post-request/</guid>
		<description><![CDATA[If you&#8217;re trying to send a python POST request with httplib, but it&#8217;s not working like example tells. Try this minor fix:
 Here is an example session that shows how to &#8220;POST&#8221; requests:
&#62;&#62;&#62; import httplib, urllib
&#62;&#62;&#62; params = urllib.urlencode({&#8217;spam&#8217;: 1, &#8216;eggs&#8217;: 2, &#8216;bacon&#8217;: 0})
&#62;&#62;&#62; headers = {&#8221;Content-Type&#8221;: &#8220;application/x-www-form-urlencoded&#8221;,
&#8230;        [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re trying to send a python POST request with httplib, but it&#8217;s not working like example tells. Try this minor fix:</p>
<p><font face="monospace"> Here is an example session that shows how to &#8220;POST&#8221; requests:</font></p>
<p><font face="monospace">&gt;&gt;&gt; import httplib, urllib<br />
&gt;&gt;&gt; params = urllib.urlencode({&#8217;spam&#8217;: 1, &#8216;eggs&#8217;: 2, &#8216;bacon&#8217;: 0})<br />
<span style="background-color: #ffbbff">&gt;&gt;&gt; headers = {&#8221;Content-</span><span style="background-color: #ff0000"><strong>T</strong></span><span style="background-color: #ffbbff">ype&#8221;: &#8220;application/x-www-form-urlencoded&#8221;,</span><br />
&#8230;            &#8220;Accept&#8221;: &#8220;text/plain&#8221;}<br />
&gt;&gt;&gt; conn = httplib.HTTPConnection(&#8221;musi-cal.mojam.com:80&#8243;)<br />
&gt;&gt;&gt; conn.request(&#8221;POST&#8221;, &#8220;/cgi-bin/query&#8221;, params, headers)<br />
&gt;&gt;&gt; response = conn.getresponse()<br />
&gt;&gt;&gt; print response.status, response.reason<br />
200 OK<br />
&gt;&gt;&gt; data = response.read()<br />
&gt;&gt;&gt; conn.close()<br />
</font></p>
<p>Thanks to wireshark and the working command below, so example above could be compared.</p>
<p><code>curl -d foo=bar http://localhost</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rafael.xavier.blog.br/2008/07/14/python-post-request/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vim &#8211; highlight search</title>
		<link>http://www.rafael.xavier.blog.br/2007/11/12/vim-highlight-search/</link>
		<comments>http://www.rafael.xavier.blog.br/2007/11/12/vim-highlight-search/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 15:51:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.rafael.xavier.blog.br/2007/11/12/vim-highlight-search/</guid>
		<description><![CDATA[Para setar seu vim (vi) para destacar o que procura (to highlight the searched text), use:
:set hlsearch
keywords: highlight destaque destacar search procurar procurado searched text string
]]></description>
			<content:encoded><![CDATA[<p>Para setar seu vim (vi) para destacar o que procura (to highlight the searched text), use:</p>
<p><code>:set hlsearch</code></p>
<h6>keywords: highlight destaque destacar search procurar procurado searched text string</h6>
]]></content:encoded>
			<wfw:commentRss>http://www.rafael.xavier.blog.br/2007/11/12/vim-highlight-search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vim &#8211; smart command completion</title>
		<link>http://www.rafael.xavier.blog.br/2007/11/12/vim-command-complete/</link>
		<comments>http://www.rafael.xavier.blog.br/2007/11/12/vim-command-complete/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 15:50:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.rafael.xavier.blog.br/2007/11/12/vim-command-complete/</guid>
		<description><![CDATA[Para completar os comandos (:) com TAB (^I):
:set wildchar=&#60;Tab&#62;
:set wildmode=full

]]></description>
			<content:encoded><![CDATA[<p>Para completar os comandos (:) com TAB (^I):</p>
<p><code>:set wildchar=&lt;Tab&gt;<br />
:set wildmode=full<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rafael.xavier.blog.br/2007/11/12/vim-command-complete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiz Fusion &#8211; linux ao estilo Mac OSX parte2</title>
		<link>http://www.rafael.xavier.blog.br/2007/11/04/compiz-fusion-linux-ao-estilo-mac-osx-parte2/</link>
		<comments>http://www.rafael.xavier.blog.br/2007/11/04/compiz-fusion-linux-ao-estilo-mac-osx-parte2/#comments</comments>
		<pubDate>Sun, 04 Nov 2007 15:43:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.rafael.xavier.blog.br/2007/11/04/compiz-fusion-linux-ao-estilo-mac-osx-parte2/</guid>
		<description><![CDATA[ Em 2006, surgiram as primeiras aparições de um desktop 3D tangível no linux, com o XGL. http://www.dicas-l.com.br/dicas-l/20060606.php
Algum tempo se passou e muito se evoluiu…
O projeto Compiz juntou-se com seu fork Beryl e, agora, chama-se:
 http://www.compiz-fusion.org

]]></description>
			<content:encoded><![CDATA[<p> Em 2006, surgiram as primeiras aparições de um desktop 3D tangível no linux, com o XGL. <a href="http://www.dicas-l.com.br/dicas-l/20060606.php" title="dicas-l">http://www.dicas-l.com.br/dicas-l/20060606.php</a></p>
<p>Algum tempo se passou e muito se evoluiu…</p>
<p>O projeto Compiz juntou-se com seu fork Beryl e, agora, chama-se:<br />
<a href="http://www.compiz-fusion.org" title="Compiz Fusion"> http://www.compiz-fusion.org</a></p>
<p><embed src="http://www.youtube.com/v/E4Fbk52Mk1w&amp;rel=1" type="application/x-shockwave-flash" wmode="transparent" height="355" width="425"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rafael.xavier.blog.br/2007/11/04/compiz-fusion-linux-ao-estilo-mac-osx-parte2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Criptografia em Linux, utilizando EncFS</title>
		<link>http://www.rafael.xavier.blog.br/2007/11/02/criptografando-dados-no-linux-utilizando-encfs/</link>
		<comments>http://www.rafael.xavier.blog.br/2007/11/02/criptografando-dados-no-linux-utilizando-encfs/#comments</comments>
		<pubDate>Fri, 02 Nov 2007 16:00:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.rafael.xavier.blog.br/2007/11/02/criptografando-dados-no-linux-utilizando-encfs/</guid>
		<description><![CDATA[ Introdução (o que?)
Este tópico descreve o procedimento para criptografia de dados no GNU/Linux, utilizando o sistema de arquivos EncFS.
Público Alvo (pra quem?)
Este tópico deve ser útil para usuários de laptop.
Vantagens e Desvantagens de utilizar o EncFS

 http://arg0.net/wiki/encfs/intro2
 http://xlife.zuavra.net/index.php/66/

Modos de criptografia
TODO
Como utilizar
Instalação
Instalar os pacotes: (utilizar o gerenciador de pacotes de sua distribuição)

 FUSE (Filesystem in [...]]]></description>
			<content:encoded><![CDATA[<h3> Introdução <em>(o que?)</em></h3>
<p>Este tópico descreve o procedimento para criptografia de dados no GNU/Linux, utilizando o sistema de arquivos <span class="twikiNewLink">EncFS</span>.</p>
<h4>Público Alvo <em>(pra quem?)</em></h4>
<p>Este tópico deve ser útil para usuários de laptop.</p>
<h4>Vantagens e Desvantagens de utilizar o EncFS</h4>
<ul>
<li> <a href="http://arg0.net/wiki/encfs/intro2">http://arg0.net/wiki/encfs/intro2</a></li>
<li> <a href="http://xlife.zuavra.net/index.php/66/">http://xlife.zuavra.net/index.php/66/</a></li>
</ul>
<h4>Modos de criptografia</h4>
<p>TODO</p>
<h3>Como utilizar</h3>
<h4>Instalação</h4>
<p>Instalar os pacotes: <em>(utilizar o gerenciador de pacotes de sua distribuição)</em></p>
<ul>
<li> FUSE (Filesystem in Userspace)</li>
<li>EncFS</li>
</ul>
<h4>Criação do diretório criptografado</h4>
<p>Na 1a tentativa de montar seu volume criptografado, ele é criado.</p>
<p>Existem várias opções de criptografia. Caso opte-se pela praticidade, siga os valores <em>default</em>.<br />
<code>$ mkdir ~/.pessoal.enc                   # dados criptografados (raw data)<br />
$ mkdir ~/pessoal                          # ponto de montagem (dados legíveis)<br />
$ encfs ~/.pessoal.enc ~/pessoal     # na 1a tentativa de montagem, o volume criptografado é criado<br />
Volume key not found, creating new encrypted volume.<br />
Password: [password entered here]<br />
Verify: [password entered here]<br />
</code><br />
O diretório ~/pessoal, agora, é um ponto de montagem de ~/.pessoal.enc e todo o conteúdo que estiver dentro dele (~/pessoal) estará seguro quando offline.</p>
<h4>Montando/Desmontando</h4>
<p>Montando.</p>
<p><code>$ encfs ~/.pessoal.enc ~/pessoal<br />
Password: [password entered here]<br />
</code></p>
<p>Diretório legível: (montado)</p>
<p><code>$ cd ~/pessoal<br />
$ echo "hello foo" &gt; foo<br />
$ echo "hello bar" &gt; bar<br />
$ ln -s foo foo2<br />
$ ls -l<br />
total 8<br />
-rw-r--r-- 1 vgough users 10 2003-11-03 21:44 bar<br />
-rw-r--r-- 1 vgough users 6 2003-11-03 21:44 foo<br />
lrwxrwxrwx 1 vgough users 7 2003-11-03 21:44 foo2 -&gt; foo</code></p>
<p>Diretório criptografado: (de fato, armazenado)</p>
<p><code>$ cd ~/.pessoal.enc<br />
$ ls -l<br />
total 8<br />
-rw-r--r-- 1 vgough users 6 2003-11-03 21:44 eEM4YfA<br />
-rw-r--r-- 1 vgough users 10 2003-11-03 21:44 gKP4xn8<br />
lrwxrwxrwx 1 vgough users 7 2003-11-03 21:44 i7t9-m,I -&gt; eEM4YfA<br />
</code></p>
<p>Desmontando.</p>
<p><code>$ fusermount -u ~/pessoal</code></p>
<h4>Criptografando os dados de seus aplicativos: Firefox, Thunderbird, etc.</h4>
<p>Deseja ter criptografados seus emails, informações de calendário, conversas do instant messenger e informações de seu browser? Mova o diretório de configuração de cada aplicativo para dentro do volume criptografado e crie um <em>link</em> de volta. Como no exemplo abaixo:</p>
<p>Antes de iniciar os aplicativos (óbvio), mova seu diretório de configuração para dentro do volume criptografado e <em>link-o</em> de volta. Por exemplo:<br />
<code>cd ~<br />
mv .mozilla ~/pessoal<br />
ln -s ~/pessoal/.mozilla .<br />
</code><br />
Faça o mesmo para mozilla-thunderbird, gaim, evolution, entre outros.</p>
<h5>Ambiente Gráfico</h5>
<p>Em ambiente gráfico, pode ser mais prático criar <em>starers</em> de aplicativos que, antes de inicializar o aplicativo em si, cheque se a unidade criptografada está montada. Caso não esteja, o próprio <em>starter</em> poderá montá-la, utilizando gtk2-ssh-askpass, x11-ssh-askpass ou zenity. Exemplo:<br />
<code>encfs --extpass=/usr/bin/zenity-encfs $ENC $MNT</code></p>
<p><a href="http://gentoo-wiki.com/TIP_EncFS" target="_top">http://gentoo-wiki.com/TIP_EncFS</a></p>
<h3>Backup!</h3>
<p>Uma vez que todos os dados estão concentrados no diretório criptografado ~/.pessoal.enc, torna-se fácil a realização de backup. Basta copiá-lo para uma mídia removível e, sim, o backup também estará criptografado.</p>
<p>Exemplos de como realizar o backup:</p>
<ol>
<li> Compactar o diretório <code>tar -czf ~/pessoal.enc.tgz ~/.pessoal.enc</code> e copiá-lo para um DVD (sugestão: k3b).</li>
<li> Utilizar alguma forma de backup diferencial/incremental (é copiado apenas o que alterou), sem sugestões&#8230;</li>
</ol>
<h3>Links externos</h3>
<p>Segue:</p>
<ul>
<li> <a href="http://arg0.net/wiki/encfs" target="_top">http://arg0.net/wiki/encfs</a></li>
<li> <a href="http://en.wikipedia.org/wiki/EncFS" target="_top">http://en.wikipedia.org/wiki/EncFS</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.rafael.xavier.blog.br/2007/11/02/criptografando-dados-no-linux-utilizando-encfs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

