<?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>unexpected[it]</title>
	<atom:link href="http://www.unexpectedit.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.unexpectedit.com</link>
	<description>Professional IT Blog</description>
	<lastBuildDate>Tue, 31 Jan 2012 21:55:19 +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>Improving Spam Score on Ubuntu/Zend</title>
		<link>http://www.unexpectedit.com/webserver/improving-spam-score-on-ubuntu-zend</link>
		<comments>http://www.unexpectedit.com/webserver/improving-spam-score-on-ubuntu-zend#comments</comments>
		<pubDate>Sat, 28 Jan 2012 20:52:14 +0000</pubDate>
		<dc:creator>ipascual</dc:creator>
				<category><![CDATA[Webserver]]></category>

		<guid isPermaLink="false">http://www.unexpectedit.com/?p=696</guid>
		<description><![CDATA[Domain: unexpectedit.com Static IP (or Elastic Amazon IP): 107.123.23.123 Setting up Postfix Setting up rDNS on Amazon Go to https://aws-portal.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request Elastic IP Address 1: 107.123.23.123 Reverse DNS Record for EIP 1: mail1.unexpectedit.com Setting up SPF Records Add to your domain TXT pointing to @ v=spf1 a ip4:107.123.23.123 include:aspmx.googlemail.com ~all &#8230;where 107.123.23.123 is your Apache/PHP server [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Domain: </strong>unexpectedit.com<br />
<strong>Static IP (or Elastic Amazon IP): </strong>107.123.23.123</p>
<h2>Setting up Postfix</h2>
<pre class="brush: bash; title: ; notranslate">
dpkg-reconfigure postfix
# Internet Site
# unexpectedit.com
</pre>
<h2>Setting up rDNS on Amazon</h2>
<p>Go to https://aws-portal.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request<br />
Elastic IP Address 1: 107.123.23.123<br />
Reverse DNS Record for EIP 1: mail1.unexpectedit.com</p>
<h2>Setting up SPF Records</h2>
<p>Add to your domain TXT pointing to @<br />
<strong>v=spf1 a ip4:107.123.23.123 include:aspmx.googlemail.com ~all </strong><br />
&#8230;where 107.123.23.123 is your Apache/PHP server IP and we relay the mailboxes to Google Apps.</p>
<h2>Check headers when I receive email</h2>
<p>On a Brinkster (www.brinkster.com) mailbox</p>
<pre>
Return-Path: www-data@unexpectedit.com
X-DSPAM-Result: Innocent
X-DSPAM-Class: Innocent
X-DSPAM-Confidence: 0.79
X-DSPAM-Probability: 0.0000
X-DSPAM-Signature: N/A
X-Virus-Scanned: amavisd-new at mta2.brinkster.com
X-Spam-Flag: NO
<strong>X-Spam-Score: 2.399</strong>
X-Spam-Level: **
X-Spam-Status: No, score=2.399 tagged_above=-10 required=5
	tests=[BAYES_50=0.001, FH_HELO_EQ_D_D_D_D=0.001,
	HTML_IMAGE_ONLY_20=1.546, HTML_MESSAGE=0.001,
	HTML_SHORT_LINK_IMG_3=0.001, MPART_ALT_DIFF=0.739,
	MPART_ALT_DIFF_COUNT=1.11, DSPAM:Innocent=-1.000] autolearn=no
Received: from mta2.brinkster.com ([127.0.0.1])
	by localhost (mta2.brinkster.com [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id YwUJP968VFhq for <other.user@unexpectedit.com>;
	Thu, 26 Jan 2012 05:40:02 -0500 (EST)
Received: from ip-10-190-222-218.ec2.internal (mail1.snappygo.com [107.123.23.123])
	by mta2.brinkster.com (Postfix) with ESMTP id 360B31285D4
	for <other.user@unexpectedit.com>; Thu, 26 Jan 2012 05:40:02 -0500 (EST)
Received: by ip-10-190-222-218.ec2.internal (Postfix, from userid 33)
	id 93D7C43AB5; Thu, 26 Jan 2012 10:39:20 +0000 (UTC)
</pre>
<p>On a Google mailbox </p>
<pre>
Received-SPF: pass (google.com: domain of www-data@unexpectedit.com designates 107.123.23.123 as permitted sender) client-ip=107.123.23.123;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of www-data@unexpectedit.com designates 107.123.23.123 as permitted sender) smtp.mail=www-data@unexpectedit.com
</pre>
<h2>Improve postfix settings</h2>
<p><strong>vi /etc/postfix/main.cf</strong></p>
<pre class="brush: bash; title: ; notranslate">
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate &quot;delayed mail&quot; warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

myhostname = unexpectedit.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = unexpectedit.com, localhost.ec2.internal, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
</pre>
<p><strong>vi /etc/mailname </strong></p>
<pre class="brush: bash; title: ; notranslate">
mail1.unexpectedit.com
</pre>
<h2>Change the Return-Path header of email to an existing account</h2>
<pre class="brush: php; title: ; notranslate">
//Setting Return-Path header
$tr = new Zend_Mail_Transport_Sendmail('-finfo@unexpectedit.com');
Zend_Mail::setDefaultTransport($tr);

//Create Mail on Zend_Mail
$mail = new Zend_Mail();
$mail-&gt;setFrom(&quot;info@unexpectedit.com&quot;, &quot;Unexpected It&quot;);
$mail-&gt;addTo(&quot;other.user@unexpectedit.com&quot;);
$mail-&gt;setSubject($subject);
$mail-&gt;setBodyText($text);
$mail-&gt;setBodyHtml($html);
$mail-&gt;send();
</pre>
<h2>Check headers now</h2>
<pre>
Return-Path: info@unexpectedit.com
X-DSPAM-Result: Innocent
X-DSPAM-Class: Innocent
X-DSPAM-Confidence: 0.69
X-DSPAM-Probability: 0.0000
X-DSPAM-Signature: N/A
X-Virus-Scanned: amavisd-new at mta9.brinkster.com
X-Spam-Flag: NO
<strong>X-Spam-Score: -1.822</strong>
X-Spam-Level:
X-Spam-Status: No, score=-1.822 tagged_above=-10 required=5
	tests=[BAYES_00=-2.599, HTML_IMAGE_ONLY_32=1.778, HTML_MESSAGE=0.001,
	SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, DSPAM:Innocent=-1.000]
	autolearn=no
Received: from mta9.brinkster.com ([127.0.0.1])
	by localhost (mta9.brinkster.com [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id g7xih7MpqhwG for <other-user@unexpectedit.com>;
	Sat, 28 Jan 2012 15:06:09 -0500 (EST)
Received: from unexpectedit.com (mail1.unexpectedit.com [107.123.23.123])
	by mta9.brinkster.com (Postfix) with ESMTP id 0478E49329B
	for <other.user@unexpectedit.com>; Sat, 28 Jan 2012 15:06:06 -0500 (EST)
Received: by snappygo.com (Postfix, from userid 33)
	id B516D441A8; Sat, 28 Jan 2012 20:05:32 +0000 (UTC)
</pre>
<div id="wpcr_respond_1"></div>]]></content:encoded>
			<wfw:commentRss>http://www.unexpectedit.com/webserver/improving-spam-score-on-ubuntu-zend/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google recruiting notes</title>
		<link>http://www.unexpectedit.com/misc/google-recruiting-notes</link>
		<comments>http://www.unexpectedit.com/misc/google-recruiting-notes#comments</comments>
		<pubDate>Tue, 17 Jan 2012 23:05:29 +0000</pubDate>
		<dc:creator>ipascual</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.unexpectedit.com/?p=690</guid>
		<description><![CDATA[800 exabytes of digital information in the world, videos, photos, music, texts, etc&#8230; the future? mobile applications, global access for everyone. Velorizonte efficiency = worker healthy Googleplex, Mountain View, USA = Headquarters Googleplex = 10 exp Google SEW (Software Engineer) SET (Software Engineer in TEST) SRE (Site Reliability Engineer) &#8211; Administer live production systems Recruiting [...]]]></description>
			<content:encoded><![CDATA[<p>800 exabytes of digital information in the world, videos, photos, music, texts, etc&#8230;<br />
the future? mobile applications, global access for everyone.</p>
<p>Velorizonte</p>
<p>efficiency = worker healthy</p>
<p>Googleplex, Mountain View, USA = Headquarters</p>
<p>Googleplex = 10 exp Google</p>
<p>SEW (Software Engineer)<br />
SET (Software Engineer in TEST)<br />
SRE (Site Reliability Engineer) &#8211; Administer live production systems</p>
<p>Recruiting process<br />
1) google-latam@google.com<br />
2) Two VERY technical phone interviews<br />
3) On-site interviews&#8230;<br />
4) Hiring Committe</p>
<p>Code Jam / http://code.google.com/codejam/</p>
<p>Testing Blog / If it ain&#8217;t broke, you&#8217;re not trying hard enough</p>
<p>OPENCOURSEWARE: Temática de cursos, metodología de enseñanza&#8230;<br />
Google Code</p>
<p>#google</p>
<div id="wpcr_respond_1"></div>]]></content:encoded>
			<wfw:commentRss>http://www.unexpectedit.com/misc/google-recruiting-notes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a new layout to Magento, using at CMS design tab</title>
		<link>http://www.unexpectedit.com/magento/howto/create-a-new-layout-to-magento-using-at-cms-design-tab</link>
		<comments>http://www.unexpectedit.com/magento/howto/create-a-new-layout-to-magento-using-at-cms-design-tab#comments</comments>
		<pubDate>Thu, 29 Sep 2011 18:28:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://www.unexpectedit.com/?p=671</guid>
		<description><![CDATA[Just edit your /app/etc/local.xml as follows]]></description>
			<content:encoded><![CDATA[<h2>Just edit your <strong>/app/etc/local.xml</strong> as follows </h2>
<pre class="brush: xml; highlight: [66,67,68,69]; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;!--
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   Mage
 * @package    Mage_Core
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
--&gt;
&lt;config&gt;
    &lt;global&gt;
        &lt;install&gt;
            &lt;date&gt;&lt;![CDATA[Fri, 23 Sep 2011 21:21:44 +0000]]&gt;&lt;/date&gt;
        &lt;/install&gt;
        &lt;crypt&gt;
            &lt;key&gt;&lt;![CDATA[ba07d498e63a98eb6e31be0720000000]]&gt;&lt;/key&gt;
        &lt;/crypt&gt;
        &lt;disable_local_modules&gt;false&lt;/disable_local_modules&gt;
        &lt;resources&gt;
            &lt;db&gt;
                &lt;table_prefix&gt;&lt;![CDATA[]]&gt;&lt;/table_prefix&gt;
            &lt;/db&gt;
            &lt;default_setup&gt;
                &lt;connection&gt;
                    &lt;host&gt;&lt;![CDATA[localhost]]&gt;&lt;/host&gt;
                    &lt;username&gt;&lt;![CDATA[root]]&gt;&lt;/username&gt;
                    &lt;password&gt;&lt;![CDATA[root]]&gt;&lt;/password&gt;
                    &lt;dbname&gt;&lt;![CDATA[magento]]&gt;&lt;/dbname&gt;
                    &lt;initStatements&gt;&lt;![CDATA[SET NAMES utf8]]&gt;&lt;/initStatements&gt;
                    &lt;model&gt;&lt;![CDATA[mysql4]]&gt;&lt;/model&gt;
                    &lt;type&gt;&lt;![CDATA[pdo_mysql]]&gt;&lt;/type&gt;
                    &lt;pdoType&gt;&lt;![CDATA[]]&gt;&lt;/pdoType&gt;
                    &lt;active&gt;1&lt;/active&gt;
                &lt;/connection&gt;
            &lt;/default_setup&gt;
        &lt;/resources&gt;
        &lt;session_save&gt;&lt;![CDATA[files]]&gt;&lt;/session_save&gt;
		&lt;cms&gt;
            &lt;layouts&gt;
                &lt;empty&gt;
                    &lt;label&gt;Empty&lt;/label&gt;
                    &lt;template&gt;page/one-column.phtml&lt;/template&gt;
                &lt;/empty&gt;
                &lt;one_column&gt;
                    &lt;label&gt;1 column&lt;/label&gt;
                    &lt;template&gt;page/1column.phtml&lt;/template&gt;
                &lt;/one_column&gt;
                &lt;one_column_home&gt;
                    &lt;label&gt;1 column home&lt;/label&gt;
                    &lt;template&gt;page/1column-home.phtml&lt;/template&gt;
                &lt;/one_column_home&gt;
                &lt;two_columns_left&gt;
                    &lt;label&gt;2 columns with left bar&lt;/label&gt;
                    &lt;template&gt;page/2columns-left.phtml&lt;/template&gt;
                &lt;/two_columns_left&gt;
                &lt;two_columns_right&gt;
                    &lt;label&gt;2 columns with right bar&lt;/label&gt;
                    &lt;template&gt;page/2columns-right.phtml&lt;/template&gt;
                &lt;/two_columns_right&gt;
                &lt;three_columns&gt;
                    &lt;label&gt;3 columns&lt;/label&gt;
                    &lt;template&gt;page/3columns.phtml&lt;/template&gt;
                &lt;/three_columns&gt;
            &lt;/layouts&gt;
        &lt;/cms&gt;
    &lt;/global&gt;
    &lt;admin&gt;
        &lt;routers&gt;
            &lt;adminhtml&gt;
                &lt;args&gt;
                    &lt;frontName&gt;&lt;![CDATA[admin]]&gt;&lt;/frontName&gt;
                &lt;/args&gt;
            &lt;/adminhtml&gt;
        &lt;/routers&gt;
    &lt;/admin&gt;
&lt;/config&gt;
</pre>
<div id="wpcr_respond_1"></div>]]></content:encoded>
			<wfw:commentRss>http://www.unexpectedit.com/magento/howto/create-a-new-layout-to-magento-using-at-cms-design-tab/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento, how to create new frontend type attribute for category</title>
		<link>http://www.unexpectedit.com/magento/howto/magento-how-to-create-new-frontend-type-attribute-for-category</link>
		<comments>http://www.unexpectedit.com/magento/howto/magento-how-to-create-new-frontend-type-attribute-for-category#comments</comments>
		<pubDate>Wed, 07 Sep 2011 23:58:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://www.unexpectedit.com/?p=663</guid>
		<description><![CDATA[In this How To, I&#8217;m going to explain how to create a new category attribute to handle PDF files. a) Create a new category attribute a1) Check your entity types catalog_category is ID 9 a2) Insert attribute. Table: eav_attribute note the new row ID is 950 a3) Define attribute set and group. Make the relation [...]]]></description>
			<content:encoded><![CDATA[<p><strong>In this How To, I&#8217;m going to explain how to create a new category attribute to handle PDF files.</strong><br />
<img src="http://www.unexpectedit.com/wp-content/uploads/2011/09/Screen-shot-2011-09-07-at-18.57.22.png" alt="Magento category with new PDF attribute" title="Magento category PDF attribute" width="784" height="580" class="alignnone size-full wp-image-664" /></p>
<h2>a) Create a new category attribute</h2>
<p><strong>a1) Check your entity types</strong></p>
<pre class="brush: sql; title: ; notranslate">
SELECT * FROM `eav_entity_type`
</pre>
<p>catalog_category is ID 9</p>
<p><strong>a2) Insert attribute. Table: eav_attribute</strong></p>
<pre class="brush: bash; title: ; notranslate">
entity_type_id = 9
attribute_code = category_pdf
attribute_model = NULL
backend_model = catalog/category_attribute_backend_file
backend_type = varchar
backend_table =
frontend_model =
frontend_input = file
frontend_label = Category PDF
frontend_class =
source_model =
is_required = 0
is_user_defined = 0
default_value =
is_unique = 0
note =
</pre>
<p>note the new row ID is 950</p>
<p><strong>a3) Define attribute set and group. Make the relation between attribute and entity. Table: eav_entity_attribute</strong></p>
<pre class="brush: bash; title: ; notranslate">
entity_type_id = 9 (Category)
attribute_set_id = 12 (&quot;Default&quot;, attribute set - eav_attribute_set)
attribute_group_id = 7 (&quot;General Information&quot;, first tab - eav_attribute_group)
attribute_id = 950 (&quot;category_pdf&quot;, link with attribute)
sort_order = 0 (order position)
</pre>
<p><strong>a4) Define attribute properties. Table: catalog_eav_attribute</strong></p>
<pre class="brush: bash; title: ; notranslate">
frontend_input_renderer =
is_global = 1
is_visible = 1
is_searchable = 0
is_filterable = 0
is_comparable = 0
is_visible_on_front = 0
is_html_allowed_on_front = 0
is_used_for_price_rules = 1
is_filterable_in_search = 0
used_in_product_listing = 0
used_for_sort_by = 0
is_configurable = 1
apply_to
is_visible_in_advanced_search = 0
position = 0 (order position)
is_wysiwyg_enabled = 0
is_used_for_promo_rules = 1
</pre>
<p><strong>a5) Remember to reindex Category Flat Data</strong></p>
<h2>b) Create a new frontend attribute type.</h2>
<p><strong>We will call it File to handle PDF files.</strong></p>
<p><strong>b1) Create the file /app/code/local/Mage/Catalog/Model/Category/Attribute/Backend/File.php</strong></p>
<pre class="brush: php; title: ; notranslate">

