<?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>info.michael-simons.eu &#187; Tipps</title>
	<atom:link href="http://info.michael-simons.eu/tag/tipps/feed/" rel="self" type="application/rss+xml" />
	<link>http://info.michael-simons.eu</link>
	<description>Just another nerd blog</description>
	<lastBuildDate>Wed, 25 Jan 2012 07:53:01 +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>Git snippets</title>
		<link>http://info.michael-simons.eu/2011/12/22/git-snippets/</link>
		<comments>http://info.michael-simons.eu/2011/12/22/git-snippets/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 20:11:36 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Shortcuts]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=614</guid>
		<description><![CDATA[These are a view things that i had looked up to solve some problems and i plan to update this post regularly… To push a new branch to remote git push origin new_branch To delete a remote branch git push origin :new_branch To push new tags git push --tags origin To delete a remote tag [...]]]></description>
			<content:encoded><![CDATA[<p><em>These are a view things that i had looked up to solve some problems and i plan to update this post regularly…</em></p>
<p>To push a new branch to remote</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> push origin new_branch</pre></div></div>

<p>To delete a remote branch</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> push origin :new_branch</pre></div></div>

<p>To push new tags</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> push <span style="color: #660033;">--tags</span> origin</pre></div></div>

<p>To delete a remote tag</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> tag <span style="color: #660033;">-d</span> <span style="color: #000000;">12345</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> push origin :refs<span style="color: #000000; font-weight: bold;">/</span>tags<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">12345</span></pre></div></div>

<p>To reset a local branch to exactly match a remote branch</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> fetch origin
<span style="color: #c20cb9; font-weight: bold;">git</span> reset <span style="color: #660033;">--hard</span> origin<span style="color: #000000; font-weight: bold;">/</span>master</pre></div></div>

<p>To abort a rebase</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> rebase <span style="color: #660033;">--abort</span></pre></div></div>

<p>Changing the origin of your git repository (relocate the repository)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> config remote.origin.url <span style="color: #7a0874; font-weight: bold;">&#91;</span>new origin url<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p><em>Last update: 2012/01/04</em></p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=614&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_614" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2011/12/22/git-snippets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create reusable MySQL schema dumps</title>
		<link>http://info.michael-simons.eu/2010/09/16/create-reusable-mysql-schema-dumps/</link>
		<comments>http://info.michael-simons.eu/2010/09/16/create-reusable-mysql-schema-dumps/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 09:18:39 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Shortcuts]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=449</guid>
		<description><![CDATA[In case you need a MySQL schema transferred from one host to another and the schema names differ, you can ran into problems with a standard MySQL dump. Use the following statement to create a schema dump that contains all table and view definitions as well as all stored procedures without a reference to the [...]]]></description>
			<content:encoded><![CDATA[<p>In case you need a MySQL schema transferred from one host to another and the schema names differ, you can ran into problems with a standard MySQL dump.</p>
<p>Use the following statement to create a schema dump that contains all table and view definitions as well as all stored procedures without a reference to the original schema:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"> mysqldump <span style="color: #660033;">-uroot</span> <span style="color: #660033;">-p</span> name_of_the_original_schema <span style="color: #660033;">--no-data</span> <span style="color: #660033;">--opt</span> <span style="color: #660033;">--routines</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/`name_of_the_original_schema`.//g'</span> <span style="color: #000000; font-weight: bold;">&gt;</span> dump.sql</pre></div></div>

<p>The dump will only contain the schema definition and no data. Calls to routines will not be prefixed with a schema name.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=449&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_449" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2010/09/16/create-reusable-mysql-schema-dumps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iTunes terminal tipps 2010</title>
		<link>http://info.michael-simons.eu/2010/09/13/itunes-terminal-tipps-2010/</link>
		<comments>http://info.michael-simons.eu/2010/09/13/itunes-terminal-tipps-2010/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 19:46:39 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=445</guid>
		<description><![CDATA[4 years ago i had a first iTunes terminal tipp, here is a round up (all terminal tipps require Mac OS X): Invert the iTunes Store links in the list The littler arrows can either point to the iTunes store or to the same artist or album in your library. Invert their behavior to let [...]]]></description>
			<content:encoded><![CDATA[<p>4 years ago i had a <a href="http://info.michael-simons.eu/2006/12/27/eine-handvoll-itunes-tipps/">first</a> iTunes terminal tipp, here is a round up (all terminal tipps require Mac OS X):</p>
<h3>Invert the iTunes Store links in  the list</h3>
<p>The littler arrows can either point to the iTunes store or to the same artist or album in your library. Invert their behavior to let them point to your files instead of the store:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">defaults <span style="color: #c20cb9; font-weight: bold;">write</span> com.apple.iTunes invertStoreLinks <span style="color: #660033;">-bool</span> YES</pre></div></div>

<p>Undo this with</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">defaults <span style="color: #c20cb9; font-weight: bold;">write</span> com.apple.iTunes invertStoreLinks <span style="color: #660033;">-bool</span> NO</pre></div></div>

<p>Disable them with</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">defaults <span style="color: #c20cb9; font-weight: bold;">write</span> com.apple.iTunes show-store-arrow-links <span style="color: #660033;">-boolean</span> FALSE</pre></div></div>

<p>Enable them with</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">defaults <span style="color: #c20cb9; font-weight: bold;">write</span> com.apple.iTunes show-store-arrow-links <span style="color: #660033;">-boolean</span> TRUE</pre></div></div>

<h3>Restore the horizontal stoplight</h3>
<p>Again, Apple messes with it&#8217;s own UI guidelines. To restore sanity, use</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">defaults <span style="color: #c20cb9; font-weight: bold;">write</span> com.apple.iTunes full-window <span style="color: #660033;">-boolean</span> TRUE</pre></div></div>

<p>Reenable the vertical layout introduced with iTunes 10 through</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">defaults <span style="color: #c20cb9; font-weight: bold;">write</span> com.apple.iTunes full-window <span style="color: #660033;">-boolean</span> FALSE</pre></div></div>

<h3>Enable half-star ratings</h3>
<p>The following will let you rate your songs with half-star ratings (i.e 3.5 stars):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">defaults <span style="color: #c20cb9; font-weight: bold;">write</span> com.apple.iTunes allow-half-stars <span style="color: #660033;">-bool</span> TRUE</pre></div></div>

<p>If you don&#8217;t like the fact, that the half-star ratings will round on any i* device, turn it off again:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">defaults <span style="color: #c20cb9; font-weight: bold;">write</span> com.apple.iTunes allow-half-stars <span style="color: #660033;">-bool</span> FALSE</pre></div></div>

<p class="akst_link"><a href="http://info.michael-simons.eu/?p=445&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_445" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2010/09/13/itunes-terminal-tipps-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux: Persistent wake-on-lan</title>
		<link>http://info.michael-simons.eu/2010/03/03/linux-persistent-wake-on-lan/</link>
		<comments>http://info.michael-simons.eu/2010/03/03/linux-persistent-wake-on-lan/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 08:36:22 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[ethtool]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=399</guid>
		<description><![CDATA[Just a quick reminder for myself: You need to enable wake-on-lan on the nic in most linux distributions via ethtool. If your nic supports WOL, it probably needs to be enabled in your computers BIOS first. Most WOL tools use the &#8220;MagicPacket(tm)&#8221; method, so the right command to enable it on the nic &#8220;eth0&#8243; would [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick reminder for myself: You need to enable wake-on-lan on the nic in most linux distributions via <em>ethtool</em>.</p>
<p>If your nic supports WOL, it probably needs to be enabled in your computers BIOS first.</p>
<p>Most WOL tools use the &#8220;MagicPacket(tm)&#8221; method, so the right command to enable it on the nic &#8220;eth0&#8243; would be</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ethtool <span style="color: #660033;">-s</span> eth0 wol g</pre></div></div>

<p>This is not a persistent setting and it is gone after a reboot. Most tips around recommend creating a runlevel script for executing this command after boot or before shutdown.</p>
<p>I&#8217;ve added the command as a hook in my network scripts:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">auto eth0
iface eth0 inet dhcp
        pre-down ethtool <span style="color: #660033;">-s</span> eth0 wol g</pre></div></div>

<p>You can also use post-up. I like this method because i tend to forget about my runlevel scripts and so i keep the network stuff in one place <img src='http://info.michael-simons.eu/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>If you are a debian user, you maybe need to stop your system from turning off the nic on HALT. To do so, add</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">NETDOWN</span>=no</pre></div></div>

<p>to &#8220;/etc/default/halt&#8221;.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=399&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_399" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2010/03/03/linux-persistent-wake-on-lan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change the image assets path in Rails</title>
		<link>http://info.michael-simons.eu/2009/11/01/how-to-change-the-image-assets-path-in-rails/</link>
		<comments>http://info.michael-simons.eu/2009/11/01/how-to-change-the-image-assets-path-in-rails/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 08:16:33 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=372</guid>
		<description><![CDATA[I found no other way to change the path of &#8220;images&#8221; in a Rails application than monkey patching the AssetTagHelper like so: module ActionView module Helpers #:nodoc: module AssetTagHelper def image_path&#40;source&#41; compute_public_path&#40;source, 'static_images'&#41; end alias_method :path_to_image, :image_path # aliased to avoid conflicts with an image_path named route end end end Share This]]></description>
			<content:encoded><![CDATA[<p>I found no other way to change the path of &#8220;images&#8221; in a Rails application than monkey patching the AssetTagHelper like so:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> ActionView
  <span style="color:#9966CC; font-weight:bold;">module</span> Helpers <span style="color:#008000; font-style:italic;">#:nodoc:</span>
    <span style="color:#9966CC; font-weight:bold;">module</span> AssetTagHelper
      <span style="color:#9966CC; font-weight:bold;">def</span> image_path<span style="color:#006600; font-weight:bold;">&#40;</span>source<span style="color:#006600; font-weight:bold;">&#41;</span>
        compute_public_path<span style="color:#006600; font-weight:bold;">&#40;</span>source, <span style="color:#996600;">'static_images'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
      alias_method <span style="color:#ff3333; font-weight:bold;">:path_to_image</span>, <span style="color:#ff3333; font-weight:bold;">:image_path</span> <span style="color:#008000; font-style:italic;"># aliased to avoid conflicts with an image_path named route</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p class="akst_link"><a href="http://info.michael-simons.eu/?p=372&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_372" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2009/11/01/how-to-change-the-image-assets-path-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SVN: Revert to previous version</title>
		<link>http://info.michael-simons.eu/2009/09/09/svn-revert-to-previous-version/</link>
		<comments>http://info.michael-simons.eu/2009/09/09/svn-revert-to-previous-version/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 20:56:29 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Shortcuts]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=366</guid>
		<description><![CDATA[Just a quick reminder: To revert a complete working copy or a single file use: svn merge -rHEAD:PREV . # or svn merge -rHEAD:PREV path/to/file svn commit -m &#34;reverted&#34; Share This]]></description>
			<content:encoded><![CDATA[<p>Just a quick reminder:</p>
<p>To revert a complete working copy or a single file use:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> merge -rHEAD:PREV .
<span style="color: #666666; font-style: italic;"># or</span>
<span style="color: #c20cb9; font-weight: bold;">svn</span> merge -rHEAD:PREV path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">file</span>
<span style="color: #c20cb9; font-weight: bold;">svn</span> commit <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;reverted&quot;</span></pre></div></div>

<p class="akst_link"><a href="http://info.michael-simons.eu/?p=366&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_366" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2009/09/09/svn-revert-to-previous-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phusion Passenger and memcache-client revisited</title>
		<link>http://info.michael-simons.eu/2009/03/23/phusion-passenger-and-memcache-client-revisited/</link>
		<comments>http://info.michael-simons.eu/2009/03/23/phusion-passenger-and-memcache-client-revisited/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 10:35:49 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=313</guid>
		<description><![CDATA[The last Passenger update brought some good explanation off the problems regarding Passenger and memcache-client (see here). Smart spawning of Passenger processes creates shared file descriptors. As the connections to memcached are sockets they are shared as well so data on them gets corrupted which is explained very nicely in the Passenger documentation: Example 1: [...]]]></description>
			<content:encoded><![CDATA[<p>The last <a href="http://www.modrails.com/">Passenger</a> update brought some good explanation off the problems regarding Passenger and memcache-client (see <a href="http://info.michael-simons.eu/2009/02/23/phusion-passenger-and-memcached-memcache-client/">here</a>). </p>
<p>Smart spawning of Passenger processes creates shared file descriptors. As the connections to memcached are sockets they are shared as well so data on them gets corrupted which is explained very nicely in the Passenger documentation: <a href="http://www.modrails.com/documentation/Users%20guide.html#_example_1_memcached_connection_sharing_harmful">Example 1: Memcached connection sharing (harmful)</a>.</p>
<p>The solution presented there works like a charm. The <em>reestablish_connection_to_memcached</em> line is actually not more than <em>CACHE.reset</em> where CACHE is the reference to the memcache connection.</p>
<p>After that change, spawning methods smart-lv2 and smart will work in connection with environment.rb configured memcache connections.</p>
<p><ins datetime="2009-03-25T15:15:15+00:00">Edit</ins>: As requested in the comments, a little example:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">memcache_options = <span style="color:#006600; font-weight:bold;">&#123;</span>
  <span style="color:#ff3333; font-weight:bold;">:c_threshold</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">10000</span>,
  <span style="color:#ff3333; font-weight:bold;">:compression</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>,
  <span style="color:#ff3333; font-weight:bold;">:debug</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span>,
  <span style="color:#ff3333; font-weight:bold;">:namespace</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'some_ns'</span>,
  <span style="color:#ff3333; font-weight:bold;">:readonly</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span>,
  <span style="color:#ff3333; font-weight:bold;">:urlencode</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span>
<span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
CACHE = MemCache.<span style="color:#9900CC;">new</span> memcache_options
CACHE.<span style="color:#9900CC;">servers</span> = <span style="color:#996600;">'127.0.0.1:11211'</span>
<span style="color:#9966CC; font-weight:bold;">begin</span>
   PhusionPassenger.<span style="color:#9900CC;">on_event</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:starting_worker_process</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>forked<span style="color:#006600; font-weight:bold;">|</span>
     <span style="color:#9966CC; font-weight:bold;">if</span> forked
       <span style="color:#008000; font-style:italic;"># We're in smart spawning mode, so...</span>
       <span style="color:#008000; font-style:italic;"># Close duplicated memcached connections - they will open themselves</span>
       CACHE.<span style="color:#9900CC;">reset</span>
     <span style="color:#9966CC; font-weight:bold;">end</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#008000; font-style:italic;"># In case you're not running under Passenger (i.e. devmode with mongrel)</span>
<span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#CC00FF; font-weight:bold;">NameError</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> error
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>In this case, CACHE is the global constant that i use to access my memcache-client.</p>
<p>I guess you&#8217;ll need to do the same with the global Rails.cache object, but i&#8217;m not sure. Anyway, the above solution works for me. </p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=313&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_313" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2009/03/23/phusion-passenger-and-memcache-client-revisited/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Phusion Passenger and memcached / memcache-client</title>
		<link>http://info.michael-simons.eu/2009/02/23/phusion-passenger-and-memcached-memcache-client/</link>
		<comments>http://info.michael-simons.eu/2009/02/23/phusion-passenger-and-memcached-memcache-client/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 16:23:46 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=294</guid>
		<description><![CDATA[I recently switch from a mod_proxy / thin setup to Phusion Passenger and my application started to do the funniest things and the production.log was full with errors related to memcached. It seems, that passengers spawn method &#8220;smart&#8221; isn&#8217;t compatible with memcached. Within seconds on a lightly loaded server the cache gets corrupted big time. [...]]]></description>
			<content:encoded><![CDATA[<p>I recently switch from a mod_proxy / thin setup to <a href="http://www.modrails.com/">Phusion Passenger</a> and my application started to do the funniest things and the production.log was full with errors related to memcached.</p>
<p>It seems, that passengers spawn method &#8220;smart&#8221; isn&#8217;t compatible with memcached. Within seconds on a lightly loaded server the cache gets corrupted big time.</p>
<p>I got better results with a newer memcache client (the ruby gem actually), but for that i need to remove the client from the rails vendor lib. Furthermore, under higher load there still where errors.</p>
<p>Only solution is to set the spawn method to conservative like so</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">RailsSpawnMethod conservative</pre></div></div>

<p>Problem seems to be known in the Phusion and Rails teams.</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=294&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_294" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2009/02/23/phusion-passenger-and-memcached-memcache-client/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ruby: Formatting time values as RFC3339</title>
		<link>http://info.michael-simons.eu/2008/11/01/ruby-formatting-time-values-as-rfc3339/</link>
		<comments>http://info.michael-simons.eu/2008/11/01/ruby-formatting-time-values-as-rfc3339/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 12:07:15 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=228</guid>
		<description><![CDATA[Times in RSS Feeds and the like are formatted as RFC3339 most of the time. You can save yourself from strftime by using Time.now.xmlschema Share This]]></description>
			<content:encoded><![CDATA[<p>Times in RSS Feeds and the like are formatted as RFC3339 most of the time. You can save yourself from strftime by using</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>.<span style="color:#9900CC;">xmlschema</span></pre></div></div>

<p class="akst_link"><a href="http://info.michael-simons.eu/?p=228&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_228" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2008/11/01/ruby-formatting-time-values-as-rfc3339/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Turn off RoRs automatic timezone conversion for columns</title>
		<link>http://info.michael-simons.eu/2008/11/01/turn-off-rors-automatic-timezone-conversion-for-columns/</link>
		<comments>http://info.michael-simons.eu/2008/11/01/turn-off-rors-automatic-timezone-conversion-for-columns/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 09:15:32 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[English posts]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Tipps]]></category>

		<guid isPermaLink="false">http://info.michael-simons.eu/?p=225</guid>
		<description><![CDATA[I couldn&#8217;t find this in the documents, but Geoff Buesing showed me the hooks to turn off Ruby On Rails&#8217; automatic timezone conversions for some columns of a model or a complete model: # Turn it off for just some columns class Picture &#60; ActiveRecord::Base def self.skip_time_zone_conversion_for_attributes &#91;:created_at, :published_at&#93; end end &#160; # Turin it [...]]]></description>
			<content:encoded><![CDATA[<p>I couldn&#8217;t find this in the documents, but <a href="http://www.geoffbuesing.com/">Geoff Buesing</a> showed me the hooks to turn off Ruby On Rails&#8217; automatic timezone conversions for some columns of a model or a complete model:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Turn it off for just some columns</span>
<span style="color:#9966CC; font-weight:bold;">class</span> Picture <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
 <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">skip_time_zone_conversion_for_attributes</span>
   <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:created_at</span>, <span style="color:#ff3333; font-weight:bold;">:published_at</span><span style="color:#006600; font-weight:bold;">&#93;</span>
 <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Turin it off for the whole model</span>
<span style="color:#9966CC; font-weight:bold;">class</span> Picture <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
 <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">time_zone_aware_attributes</span>
   <span style="color:#0000FF; font-weight:bold;">false</span>
 <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Thanks a lot!</p>
<p class="akst_link"><a href="http://info.michael-simons.eu/?p=225&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_225" class="akst_share_link " rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://info.michael-simons.eu/2008/11/01/turn-off-rors-automatic-timezone-conversion-for-columns/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.762 seconds -->

