<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Yevgeniy Viktorov's blog</title>
 <link href="http://yviktorov.github.com/atom.xml" rel="self"/>
 <link href="http://yviktorov.github.com/"/>
 <updated>2011-12-09T07:59:30-08:00</updated>
 <id>http://yviktorov.github.com/</id>
 <author>
   <name>Yevgeniy Viktorov</name>
   <email>wik@osmonitoring.com</email>
 </author>
 
 
   <entry>
     <title>Welcome to My Octopress Blog</title>
     <link href="http://yviktorov.github.com/other/2011/11/27/new-blog.html"/>
     <updated>2011-11-27T00:00:00-08:00</updated>
     <id>http://yviktorov.github.com/other/2011/11/27/new-blog</id>
     <content type="html">&lt;p&gt;Dear friends, some time ago I made a decision to switching my blogging toolkit, you can read more on the &lt;a href='http://yevgenko.me/'&gt;my new blog&lt;/a&gt;. And I&amp;#8217;ll keep this blog as is for historical purposes.&lt;/p&gt;

&lt;p&gt;Sorry for any inconvenience caused.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</content>
   </entry>
 
   <entry>
     <title>Bootstrap cloud instances with a Chef and Opscode</title>
     <link href="http://yviktorov.github.com/chef/2010/07/09/bootstrap-cloud-instances-with-chef.html"/>
     <updated>2010-07-09T00:00:00-07:00</updated>
     <id>http://yviktorov.github.com/chef/2010/07/09/bootstrap-cloud-instances-with-chef</id>
     <content type="html">&lt;p&gt;I was looking for cloud automation approaches and come up with some interesting pragmatic solution.&lt;/p&gt;

&lt;p&gt;If shortly, this is about provisioning &lt;a href='http://wiki.opscode.com/display/chef/Chef+Client'&gt;Chef Client&lt;/a&gt; ready server on &lt;a href='http://www.rackspacecloud.com/'&gt;Rackspace Cloud&lt;/a&gt; services with a single command. We also will be using &lt;a href='http://www.opscode.com/'&gt;Opscode&lt;/a&gt; instead of our own &lt;a href='http://wiki.opscode.com/display/chef/Chef+Server'&gt;Chef Server&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE(31 Aug 2010):&lt;/strong&gt; forgot to mention &lt;code&gt;server_url&lt;/code&gt; attribute which are important for future findings of chef server, i.e. &lt;a href='http://www.opscode.com/'&gt;Opscode&lt;/a&gt; server in our case. See &lt;strong&gt;Bootstrap Rackspace Cloud server with chef-client daemon&lt;/strong&gt; section.&lt;/p&gt;

&lt;h2 id='prerequirements'&gt;Pre-requirements&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href='http://www.rackspacecloud.com/'&gt;Rackspace Cloud&lt;/a&gt; account&lt;/li&gt;

&lt;li&gt;&lt;a href='http://www.opscode.com/'&gt;Opscode&lt;/a&gt; account&lt;/li&gt;

&lt;li&gt;Follow &lt;a href='http://help.opscode.com/faqs/start/how-to-get-started'&gt;Opscode quick start guide&lt;/a&gt; first&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id='sharpening_knife_for_the_cloud'&gt;Sharpening Knife for the cloud&lt;/h2&gt;

&lt;p&gt;I&amp;#8217;ll assume we continue with &lt;a href='http://help.opscode.com/faqs/start/how-to-get-started'&gt;Opscode quick start guide&lt;/a&gt; for simplicity.&lt;/p&gt;

&lt;p&gt;At this point you must have workstation with a basic &lt;a href='http://wiki.opscode.com/display/chef/Chef+Repository'&gt;Chef Repository&lt;/a&gt; and &lt;a href='http://wiki.opscode.com/display/chef/Chef+Client'&gt;Chef Client&lt;/a&gt; installed.&lt;/p&gt;