&lt;?php
/**
 * Catalog category file attribute backend model
 *
 */
class Mage_Catalog_Model_Category_Attribute_Backend_File extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract
{

    /**
     * Save uploaded file and set its name to category
     *
     * @param Varien_Object $object
     */
    public function afterSave($object)
    {
        $value = $object-&gt;getData($this-&gt;getAttribute()-&gt;getName());

        if (is_array($value) &amp;&amp; !empty($value['delete'])) {
            $object-&gt;setData($this-&gt;getAttribute()-&gt;getName(), '');
            $this-&gt;getAttribute()-&gt;getEntity()
                -&gt;saveAttribute($object, $this-&gt;getAttribute()-&gt;getName());
            return;
        }

        $path = Mage::getBaseDir('media') . DS . 'files' . DS;

        try {
            $uploader = new Mage_Core_Model_File_Uploader($this-&gt;getAttribute()-&gt;getName());
            $uploader-&gt;setAllowedExtensions(array('pdf'));
            $uploader-&gt;setAllowRenameFiles(true);
            $result = $uploader-&gt;save($path);

            $object-&gt;setData($this-&gt;getAttribute()-&gt;getName(), $result['file']);
            $this-&gt;getAttribute()-&gt;getEntity()-&gt;saveAttribute($object, $this-&gt;getAttribute()-&gt;getName());
        } catch (Exception $e) {
            if ($e-&gt;getCode() != Mage_Core_Model_File_Uploader::TMP_NAME_EMPTY) {
                Mage::logException($e);
            }
            /** @TODO ??? */
            return;
        }
    }
}
</pre>
<p><strong>b2) Create the file /app/code/local/Varien/Data/Form/Element/File.php</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
/**
 * Category form input file element
 *
 */
