<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Desabafo binário</title>
	<atom:link href="http://rodrigoramalho.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://rodrigoramalho.org</link>
	<description>Rodrigo Ramalho em</description>
	<lastBuildDate>Wed, 18 Jan 2012 13:56:59 +0000</lastBuildDate>
	<language>pt-br</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rodrigoramalho.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/41955b3c68466d1f55cbe2371bae9769?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Desabafo binário</title>
		<link>http://rodrigoramalho.org</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rodrigoramalho.org/osd.xml" title="Desabafo binário" />
	<atom:link rel='hub' href='http://rodrigoramalho.org/?pushpress=hub'/>
		<item>
		<title>Inserir tag no cabeçalho html do Portal Gatein</title>
		<link>http://rodrigoramalho.org/2012/01/17/inserir-tag-no-cabecalho-html-do-portal-gatein/</link>
		<comments>http://rodrigoramalho.org/2012/01/17/inserir-tag-no-cabecalho-html-do-portal-gatein/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 19:45:25 +0000</pubDate>
		<dc:creator>Rodrigo Ramalho da Silva</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[portal]]></category>
		<category><![CDATA[exo]]></category>
		<category><![CDATA[gatein]]></category>
		<category><![CDATA[head element]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tag cabecalho]]></category>
		<category><![CDATA[tag head]]></category>

		<guid isPermaLink="false">http://rodrigoramalho.org/?p=131</guid>
		<description><![CDATA[Esses dias precisei inserir uma tag no cabeçalho de todas as páginas que estivessem no portal gatein. Existem duas maneiras de fazer isso: 1. Criando um portlet que insere essa tag no &#60;head&#62; da página, carregando pelo método doHeader. o código do portlet deverá ser semelhante a esse: Com isso basta colocar este portlet no [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodrigoramalho.org&amp;blog=22400385&amp;post=131&amp;subd=haxorslab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Esses dias precisei inserir uma tag no cabeçalho de todas as páginas que estivessem no portal gatein.</p>
<p>Existem duas maneiras de fazer isso:</p>
<p>1. Criando um portlet que insere essa tag no &lt;head&gt; da página, carregando pelo método doHeader.</p>
<p>o código do portlet deverá ser semelhante a esse:</p>
<p><pre class="brush: java;">
public class HeaderExtension extends GenericPortlet {

@Override
protected void doHeaders(RenderRequest request, RenderResponse response) {
Element meta = response.createElement(&quot;meta&quot;);
meta.setAttribute(&quot;http-equiv&quot;, &quot;X-UA-Compatible&quot;);
meta.setAttribute(&quot;content&quot;, &quot;IE=edge&quot;);
response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, meta);
}

@Override
public void doView(RenderRequest request, RenderResponse response) {
PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(&quot;/jsp/index.jsp&quot;);
try {
prd.include(request, response);
} catch (Exception e) {
e.printStackTrace();
}
}
}
</pre></p>
<p>Com isso basta colocar este portlet no layout do site e ele irá colocar toda vez essa tag no cabeçalho da página. Pode ser usado também pra carregar css, javascript, etc.. (<a href="https://community.jboss.org/wiki/JQueryPortlet">Veja mais</a>)<br />
Porém com essa abordagem tudo que for inserido aparece no final da tag head, ou seja, próximo ao /head. As vezes é necessário que a tag esteja no começo do head, como no caso da tag:</p>
<p><pre class="brush: xml;">
 &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;/&gt;
</pre></p>
<p>Que é utilizada para compatibilidade com o Internet Explorer.<br />
Com este cenário temos que alterar o fonte do template groovy que o portal utiliza. O arquivo pode ser encontrado em:</p>
<p><pre class="brush: java;">
$JBOSS_EPP_HOME/server/$SERVER_NAME/deploy/gatein-wcm-extension-2.1.5-CP02.ear/ecm-wcm-extension.war/groovy/portal/webui/workspace/UIPortalApplication.gtmpl
</pre></p>
<p>Ps: É necessário explodir o arquivo gatein-wcm-extension-2.1.5-CP02.ear e o ecm-wcm-extension.war</p>
<p>Feita a alteração neste template groovy basta reiniciar o portal.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/haxorslab.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/haxorslab.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/haxorslab.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/haxorslab.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/haxorslab.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/haxorslab.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/haxorslab.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/haxorslab.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/haxorslab.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/haxorslab.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/haxorslab.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/haxorslab.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/haxorslab.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/haxorslab.wordpress.com/131/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodrigoramalho.org&amp;blog=22400385&amp;post=131&amp;subd=haxorslab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodrigoramalho.org/2012/01/17/inserir-tag-no-cabecalho-html-do-portal-gatein/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5a8095b6b9b59ebe2001ddfccc86cbe7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodrigoramalhosilva</media:title>
		</media:content>
	</item>
		<item>
		<title>Autenticação pelo Google utilizando OpenID</title>
		<link>http://rodrigoramalho.org/2012/01/12/autenticacao-pelo-google-utilizando-openid/</link>
		<comments>http://rodrigoramalho.org/2012/01/12/autenticacao-pelo-google-utilizando-openid/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 04:00:36 +0000</pubDate>
		<dc:creator>Rodrigo Ramalho da Silva</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[autenticação]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[login federado]]></category>
		<category><![CDATA[openid]]></category>

		<guid isPermaLink="false">http://rodrigoramalho.org/?p=121</guid>
		<description><![CDATA[&#8220;A API de login federado do Google, com base no protocolo OpenID 2.0, permite que os usuários façam login no seu site ou aplicativo da web com suas Contas do Google. Quando o Google autentica uma conta de usuário, ele retorna um ID de usuário para o seu aplicativo, o que permite que você colete [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodrigoramalho.org&amp;blog=22400385&amp;post=121&amp;subd=haxorslab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>&#8220;A API de login federado do Google, com base no protocolo OpenID 2.0, permite que os usuários façam login no seu site ou aplicativo da web com suas Contas do Google. Quando o Google autentica uma conta de usuário, ele retorna um ID de usuário para o seu aplicativo, o que permite que você colete e armazene informações do usuário. O Login federado também permite que você obtenha acesso a determinadas informações sobre a conta do usuário, com a aprovação dele.&#8221; <a href="http://code.google.com/intl/pt-BR/apis/accounts/" target="_blank">http://code.google.com/intl/pt-BR/apis/accounts/</a></p>
<p>Então&#8230; Hands ON! Cabe lembrar que da mesma maneira que faremos para o google podemos fazer para qualquer site que seja um provedor OpenID, como Yahoo, Flickr dentre outros.</p>
<p>Segue uma imagem que tenta representar como ficará o fluxo dessa autenticação.</p>
<p><a href="http://haxorslab.files.wordpress.com/2012/01/fluxo1.jpg"><img class="aligncenter size-full wp-image-125" title="fluxo" src="http://haxorslab.files.wordpress.com/2012/01/fluxo1.jpg?w=620&#038;h=115" alt="" width="620" height="115" /></a></p>
<ol>
<li>O usuário entra na tela de login, seleciona o botão para fazer autenticação pelo google.</li>
<li>É feito um direcionamento para autenticação pela página do google.</li>
<li>Ao efetuar a autenticação ocorre o redirecionamento de volta para a página da aplicação.</li>
</ol>
<h3>1. SETUP</h3>
<p><a href="http://code.google.com/p/openid4java/downloads/list" target="_blank">Baixe a biblioteca openid4java</a>.</p>
<p><a href="http://blog.camilolopes.com.br/criando-dynamic-webproject-jee-%E2%80%93-eclipse/" target="_blank">No eclipse crie um projeto Dynamic Web Project.</a></p>
<p>Fiz comentários quase que linha a linha em todo o código para facilitar o entendimento.</p>
<h3>2. ResultType.java</h3>
<p>Criei um Enum pra indicar se a autenticação teve <strong>sucesso</strong>, <strong>não sucesso</strong> ou se foi <strong>redirecionada</strong>.</p>
<p><pre class="brush: java;">

package org.rodrigoramalho.openid.autenticacao;

public enum ResultType {

AUTH_SUCCESS, AUTH_FAILURE, REDIRECT_TO_OPENID_PROVIDER_FAILURE

}
</pre></p>
<h3>2. Consumer.java</h3>
<p>Éssa classe que será responsável pela autenticação utilizando o openid.</p>
<p>O método a seguir <strong>authRequest</strong> é o método responsável pela ação de quando o usuário clicar no botão de autenticação com o google, fazer o request OpenID e direcionar para a página de autenticação do google.</p>
<p><pre class="brush: java;">

public ResultType authRequest(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) throws IOException{

try{

// realm é a url da aplicação + porta ex: http://localhost:8080

String realm = getRealm(request);

// Definimos a url a qual o google deverá retornar após autenticar o usuário

String returnToUrl = new StringBuffer(realm).append(request.getContextPath()) + &quot;/Auth&quot;;

// &quot;descobre&quot; o OpenID do fornecedor

List discoveries = manager.discover(&quot;https://www.google.com/accounts/o8/id&quot;);
// Tentativa de se conectar com o provedor OpenID

// e acessar um endpoint service pra se autenticar

DiscoveryInformation discovered = manager.associate(discoveries);

// Obtém a requisição de autorização que será mandada para o provedor OpenID

AuthRequest authReq = manager.authenticate(discovered, returnToUrl);

// Informa quais atributos deverão ser 'requeridos'

FetchRequest fetch = FetchRequest.createFetchRequest();

fetch.addAttribute(&quot;email&quot;, &quot;http://axschema.org/contact/email&quot;, true);

fetch.addAttribute(&quot;firstName&quot;, &quot;http://axschema.org/namePerson/first&quot;, true);

fetch.addAttribute(&quot;lastName&quot;, &quot;http://axschema.org/namePerson/last&quot;, true);

authReq.addExtension(fetch);

authReq.setRealm(realm);

// coloca o objeto discovered na sessão do usuário

request.getSession().setAttribute(&quot;discovered&quot;, discovered);

request.getSession().setAttribute(&quot;checkResponse&quot;, true);

// Encaminha para a página de autenticação do google

response.sendRedirect(authReq.getDestinationUrl(true));

}

catch (OpenIDException e){

e.printStackTrace();

}

return ResultType.REDIRECT_TO_OPENID_PROVIDER_FAILURE;

}

</pre></p>
<p>Após fazer a autenticação pelo google, deve-se verificar se essa autenticação foi válida, para isso deve-se chamar o método <strong>verifyResponse </strong></p>
<p><pre class="brush: java;">

public ResultType verifyResponse(HttpServletRequest httpReq){

try{

// extrai os parametros que vem do HTTP request do OpenID provider.

ParameterList response = new ParameterList(httpReq.getParameterMap());

// Lembra que a gente colocou esse objeto na sessão?

DiscoveryInformation discovered = (DiscoveryInformation) httpReq.getSession().getAttribute(&quot;discovered&quot;);

// Extrai os parametros da url

StringBuffer receivingURL = httpReq.getRequestURL();

String queryString = httpReq.getQueryString();

if (queryString != null &amp;&amp; queryString.length() &gt; 0){

receivingURL.append(&quot;?&quot;).append(httpReq.getQueryString());

}

// Valida o response, verificar se o ConsumerManager é o mesmo que efetuou o request

VerificationResult verification = manager.verify(receivingURL.toString(), response, discovered);

// Analisa o resultado da verificação e extrai o identificador de verificação

Identifier verified = verification.getVerifiedId();

if (verified != null){

AuthSuccess authSuccess = (AuthSuccess) verification.getAuthResponse();

if (authSuccess.hasExtension(AxMessage.OPENID_NS_AX)){

// Extrai os atributos que fizemos a requisição (no fetchRequest)

FetchResponse fetchResp = (FetchResponse) authSuccess.getExtension(AxMessage.OPENID_NS_AX);

Map userAttributes = fetchResp.getAttributes();

User user = new User();

user.setEmail(userAttributes.get(&quot;email&quot;).toString());

String nome = userAttributes.get(&quot;firstName&quot;) + &quot; &quot;+ userAttributes.get(&quot;lastName&quot;);

user.setName(removeBrackets(nome));

// Coloca o usuário na sessão

httpReq.getSession().setAttribute(&quot;user&quot;, user);

}

return ResultType.AUTH_SUCCESS;  // success

}

}catch (OpenIDException e){

e.printStackTrace();

}

httpReq.getSession().removeAttribute(&quot;checkResponse&quot;);

return ResultType.AUTH_FAILURE;

}

</pre></p>
<h3>3. AuthServlet.java</h3>
<p><pre class="brush: java;">

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

try {

if (request.getParameter(&quot;logout&quot;) != null) {

logoutUser(request, response);

}else{

Consumer consumer = new Consumer();

HttpSession session = request.getSession();

boolean checkResponse = session.getAttribute(&quot;checkResponse&quot;) != null ? true : false;

if (!checkResponse){

consumer.authRequest(request, response, getServletContext());

}else{

consumer.verifyResponse(request);

RequestDispatcher dispatcher = request.getRequestDispatcher(&quot;login.jsp&quot;);

dispatcher.forward(request, response);

}

}

} catch (ConsumerException e) {

e.printStackTrace();

}

}

</pre></p>
<h3>4. login.jsp</h3>
<p><pre class="brush: java;">

&lt;body&gt;

&lt;%@page import=&quot;org.rodrigoramalho.openid.beans.User&quot;%&gt;

&lt;% User user = (User) request.getSession().getAttribute(&quot;user&quot;); %&gt;

&lt;% if ( user == null){ %&gt;

Sign in

&lt;hr/&gt;

&lt;div&gt;&lt;div id=&quot;login_por_terceiros&quot;&gt;

&lt;a href=&quot;Auth&quot;&gt;

&lt;div id=&quot;login_google&quot;&gt;&lt;/div&gt;

&lt;/a&gt;

&lt;/div&gt;&lt;/div&gt;

&lt;% } else {%&gt;

&lt;p&gt; Bem vindo &lt;%= user.getName() %&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;Auth?logout&quot;&gt;Logout&lt;/a&gt;&lt;/p&gt;

&lt;%} %&gt;

&lt;/body&gt;

</pre></p>
<p><a href="https://github.com/hodrigohamalho/openid-example" target="_blank">O código fonte do projeto.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/haxorslab.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/haxorslab.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/haxorslab.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/haxorslab.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/haxorslab.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/haxorslab.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/haxorslab.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/haxorslab.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/haxorslab.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/haxorslab.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/haxorslab.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/haxorslab.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/haxorslab.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/haxorslab.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodrigoramalho.org&amp;blog=22400385&amp;post=121&amp;subd=haxorslab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodrigoramalho.org/2012/01/12/autenticacao-pelo-google-utilizando-openid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5a8095b6b9b59ebe2001ddfccc86cbe7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodrigoramalhosilva</media:title>
		</media:content>

		<media:content url="http://haxorslab.files.wordpress.com/2012/01/fluxo1.jpg" medium="image">
			<media:title type="html">fluxo</media:title>
		</media:content>
	</item>
		<item>
		<title>Bash Script find and replace</title>
		<link>http://rodrigoramalho.org/2012/01/03/bash-script-find-and-replace/</link>
		<comments>http://rodrigoramalho.org/2012/01/03/bash-script-find-and-replace/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 14:35:38 +0000</pubDate>
		<dc:creator>Rodrigo Ramalho da Silva</dc:creator>
				<category><![CDATA[Bash Script]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bash script]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[renomear arquivos]]></category>
		<category><![CDATA[renomear diretórios]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[substituir textos]]></category>

		<guid isPermaLink="false">http://rodrigoramalho.org/?p=110</guid>
		<description><![CDATA[Faz substituição no texto de arquivos. A linha de comando abaixo faz uma procura e substitui todas as ocorrências em arquivos textos da palavra &#8220;procure_por_isso&#8221; nos diretórios abaixo de &#8220;/home/meu_diretorio&#8221; e substitui por &#8221;substitua_por_isso&#8221;. . find "/home/meu_diretorio" -type f -exec sed -i "" -e s/procure_por_isso/"substitua_por_isso"/g {} \; . . Faz substituição no nome de arquivos e [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodrigoramalho.org&amp;blog=22400385&amp;post=110&amp;subd=haxorslab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="LC31"><strong>Faz substituição no texto de arquivos.</strong></div>
<div>A linha de comando abaixo faz uma procura e substitui todas as ocorrências em arquivos textos da palavra &#8220;procure_por_isso&#8221; nos diretórios abaixo de &#8220;/home/meu_diretorio&#8221; e substitui por &#8221;substitua_por_isso&#8221;.</div>
<div><span style="color:#ffffff;">.</span></div>
<pre>find "/home/meu_diretorio" -type f -exec sed -i "" -e s/procure_por_isso/"substitua_por_isso"/g {} \;
<span style="color:#ffffff;">.</span></pre>
<div><span style="color:#ffffff;">.</span></div>
<div><strong>Faz substituição no nome de arquivos e diretórios</strong></div>
<div>O script abaixo renomeia todos os arquivos e diretórios com o nome de &#8220;procure_por_isso&#8221; e substitui por &#8220;substitua_por_isso&#8221; a partir do diretório &#8220;/home/procure_por_aqui&#8221;</div>
<div><span style="color:#ffffff;">.</span></div>
<div>
<pre style="padding-left:30px;">  FILES=$(find /home/procure_por_aqui -name "procure_por_isso")</pre>
<pre style="padding-left:30px;">  for FILE in $FILES; do</pre>
<pre style="padding-left:30px;">    NAME="$FILE"</pre>
<pre style="padding-left:30px;">    NAME_REPLACED=$(echo $FILE | sed -e s/"procure_por_isso"/"substitua_por_isso"/g)</pre>
<pre style="padding-left:30px;">    mv $NAME $NAME_REPLACED</pre>
<pre style="padding-left:30px;">  done</pre>
</div>
<div><span style="color:#ffffff;">.</span></div>
<div></div>
<div>Cabe lembrar que caso queira pesquisar pela parte do nome, no parametro -name pode-se utilizar o: *</div>
<div>por exemplo:</div>
<div><span style="color:#ffffff;">.</span></div>
<pre style="padding-left:30px;">FILES=$(find /home/procure_por_aqui -name *procure_por_isso*)</pre>
<pre style="padding-left:30px;"><span style="color:#ffffff;">.</span></pre>
<div>Vai procurar por qualquer ocorrência de &#8220;procure_por_isso&#8221;. Segue um exemplo de alguns resultados possíveis:</div>
<div><span style="color:#ffffff;">.</span></div>
<div style="padding-left:30px;">abc_procure_por_isso</div>
<div style="padding-left:30px;">procure_por_isso_abc</div>
<div style="padding-left:30px;">procure_por_isso</div>
<div style="padding-left:30px;"><span style="color:#ffffff;">.</span></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/haxorslab.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/haxorslab.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/haxorslab.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/haxorslab.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/haxorslab.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/haxorslab.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/haxorslab.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/haxorslab.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/haxorslab.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/haxorslab.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/haxorslab.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/haxorslab.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/haxorslab.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/haxorslab.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodrigoramalho.org&amp;blog=22400385&amp;post=110&amp;subd=haxorslab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodrigoramalho.org/2012/01/03/bash-script-find-and-replace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5a8095b6b9b59ebe2001ddfccc86cbe7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodrigoramalhosilva</media:title>
		</media:content>
	</item>
		<item>
		<title>Introdução a Cluster</title>
		<link>http://rodrigoramalho.org/2011/10/11/introducao-cluster/</link>
		<comments>http://rodrigoramalho.org/2011/10/11/introducao-cluster/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 17:04:08 +0000</pubDate>
		<dc:creator>Rodrigo Ramalho da Silva</dc:creator>
				<category><![CDATA[cluster]]></category>

		<guid isPermaLink="false">http://rodrigoramalho.org/?p=73</guid>
		<description><![CDATA[Cluster ? Cluster é o ato de de rodar a mesma aplicação em vários servidores de aplicação simultaneamente com cada aplicação estando ciente das outras que estão no cluster. Um servidor de aplicação em um cluster é chamado de nó. Pra quê ? Creio que a melhor forma de entender o por que? é com [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodrigoramalho.org&amp;blog=22400385&amp;post=73&amp;subd=haxorslab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#000000;"><strong>Cluster ?</strong></span></p>
<p><span style="color:#000000;">Cluster é o ato de de rodar a mesma aplicação em vários servidores de aplicação simultaneamente com cada aplicação estando ciente das outras que estão no cluster. Um servidor de aplicação em um cluster é chamado de nó.</span></p>
<p><span style="color:#000000;"><strong>Pra quê ?</strong></span></p>
<p><span style="color:#000000;">Creio que a melhor forma de entender o por que? é com um exemplo, então:</span></p>
<p><span style="color:#000000;">O servidor em que minha aplicação está rodando suporta 1000 usuários simultâneos, porém hoje 2000 usuários simultâneos acessaram minha aplicação e o servidor caiu.</span><br />
<span style="color:#000000;">E agora José ? Temos 2 opções, ou adquiro recursos para o servidor que já está rodando ou adiciono outras máquinas para responderem esses requests, desafogando a primeiro servidor.</span></p>
<p><span style="color:#000000;"><strong>Cluster: Vertical x Horizontal</strong></span></p>
<p><span style="color:#000000;">Clusters podem ser formados com nós rodando em uma máquina ou em várias máquinas. Essa formação do cluster é comumente se referida como topologia.</span></p>
<ul>
<li><span style="color:#000000;">Horizontal: Quando os nós do cluster estão em diferentes máquinas.</span></li>
<li><span style="color:#000000;">Vertical: Quando os nós do clusters estão na mesma máquina</span></li>
</ul>
<p><span style="color:#000000;">No cluster horizontal  se acontece alguma falha com a máquina (ex: queda de energia, queimar algum periférico, etc) a outra máquina assume o cluster sem problemas. Se a máquina do cluster vertical ocorrer algum problema todos os servidores que estavam rodando nela, serão comprometidos. Em outras palavras um cluster horizontal é uma melhor opção para alta disponibilidade.</span></p>
<div><span style="color:#000000;"><a href="http://haxorslab.files.wordpress.com/2011/10/screenshot-5.png"><span style="color:#000000;"><img class="size-full wp-image-77 aligncenter" title="Cluster horizontal x Vertical" src="http://haxorslab.files.wordpress.com/2011/10/screenshot-5.png?w=620&#038;h=270" alt="" width="620" height="270" /></span></a></span></div>
<p><span style="color:#000000;"><strong>Balanceamento de Carga</strong></span></p>
<p><span style="color:#000000;">Balanceamento de carga é a maneira de distribuir a carga de entrada entre os diferentes servidores de aplicação, fazendo com que sua aplicação seja escalável e tenha alta disponibilidade. Escalabilidade é o termo usado para descrever a habilidade de fazer com que sua aplicação manipule mais carga adicionando hardware e/ou criando instâncias redundantes sem alterar o código. Então um cluster sem balanceamento de carga faz pouco ou nenhum sentido.</span></p>
<p style="text-align:center;"><span style="color:#000000;"><a href="http://haxorslab.files.wordpress.com/2011/10/screenshot-41.png"><span style="color:#000000;"><img class="size-full wp-image-76 aligncenter" title="Load Balance" src="http://haxorslab.files.wordpress.com/2011/10/screenshot-41.png?w=620&#038;h=281" alt="" width="620" height="281" /></span></a></span></p>
<p><span style="color:#000000;"><strong>Alta disponibilidade</strong></span></p>
<p><span style="color:#000000;">Caso se tenha uma aplicação que seja toda stateless, pode-se garantir alta disponibilidade apenas colocando um balanceador de carga na frente de vários servidores com a mesma aplicação deployada (note, sem cluster). Esse mecanismo é conhecido como <strong>Failover</strong>. Cabe a ressalva que no failover nenhum tipo de estado da aplicação é replicado.</span></p>
<p><span style="color:#000000;">Porém se a aplicação for stateful o problema é mais em baixo, imagine que você esteja em um site de compras o seu carrinho já possui 10 itens derrepente o servidor cai, você não vai gostar nada de quando clicar no próximo botão cair em um tela de login e o seu carrinho aparecer zerado. O <strong>failover </strong>não replica estado então não seria adequado para esse tipo de situação para isso temos o mecanismo a seguir:</span></p>
<p><span style="color:#000000;"><strong>Replicação e Tolerância a falhas </strong>(Replication e Fault Tolerance)</span></p>
<p><span style="color:#000000;">Um servidor com tolerância a falhas promove alta disponibilidade e continua se comunicando com o cliente mesmo que o servidor caia, ou seja o estado do cliente é mantido. Então no exemplo anterior se o cluster tiver tolerância a falhas então o servidor cairá o cliente será balanceado para outro nó e continuará logado na aplicação com seu carrinho de compras com todos os itens como se nada tivesse acontecido.</span><br />
<span style="color:#000000;"> Mas o que contém nesse estado do cliente?</span><br />
<span style="color:#000000;"> Basicamente duas coisas: Dados de sessão e de entidades.</span></p>
<p><span style="color:#000000;">Dados de sessão (Session data) são mantidos em memória pela aplicação ou por mecanismos de cache habilitados pelo servidor de aplicação.</span><br />
<span style="color:#000000;"> Dados de entidade (Entity data) são mantidos em banco de dados.</span></p>
<p><span style="color:#000000;">Para ser tolerante a falhas o estado associado a uma aplicação deve redundantemente disponível, ou seja, os nós devem replicar o estado entre cada nó do cluster</span></p>
<p><span style="color:#000000;">Fault tolerance = fail over + state replication</span><br />
<span style="color:#000000;"> <a href="http://haxorslab.files.wordpress.com/2011/10/screenshot-6.png"><span style="color:#000000;"><img class="size-full wp-image-78 aligncenter" title="Fault Tolerance" src="http://haxorslab.files.wordpress.com/2011/10/screenshot-6.png?w=620&#038;h=299" alt="" width="620" height="299" /></span></a></span></p>
<p><span style="color:#000000;">É muito comum escutarmos conversas de pessoas pensando em cluster como uma forma de melhorar performance, e como podemos ver cluster é sinônimo de disponibilidade e dependendo do cluster pode é trazer défict de performance devido o fato do servidor de aplicação ter que ficar replicando estado, sincronizando cache, etc.</span></p>
<p><span style="color:#000000;">Existem diferentes formas dessa replicação de estado acontecer em um cluster, mas para não deixar o post muito longo vou encerrando por aqui.<br />
</span></p>
<p><span style="color:#000000;">Fonte:</span><br />
<span style="color:#000000;"> <a href="http://www.manning.com/jamae/"><span style="color:#000000;"> JBoss in Action &#8211; Chapter 12 &#8211; Understanding Cluster.</span></a></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/haxorslab.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/haxorslab.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/haxorslab.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/haxorslab.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/haxorslab.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/haxorslab.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/haxorslab.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/haxorslab.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/haxorslab.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/haxorslab.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/haxorslab.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/haxorslab.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/haxorslab.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/haxorslab.wordpress.com/73/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodrigoramalho.org&amp;blog=22400385&amp;post=73&amp;subd=haxorslab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodrigoramalho.org/2011/10/11/introducao-cluster/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5a8095b6b9b59ebe2001ddfccc86cbe7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodrigoramalhosilva</media:title>
		</media:content>

		<media:content url="http://haxorslab.files.wordpress.com/2011/10/screenshot-5.png" medium="image">
			<media:title type="html">Cluster horizontal x Vertical</media:title>
		</media:content>

		<media:content url="http://haxorslab.files.wordpress.com/2011/10/screenshot-41.png" medium="image">
			<media:title type="html">Load Balance</media:title>
		</media:content>

		<media:content url="http://haxorslab.files.wordpress.com/2011/10/screenshot-6.png" medium="image">
			<media:title type="html">Fault Tolerance</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery placeholder plugin (Twitter Like)</title>
		<link>http://rodrigoramalho.org/2011/09/28/jquery-placeholder-plugin/</link>
		<comments>http://rodrigoramalho.org/2011/09/28/jquery-placeholder-plugin/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 06:32:34 +0000</pubDate>
		<dc:creator>Rodrigo Ramalho da Silva</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jquery placeholder]]></category>
		<category><![CDATA[jquery plugin]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://rodrigoramalho.org/?p=50</guid>
		<description><![CDATA[Recentemente programando com minha amiga Carolina Mascarenhas ela fez um placeholder bem parecido com o do twitter, apenas dei uma acabada no código e coloquei no formato de plugin. Placeholder é quando o label de um campo input está localizado dentro do pŕoprio input. Como podemos ver na imagem abaixo: &#160; &#160; Segue a página [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodrigoramalho.org&amp;blog=22400385&amp;post=50&amp;subd=haxorslab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recentemente programando com minha amiga<a title="Carolina Mascarenhas" href="http://twitter.com/#!/anylyne" target="_blank"> Carolina Mascarenhas</a> ela fez um placeholder bem parecido com o do twitter, apenas dei uma acabada no código e coloquei no formato de plugin.</p>
<p>Placeholder é quando o label de um campo input está localizado dentro do pŕoprio input. Como podemos ver na imagem abaixo:</p>
<p><a href="http://haxorslab.files.wordpress.com/2011/09/screenshot-1.png"><img class="alignleft size-thumbnail wp-image-64" title="placeholder input" src="http://haxorslab.files.wordpress.com/2011/09/screenshot-1.png?w=200&#038;h=35" alt="" width="200" height="35" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Segue a página contendo o exemplo: <a href="http://jspace.com.br/jquery-placeholder-plugin/" target="_blank">http://jspace.com.br/jquery-placeholder-plugin/</a></p>
<p>Como utilizar:</p>
<p>Adicionar os arquivos<strong> jquery.js</strong>, <strong>jquery.placeholder.js</strong> e o<strong> placeholder.cs</strong>s a página.</p>
<pre>&lt;script type="text/javascript" src="jquery.min.js" &gt;&lt;/script&gt;
&lt;script type="text/javascript" src="jquery.placeholder.js" &gt;&lt;/script&gt;
&lt;link href="placeholder.css" type="text/css" rel="stylesheet" /&gt;</pre>
<p>O html deve respeitar a seguinte estrutura:</p>
<pre>&lt;div class="holding username"&gt;</pre>
<pre style="padding-left:30px;">&lt;input type="text" id="username" name="username" /&gt;</pre>
<pre style="padding-left:30px;">&lt;span class="holder"&gt;Email&lt;/span&gt;
&lt;/div&gt;</pre>
<p>Onde o conteúdo que estiver dentro da tag &lt;span&gt; será o que aparecerá dentro do input.</p>
<p>Tendo isso como premissa, o código para adicionar o placeholder deverá ser o seguinte:</p>
<pre> jQuery(".username").placeholder();</pre>
<p>Onde &#8220;.username&#8221; é a classe da div. Também pode ser utilizado o id.</p>
<p>Algumas opções podem ser especificadas:</p>
<pre>jQuery(".username").placeholder({</pre>
<pre style="padding-left:30px;">color_onfocus: "b9b9b9",</pre>
<pre style="padding-left:30px;">color_background_onfocus: "white"
});</pre>
<p>Cabe lembrar que o HTML5 tem suporte nativo ao placeholder bastando apenas colocar a propriedade placeholder=&#8221;Rodrigo Ramalho&#8221; dentro do input.</p>
<p>exemplo:</p>
<pre>&lt;input type="text" name="exemplo" placeholder="Demonstrando placeholder" /&gt;</pre>
<p>Simples assim. Porém nem todos os browsers suportam HTML5 ainda.</p>
<p>Pra quem quiser contribuir e/ou entender melhor o projeto, o source está no meu github:</p>
<p><a href="https://github.com/hodrigohamalho/jquery-placeholder-plugin">https://github.com/hodrigohamalho/jquery-placeholder-plugin</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/haxorslab.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/haxorslab.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/haxorslab.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/haxorslab.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/haxorslab.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/haxorslab.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/haxorslab.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/haxorslab.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/haxorslab.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/haxorslab.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/haxorslab.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/haxorslab.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/haxorslab.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/haxorslab.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodrigoramalho.org&amp;blog=22400385&amp;post=50&amp;subd=haxorslab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodrigoramalho.org/2011/09/28/jquery-placeholder-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5a8095b6b9b59ebe2001ddfccc86cbe7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodrigoramalhosilva</media:title>
		</media:content>

		<media:content url="http://haxorslab.files.wordpress.com/2011/09/screenshot-1.png?w=150" medium="image">
			<media:title type="html">placeholder input</media:title>
		</media:content>
	</item>
		<item>
		<title>Cheat Sheets</title>
		<link>http://rodrigoramalho.org/2011/07/08/cheat-sheets/</link>
		<comments>http://rodrigoramalho.org/2011/07/08/cheat-sheets/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 04:32:53 +0000</pubDate>
		<dc:creator>Rodrigo Ramalho da Silva</dc:creator>
				<category><![CDATA[Cheat Sheet]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[cheat sheet]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[heroku]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://rodrigoramalho.org/?p=23</guid>
		<description><![CDATA[Para evitar o problema de ter que ficar dando uma googlada pra lembrar 'aquele' comando que está lhe falhando a memória,  basta aprender a explorar os "cheat sheets". Cheat sheet  é um resumo dos principais comandos de uma determinada API. Hoje precisei lembrar alguns comandos do heroku e achei esse cheat sheet no qual acrescentei [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodrigoramalho.org&amp;blog=22400385&amp;post=23&amp;subd=haxorslab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre>Para evitar o problema de ter que ficar dando uma googlada pra lembrar 'aquele' comando
que está lhe falhando a memória,  basta aprender a explorar os <a title="cheat sheets" href="http://tinyurl.com/6zdx4pf" target="_blank">"cheat sheets"</a>. Cheat sheet 
é um resumo dos principais comandos de uma determinada API. Hoje precisei lembrar alguns
comandos do <a title="heroku" href="http://heroku.com" target="_blank">heroku</a> e achei esse <a title="cheat sheet" href="http://cheat.errtheblog.com/s/heroku/2" target="_blank">cheat sheet</a> no qual acrescentei algumas linhas.

<strong>Heroku Cheat Sheet </strong>
<strong>=== General Commands</strong>
 help                         # show this usage
 version                      # show the gem version

 list                         # list your apps
 create [&lt;name&gt;]              # create a new app

 keys                         # show your user's public keys
 keys:add [&lt;path to keyfile&gt;] # add a public key
 keys:remove &lt;keyname&gt;        # remove a key by name (user@host)
 keys:clear                   # remove all keys
 ps                           # display process

<strong>=== App Commands (execute inside a checkout directory, or use --app &lt;appname&gt;)</strong>

 info                         # show app info, like web url and git repo
 open                         # open the app in a web browser
 rename &lt;newname&gt;             # rename the app
 dynos &lt;qty&gt;                  # set the app to use the specified qty of dynos

 sharing:add &lt;email&gt;          # add a collaborator
 sharing:remove &lt;email&gt;       # remove a collaborator
 sharing:transfer &lt;email&gt;     # transfers the app ownership

 domains:add &lt;domain&gt;         # add a custom domain name
 domains:remove &lt;domain&gt;      # remove a custom domain name
 domains:clear                # remove all custom domains

 ssl:add &lt;pem&gt; &lt;key&gt;          # add SSL cert to the app
 ssl:remove &lt;domain&gt;          # removes SSL cert from the app domain

 rake &lt;command&gt;               # remotely execute a rake command
 console &lt;command&gt;            # remotely execute a single console command
 console                      # start an interactive console to the remote app

 restart                      # restart app servers
 logs                         # fetch recent log output for debugging
 logs:cron                    # fetch cron log output

 maintenance:on               # put the app into maintenance mode
 maintenance:off              # take the app out of maintenance mode

 config                       # display the app's config vars (environment)
 config:add key=val [...]     # add one or more config vars
 config:remove key [...]      # remove one or more config vars
 config:clear                 # clear user-set vars and reset to default

 db:pull [&lt;database_url&gt;]     # pull the app's database into a local database
 db:push [&lt;database_url&gt;]     # push a local database into the app's remote
 database
 db:reset                     # reset the database for the app
<strong>-- Postgres databases ---</strong>
 pg:info                      # show db info
 pgbackups                    # list postgres backups
 pgbackups:url id             # get url to download backup
 pgbackups:capture            # capture a new backup
 pgbackups:destroy id         # destroy bakup

 bundles                      # list bundles for the app
 bundles:capture [&lt;bundle&gt;]   # capture a bundle of the app's code and data
 bundles:download             # download most recent app bundle as a tarball
 bundles:download &lt;bundle&gt;    # download the named bundle
 bundles:animate &lt;bundle&gt;     # animate a bundle into a new app
 bundles:destroy &lt;bundle&gt;     # destroy the named bundle

 addons                       # list addons
 addons:add name [key=value]  # install addon (with zero or more config vars)
 addons:remove name           # uninstall an addons
 addons:clear                 # uninstall all addons

 destroy                      # destroy the app permanently

<strong>=== Example:</strong>

 rails myapp
 cd myapp
 git init
 git add .
 git commit -m "my new app"
 heroku create
 git push heroku master</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/haxorslab.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/haxorslab.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/haxorslab.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/haxorslab.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/haxorslab.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/haxorslab.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/haxorslab.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/haxorslab.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/haxorslab.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/haxorslab.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/haxorslab.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/haxorslab.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/haxorslab.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/haxorslab.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodrigoramalho.org&amp;blog=22400385&amp;post=23&amp;subd=haxorslab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodrigoramalho.org/2011/07/08/cheat-sheets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5a8095b6b9b59ebe2001ddfccc86cbe7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodrigoramalhosilva</media:title>
		</media:content>
	</item>
		<item>
		<title>Introdução</title>
		<link>http://rodrigoramalho.org/2011/04/21/hello-world/</link>
		<comments>http://rodrigoramalho.org/2011/04/21/hello-world/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 17:57:32 +0000</pubDate>
		<dc:creator>Rodrigo Ramalho da Silva</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://haxorslab.wordpress.com/?p=1</guid>
		<description><![CDATA[Já faz um bom tempo que queria fazer um blog, mas sempre acabava adiando. Enquanto isso muitos posts preciosos foram perdidos. Importante é que enfim criei um aqui no wordpress e apontei pro DNS (rodrigoramalho.org) que tinha registrado há muito tempo e nem sabia mais da existência. Creio que não preciso me apresentar porque tem uma aba constante aqui no blog só falando de [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodrigoramalho.org&amp;blog=22400385&amp;post=1&amp;subd=haxorslab&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Já faz um bom tempo que queria fazer um blog, mas sempre acabava adiando. Enquanto isso muitos posts preciosos foram perdidos.</p>
<p>Importante é que enfim criei um aqui no <a title="WordPress" href="http://pt-br.wordpress.com/" target="_blank">wordpress </a>e apontei pro <a title="DNS" href="http://www.infowester.com/dns.php" target="_blank">DNS</a> (rodrigoramalho.org) que tinha registrado há muito tempo e nem sabia mais da existência.</p>
<p>Creio que não preciso me apresentar porque tem uma <a title="Sobre" href="http://rodrigoramalho.org/sobre">aba</a> constante aqui no blog só falando de mim.</p>
<p>Espero que me conheçam um pouco mais a cada post e que gostem do que será apresentado.</p>
<p>Abraço.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/haxorslab.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/haxorslab.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/haxorslab.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/haxorslab.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/haxorslab.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/haxorslab.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/haxorslab.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/haxorslab.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/haxorslab.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/haxorslab.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/haxorslab.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/haxorslab.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/haxorslab.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/haxorslab.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rodrigoramalho.org&amp;blog=22400385&amp;post=1&amp;subd=haxorslab&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rodrigoramalho.org/2011/04/21/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5a8095b6b9b59ebe2001ddfccc86cbe7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rodrigoramalhosilva</media:title>
		</media:content>
	</item>
	</channel>
</rss>