&lt;p&gt;So, let&amp;#8217;s tweak &lt;a href='http://wiki.opscode.com/display/chef/Knife' title='command-line utility used to interact with a Chef server directly through the RESTful API'&gt;Knife&lt;/a&gt; configuration to let it interact with a &lt;a href='http://www.rackspacecloud.com/'&gt;Rackspace Cloud&lt;/a&gt; API. Open &lt;code&gt;~/chef-repo/.chef/knife.rb&lt;/code&gt; and add the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;knife(
  :rackspace_api_key =&amp;gt; &amp;quot;Your Rackspace Cloud API key here&amp;quot;,
  :rackspace_api_username =&amp;gt; &amp;quot;Your Rackspace Cloud username here&amp;quot;
)&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Preparing necessary cookbooks(&lt;a href='http://github.com/opscode/cookbooks/tree/master/chef/'&gt;Chef Cookbook&lt;/a&gt; with dependencies) and pushing them to the &lt;a href='http://www.opscode.com/'&gt;Opscode&lt;/a&gt; server:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;knife cookbook site vendor chef --dependencies
rake upload_cookbooks&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Ok, Knife is sharp now, cookbook opened on the right page, let&amp;#8217;s bootstrap client ;)&lt;/p&gt;

&lt;h2 id='bootstrap_rackspace_cloud_server_with_chefclient_daemon'&gt;Bootstrap Rackspace Cloud server with chef-client daemon&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Yes, &lt;a href='http://wiki.opscode.com/display/chef/Chef+Client'&gt;Chef Client&lt;/a&gt; will be running as persistent daemon in order to &amp;#8220;talk&amp;#8221; to &lt;a href='http://www.opscode.com/'&gt;Opscode&lt;/a&gt; server periodically(about 30 minutes).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Create &lt;code&gt;~/chef-repo/roles/chef4test.rb&lt;/code&gt; file with the following, replacing &lt;strong&gt;ORGNAME&lt;/strong&gt; with your organization&amp;#8217;s simple string name:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;name &amp;quot;chef4test&amp;quot;
description &amp;quot;Bootstraping chef node&amp;quot;
run_list(&amp;quot;recipe[chef::bootstrap_client]&amp;quot;)
default_attributes &amp;quot;chef&amp;quot; =&amp;gt; { &amp;quot;server_url&amp;quot; =&amp;gt; &amp;quot;https://api.opscode.com/organizations/ORGNAME&amp;quot; }&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And throw the following commands:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd ~/chef-repo
rake roles
knife rackspace server create &amp;#39;role[chef4test]&amp;#39; --server-name chef4test --image 49 --flavor 2&lt;/code&gt;&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;image 49 it&amp;#8217;s Ubuntu 10.04 LTS (Lucid Lynx);&lt;/li&gt;

&lt;li&gt;flavor it&amp;#8217;s a server size, i.e. 512MB RAM with 20GB disk for $0.03 per hour in this case.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;And image 4 it&amp;#8217;s Debian 5.0 (Lenny) if you interested ;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now wait a little and check &lt;a href='http://manage.opscode.com/'&gt;Opscode Console&lt;/a&gt; when &lt;a href='http://wiki.opscode.com/display/chef/Knife' title='command-line utility used to interact with a Chef server directly through the RESTful API'&gt;Knife&lt;/a&gt; complete.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;However it&amp;#8217;s easy to discover the flavor id, I still did not found an easy way to discover image ID and using &lt;a href='http://github.com/geemus/fog'&gt;FOG&lt;/a&gt; library(which also required by rackspace server sub-commands of &lt;a href='http://wiki.opscode.com/display/chef/Knife' title='command-line utility used to interact with a Chef server directly through the RESTful API'&gt;Knife&lt;/a&gt; btw).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id='removing_servers'&gt;Removing servers&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;knife rackspace server delete &amp;lt;ID&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can discover server ID with a list command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;knife rackspace server list&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id='related_posts'&gt;Related posts&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href='http://blog.zefironetworks.com/?p=21'&gt;Getting dynamic on the cloud part #1&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href='http://ubuntumathiaz.wordpress.com/2010/03/25/using-puppet-in-uecec2-automating-the-signing-process/'&gt;Using puppet in UEC/EC2: Automating the signing process&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href='http://ubuntu-smoser.blogspot.com/2010/03/introducing-cloud-inits-cloud-config.html'&gt;Introducing cloud-init&amp;#8217;s cloud-config syntax&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href='http://www.turnkeylinux.org/blog/ec2-userdata'&gt;Automating EC2 instance setup with user-data scripts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
   </entry>
 
   <entry>
     <title>Distribute Magento extensions as a PEAR packages</title>
     <link href="http://yviktorov.github.com/magento/2010/05/08/distribute-extensions.html"/>
     <updated>2010-05-08T00:00:00-07:00</updated>
     <id>http://yviktorov.github.com/magento/2010/05/08/distribute-extensions</id>
     <content type="html">&lt;p&gt;Many users and developers do not know that Magento uses a &lt;a href='http://pear.php.net/'&gt;PEAR&lt;/a&gt;-repository for installation and management of its extensions. Some of you might now ask: What is &lt;a href='http://pear.php.net/'&gt;PEAR&lt;/a&gt;? &lt;a href='http://pear.php.net/'&gt;PEAR&lt;/a&gt; (PHP Extension and Application Repository) is - as the name indicates already - a repository for PHP-extensions and applications. &lt;a href='http://pear.php.net/'&gt;PEAR&lt;/a&gt; was set up in 2001 and is managed by the &lt;a href='http://pear.php.net/group/'&gt;PEAR group&lt;/a&gt;, which was founded for this purpose. This repository currently offers more than 550 so-called packages with software provided under the &lt;a href='http://www.php.net/license/'&gt;PHP-license&lt;/a&gt; for download. Most of them are components, thus software that is not able to run on its own, which can be integrated in another software application.&lt;/p&gt;

&lt;p&gt;Administration of the packages is done using a so-called &lt;a href='http://pear.php.net/manual/en/channels.whatarethey.php'&gt;PEAR channel&lt;/a&gt;, allowing the developer to download the package directly. Nevertheless, it is much more comfortable to install the packages using a local PEAR repository which is included in every current Linux-distribution and every Apple-computer.&lt;/p&gt;

&lt;p&gt;In this post I would like to cover some practices of distributing free and paid magento extensions though &lt;a href='http://pear.php.net/manual/en/channels.whatarethey.php'&gt;PEAR channel&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id='magento_connect'&gt;Magento Connect&lt;/h2&gt;

&lt;p&gt;&lt;a href='http://www.magentocommerce.com/magento-connect'&gt;Magento Connect&lt;/a&gt; it&amp;#8217;s not only the official marketplace for magento extensions, but also &lt;a href='http://pear.php.net/manual/en/channels.whatarethey.php'&gt;PEAR channel&lt;/a&gt; for distribution of core and community extensions which can be installed in the one of the following ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href='http://www.magentocommerce.com/wiki/groups/227/installing_magento_via_shell_ssh#use_pear_to_download_and_install_magento_connect_extension'&gt;PEAR command line&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href='http://www.magentocommerce.com/wiki/how-to/how_tu_use_magento_connect_manager_-_downloader'&gt;Magento Connect Manager&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both methods are compatible, the &lt;a href='http://www.magentocommerce.com/wiki/how-to/how_tu_use_magento_connect_manager_-_downloader'&gt;Magento Connect Manager&lt;/a&gt; it&amp;#8217;s a web interface to &lt;a href='http://www.magentocommerce.com/wiki/groups/227/installing_magento_via_shell_ssh#use_pear_to_download_and_install_magento_connect_extension'&gt;PEAR command line&lt;/a&gt;. You can also install extensions manually, but that&amp;#8217;s not effective and might lead to serious maintenance problems in future.&lt;/p&gt;

&lt;p&gt;If you developing Open Source extensions this is the best way to go, after you get familiar with &lt;a href='http://www.magentocommerce.com/wiki/packaging_a_magento_extension'&gt;packaging a magento extension&lt;/a&gt; continue with &amp;#8221;&lt;a href='http://www.magentocommerce.com/wiki/how_to_use_magentoconnect#creating_a_magento_community_extension'&gt;Creating a Magento Community extension&lt;/a&gt;&amp;#8221; :)&lt;/p&gt;

&lt;h2 id='simple_personal_pear_channel'&gt;Simple personal PEAR channel&lt;/h2&gt;

&lt;p&gt;There are three more or less known implementations we can use to establish own &lt;a href='http://pear.php.net/manual/en/channels.whatarethey.php'&gt;PEAR channel&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href='http://pear.php.net/manual/en/channels.scs.php'&gt;PEAR2_SimpleChannelServer&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href='http://greg.chiaraquartet.net/archives/123-Setting-up-your-own-PEAR-channel-with-Chiara_PEAR_Server-the-official-way.html'&gt;Chiara_PEAR_Server&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href='http://www.pirum-project.org/'&gt;Pirum&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every solution has it&amp;#8217;s advantages/disadvantages, you have to read more about it&amp;#8217;s features. Here I would like to describe one use case for setting up private(password protected) channel and in order to keep things simple and clean I&amp;#8217;ll be using Pirum, because: &lt;em&gt;Pirum consists of just one file, a command line tool, written in PHP. There is no external dependencies, no not need for a database, no need to setup credentials, and nothing need to be installed or configured.&lt;/em&gt;&lt;/p&gt;

&lt;h3 id='private_channel_using_subversion'&gt;Private channel using Subversion&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;A PEAR channel server managed by Pirum is simply a directory full of static XML files. As such, the server can be hosted on any shared host, without the need for PHP or any other web server technology installed.&lt;/em&gt; i.e. on any http/https accessible server and it&amp;#8217;s very popular setup when subversion served by webserver with the help of &lt;code&gt;WebDAV&lt;/code&gt; module.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;PEAR compatible channels can be password protected. Password protection is done via a HTTP Basic Authentication (.htaccess and .htpassword on Apache).&lt;/em&gt; i.e. this is how password protection works for subversion when it served by webserver.&lt;/p&gt;

&lt;p&gt;When I realize this I was felt lucky that in addition to multiple git repositories on per project basis the &lt;a href='http://www.codebasehq.com/' title='Git hosting, Mercurial hosting &amp;amp; Subversion hosting with complete project management'&gt;codebasehq&lt;/a&gt; allow to create subversion repositories the same way. So, in order to proceed you must have password protected subversion repository accessible though http/https protocol, but don&amp;#8217;t worry, I mentioned &lt;a href='http://www.codebasehq.com/' title='Git hosting, Mercurial hosting &amp;amp; Subversion hosting with complete project management'&gt;codebasehq&lt;/a&gt; because they also have Free Account you could use for this little experiment ;)&lt;/p&gt;

&lt;h4 id='intstall_the_pirum_and_create_your_channel'&gt;Intstall the Pirum and create your channel&lt;/h4&gt;

&lt;p&gt;As described at Pirum &lt;a href='http://www.pirum-project.org/'&gt;website&lt;/a&gt;, but with the following adjustments in the &lt;code&gt;pirum.xml&lt;/code&gt; file, prior to build command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;use &amp;#8220;tinycarts&amp;#8221; for alias (it&amp;#8217;s to simplify example, you can use your own alias after you get familiar with the concept)&lt;/li&gt;

&lt;li&gt;use &lt;code&gt;tinycarts.github.com&lt;/code&gt; for the name (for same as above reason)&lt;/li&gt;

&lt;li&gt;url must pointing to the repository, i.e. http://mysite.svn.codebasehq.com/foobar/pear/&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id='releasing_package'&gt;Releasing package&lt;/h4&gt;

&lt;p&gt;During channel creation step we used &amp;#8220;tinycarts&amp;#8221; as alias and name for our channel, this is to make it possible to use the following package in this experiment: &lt;a href='http://tinycarts.github.com//get/Lib_Tinycarts_Debug-1.0.0.tgz'&gt;Lib_Tinycarts_Debug&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Simply download and execute the following command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; php pirum add pear /path/to/saved/Lib_Tinycarts_Debug-1.0.0.tgz&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id='import_channel_into_repository'&gt;Import channel into repository&lt;/h4&gt;

&lt;pre&gt;&lt;code&gt; cd pear
 svn import . http://mysite.svn.codebasehq.com/foobar/pear&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt; if you also considered to go with &lt;a href='http://www.codebasehq.com/' title='Git hosting, Mercurial hosting &amp;amp; Subversion hosting with complete project management'&gt;codebasehq&lt;/a&gt; for this experiment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;mysite - the name of site you choose when sign up for account&lt;/li&gt;

&lt;li&gt;foobar - the project short name&lt;/li&gt;

&lt;li&gt;pear - subversion repository short name&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id='using_your_pear_channel_server'&gt;Using your PEAR Channel Server&lt;/h4&gt;

&lt;p&gt;Here is minor problem, you need to associate the login/password with a channel, but you can&amp;#8217;t discover the channel because it&amp;#8217;s already password protected :) So, you need to do some routine, i.e. discover the channel using the channel.xml file manually, execute the following command in magento directory:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;./pear channel-add /path/to/saved/channel.xml&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now the PEAR manager needs to know about the channel&amp;#8217;s username and password. We tell him by using set-config in connection with the channel option:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;./pear config-set -c tinycarts username johndoe
./pear config-set -c tinycarts password secret&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And finally install the &lt;code&gt;Lib_Tinycarts_Debug&lt;/code&gt; package:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;./pear install tinycarts/Lib_Tinycarts_Debug&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; if after you set the login/password you still can&amp;#8217;t access the package, try to clear the cache with the following command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;./pear clear-cache&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I found it simple and useful for ongoing developments for particular client.&lt;/p&gt;

&lt;h2 id='faettnet_tools'&gt;faett.net tools&lt;/h2&gt;

&lt;p&gt;As described in &lt;a href='http://www.prlog.org/10619989-magento-connect-20-comes-with-faettnet-it-new-media-software.html'&gt;press release&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Companies offering extensions for Magento can now distribute their products as PEAR packages in their shops. This is much easier than the somehow complicated solution using zip-files and ftp-upload. The components provided by faett.net allow&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is last minute found and I had not chance to try it myself, but it looks very promising, see the following posts for the more info:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href='http://www.faett.net/?___store=english'&gt;faett.net website&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href='http://www.faett.net/blog/cat/faett-manager-en/'&gt;Faett_Manager&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href='http://www.faett.net/blog/cat/faett-channel-en/'&gt;Faett_Channel&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This way seems ideal for distributing paid extensions and will lead in better connection with your customers. And even more simplify their life when they host magento at the servers with no SSH, like &lt;a href='http://www.rackspacecloud.com/cloud_hosting_products/sites'&gt;cloudsites&lt;/a&gt; by &lt;a href='http://www.rackspacecloud.com/'&gt;Rackspace Cloud&lt;/a&gt;.&lt;/p&gt;</content>
   </entry>
 
   <entry>
     <title>Using FirePHP with Magento</title>
     <link href="http://yviktorov.github.com/magento/2009/08/05/firephp.html"/>
     <updated>2009-08-05T00:00:00-07:00</updated>
     <id>http://yviktorov.github.com/magento/2009/08/05/firephp</id>
     <content type="html">&lt;p&gt;The good example of &lt;a href='http://www.firephp.org/' title='FirePHP - Firebug Extension for AJAX Development'&gt;FirePHP&lt;/a&gt; usage in Magento has been introduced by &lt;a href='http://activecodeline.com/' title='blog site of branko ajzele, senior developer / project manager'&gt;ActiveCodeline&lt;/a&gt; in his post &lt;a href='http://activecodeline.com/utilize-firebug-and-firephp-to-speed-up-magento-development/'&gt;Utilize FireBug (and FirePHP) to speed up Magento development&lt;/a&gt; early this year. Here I would like to show you another place you can utilize that function in :)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; the FirePHP wrapper class now available as a magento extension though &lt;a href='http://tinycarts.github.com/' title='Tinycarts PEAR channel'&gt;tinycarts channel&lt;/a&gt;, simply proceed with the following commands under the top directory of your magento instance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;./pear channel-discover tinycarts.github.com&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;./pear install tinycarts/Lib_Tinycarts_Debug&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And skip to &lt;strong&gt;usage&lt;/strong&gt; example.&lt;/p&gt;