class Varien_Data_Form_Element_File extends Varien_Data_Form_Element_Abstract
{

    /**
     * Enter description here...
     *
     * @param array $data
     */
    public function __construct($data)
    {
        parent::__construct($data);
        $this-&gt;setType('file');
    }

    /**
     * Enter description here...
     *
     * @return string
     */
    public function getElementHtml()
    {
        $html = '';

        if ($this-&gt;getValue()) {
            $url = $this-&gt;_getUrl();

            if( !preg_match(&quot;/^http\:\/\/|https\:\/\//&quot;, $url) ) {
                $url = Mage::getBaseUrl('media') . 'files' . DS . $url;
            }

            $html = '&lt;a href=&quot;'.$url.'&quot; target=&quot;_blank&quot;&gt;';
            $html.= 'View file';
            $html.='&lt;/a&gt; ';
        }
        $this-&gt;setClass('input-file');
        $html.= parent::getElementHtml();
        $html.= $this-&gt;_getDeleteCheckbox();

        return $html;
    }

    /**
     * Enter description here...
     *
     * @return string
     */
    protected function _getDeleteCheckbox()
    {
        $html = '';
        if ($this-&gt;getValue()) {
            $label = Mage::helper('core')-&gt;__('Delete File');
            $html .= '&lt;span class=&quot;delete-image&quot;&gt;';
            $html .= '&lt;input type=&quot;checkbox&quot; name=&quot;'.parent::getName().'[delete]&quot; value=&quot;1&quot; class=&quot;checkbox&quot; id=&quot;'.$this-&gt;getHtmlId().'_delete&quot;'.($this-&gt;getDisabled() ? ' disabled=&quot;disabled&quot;': '').'/&gt;';
            $html .= '&lt;label for=&quot;'.$this-&gt;getHtmlId().'_delete&quot;'.($this-&gt;getDisabled() ? ' class=&quot;disabled&quot;' : '').'&gt; '.$label.'&lt;/label&gt;';
            $html .= $this-&gt;_getHiddenInput();
            $html .= '&lt;/span&gt;';
        }

        return $html;
    }

    /**
     * Enter description here...
     *
     * @return string
     */
    protected function _getHiddenInput()
    {
        return '&lt;input type=&quot;hidden&quot; name=&quot;'.parent::getName().'[value]&quot; value=&quot;'.$this-&gt;getValue().'&quot; /&gt;';
    }

    /**
     * Get image preview url
     *
     * @return string
     */
    protected function _getUrl()
    {
        return $this-&gt;getValue();
    }

    /**
     * Enter description here...
     *
     * @return string
     */
    public function getName()
    {
        return  $this-&gt;getData('name');
    }

}
</pre>
<div class="note" style="text-align:left">
<div>Tested on Magento 1.5.1.0</div>
</div>
<div id="wpcr_respond_1"></div>]]></content:encoded>
			<wfw:commentRss>http://www.unexpectedit.com/magento/howto/magento-how-to-create-new-frontend-type-attribute-for-category/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mac os X &#8211; Daemon services</title>
		<link>http://www.unexpectedit.com/mac/mac-os-x-daemon-services</link>
		<comments>http://www.unexpectedit.com/mac/mac-os-x-daemon-services#comments</comments>
		<pubDate>Mon, 01 Aug 2011 17:11:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://www.unexpectedit.com/?p=656</guid>
		<description><![CDATA[From console Useful GUI for launchctl Lingon http://sourceforge.net/projects/lingon/ Some identify daemons net.culater.SIMBL.Agent is a daemon required for LastPass Safari plugin]]></description>
			<content:encoded><![CDATA[<h2>From console</h2>
<pre class="brush: bash; title: ; notranslate">
# List daemons
launchctl list

# Remove daemon from memory
launchctl remove ...anonymous.com.avast.MacAvast
</pre>
<h2>Useful GUI for launchctl</h2>
<p>Lingon <a href="http://sourceforge.net/projects/lingon/">http://sourceforge.net/projects/lingon/</a></p>
<p><a href="http://www.unexpectedit.com/wp-content/uploads/2011/08/Screen-shot-2011-08-01-at-12.09.45.png"><img class="size-medium wp-image-657 alignnone" title="Lingon screenshow" src="http://www.unexpectedit.com/wp-content/uploads/2011/08/Screen-shot-2011-08-01-at-12.09.45-300x203.png" alt="Lingon screenshow on Mac" width="300" height="203" /></a></p>
<h2>Some identify daemons</h2>
<p>net.culater.SIMBL.Agent is a daemon required for LastPass Safari plugin</p>
<div id="wpcr_respond_1"></div>]]></content:encoded>
			<wfw:commentRss>http://www.unexpectedit.com/mac/mac-os-x-daemon-services/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrade WordPress 2.x to 3.x with Flutter migration to Magic Fields</title>
		<link>http://www.unexpectedit.com/wordpress/upgrade-wordpress-2-x-to-3-x-with-flutter-migration-to-magic-fields</link>
		<comments>http://www.unexpectedit.com/wordpress/upgrade-wordpress-2-x-to-3-x-with-flutter-migration-to-magic-fields#comments</comments>
		<pubDate>Fri, 29 Jul 2011 14:29:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[flutter]]></category>
		<category><![CDATA[flutter migration]]></category>
		<category><![CDATA[magic fields]]></category>
		<category><![CDATA[update flutter]]></category>
		<category><![CDATA[wordpress 3.x]]></category>

		<guid isPermaLink="false">http://www.unexpectedit.com/?p=654</guid>
		<description><![CDATA[Such a hard work was this migration / update of a company due to an old version of WordPress 2.5 using Flutter. This is the case: Wordpress 2.5 (OLD) - Flutter Migration to: Wordpress 3.2.1 (NEW) - Magic Fields My successful process as follows OLD &#8211; WordPress 2.5 all posts / categories / users (current [...]]]></description>
			<content:encoded><![CDATA[<p>Such a hard work was this migration / update of a company due to an old version of WordPress 2.5 using Flutter.</p>
<p>This is the case:<br />
Wordpress 2.5 (OLD)<br />
- Flutter</p>
<p>Migration to:<br />
Wordpress 3.2.1 (NEW)<br />
- Magic Fields</p>
<h2>My successful process as follows</h2>
<p>OLD &#8211; WordPress 2.5 all posts / categories / users (current server)<br />
NEW &#8211; WordPress 3.x clean instalation (in a new server or localhost)</p>
<p><strong>1) Create a fresh WordPress 3.x (NEW) with the newest version and all plugins like in (OLD)</strong></p>
<p><strong>2) Copy all settings and users manually of admin from OLD to NEW </strong></p>
<p><strong>3) Migrate from Flutter to Magic Fields (OLD)</strong><br />
Before upgrading WP 3.x<br />
a) Deactivate flutter plugin<br />
b) Execute the script to migrate tables <a href="http://gist.github.com/558207" target="_blank" >http://gist.github.com/558207</a><br />
c) Rename the name of wp-content/files_flutter to wp-content/files_mf<br />
d) Install plugin Magic Fields<br />
e) Activate it</p>
<p><strong>4) Upgrade WordPress to 3.x and all plugins (OLD)</strong></p>
<p><strong>5) Copy from OLD all files and overwrite NEW</strong></p>
<p><strong>6) Import these tables from server to localhost database</strong><br />
** Do a full replace of your_old_server.com to your_new_server.com **<br />
wp_commentmeta<br />
wp_comments<br />
wp_links<br />
wp_mf* (all wp_mf wordpress_magic fields tables)<br />
wp_postmeta<br />
wp_posts<br />
wpmt_terms<br />
wpmt_term_relationships<br />
wpmt_term_taxonomy</p>
<p><strong>7) You will notice we don&#8217;t move wp_options, wp_users&#8230; these tables you have to open two browser windows and config all from server to localhost manually.</strong><br />
wp_options especially is the most complicate part and it is like Microsoft Windows. It&#8217;s better format with a fresh version than upgrade it.<br />
Why? After several tries this way is much better, if not you will get errors like:<br />
>>> You do not have sufficient permissions to access this page.</p>
<p>That&#8217;s it!</p>
<h2> What can I do next? </h2>
<p>1) See if the website works fine<br />
2) Check the Settings > Reading has the default home page set.<br />
3) Check your Settings > Permanent Links<br />
4) The last one but the most important, <strong>you could have some issues with old plugins used on your theme.</strong> Check the code, upgrade your plugin or rewrite the old code with new WP3.x features. Happy coding!</p>
<div id="wpcr_respond_1"></div>]]></content:encoded>
			<wfw:commentRss>http://www.unexpectedit.com/wordpress/upgrade-wordpress-2-x-to-3-x-with-flutter-migration-to-magic-fields/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SUID to Linux bash or sh scripts</title>
		<link>http://www.unexpectedit.com/webserver/suid-to-linux-bash-or-sh-scripts</link>
		<comments>http://www.unexpectedit.com/webserver/suid-to-linux-bash-or-sh-scripts#comments</comments>
		<pubDate>Thu, 21 Jul 2011 15:46:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Webserver]]></category>
		<category><![CDATA[password sudo]]></category>
		<category><![CDATA[sudo root]]></category>
		<category><![CDATA[sudo script]]></category>
		<category><![CDATA[suid]]></category>

		<guid isPermaLink="false">http://www.unexpectedit.com/?p=648</guid>
		<description><![CDATA[Running scripts / programs as root privileges. Assign SUID to programs I doesn&#8217;t work with shell scripts!!! Linux doesn&#8217;t allow you to use SUID root for shell scripts due to security role. Just real binary programs. The reason is because an attacker could get the computer to execute any shell script when the script is [...]]]></description>
			<content:encoded><![CDATA[<h2>Running scripts / programs as root privileges.</h2>
<h3>Assign SUID to programs</h3>
<pre class="brush: bash; title: ; notranslate">
$ chmod 4755 /home/ipascual/scripts/test.sh
</pre>
<p><strong>I doesn&#8217;t work with shell scripts!!!</strong></p>
<p>Linux doesn&#8217;t allow you to use SUID root for shell scripts due to security role. Just real binary programs.<br />
The reason is because an attacker could get the computer to execute any shell script when the script is processing to execute. Because of this, modern linux distributions ignore SUID shell scripts.</p>
<p><strong>The solution is to use &#8220;sudo&#8221;.</strong></p>
<h3>What is sudo?</h3>
<p>sudo allows a permitted user to execute a command as the superuser or another user, as specified in the sudoers file.<br />
But, sudo asks me for the root! My users still can&#8217;t use it whiout password.</p>
<h3>Running a shell script without asking for root password</h3>
<pre class="brush: bash; title: ; notranslate">
$ sudo visudo

# Add this line at the end
ipascual        ALL=NOPASSWD: /home/ipascual/scripts/test.sh

$ cat /home/ipascual/scripts/test.sh
#!/bin/sh
/sbin/shutdown -h now

$ sudo /home/ipascual/scripts/test.sh
</pre>
<p>Now the user <strong>ipascual</strong> will execute <strong>test.sh</strong> as root without password.</p>
<div id="wpcr_respond_1"></div>]]></content:encoded>
			<wfw:commentRss>http://www.unexpectedit.com/webserver/suid-to-linux-bash-or-sh-scripts/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Other useful script to avoid upload phpMyAdmin</title>
		<link>http://www.unexpectedit.com/webserver/other-useful-script-to-avoid-upload-phpmyadmin</link>
		<comments>http://www.unexpectedit.com/webserver/other-useful-script-to-avoid-upload-phpmyadmin#comments</comments>
		<pubDate>Fri, 15 Jul 2011 00:57:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Webserver]]></category>
		<category><![CDATA[mysql_import]]></category>
		<category><![CDATA[php import mysql dump script]]></category>
		<category><![CDATA[php run query script]]></category>
		<category><![CDATA[php script mysql]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://www.unexpectedit.com/?p=644</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: php; title: ; notranslate">

import_tables('localhost','root','123456','blogdb','database-dump.sql');

show_tables('localhost','root','123456','blogdb');

run_query('localhost','root','123456','blogdb', 'select * from wp_users');

show_variables('localhost','root','123456');

function import_tables($host,$user,$pass,$db,$file)
{
	passthru(&quot;nohup mysql -h'&quot;.$host.&quot;' -u'&quot;.$user.&quot;' -p'&quot;.$pass.&quot;' &quot;.$db.&quot; &lt; &quot;.$file);
}

function show_tables($host,$user,$pass,$db)
{
    $link = mysql_connect($host,$user,$pass);
    mysql_select_db($db,$link);

	$tables = array();
	$result = mysql_query('SHOW TABLES');

	while($row = mysql_fetch_row($result))
	{
		echo $row[0] . &quot;&lt;br/&gt;&quot;;
	}
}

function run_query($host,$user,$pass,$db,$sql)
{
    $link = mysql_connect($host,$user,$pass);
    mysql_select_db($db,$link);

	$tables = array();
	$result = mysql_query($sql);

	while($row = mysql_fetch_row($result))
	{
		foreach($row as $field) {
			echo $field. &quot; &quot;;
		}
		echo &quot;&lt;br/&gt;&quot;;
	}
}

function show_variables($host,$user,$pass)
{
    $link = mysql_connect($host,$user,$pass);

    $tables = array();
    $result = mysql_query('SHOW VARIABLES');

    while($row = mysql_fetch_row($result))
    {
		echo $row[0].' : '.$row[1].&quot;&lt;br&gt;\n&quot;;
    }
}
</pre>
<div id="wpcr_respond_1"></div>]]></content:encoded>
			<wfw:commentRss>http://www.unexpectedit.com/webserver/other-useful-script-to-avoid-upload-phpmyadmin/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Website full php backup script, mysql / files</title>
		<link>http://www.unexpectedit.com/webserver/website-full-php-backup-script-mysql-files</link>
		<comments>http://www.unexpectedit.com/webserver/website-full-php-backup-script-mysql-files#comments</comments>
		<pubDate>Thu, 14 Jul 2011 00:20:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Webserver]]></category>
		<category><![CDATA[backup database]]></category>
		<category><![CDATA[backup files]]></category>
		<category><![CDATA[database mysql]]></category>
		<category><![CDATA[webserver]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.unexpectedit.com/?p=634</guid>
		<description><![CDATA[Hi, it&#8217;s being lot of times to download an old website from other company to start working on it, or just to have a copy in localhost to work with. I had to create a script to make my job easier. Thanks to David Walsh for backup_tables cool function I can share this script to [...]]]></description>
			<content:encoded><![CDATA[<p>Hi, it&#8217;s being lot of times to download an old website from other company to start working on it, or just to have a copy in localhost to work with.</p>
<p>I had to create a script to make my job easier. </p>
<p>Thanks to David Walsh for backup_tables cool function I can share this script to you guys</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
//1) Create a database dump file
backup_tables('localhost','root','123456','database_blog');

//2 Compress all folder tree including the database dump file before
$target = dirname(__FILE__);
echo exec('tar cfvz backup-'.time().'.tar.gz '.$target);

//3 To upload the full website
$target = dirname(__FILE__).&quot;/website.zip&quot;;
echo exec('unzip '.$target);

/*
*	Script from http://davidwalsh.name/backup-mysql-database-php
* Thanks to david walsh
*/
function backup_tables($host,$user,$pass,$name,$tables = '*')
{

	$link = mysql_connect($host,$user,$pass);
	mysql_select_db($name,$link);

	//get all of the tables
	if($tables == '*')
	{
		$tables = array();
		$result = mysql_query('SHOW TABLES');
		while($row = mysql_fetch_row($result))
		{
			$tables[] = $row[0];
		}
	}
	else
	{
		$tables = is_array($tables) ? $tables : explode(',',$tables);
	}

	//cycle through
	foreach($tables as $table)
	{
		$result = mysql_query('SELECT * FROM '.$table);
		$num_fields = mysql_num_fields($result);

		$return.= 'DROP TABLE '.$table.';';
		$row2 = mysql_fetch_row(mysql_query('SHOW CREATE TABLE '.$table));
		$return.= &quot;\n\n&quot;.$row2[1].&quot;;\n\n&quot;;

		for ($i = 0; $i &lt; $num_fields; $i++)
		{
			while($row = mysql_fetch_row($result))
			{
				$return.= 'INSERT INTO '.$table.' VALUES(';
				for($j=0; $j&lt;$num_fields; $j++)
				{
					$row[$j] = addslashes($row[$j]);
					$row[$j] = ereg_replace(&quot;\n&quot;,&quot;\\n&quot;,$row[$j]);
					if (isset($row[$j])) { $return.= '&quot;'.$row[$j].'&quot;' ; } else { $return.= '&quot;&quot;'; }
					if ($j&lt;($num_fields-1)) { $return.= ','; }
				}
				$return.= &quot;);\n&quot;;
			}
		}
		$return.=&quot;\n\n\n&quot;;
	}

	//save file
	$handle = fopen('db-backup-'.time().'-'.(md5(implode(',',$tables))).'.sql','w+');
	fwrite($handle,$return);
	fclose($handle);
}

?&gt;
</pre>
<p>References: http://davidwalsh.name/backup-mysql-database-php</p>
<div id="wpcr_respond_1"></div>]]></content:encoded>
			<wfw:commentRss>http://www.unexpectedit.com/webserver/website-full-php-backup-script-mysql-files/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento Schedule Export Google Base products with Cron</title>
		<link>http://www.unexpectedit.com/magento/magento-schedule-export-google-base-products-with-cron</link>
		<comments>http://www.unexpectedit.com/magento/magento-schedule-export-google-base-products-with-cron#comments</comments>
		<pubDate>Sat, 28 May 2011 14:43:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[cron job]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[google base]]></category>

		<guid isPermaLink="false">http://www.unexpectedit.com/?p=612</guid>
		<description><![CDATA[Schedule the script bellow every day with cron in your system like 01 00 * * * php -f /srv/www/htdocs/Magento/exportGoogleBase.php Then set up your Google Base merchant account like the pic bellow]]></description>
			<content:encoded><![CDATA[<p>Schedule the script bellow every day with cron in your system like<br />
01 00 * * * php -f /srv/www/htdocs/Magento/exportGoogleBase.php</p>
<pre class="brush: php; title: ; notranslate">
define('SAVE_FEED_LOCATION','/srv/www/htdocs/Magento/var/export/google_base_feed.txt'); //you can set a new folder and file if you want, don't forget to chmod the folder to 777

function cleanString($text) {
	// 1) convert á ô =&gt; a o
	$text = preg_replace(&quot;/[áàâãªä]/u&quot;,&quot;a&quot;,$text);
	$text = preg_replace(&quot;/[ÁÀÂÃÄ]/u&quot;,&quot;A&quot;,$text);
	$text = preg_replace(&quot;/[ÍÌÎÏ]/u&quot;,&quot;I&quot;,$text);
	$text = preg_replace(&quot;/[íìîï]/u&quot;,&quot;i&quot;,$text);
	$text = preg_replace(&quot;/[éèêë]/u&quot;,&quot;e&quot;,$text);
	$text = preg_replace(&quot;/[ÉÈÊË]/u&quot;,&quot;E&quot;,$text);
	$text = preg_replace(&quot;/[óòôõºö]/u&quot;,&quot;o&quot;,$text);
	$text = preg_replace(&quot;/[ÓÒÔÕÖ]/u&quot;,&quot;O&quot;,$text);
	$text = preg_replace(&quot;/[úùûü]/u&quot;,&quot;u&quot;,$text);
	$text = preg_replace(&quot;/[ÚÙÛÜ]/u&quot;,&quot;U&quot;,$text);
	$text = preg_replace(&quot;/[’‘‹›‚]/u&quot;,&quot;'&quot;,$text);
	$text = preg_replace(&quot;/[“”«»„]/u&quot;,'&quot;',$text);
	$text = str_replace(&quot;–&quot;,&quot;-&quot;,$text);
	$text = str_replace(&quot; &quot;,&quot; &quot;,$text);
	$text = str_replace(&quot;ç&quot;,&quot;c&quot;,$text);
	$text = str_replace(&quot;Ç&quot;,&quot;C&quot;,$text);
	$text = str_replace(&quot;ñ&quot;,&quot;n&quot;,$text);
	$text = str_replace(&quot;Ñ&quot;,&quot;N&quot;,$text);

	//2) Translation CP1252. &amp;ndash; =&gt; -
	$trans = get_html_translation_table(HTML_ENTITIES);
	$trans[chr(130)] = '&amp;sbquo;';    // Single Low-9 Quotation Mark
	$trans[chr(131)] = '&amp;fnof;';    // Latin Small Letter F With Hook
	$trans[chr(132)] = '&amp;bdquo;';    // Double Low-9 Quotation Mark
	$trans[chr(133)] = '&amp;hellip;';    // Horizontal Ellipsis
	$trans[chr(134)] = '&amp;dagger;';    // Dagger
	$trans[chr(135)] = '&amp;Dagger;';    // Double Dagger
	$trans[chr(136)] = '&amp;circ;';    // Modifier Letter Circumflex Accent
	$trans[chr(137)] = '&amp;permil;';    // Per Mille Sign
	$trans[chr(138)] = '&amp;Scaron;';    // Latin Capital Letter S With Caron
	$trans[chr(139)] = '&amp;lsaquo;';    // Single Left-Pointing Angle Quotation Mark
	$trans[chr(140)] = '&amp;OElig;';    // Latin Capital Ligature OE
	$trans[chr(145)] = '&amp;lsquo;';    // Left Single Quotation Mark
	$trans[chr(146)] = '&amp;rsquo;';    // Right Single Quotation Mark
	$trans[chr(147)] = '&amp;ldquo;';    // Left Double Quotation Mark
	$trans[chr(148)] = '&amp;rdquo;';    // Right Double Quotation Mark
	$trans[chr(149)] = '&amp;bull;';    // Bullet
	$trans[chr(150)] = '&amp;ndash;';    // En Dash
	$trans[chr(151)] = '&amp;mdash;';    // Em Dash
	$trans[chr(152)] = '&amp;tilde;';    // Small Tilde
	$trans[chr(153)] = '&amp;trade;';    // Trade Mark Sign
	$trans[chr(154)] = '&amp;scaron;';    // Latin Small Letter S With Caron
	$trans[chr(155)] = '&amp;rsaquo;';    // Single Right-Pointing Angle Quotation Mark
	$trans[chr(156)] = '&amp;oelig;';    // Latin Small Ligature OE
	$trans[chr(159)] = '&amp;Yuml;';    // Latin Capital Letter Y With Diaeresis
	$trans['euro'] = '&amp;euro;';    // euro currency symbol
	ksort($trans); 

	foreach ($trans as $k =&gt; $v) {
		$text = str_replace($v, $k, $text);
	}

	// 3) remove &lt;p&gt;, &lt;br/&gt; ...
	$text = strip_tags($text); 

	// 4) &amp;amp; =&gt; &amp; &amp;quot; =&gt; '
	$text = html_entity_decode($text);

	// 5) remove Windows-1252 symbols like &quot;TradeMark&quot;, &quot;Euro&quot;...
	$text = preg_replace('/[^(\x20-\x7F)]*/','', $text); 

	return ($text);
} 

// make sure we don't time out
set_time_limit(0);

require_once '/srv/www/htdocs/Magento/app/Mage.php';
Mage::app('default');

try{
	$handle = fopen(SAVE_FEED_LOCATION, 'w');

	$heading = array('id','title','description','link','image_link','price','condition','c:product_code');
	$feed_line=implode(&quot;\t&quot;, $heading).&quot;\r\n&quot;;
	fwrite($handle, $feed_line);

	$products = Mage::getModel('catalog/product')-&gt;getCollection();
	$products-&gt;addAttributeToFilter('status', 1);//enabled
	$products-&gt;addAttributeToFilter('visibility', 4);//catalog, search
	$products-&gt;addAttributeToSelect('*');
	$prodIds=$products-&gt;getAllIds();

	$i = 0;
	foreach($prodIds as $productId) {
		$product = Mage::getModel('catalog/product');
		$product-&gt;load($productId);
			$i++;
			$product_data = array();
			$product_data['id']=$product-&gt;getId();
			$product_data['title']=$product-&gt;getName();
			$product_data['description']=$product-&gt;getDescription();
			$product_data['link']=$product-&gt;getProductUrl();
			$product_data['image_link']=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'catalog/product'.$product-&gt;getImage();
			if($product-&gt;getSpecialPrice())
			$product_data['price']=round($product-&gt;getSpecialPrice(),2);
			else
			$product_data['price']=round($product-&gt;getPrice(),2);
			$product_data['condition']='new';
			$product_data['c:product_code']=$product-&gt;getSku();

			//sanitize data
			foreach($product_data as $k=&gt;$val){
				$bad=array('&quot;',&quot;\r\n&quot;,&quot;\n&quot;,&quot;\r&quot;,&quot;\t&quot;);
				$good=array(&quot;&quot;,&quot; &quot;,&quot; &quot;,&quot; &quot;,&quot;&quot;);
				$val = str_replace($bad,$good,$val);
				$val = cleanString($val); // convert á ô ... =&gt; a o
				$product_data[$k] = $val;
			}

			$feed_line = implode(&quot;\t&quot;, $product_data).&quot;\r\n&quot;;
			fwrite($handle, $feed_line);
			fflush($handle);

			unset($product);
	}
	fclose($handle);
}
catch(Exception $e){
	die($e-&gt;getMessage());
}
</pre>
<p>Then set up your Google Base merchant account like the pic bellow<br/><br />
<a href="http://www.unexpectedit.com/wp-content/uploads/2011/05/Screen-shot-2011-05-28-at-09.41.08.png"><img src="http://www.unexpectedit.com/wp-content/uploads/2011/05/Screen-shot-2011-05-28-at-09.41.08.png" alt="Google Base Magento settings" title="Google Base Magento setup" width="581" height="573" class="aligncenter size-full wp-image-613" /></a></p>
<div id="wpcr_respond_1"></div>]]></content:encoded>
			<wfw:commentRss>http://www.unexpectedit.com/magento/magento-schedule-export-google-base-products-with-cron/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

