<?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>Anton Babenko</title>
	<atom:link href="http://www.antonbabenko.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.antonbabenko.com</link>
	<description>Notes from happy web-developer</description>
	<lastBuildDate>Sat, 19 May 2012 09:24:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Splunk Enterprise on Amazon Linux</title>
		<link>http://www.antonbabenko.com/2012/05/19/splunk-enterprise-on-amazon-linux/</link>
		<comments>http://www.antonbabenko.com/2012/05/19/splunk-enterprise-on-amazon-linux/#comments</comments>
		<pubDate>Sat, 19 May 2012 09:10:07 +0000</pubDate>
		<dc:creator>Anton</dc:creator>
				<category><![CDATA[Web-development]]></category>

		<guid isPermaLink="false">http://www.antonbabenko.com/?p=71</guid>
		<description><![CDATA[Splunk is one of the best tool for log analysis with some flaws in Free edition (no user authentication and 500mb indexing limit per day). Most setups don&#8217;t need to have user authentication, because splunk can stay behind nginx proxy and have http basic auth there. Also for many sites the limit of 500mb/day is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.splunk.com/">Splunk</a> is one of the best tool for log analysis with some flaws in Free edition (no user authentication and 500mb indexing limit per day). Most setups don&#8217;t need to have user authentication, because splunk can stay behind nginx proxy and have http basic auth there. Also for many sites the limit of 500mb/day is fairy high limit. Though, one of my site has been indexing more than 500mb of logs per day several times per month and according to Splunk Free License it broke the terms of use (huh?), which means that I couldn&#8217;t even search on already indexed logs.</p>
<p>Splunk Enterprise Trial version works for 60 days and then you have to migrate to Free license (see above) or buy Enterprise license (it is very expensive if you want to have it on small sites like my <a href="http://imagepush.to/">imagepush.to</a>). The solution I found is to reinstall it every 2 months:</p>
<p><code><br />
# remove splunk, if you have it installed already<br />
sudo rpm -e splunk</p>
<p>mkdir ~/splunk_tmp<br />
cd ~/splunk_tmp</p>
<p># Splunk for Amazon Linux (32bit)<br />
curl -O http://216.221.226.44/releases/4.3.2/splunk/linux/splunk-4.3.2-123586.i386.rpm<br />
sudo rpm -U splunk-4.3.2-123586.i386.rpm<br />
sudo /opt/splunk/bin/splunk start<br />
</code></p>
<p>Then login to splunk web and set password. All settings will be in place already.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.antonbabenko.com/2012/05/19/splunk-enterprise-on-amazon-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use Zend_Feed in Symfony2 project</title>
		<link>http://www.antonbabenko.com/2012/03/24/how-to-use-zend_feed-in-symfony2-project/</link>
		<comments>http://www.antonbabenko.com/2012/03/24/how-to-use-zend_feed-in-symfony2-project/#comments</comments>
		<pubDate>Sat, 24 Mar 2012 15:13:13 +0000</pubDate>
		<dc:creator>Anton</dc:creator>
				<category><![CDATA[Web-development]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.antonbabenko.com/?p=67</guid>
		<description><![CDATA[There are several Symfony2 bundles to generate feeds (FeedBundle, for example). For imagepush.to I have to generate a variety of feeds and none of available bundles was good enough, so I want to use Zend_Feed. I didn&#8217;t want to clone bloated Zend Framework into my project, and luckily KnpLabs have made repos with all popular [...]]]></description>
			<content:encoded><![CDATA[<p>There are <a href="http://knpbundles.com/search?q=feed">several Symfony2 bundles to generate feeds</a> (<a href="https://github.com/Nek-/FeedBundle" title="FeedBundle">FeedBundle</a>, for example). For <a href="http://imagepush.to">imagepush.to</a> I have to generate a variety of feeds and none of available bundles was good enough, so I want to use Zend_Feed. I didn&#8217;t want to clone bloated Zend Framework into my project, and luckily KnpLabs have made repos with all popular Zend components already. Here is what I have in <strong>deps</strong>:</p>
<pre>
[zend-feed]
    git=http://github.com/KnpLabs/zend-feed.git
    target=Zend/Feed

[zend-loader]
    git=http://github.com/KnpLabs/zend-loader.git
    target=Zend/Loader

[zend-stdlib]
    git=http://github.com/KnpLabs/zend-stdlib.git
    target=Zend/Stdlib
</pre>
<p>and this is in <strong>autoload.php</strong>:</p>
<pre class="brush: php; title: ; notranslate">
$loader-&gt;registerNamespaces(array(
    // ...
    'Zend'            =&gt; __DIR__.'/../vendor'
    // ...
));
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.antonbabenko.com/2012/03/24/how-to-use-zend_feed-in-symfony2-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Elastica: reindexing on demand</title>
		<link>http://www.antonbabenko.com/2012/03/09/elastica-reindexing-on-demand/</link>
		<comments>http://www.antonbabenko.com/2012/03/09/elastica-reindexing-on-demand/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 18:02:46 +0000</pubDate>
		<dc:creator>Anton</dc:creator>
				<category><![CDATA[Web-development]]></category>
		<category><![CDATA[elastica]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.antonbabenko.com/?p=59</guid>
		<description><![CDATA[I used to make sure that Elastica is updating search index after record is created or updated, and there are listeners as specified in documentation. It works fine for basic needs out of the box, but I have some index fields, which were populated from another related objects, which I do lazy-fetch, so I ended [...]]]></description>
			<content:encoded><![CDATA[<p>I used to make sure that <a href="https://github.com/Exercise/FOQElasticaBundle" title="Elastica" target="_blank">Elastica</a> is updating search index after record is created or updated, and there are listeners as specified in <a href="https://github.com/Exercise/FOQElasticaBundle/blob/master/README.md" target="_blank">documentation</a>. It works fine for basic needs out of the box, but I have some index fields, which were populated from another related objects, which I do lazy-fetch, so I ended up with this code:</p>
<pre class="brush: php; title: ; notranslate">
// do something with $property
$em-&gt;persist($property);
$em-&gt;flush();
$em-&gt;clear();

// reload property from the database to get saved data with all related objects needed for index
$property = $em-&gt;find('MyBundle:Property', $property-&gt;getId());

// reindex
$type = $this-&gt;kernel-&gt;getContainer()-&gt;get('foq_elastica.index.website.property');
$modelTransformer = new \FOQ\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer();
$mapping = $type-&gt;getMapping();
$fields = array_keys($mapping[&quot;property&quot;][&quot;properties&quot;]);

$objectPersister = new \FOQ\ElasticaBundle\Persister\ObjectPersister($type, $modelTransformer, 'My\MyBundle\Entity\Property', $fields);
$objectPersister-&gt;replaceOne($property);
</pre>
<p>The trick here is to clear doctrine entity manager and then fetch object to replace one more time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.antonbabenko.com/2012/03/09/elastica-reindexing-on-demand/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy text search using Elastic Search</title>
		<link>http://www.antonbabenko.com/2012/01/25/easy-text-search-using-elastic-search/</link>
		<comments>http://www.antonbabenko.com/2012/01/25/easy-text-search-using-elastic-search/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 15:39:33 +0000</pubDate>
		<dc:creator>Anton</dc:creator>
				<category><![CDATA[Web-development]]></category>
		<category><![CDATA[elastica]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.antonbabenko.com/?p=43</guid>
		<description><![CDATA[Recently I used to add very plain text search to ne.no and since I&#8217;m using Elastic Search with ElasticaBundle it was easy to achieve. Added star-wildcard after all words, but not after numbers, so that user is able to find correct building address located on Drammensgt or Drammensvn if he searches for &#8220;Drammens 171&#8243;.]]></description>
			<content:encoded><![CDATA[<p>Recently I used to add very plain text search to <a href="http://ne.no/">ne.no</a> and since I&#8217;m using <a href="http://www.elasticsearch.org/" target="_blank">Elastic Search</a> with <a href="http://github.com/Exercise/FOQElasticaBundle" title="ElasticaBundle" target="_blank">ElasticaBundle</a> it was easy to achieve.</p>
<pre class="brush: php; title: ; notranslate">
$textQuery = new \Elastica_Query_QueryString();
$textQuery-&gt;setFields(array(&quot;address&quot;, &quot;name&quot;, &quot;city&quot;, &quot;searchPartNames&quot;, &quot;searchCompanyName&quot;));
$textQuery-&gt;setDefaultOperator(&quot;AND&quot;);
$textQuery-&gt;setQueryString($selectedText);

$tmpTexts = array();
foreach (explode(&quot; &quot;, $selectedText) as $oneWord) {
    $oneWord = trim($oneWord);
    if ($oneWord == &quot;&quot;)
        continue;
    if (preg_match(&quot;/^[0-9]+/&quot;, $oneWord)) {
        $tmpTexts[] = $oneWord;
    } else {
        $tmpTexts[] = $oneWord . &quot;*&quot;;
    }
}
$selectedText = implode(&quot; &quot;, $tmpTexts);
</pre>
<p>Added star-wildcard after all words, but not after numbers, so that user is able to find correct building address located on Drammensgt or Drammensvn if he searches for &#8220;Drammens 171&#8243;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.antonbabenko.com/2012/01/25/easy-text-search-using-elastic-search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lego</title>
		<link>http://www.antonbabenko.com/2012/01/23/lego/</link>
		<comments>http://www.antonbabenko.com/2012/01/23/lego/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 18:42:16 +0000</pubDate>
		<dc:creator>Anton</dc:creator>
				<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://www.antonbabenko.com/?p=35</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.inpic.ru/pic/8804-28c4617e.jpg"><br />
<img src='http://www.antonbabenko.com/wp-content/uploads/2012/01/8804-28c4617e.jpg' alt='' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.antonbabenko.com/2012/01/23/lego/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ne.no has been released</title>
		<link>http://www.antonbabenko.com/2012/01/15/ne-no-has-been-released/</link>
		<comments>http://www.antonbabenko.com/2012/01/15/ne-no-has-been-released/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 18:21:45 +0000</pubDate>
		<dc:creator>Anton</dc:creator>
				<category><![CDATA[Web-development]]></category>

		<guid isPermaLink="false">http://www.antonbabenko.com/?p=27</guid>
		<description><![CDATA[Ne.no is out and working well. It is my second project built using Symfony2 framework.]]></description>
			<content:encoded><![CDATA[<p><a href="http://ne.no/" target="_blank">Ne.no</a> is out and working well. It is my second project built using Symfony2 framework.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.antonbabenko.com/2012/01/15/ne-no-has-been-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>This blog v2</title>
		<link>http://www.antonbabenko.com/2012/01/15/this-blog-v2/</link>
		<comments>http://www.antonbabenko.com/2012/01/15/this-blog-v2/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 14:02:55 +0000</pubDate>
		<dc:creator>Anton</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.antonbabenko.com/?p=31</guid>
		<description><![CDATA[After several years of silence I decided to continue blogging about things I read, see or just want to mention.]]></description>
			<content:encoded><![CDATA[<p>After several years of silence I decided to continue blogging about things I read, see or just want to mention.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.antonbabenko.com/2012/01/15/this-blog-v2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