&lt;h2 id='firephp_wrapper'&gt;FirePhp wrapper&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;Firephp.php&lt;/code&gt; file in &lt;code&gt;lib/Tinycarts/Debug&lt;/code&gt;, or checkout(or download) it from github &lt;a href='http://github.com/yviktorov/tinycarts_libs/tree/master' title='Additional collection of php classes for magento - ecommerce platform'&gt;TinycartsLibs&lt;/a&gt;.&lt;/p&gt;
&lt;script src='http://gist.github.com/369222.js'&gt;
&lt;/script&gt;
&lt;p&gt;The static &lt;code&gt;send()&lt;/code&gt; method it&amp;#8217;s exact copy of &lt;code&gt;acl()&lt;/code&gt; function introduced by &lt;a href='http://activecodeline.com/' title='blog site of branko ajzele, senior developer / project manager'&gt;ActiveCodeline&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id='usage'&gt;Usage&lt;/h2&gt;

&lt;p&gt;Go into one of your template files like &lt;code&gt;/catalog/product/view.phtml&lt;/code&gt; and call this function like:&lt;/p&gt;
&lt;script src='http://gist.github.com/369224.js'&gt;
&lt;/script&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; to let it send debug messages you have to uncomment &lt;code&gt;Mage::setIsDeveloperMode(true);&lt;/code&gt; in your index.php &lt;em&gt;in development environment ONLY!!!&lt;/em&gt;. Next time I&amp;#8217;ll tell you how to split environment and do not bother index.php at all ;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; sinse 1.4 release developer mode can be enabled by defining special environment variable &lt;code&gt;MAGE_IS_DEVELOPER_MODE&lt;/code&gt; at your development machine, see &lt;a href='http://www.magentocommerce.com/wiki/fix/configure_magento_error_page' title='Configure Magento error page'&gt;configure_magento_error_page&lt;/a&gt;.&lt;/p&gt;</content>
   </entry>
 
   <entry>
     <title>Using sfWidgetFormReCaptcha with ajax enabled forms</title>
     <link href="http://yviktorov.github.com/symfony/2009/05/30/recaptcha-ajax-forms.html"/>
     <updated>2009-05-30T00:00:00-07:00</updated>
     <id>http://yviktorov.github.com/symfony/2009/05/30/recaptcha-ajax-forms</id>
     <content type="html">&lt;p&gt;In this post I wold like to make a note about usage of &lt;a href='http://trac.symfony-project.org/browser/plugins/sfFormExtraPlugin/lib/widget/sfWidgetFormReCaptcha.class.php'&gt;sfWidgetFormReCaptcha&lt;/a&gt; with ajax enabled forms.&lt;/p&gt;

