<?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>kelpdesign &#187; How to</title>
	<atom:link href="http://www.kelpdesign.com/keys/how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kelpdesign.com</link>
	<description>We build easy to manage websites.</description>
	<lastBuildDate>Wed, 30 Nov 2011 20:19:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SVN Update made easy PT2</title>
		<link>http://www.kelpdesign.com/tech-talk/svn-update-made-easy-pt2/</link>
		<comments>http://www.kelpdesign.com/tech-talk/svn-update-made-easy-pt2/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 01:18:23 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Tech Talk]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://www.kelpdesign.com/?p=644</guid>
		<description><![CDATA[On a <a title="PHP Svn Updater" href="http://www.kelpdesign.com/tech-talk/svn-update-made-easy/">previous post</a> I explained how to build SVN updater script in PHP. This works fine on hosts that allow the webserver runas user to access the subversion binaries, such as <a href="http://dreamhost.com/">Dreamhost</a>.]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-672" title="SSH, PHP and Subversion equals lots of fun!" src="http://www.kelpdesign.com/wp-content/uploads/2009/08/ssh_and_svn.png" alt="SSH, PHP and Subversion equals lots of fun!" width="383" height="46" /></p>
<p>On a <a title="PHP Svn Updater" href="http://www.kelpdesign.com/tech-talk/svn-update-made-easy/">previous post</a> I explained how to build SVN updater script in PHP. This works fine on hosts that allow the webserver runas user to access the subversion binaries, such as <a href="http://dreamhost.com/">Dreamhost</a>.</p>
<h3>What if not?</h3>
<p>Our favorite hosting provider <a href="http://www.webdrive.co.nz/">Webdrive</a> allows our ssh-user access to subversion but not the apache runas user.</p>
<h3>What can we do?</h3>
<p>In order to avoid being asked to update the working files for website xyz.com every change someone made -> we need a script that executes the command &#8220;svn up&#8221; via ssh on a remote server!</p>
<p>This script will be hosted locally and the access will be restricted.</p>
<h3>Sounds good what are the problems?</h3>
<p>Everyone, who ever tried to build a script that connects via SSH to a remote machine in PHP, knows the big question:</p>
<p><em>&#8220;How can I send the password?&#8221;</em></p>
<p>The answer is: &#8220;<em>Not</em>&#8220;</p>
<p>thanks to ssh key authentication.</p>
<p><span id="more-644"></span></p>
<p><br class="spacer_" /></p>
<p>Step by step (on Ubuntu 8.04 LTS) server:</p>
<ol>
<li>log in to your local webserver [<em>local-server</em>] (the one that will runs the updater script)</li>
<li>find out what user apache runs as &#8216;<em>ps aux | grep apache</em>&#8216; -> [<em>www-data</em>]</li>
<li>log in as this user: &#8216;<em>su www-data</em>&#8216;</li>
<li>create a ssh-key pair: &#8216;<em>ssh-keygen</em>&#8216;</li>
<li>copy the public key to the remote server: &#8216;<em>ssh-copy-id user@remote-server.com</em>&#8216;</li>
<li>enter your password when prompted </li>
<li>login to the remote server: &#8216;<em>ssh user@remote-server.com</em>&#8216; &#8211; you should not be asked for the password anymore -> if not make sure the file &#8220;~/.ssh/authorized_keys&#8221; has 644 permissions and try again</li>
</ol>
<p><br class="spacer_" /></p>
<p>Thats it!</p>
<p>now all we need is the script:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">exec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ssh user@remote-server.com svn up /home/user/xyz.com&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>You can also make the site a parameter-variable by using</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">exec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ssh user@remote-server.com svn up /home/user/<span style="color: #006699; font-weight: bold;">{$_GET['site']}</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This script should be password protected to avoid having the wrong people playing with it!</p>
<p>This should be easy to adapt for other Source Control systems, such as GIT, Mercurial, Bazaar etc&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kelpdesign.com/tech-talk/svn-update-made-easy-pt2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What are the hard refresh shortcuts for a Mac using Safari and Firefox?</title>
		<link>http://www.kelpdesign.com/tech-talk/what-are-the-hard-refresh-shortcuts-for-a-mac-using-safari-and-firefox/</link>
		<comments>http://www.kelpdesign.com/tech-talk/what-are-the-hard-refresh-shortcuts-for-a-mac-using-safari-and-firefox/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 22:19:34 +0000</pubDate>
		<dc:creator>Lexi</dc:creator>
				<category><![CDATA[Tech Talk]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.kelpdesign.com/?p=448</guid>
		<description><![CDATA[Quick tip The shortcut keys for refresh / hard (force) refresh on a Mac for Safari and Firefox: Firefox Refresh: Command+R Hard refresh: Command+Shift+R Safari Refresh: Command+R Clear the cache: Command + Option + E *Command = Apple key]]></description>
			<content:encoded><![CDATA[<h2>Quick tip</h2>
<p>The shortcut keys for refresh / hard (force) refresh on a Mac for Safari and Firefox:</p>
<h2>Firefox</h2>
<p>Refresh: Command+R<br />
Hard refresh: Command+Shift+R</p>
<h2>Safari</h2>
<p>Refresh: Command+R<br />
Clear the cache: Command + Option + E</p>
<p><em>*Command = Apple key</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kelpdesign.com/tech-talk/what-are-the-hard-refresh-shortcuts-for-a-mac-using-safari-and-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SVN update made easy</title>
		<link>http://www.kelpdesign.com/tech-talk/svn-update-made-easy/</link>
		<comments>http://www.kelpdesign.com/tech-talk/svn-update-made-easy/#comments</comments>
		<pubDate>Mon, 25 May 2009 04:44:35 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Tech Talk]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://kelpdesign.com/?p=279</guid>
		<description><![CDATA[PHP Subversion Updater In our company we use Subversion for version control. Using a GUI for Mac gives our more graphical team members easy access to common tasks, such as committing changed files to the repository. However updating the working copy on a (test-) web server still requires knowlegde of a unix shell and having [...]]]></description>
			<content:encoded><![CDATA[<h3><img class="alignright size-full wp-image-283" title="subversion logo" src="http://kelpdesign.com/wp-content/uploads/2009/05/imageaxd.png" alt="subversion logo" width="230" height="199" />PHP Subversion Updater</h3>
<p>In our company we use <a href="http://subversion.tigris.org/">Subversion</a> for version control.</p>
<p>Using a GUI for Mac gives our more graphical team members easy access to common tasks, such as committing changed files to the repository.</p>
<p>However updating the working copy on a (test-) web server still requires knowlegde of a unix shell and having to log in and running it manually can be a full time position.</p>
<p>After doing some research I found the <a href="http://nz2.php.net/manual/en/book.svn.php">official PECL SVN bindings</a>. These are still very experimental and a hussle to install.</p>
<p>So I decided to use the simplest solution that just executes a &#8220;svn up&#8221; on the server and does not require any server-side modification:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">exec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;svn up &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$out</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ret</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Which serves perfectly for this purpose.</p>
<p>Wrapping this line in a (30secs) self refreshing file makes sure the working copy stays updated.</p>
<p>And the best thing is:<br />
it does not require anything, except installed svn binaries that are executable for the apache user and write access to the webroot.<br />
<a href="http://kelpdesign.com/wp-content/uploads/2009/05/svn-upphps.zip">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kelpdesign.com/tech-talk/svn-update-made-easy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Howto downsize product images in Magento using Mage_Catalog_Helper_Image</title>
		<link>http://www.kelpdesign.com/tech-talk/howto-downsize-product-images-in-magento-using-mage_catalog_helper_image/</link>
		<comments>http://www.kelpdesign.com/tech-talk/howto-downsize-product-images-in-magento-using-mage_catalog_helper_image/#comments</comments>
		<pubDate>Thu, 14 May 2009 06:21:33 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[Tech Talk]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Image manipulation]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Templates]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://kelpdesign.com/?p=111</guid>
		<description><![CDATA[or &#8220;How can I downsize large product images but not enlarge small images?&#8221; simple as: syntax: $this-&#62;helper&#40;'catalog/image'&#41; -&#62;init&#40;$_product, 'image'&#41; -&#62;keepFrame&#40;false&#41; -&#62;constrainOnly&#40;true&#41; -&#62;resize&#40;650&#41;; example: $this-&#62;helper&#40;'catalog/image'&#41; -&#62;init&#40;$_product, 'image'&#41; -&#62;keepFrame&#40;false&#41; -&#62;constrainOnly&#40;true&#41; -&#62;resize&#40;650&#41;; explanation: $this-&#62;helper(&#8216;catalog/image&#8217;) loads the &#8216;Mage_Catalog_Helper_Image&#8217; located at &#8216;app/code/core/Mage/Catalog/Helper/Image.php&#8217; (NOTE: it only handles instances of &#8216;Mage_Catalog_Model_Product&#8217;) [why not categories? - they can have images too!!] Mage_Catalog_Helper_Image::init($_product, &#8216;image&#8217;) [...]]]></description>
			<content:encoded><![CDATA[<p>or</p>
<h2>&#8220;How can I downsize large product images but not enlarge small images?&#8221;</h2>
<p>simple as:</p>
<p>syntax:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog/image'</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">init</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_product</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'image'</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">keepFrame</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">constrainOnly</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">resize</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">650</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>example:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'catalog/image'</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">init</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_product</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'image'</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">keepFrame</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">constrainOnly</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">-&gt;</span><span style="color: #004000;">resize</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">650</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span id="more-111"></span></p>
<h3>explanation:</h3>
<p><strong><em>$this-&gt;helper(&#8216;catalog/image&#8217;)</em></strong></p>
<p>loads the &#8216;Mage_Catalog_Helper_Image&#8217; located at &#8216;app/code/core/Mage/Catalog/Helper/Image.php&#8217;</p>
<p>(<strong>NOTE</strong>: it only handles instances of &#8216;Mage_Catalog_Model_Product&#8217;)</p>
<p>[<em>why not categories? - they can have images too!!</em>]</p>
<p><strong><em>Mage_Catalog_Helper_Image::init($_product, &#8216;image&#8217;)</em></strong></p>
<p>loads the actual product in the helper</p>
<p><strong><em>Mage_Catalog_Helper_Image::keepFrame(false)</em></strong></p>
<p>avoids getting the small image in original size on a solid background color presented (can be handy not to break some layouts)</p>
<p><strong><em>Mage_Catalog_Helper_Image::constrainOnly(false)</em></strong></p>
<p>avoids getting small images bigger</p>
<p><strong><em>Mage_Catalog_Helper_Image::resize(600)</em></strong></p>
<p>sets the desired width to 600px and the height accordingly (proportional by default)</p>
<p>Check &#8216;app/code/core/Mage/Catalog/Helper/Image.php&#8217; for more handy methods!</p>
<p>Hope this helps someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kelpdesign.com/tech-talk/howto-downsize-product-images-in-magento-using-mage_catalog_helper_image/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

