<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Icebergist</title>
	
	<link>http://icebergist.com</link>
	<description>Exploring hidden depths of web apps business</description>
	<lastBuildDate>Mon, 29 Mar 2010 13:14:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/icebergist" /><feedburner:info uri="icebergist" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-sa/3.0/</creativeCommons:license><item>
		<title>Rails 3 reading list</title>
		<link>http://feedproxy.google.com/~r/icebergist/~3/zDd8N84OMLo/rails-3-reading-list</link>
		<comments>http://icebergist.com/posts/rails-3-reading-list#comments</comments>
		<pubDate>Mon, 29 Mar 2010 13:14:23 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails3]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=38</guid>
		<description><![CDATA[I&#8217;ve been planning to catchup with all the new Rails 3 stuff. To get me started I&#8217;ve compiled a small Rails 3 related reading list.

Ruby on Rails 3.0 Release Notes
Active Record Query Interface 3.0
The Skinny on Scopes (Formerly named_scope)
Rails 3 Beautiful Code
Railscasts &#8211; rails-3.0 episodes
jQuery with Rails 3
The Rails Module (in Rails 3)

Once I&#8217;m done [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been planning to catchup with all the new Rails 3 stuff. To get me started I&#8217;ve compiled a small Rails 3 related reading list.</p>
<ol>
<li><a href="http://guides.rails.info/3_0_release_notes.html">Ruby on Rails 3.0 Release Notes</a></li>
<li><a href="http://m.onkey.org/2010/1/22/active-record-query-interface">Active Record Query Interface 3.0</a></li>
<li><a href="http://edgerails.info/articles/what-s-new-in-edge-rails/2010/02/23/the-skinny-on-scopes-formerly-named-scope/">The Skinny on Scopes (Formerly named_scope)</a></li>
<li><a href="http://blog.envylabs.com/2010/02/rails-3-beautiful-code/">Rails 3 Beautiful Code</a></li>
<li><a href="http://railscasts.com/tags/27">Railscasts &#8211; rails-3.0 episodes</a></li>
<li><a href="http://joshhuckabee.com/jquery-rails-3">jQuery with Rails 3</a></li>
<li><a href="http://litanyagainstfear.com/blog/2010/02/03/the-rails-module/">The Rails Module (in Rails 3)</a></li>
</ol>
<p>Once I&#8217;m done with it I plan to get even more from:</p>
<ul>
<li><a href="http://edgerails.info/articles/what-s-new-in-edge-rails/2010/02/10/rails-3-resources/">Rails 3 Resources</a></li>
<li><a href="http://www.rubyinside.com/rails-3-0-beta-links-2966.html">Rails 3.0 Beta: 36 Links and Resources To Get You Going</a></li>
</ul>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=Rails%203%20reading%20list&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Frails-3-reading-list"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="Rails 3 reading list";
		a2a_linkurl="http://icebergist.com/posts/rails-3-reading-list";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p><img src="http://feeds.feedburner.com/~r/icebergist/~4/zDd8N84OMLo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/rails-3-reading-list/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://icebergist.com/posts/rails-3-reading-list</feedburner:origLink></item>
		<item>
		<title>Expected x.rb to define X (LoadError)</title>
		<link>http://feedproxy.google.com/~r/icebergist/~3/sq0RGayvWLk/expected-xrb-to-define-x-loaderror</link>
		<comments>http://icebergist.com/posts/expected-xrb-to-define-x-loaderror#comments</comments>
		<pubDate>Wed, 15 Apr 2009 16:00:56 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Ruby and Rails]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=33</guid>
		<description><![CDATA[I have been working on extending Rails&#8217; I18n Simple backend to make it work with Serbian grammar (post on that will follow soon), but I kept getting an error:
Expected ./lib/serbian_simple.rb to define SerbianSimple (LoadError)
I&#8217;ve just spent an hour trying to figure out why this keeps happening and I found that there&#8217;s a lot of people [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working on extending Rails&#8217; I18n Simple backend to make it work with Serbian grammar (post on that will follow soon), but I kept getting an error:</p>
<p><code>Expected ./lib/serbian_simple.rb to define SerbianSimple (LoadError)</code></p>
<p>I&#8217;ve just spent an hour trying to figure out why this keeps happening and I found that there&#8217;s a lot of people with similar problem.</p>
<p>It seems that the problem appears when Rails tries to autoload files. In my case there was a simple solution &#8211; I just added require &#8217;serbian_simple.rb&#8217; in environment.rb to manually load the file.</p>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=Expected%20x.rb%20to%20define%20X%20%28LoadError%29&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Fexpected-xrb-to-define-x-loaderror"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="Expected x.rb to define X (LoadError)";
		a2a_linkurl="http://icebergist.com/posts/expected-xrb-to-define-x-loaderror";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p><img src="http://feeds.feedburner.com/~r/icebergist/~4/sq0RGayvWLk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/expected-xrb-to-define-x-loaderror/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://icebergist.com/posts/expected-xrb-to-define-x-loaderror</feedburner:origLink></item>
		<item>
		<title>Simple password protected administration with CodeIgniter</title>
		<link>http://feedproxy.google.com/~r/icebergist/~3/_-PllekGEyY/simple-password-protected-administration-with-codeigniter</link>
		<comments>http://icebergist.com/posts/simple-password-protected-administration-with-codeigniter#comments</comments>
		<pubDate>Sun, 08 Mar 2009 17:38:08 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[erkanaauth]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[password protected]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=19</guid>
		<description><![CDATA[Last week I&#8217;ve taken a break from Ruby/Rails development and I&#8217;ve worked on a site that uses PHP with CodeIgniter framework.
Despite the fact that CodeIgniter has a very nice documentation I found it very difficult to find a way to do some simple things, that are more or less obvious, but which can be a [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I&#8217;ve taken a break from Ruby/Rails development and I&#8217;ve worked on a site that uses PHP with <a href="http://codeigniter.com/">CodeIgniter</a> framework.</p>
<p>Despite the fact that CodeIgniter has a very nice documentation I found it very difficult to find a way to do some simple things, that are more or less obvious, but which can be a problem for someone who hasn&#8217;t worked with CodeIgniter before. (for example, I found myself more than once looking at CI code to figure out how it works, so I can use it)</p>
<p>I had to make a simple password protected administration section. One admin user, one password, no user registrations, no roles &#8211; simple as possible. As I was using CI framework I decided to find a plugin/library that does this. Unfortunately most CI authorization plugins/libraries are very bloated and too complicated for this simple task. I tried to find some examples how to handle this simple use case, but nothing came up.</p>
<p>Finally I&#8217;ve found a small authorization plugin: <a href="http://codeigniter.com/wiki/Erkana/">Erkanaauth</a>.</p>
<p>First you need a user table (must be named &#8216;users&#8217;) which only needs to have an id field and all other fields are optional because you will manually specify what other columns will be used. I opted for simple id, username, password:</p>
<pre>CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL auto_increment,
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
);</pre>
<p>We will need to &#8220;install&#8221; ErkanaAuth library. You should <a href="http://codeigniter.com/wiki/File:erkanaauth.zip/">download it</a> and unzip it.</p>
<p>Next we should create an Admin controller which will handle all administration tasks (remember I&#8217;m making simple admin here, so I don&#8217;t need to protect multiple controllers).</p>
<pre>&lt;?php
class Admin extends Controller {
  function Admin()
  {
    parent::Controller();
    $this->load->database();
    $this->load->helper(array('url', 'form', 'date'));
    $this->load->library(array('form_validation', 'upload', 'Erkanaauth', 'session'));
  }
}
?&gt;</pre>
<p>Constructor just connects to database and loads some standard helpers and libraries (including Erkanaauth) that are usually used.</p>
<p>Next step is to add a function which we can call to verify if user is logged in:</p>
<pre>
  private
  function authorize()
  {
	  if($this->erkanaauth->try_session_login())
	      return true;

	  redirect('admin/login');
  }
</pre>
<p>Function uses Erkanaauth&#8217;s try_session_login which checks if user is already logged in (checks session for user id). If user isn&#8217;t logged in we&#8217;ll redirect him to our login page:</p>
<pre>
  function login()
  {
    $username = $this->input->post('username', true);
    $password = $this->input->post('password', true);
    if($username || $password)
    {
      if($this->erkanaauth->try_login(array('username' => $username, 'password' => $password)))
        redirect('admin');
    }

    $this->load->view('admin_login');
  }

  function logout()
  {
    $this->erkanaauth->logout();
    redirect('admin');
  }
</pre>
<p>Key command here is try_login in login function which tries to find an entry in users table that fulfills given conditions. If you have different users table than the one I made this is the place where you should enter your column names.</p>
<p>Logout function is has just a simple call to Erkana&#8217;s logout function. Nothing special there.</p>
<p>Of course we also need a login page template which should contain a simple user/pass form. It&#8217;s pretty basic and you can see it if you get the complete code (see at the end).</p>
<p>Finally we have everything needed to protect any page in Admin controller. In order to protect a page all you need to do is to add a call to authorize function to any function you want to protect. Like this:</p>
<pre>
  function index()
  {
    $this->authorize();
    echo "Do something useful... For now just display logout link: ";
    echo anchor('admin/logout', "Logout");
  }
</pre>
<p>That&#8217;s it. Now you have fully functional administration section which requires username and password authorization.</p>
<p>You can get the complete sample application from <a href="http://github.com/basti/ci-admin-section/tree/master">Github repository</a>. Feel free to expand on it or use it any way you like.</p>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=Simple%20password%20protected%20administration%20with%20CodeIgniter&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Fsimple-password-protected-administration-with-codeigniter"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="Simple password protected administration with CodeIgniter";
		a2a_linkurl="http://icebergist.com/posts/simple-password-protected-administration-with-codeigniter";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p><img src="http://feeds.feedburner.com/~r/icebergist/~4/_-PllekGEyY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/simple-password-protected-administration-with-codeigniter/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://icebergist.com/posts/simple-password-protected-administration-with-codeigniter</feedburner:origLink></item>
		<item>
		<title>Restoring superblock on Ubutnu</title>
		<link>http://feedproxy.google.com/~r/icebergist/~3/x0bpyaK6Ot4/restoring-superblock-on-ubutnu</link>
		<comments>http://icebergist.com/posts/restoring-superblock-on-ubutnu#comments</comments>
		<pubDate>Sun, 09 Nov 2008 10:13:43 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=16</guid>
		<description><![CDATA[Recently I had a problem on my Torrent box (an old PC that I use as dedicated torrent client) that runs Ubuntu. For some reason my root partition was being mounted as read-only. Everything else seemed to work (all other partitions were mounted properly), but I couldn&#8217;t change any of my config or do anything [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had a problem on my Torrent box (an old PC that I use as dedicated torrent client) that runs Ubuntu. For some reason my root partition was being mounted as read-only. Everything else seemed to work (all other partitions were mounted properly), but I couldn&#8217;t change any of my config or do anything on root partition.</p>
<p>I did the usual stuff:</p>
<ul>
<li>Run fsck checks and it said that everything is fine</li>
<li>Used Ubuntu&#8217;s live CD to boot, which got me read-write access to root partition. I changed some things in fstab, tried to get it to be rw permanently. No matter what I did as soon as I rebooted the root partition was once again read-only.</li>
<li>I tried booting from some repair disks I have, but all checks passed and no problem was detected. <img src='http://icebergist.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </li>
</ul>
<p>Finally, I read somewhere that a similar problem was caused by faulty superblock on hard drive. Fortunately Ubuntu stores superblock backups in different places around disk, so I decided to try to restore it from one of those backups.</p>
<p>It turned out that all I needed was a single command (this <a title="Bad superblock" href="http://ubuntuforums.org/showpost.php?s=72da065bbe1506b27f41a8cfc252c732&amp;p=1424786&amp;postcount=5">Ubuntu forum post helped</a>) to restore superblock:</p>
<p><code>e2fsck -b 32768 /dev/hdc1</code></p>
<p>After that my root partition was back to read-write mode. <img src='http://icebergist.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Before you do stuff like that to your computer I suggest that you read man pages for <a title="mke2fs" href="http://linux.die.net/man/8/mke2fs">mke2fs</a> and <a title="e2fsck" href="http://linux.die.net/man/8/e2fsck">e2fsck</a>. It will prevent you from doing something foolish like deleting your whole hard drive. <img src='http://icebergist.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=Restoring%20superblock%20on%20Ubutnu&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Frestoring-superblock-on-ubutnu"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="Restoring superblock on Ubutnu";
		a2a_linkurl="http://icebergist.com/posts/restoring-superblock-on-ubutnu";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p><img src="http://feeds.feedburner.com/~r/icebergist/~4/x0bpyaK6Ot4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/restoring-superblock-on-ubutnu/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://icebergist.com/posts/restoring-superblock-on-ubutnu</feedburner:origLink></item>
		<item>
		<title>RESTful admin namespaced controller using scaffolding</title>
		<link>http://feedproxy.google.com/~r/icebergist/~3/HgqEnAvQbCM/restful-admin-namespaced-controller-using-scaffolding</link>
		<comments>http://icebergist.com/posts/restful-admin-namespaced-controller-using-scaffolding#comments</comments>
		<pubDate>Wed, 17 Sep 2008 20:58:56 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[restful]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[scaffold]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=14</guid>
		<description><![CDATA[Most of my clients prefer to have a separate admin section. In turn, I like to have separate controllers for admin section and front-end in my Rails app. This is not as straightforward as it might seem, especially if you like to use scaffolding for admin controller.
The goal is to get 2 separate RESTful controllers, [...]]]></description>
			<content:encoded><![CDATA[<p>Most of my clients prefer to have a separate admin section. In turn, I like to have separate controllers for admin section and front-end in my Rails app. This is not as straightforward as it might seem, especially if you like to use scaffolding for admin controller.</p>
<p>The goal is to get 2 separate RESTful controllers, admin &amp; front-end controller, one model and for admin pages to have scaffolding.</p>
<p>Here is the easiest way I found so far to accomplish this. This example generates categories model and controllers for it.</p>
<p><code>./script/generate controller admin/categories<br />
./script/generate scaffold category name:string</code></p>
<p>This will generate an empty controller in admin namespace and a scaffolded resource for front-end controller.</p>
<p>Now we have everything generated we just need to make it work with admin controller and not with front-end.</p>
<ul>
<li>move all templates from app/views/categories to app/views/<strong>admin</strong>/categories</li>
<li>copy all functions from categories_controller.rb to admin/categories_controller.rb</li>
<li>add namespace for admin controller in routes.rb:<code>map.namespace :admin do |admin|<br />
admin.resources :categories<br />
end</code></li>
<li>in admin/categories_controller.rb replace in 3 places redirect_to calls to work with admin namespace. It will have something like redirect_to(@category), but to work with namespace it needs to have redirect_to([:admin, @category])</li>
<li>make similar changes in all templates, i.e. make it work within an admin namespace. You need to make following changes:
<ul>
<li>form_for(@category) =&gt; <strong>form_for([:admin, @category])</strong></li>
<li>&lt;%= link_to &#8216;Show&#8217;, @category %&gt; =&gt; <strong>&lt;%= link_to &#8216;Show&#8217;, [:admin, @category] %&gt;</strong></li>
<li>categories_path =&gt; <strong>admin_categories_path</strong></li>
<li>edit_category_path(@category) =&gt; <strong>edit_admin_category_path(@category)</strong></li>
<li>new_category_path =&gt; <strong>new_admin_category_path</strong></li>
</ul>
</li>
</ul>
<p>That&#8217;s it. Now you&#8217;ll have /admin/categories for all administrative tasks and you have a free controller for front-end actions.</p>
<p>You might wonder why not just generate scaffold for admin/categories&#8230; The reason is that you&#8217;ll also get a model that is namespaced in admin (i.e. model would be Admin::Category). Scaffolded views also wouldn&#8217;t work as it seems that generator doesn&#8217;t take into account the fact that you are using a namespace.</p>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=RESTful%20admin%20namespaced%20controller%20using%20scaffolding&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Frestful-admin-namespaced-controller-using-scaffolding"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="RESTful admin namespaced controller using scaffolding";
		a2a_linkurl="http://icebergist.com/posts/restful-admin-namespaced-controller-using-scaffolding";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p><img src="http://feeds.feedburner.com/~r/icebergist/~4/HgqEnAvQbCM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/restful-admin-namespaced-controller-using-scaffolding/feed</wfw:commentRss>
		<slash:comments>24</slash:comments>
		<feedburner:origLink>http://icebergist.com/posts/restful-admin-namespaced-controller-using-scaffolding</feedburner:origLink></item>
		<item>
		<title>Mosso hosting cloud</title>
		<link>http://feedproxy.google.com/~r/icebergist/~3/QwAVQFH6_jQ/mosso-hosting-cloud</link>
		<comments>http://icebergist.com/posts/mosso-hosting-cloud#comments</comments>
		<pubDate>Wed, 17 Sep 2008 10:44:33 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=13</guid>
		<description><![CDATA[Mosso&#8217;s hosting cloud at $100 / month seems like a good solution to get a scalable server. However one thing bugs me, actually two things&#8230;
First one: they offer FTP only access. Meaning you cannot deploy sites directly from code repositories (i.e. git or svn). That sucks.
Second thing that bugs me: for $100 you get quite [...]]]></description>
			<content:encoded><![CDATA[<p><a class="external" href="http://www.mosso.com/">Mosso&#8217;s hosting cloud</a> at $100 / month seems like a good solution to get a scalable server. However one thing bugs me, actually two things&#8230;</p>
<p>First one: they offer <strong>FTP only access</strong>. Meaning you cannot deploy sites directly from code repositories (i.e. git or svn). That sucks.</p>
<p>Second thing that bugs me: for $100 you get quite a lot of computing power which can be used to run multiple sites &#8211; but <strong>you are only allowed to have one Rails app running</strong>. Only one. If you want additional Rails apps (for example to have a test server) you need to pay an extra fee.</p>
<p>I know it&#8217;s cloud computing and that you have to be able to run it with any additional configuration (that&#8217;s why I think it&#8217;s ok that you have to freeze your gems in Rails apps, because you cannot install any gems yourself)&#8230; but not being able to checkout my code from repository and having to upload the whole app each time you make changes <strong>is really annoying</strong>.</p>
<p>In their defense, the support guy said that they are working on it, but he could give me an ETA when they&#8217;ll allow something like that.</p>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=Mosso%20hosting%20cloud&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Fmosso-hosting-cloud"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="Mosso hosting cloud";
		a2a_linkurl="http://icebergist.com/posts/mosso-hosting-cloud";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p><img src="http://feeds.feedburner.com/~r/icebergist/~4/QwAVQFH6_jQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/mosso-hosting-cloud/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://icebergist.com/posts/mosso-hosting-cloud</feedburner:origLink></item>
		<item>
		<title>InnoDB per-table tablespaces – split ibdata1 to smaller chunks</title>
		<link>http://feedproxy.google.com/~r/icebergist/~3/04pHx3d5LWo/innodb-per-table-tablespaces-split-ibdata1-to-smaller-chunks</link>
		<comments>http://icebergist.com/posts/innodb-per-table-tablespaces-split-ibdata1-to-smaller-chunks#comments</comments>
		<pubDate>Thu, 24 Jul 2008 21:01:16 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=12</guid>
		<description><![CDATA[Today I had to import 3GB of InnoDB tables in MySQL. Unfortunately, while importing the server run out of disk space &#8211; which caused whole server to grind to a halt. Naively I tried to delete imported data to free up space&#8230; I was in for an unpleasant surprise.
By default when MySQL uses InnoDB engine [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had to import 3GB of InnoDB tables in MySQL. Unfortunately, while importing the server run out of disk space &#8211; which caused whole server to grind to a halt. Naively I tried to delete imported data to free up space&#8230; I was in for an unpleasant surprise.</p>
<p>By default when MySQL uses InnoDB engine it stores most of the information in single file called ibdata1. One downside is that once ibdata1 file grows it cannot shrink &#8211; even if you delete all InnoDB tables. For some reason MySQL is set to use single file instead of per-table tablespaces similar to MyISAM.</p>
<p>Enabling per-table tablespaces is easy just add <a title="InnoDB Per-table tablespaces" href="http://dev.mysql.com/doc/refman/5.0/en/multiple-tablespaces.html">innodb_file_per_table</a> to my.cnf file. Problem is that <strong>all newly created tables</strong>, only new tables, will be in separate files. It seems that there&#8217;s no easy way to convert old tables and reclaim the space taken by ibdata1.</p>
<p>There are 3 ways and two are basically export-drop-delete-import type of solutions:</p>
<ol>
<li>Convert all InnoDB tables to MyISAM</li>
<li>Export only InnoDB tables, drop them, delete ibdata1 and import InnoDB tables.</li>
<li>Export all databases, delete ibdata1 and import everything back.</li>
</ol>
<p>I choose option 2 because I luckily had only 40 InnoDB tables and much more using MyISAM. For details on how to apply each solution and down/up sides of each read <a title="MySQL Reducing ibdata1" href="http://vdachev.net/blog/2007/02/22/mysql-reducing-ibdata1/en/">MySQL: Reducing ibdata1</a>.</p>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=InnoDB%20per-table%20tablespaces%20%E2%80%93%20split%20ibdata1%20to%20smaller%20chunks&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Finnodb-per-table-tablespaces-split-ibdata1-to-smaller-chunks"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="InnoDB per-table tablespaces – split ibdata1 to smaller chunks";
		a2a_linkurl="http://icebergist.com/posts/innodb-per-table-tablespaces-split-ibdata1-to-smaller-chunks";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p><img src="http://feeds.feedburner.com/~r/icebergist/~4/04pHx3d5LWo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/innodb-per-table-tablespaces-split-ibdata1-to-smaller-chunks/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://icebergist.com/posts/innodb-per-table-tablespaces-split-ibdata1-to-smaller-chunks</feedburner:origLink></item>
		<item>
		<title>This should be interesting weekly – week 28</title>
		<link>http://feedproxy.google.com/~r/icebergist/~3/uroZCAV7M0I/this-should-be-interesting-weekly-week-28</link>
		<comments>http://icebergist.com/posts/this-should-be-interesting-weekly-week-28#comments</comments>
		<pubDate>Sun, 13 Jul 2008 10:25:00 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[This should be interesting - weekly]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[weekly]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=10</guid>
		<description><![CDATA[
What&#8217;s New in Edge Rails: Easy Join Table Conditions.
Faces of Millions &#8211; Art project which aims to gather one million photos of people faces and create 10m x 10m photo mosaic.
Uni-Form is an attempt to standardize form markup (xhtml) and css.
Mac OS X full screen QuickLook shortcut.
A guide to CSS support in Email.

[condensed from 'this [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li>What&#8217;s New in Edge Rails: <a href="http://tumblelog.slobodankovacevic.com/post/41430445/whats-new-in-edge-rails-easy-join-table-conditions">Easy Join Table Conditions.</a></li>
<li><a href="http://tumblelog.slobodankovacevic.com/post/41483353/faces-of-millions">Faces of Millions</a> &#8211; Art project which aims to gather one million photos of people faces and create 10m x 10m photo mosaic.</li>
<li><a href="http://tumblelog.slobodankovacevic.com/post/41727168/uni-form">Uni-Form</a> is an attempt to standardize form markup (xhtml) and css.</li>
<li><a href="http://tumblelog.slobodankovacevic.com/post/41886839/mac-fullscreen-quicklook-a-k-a-slideshow">Mac OS X full screen QuickLook shortcut.</a></li>
<li>A guide to <a href="http://tumblelog.slobodankovacevic.com/post/41978415/a-guide-to-css-support-in-email">CSS support in Email</a>.</li>
</ul>
<p>[condensed from '<a href="http://tumblelog.slobodankovacevic.com/">this should be interesting</a>' tumblelog]</p>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=This%20should%20be%20interesting%20weekly%20%E2%80%93%20week%2028&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Fthis-should-be-interesting-weekly-week-28"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="This should be interesting weekly – week 28";
		a2a_linkurl="http://icebergist.com/posts/this-should-be-interesting-weekly-week-28";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p><img src="http://feeds.feedburner.com/~r/icebergist/~4/uroZCAV7M0I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/this-should-be-interesting-weekly-week-28/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://icebergist.com/posts/this-should-be-interesting-weekly-week-28</feedburner:origLink></item>
		<item>
		<title>Collection partial variable naming – new in edge rails</title>
		<link>http://feedproxy.google.com/~r/icebergist/~3/9UaiL2gAius/collection-partial-variable-naming</link>
		<comments>http://icebergist.com/posts/collection-partial-variable-naming#comments</comments>
		<pubDate>Mon, 07 Jul 2008 21:41:41 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[edge]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=9</guid>
		<description><![CDATA[One thing that always annoyed me when rendering collection partials is that a local var in partial is named same as a partial template name. So, to go around this I always created another local variable in partial and gave it a more meaningful name.
No longer&#8230; As the Ryan says from now on in the [...]]]></description>
			<content:encoded><![CDATA[<p>One thing that always annoyed me when rendering collection partials is that a local var in partial is named same as a partial template name. So, to go around this I always created another local variable in partial and gave it a more meaningful name.</p>
<p>No longer&#8230; As the <a title="What's New in Edge Rails: Collection Partial Variable Naming " href="http://ryandaigle.com/articles/2008/7/7/what-s-new-in-edge-rails-collection-partial-variable-naming">Ryan says</a> from now on in the Edge Rails you can specify the name of the local variable in which each collection element will be exposed within a partial. You will can do this:</p>
<pre>render :partial =&gt; 'employees', :collection =&gt; @workers, :as =&gt; :person</pre>
<p>It&#8217;s a simple thing, but it&#8217;s just one of the things that bugged me. I am glad it&#8217;s gone now.</p>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=Collection%20partial%20variable%20naming%20%E2%80%93%20new%20in%20edge%20rails&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Fcollection-partial-variable-naming"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="Collection partial variable naming – new in edge rails";
		a2a_linkurl="http://icebergist.com/posts/collection-partial-variable-naming";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p><img src="http://feeds.feedburner.com/~r/icebergist/~4/9UaiL2gAius" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/collection-partial-variable-naming/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://icebergist.com/posts/collection-partial-variable-naming</feedburner:origLink></item>
		<item>
		<title>This should be interesting weekly – week 27</title>
		<link>http://feedproxy.google.com/~r/icebergist/~3/hJCdGf4icjU/this-should-be-interesting-weekly-week-27</link>
		<comments>http://icebergist.com/posts/this-should-be-interesting-weekly-week-27#comments</comments>
		<pubDate>Sun, 06 Jul 2008 14:30:37 +0000</pubDate>
		<dc:creator>Slobodan Kovačević</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[This should be interesting - weekly]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[weekly]]></category>

		<guid isPermaLink="false">http://icebergist.com/?p=8</guid>
		<description><![CDATA[This is the first weekly condensed edition of my &#8220;This should be interesting&#8221; tumblelog. Every Sunday I will re-post most interesting posts here on the Icebergist.

Free Book: &#8220;Ruby on Rails 2.1 &#8211; What’s new&#8221;
Better Blockquotes &#8211; blockquotes CSS styling examples
Slife &#8211; free automatic time tracking for Mac
unfocus-history-keeper &#8211; back button enabling, deep linking, event driven [...]]]></description>
			<content:encoded><![CDATA[<p>This is the first weekly condensed edition of my <a title="Tumblelog by Slobodan Kovacevic" href="http://tumblelog.slobodankovacevic.com/">&#8220;This should be interesting&#8221; tumblelog</a>. Every Sunday I will re-post most interesting posts here on the Icebergist.</p>
<ul>
<li><a title="Free Book: &quot;Ruby on Rails 2.1 - What’s new&quot;" href="http://tumblelog.slobodankovacevic.com/post/40966961/new-free-book-ruby-on-rails-2-1-whats-new">Free Book: &#8220;Ruby on Rails 2.1 &#8211; What’s new&#8221;</a></li>
<li><a title="Better Blockquotes - Blockquotes examples" href="http://tumblelog.slobodankovacevic.com/post/40888615/better-blockquotes-blockquotes-examples">Better Blockquotes</a> &#8211; blockquotes CSS styling examples</li>
<li><a title="Slife - free automatic time tracking for Mac" href="http://tumblelog.slobodankovacevic.com/post/39785793/slife-free-automatic-time-tracking-for-mac">Slife</a> &#8211; free automatic time tracking for Mac</li>
<li><a title="unfocus-history-keeper" href="http://tumblelog.slobodankovacevic.com/post/39263529/unfocus-history-keeper-back-button-enabling-deep">unfocus-history-keeper</a> &#8211; back button enabling, deep linking, event driven Javascrpt/DHTML/Ajax Library (works for Flash too)</li>
</ul>
<p class="addtoany_share_save">
    <a name="a2a_dd" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/bookmark?sitename=Icebergist&amp;siteurl=http%3A%2F%2Ficebergist.com%2F&amp;linkname=This%20should%20be%20interesting%20weekly%20%E2%80%93%20week%2027&amp;linkurl=http%3A%2F%2Ficebergist.com%2Fposts%2Fthis-should-be-interesting-weekly-week-27"><img src="http://icebergist.com/wp-content/plugins/add-to-any/share_save_171_16.gif" width="171" height="16"  alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="This should be interesting weekly – week 27";
		a2a_linkurl="http://icebergist.com/posts/this-should-be-interesting-weekly-week-27";
				a2a_show_title=1;    </script>
    <script type="text/javascript" src="http://www.addtoany.com/menu/page.js"></script>

	</p><img src="http://feeds.feedburner.com/~r/icebergist/~4/hJCdGf4icjU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://icebergist.com/posts/this-should-be-interesting-weekly-week-27/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://icebergist.com/posts/this-should-be-interesting-weekly-week-27</feedburner:origLink></item>
	</channel>
</rss>