&lt;p&gt;The &lt;a href='http://trac.symfony-project.org/browser/plugins/sfFormExtraPlugin/lib/widget/sfWidgetFormReCaptcha.class.php'&gt;sfWidgetFormReCaptcha&lt;/a&gt; renders a &lt;a href='http://recaptcha.net/'&gt;ReCaptcha&lt;/a&gt; widget, i.e. let you protect your forms with visual code generated by &lt;a href='http://recaptcha.net/'&gt;ReCaptcha&lt;/a&gt;, but I assume you already familiar with this widget, &lt;a href='http://www.symfony-project.org/plugins/sfFormExtraPlugin'&gt;visit plugin page&lt;/a&gt; if not ;)&lt;/p&gt;

&lt;p&gt;Current implementation will not work out of box with ajax enabled forms, because, &lt;a href='http://trac.symfony-project.org/browser/plugins/sfFormExtraPlugin/lib/widget/sfWidgetFormReCaptcha.class.php'&gt;according implementation&lt;/a&gt;, ajax response will include link to external resource, e.g. &lt;code&gt;recaptcha_ajax.js&lt;/code&gt;, and browser will throw security issue.&lt;/p&gt;

&lt;h2 id='solution'&gt;Solution&lt;/h2&gt;

&lt;p&gt;Remove &lt;code&gt;recaptcha_ajax.js&lt;/code&gt; inclusion from widget and put into header of your page.&lt;/p&gt;

&lt;h3 id='step_1_create_sfwidgetformrecaptcha2'&gt;Step 1. Create sfWidgetFormReCaptcha2&lt;/h3&gt;

&lt;p&gt;We will be creating &lt;code&gt;sfWidgetFormReCaptcha2.class.php&lt;/code&gt; file which simply extends original &lt;code&gt;sfWidgetFormReCaptcha&lt;/code&gt; and overrides &lt;code&gt;render(...)&lt;/code&gt; method. You can put into &lt;code&gt;apps/frontend/lib/widget/&lt;/code&gt;.&lt;/p&gt;
&lt;script src='http://gist.github.com/369216.js'&gt;
&lt;/script&gt;
&lt;h3 id='step_2_modify_your_form_class'&gt;Step 2. Modify your form class&lt;/h3&gt;

&lt;p&gt;Modify your form class and add following, e.g. simply replace &lt;code&gt;sfWidgetFormReCaptcha&lt;/code&gt; to &lt;code&gt;sfWidgetFormReCaptcha2&lt;/code&gt;&lt;/p&gt;
&lt;script src='http://gist.github.com/369218.js'&gt;
&lt;/script&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; The usage of ReCaptcha widget and validator explained &lt;a href='http://www.symfony-project.org/blog/2008/10/18/spice-up-your-forms-with-some-nice-widgets-and-validators'&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h3 id='step_3_include_recaptcha_api'&gt;Step 3. Include ReCaptcha api&lt;/h3&gt;

&lt;p&gt;For example, put into your template ;)&lt;/p&gt;
&lt;script src='http://gist.github.com/369219.js'&gt;
&lt;/script&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Above template must be processed with regular(non ajax) response at least once, i.e. first time page requested!&lt;/p&gt;</content>
   </entry>
 
   <entry>
     <title>How to override email templates in Magento</title>
     <link href="http://yviktorov.github.com/magento/2009/05/23/override-email-templates.html"/>
     <updated>2009-05-23T00:00:00-07:00</updated>
     <id>http://yviktorov.github.com/magento/2009/05/23/override-email-templates</id>
     <content type="html">&lt;p&gt;In this post I would like to share the idea of overriding default email templates in a &lt;strong&gt;programmatic&lt;/strong&gt; way and on per design basis. So, you can copy email templates from &lt;code&gt;app/locale/en_US/template/email&lt;/code&gt; to &lt;code&gt;app/design/frontend/&amp;lt;yourInterface&amp;gt;/default/locale/en_US/template/email&lt;/code&gt; and modify them as you like.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; &lt;em&gt;I&amp;#8217;ll use naming from some real project, i.e. you most likely will need to change&lt;/em&gt; &lt;code&gt;TJU_&lt;/code&gt; &lt;em&gt;prefix and&lt;/em&gt; &lt;code&gt;tjuInterface&lt;/code&gt; &lt;em&gt;to the name of your design package.&lt;/em&gt; &lt;em&gt;This has been tested with magento 1.3.1 and might not work(or to be different) for others versions.&lt;/em&gt;&lt;/p&gt;

&lt;h2 id='step_1_override_translate_model'&gt;Step 1. Override Translate model&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Translate&lt;/strong&gt; model &amp;#8220;responsible&amp;#8221; for the path to email templates, see &lt;code&gt;getTemplateFile&lt;/code&gt; method in &lt;code&gt;app/code/core/Mage/Core/Model/Translate.php&lt;/code&gt;. We will be creating 3 files to extend it&amp;#8217;s default functionality:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;app/code/local/TJU/Core/Model/Translate.php&lt;/code&gt;;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;app/code/local/TJU/Core/etc/config.xml&lt;/code&gt;;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;app/etc/modules/TJU_All.xml&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1.1&lt;/strong&gt; Create Translate model class in &lt;code&gt;app/code/local/TJU/Core/Model/Translate.php&lt;/code&gt;.&lt;/p&gt;
&lt;script src='http://gist.github.com/369205.js'&gt;
&lt;/script&gt;
&lt;p&gt;&lt;strong&gt;1.2&lt;/strong&gt; Configure magento to use your class instead of default one. Create &lt;code&gt;app/code/local/TJU/Core/etc/config.xml&lt;/code&gt;.&lt;/p&gt;
&lt;script src='http://gist.github.com/369206.js'&gt;
&lt;/script&gt;
&lt;p&gt;&lt;strong&gt;1.3&lt;/strong&gt; Enable our module. Create &lt;code&gt;app/etc/modules/TJU_All.xml&lt;/code&gt;.&lt;/p&gt;
&lt;script src='http://gist.github.com/369208.js'&gt;
&lt;/script&gt;
&lt;p&gt;&lt;strong&gt;1.4&lt;/strong&gt; Clear cache, just &lt;code&gt;rm -rf var/*&lt;/code&gt; for now ;)&lt;/p&gt;

&lt;h2 id='step_2_modify_email_templates'&gt;Step 2. Modify email templates&lt;/h2&gt;

&lt;p&gt;Now copy email templates from &lt;code&gt;app/locale/en_US/template/email&lt;/code&gt; to &lt;code&gt;app/design/frontend/tjuInterface/default/locale/en_US/template/email&lt;/code&gt; and modify them as you like.&lt;/p&gt;

&lt;p&gt;I also found nice script which helps to override all dummy data at once, &lt;a href='http://www.bearsols.com/how-to-change-the-magento-email-templates-a103.html'&gt;take a look&lt;/a&gt;, pls. For some reason it did not work out of box for me, with magento 1.3.1, so I made some adjustments, see below.&lt;/p&gt;

&lt;p&gt;Create &lt;code&gt;email.sh&lt;/code&gt; file and make it executable.&lt;/p&gt;
&lt;script src='http://gist.github.com/369209.js'&gt;
&lt;/script&gt;
&lt;p&gt;Thanks.&lt;/p&gt;

&lt;h2 id='references'&gt;References&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href='http://www.magentocommerce.com/wiki/how-to/customize_part_of_configuration#models'&gt;Customize Models&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
   </entry>
 
   <entry>
     <title>Lorem Ipsum</title>
     <link href="http://yviktorov.github.com/other/2009/05/22/lorem-ipsum.html"/>
     <updated>2009-05-22T00:00:00-07:00</updated>
     <id>http://yviktorov.github.com/other/2009/05/22/lorem-ipsum</id>
     <content type="html">&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.&lt;/p&gt;

&lt;p&gt;Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.&lt;/p&gt;</content>
   </entry>
 
 
</feed>
