<?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>Frane Bandov's Blog</title>
	<atom:link href="http://frane.offbyte.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://frane.offbyte.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 Sep 2009 21:56:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>My shiny new iPhone</title>
		<link>http://frane.offbyte.com/2009/05/18/my-shiny-new-iphone/</link>
		<comments>http://frane.offbyte.com/2009/05/18/my-shiny-new-iphone/#comments</comments>
		<pubDate>Mon, 18 May 2009 16:13:41 +0000</pubDate>
		<dc:creator>Frane</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://frane.offbyte.com/?p=167</guid>
		<description><![CDATA[Today my shiny new iPhone arrived. It&#8217;s really cool and I&#8217;m really happy to finally have it. For months now I wanted replace my old cell phone and with a new one.
The iPhone was my preferred choice, but I didn&#8217;t like T-Mobile&#8217;s cell phone plans for the iPhone and I was quite happy with my [...]]]></description>
			<content:encoded><![CDATA[<p>Today my shiny new iPhone arrived. It&#8217;s really cool and I&#8217;m really happy to finally have it. For months now I wanted replace my old cell phone and with a new one.<br />
The iPhone was my preferred choice, but I didn&#8217;t like T-Mobile&#8217;s cell phone plans for the iPhone and I was quite happy with my plan. I hat already started to look for other phones, when I got a phone call from T-Mobile. The nice lady on the phone explained that they wanted thank for being a loyal customer and that I could get a new phone if I renew my contract. When I asked if I could get an iPhone, the T-Mobile lady responded that I would have to pay a small fee but that could have it if I want.<br />
So I renewed my contract (I was going to do that anyway) and got my iPhone. It&#8217;s really funny how things sometimes sort themselves out all on their own.</p>
]]></content:encoded>
			<wfw:commentRss>http://frane.offbyte.com/2009/05/18/my-shiny-new-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails I18n and emails</title>
		<link>http://frane.offbyte.com/2009/04/07/rails-i18n-and-emails/</link>
		<comments>http://frane.offbyte.com/2009/04/07/rails-i18n-and-emails/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 14:57:11 +0000</pubDate>
		<dc:creator>Frane</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[I18n]]></category>
		<category><![CDATA[mail]]></category>

		<guid isPermaLink="false">http://frane.offbyte.com/?p=154</guid>
		<description><![CDATA[Since version 2.2, Ruby on Rails comes with an integrated support for internationalization (I18n) which makes developing multi-language websites very easy. Here&#8217;s how it works.
Recently I worked on a project where I used the I18n API to provide multi-language support. The website had a user system and the user was able to change the  [...]]]></description>
			<content:encoded><![CDATA[<p>Since version 2.2, Ruby on Rails comes with an integrated support for internationalization (I18n) which makes developing multi-language websites very easy. <a href="http://www.artweb-design.de/2008/7/18/the-ruby-on-rails-i18n-core-api">Here&#8217;s how it works.</a><br />
Recently I worked on a project where I used the I18n API to provide multi-language support. The website had a user system and the user was able to change the  web-site&#8217;s language in his/her profile. Basically, there was a model &#8220;User&#8221; with an attribute &#8220;language&#8221;, which was stored in the database. Every time when a user would log in on the website, the web-site&#8217;s language would change to the user&#8217;s preset language with:</p>
<div class="codecolorer-container ruby twitlight cc-smaller-font" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">I18n.<span style="color:#9900CC;">locale</span> = current_user.<span style="color:#9900CC;">language</span></div></div>
<p>However, there was a problem with the emails, which a user automatically received from the web-site. I used a cron-job with Rails&#8217; &#8220;script/runner&#8221; to periodically send mails from a model like this:</p>
<div class="codecolorer-container ruby twitlight cc-smaller-font" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">class</span> Task<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">send_mails</span><br />
&nbsp; &nbsp; User.<span style="color:#9900CC;">all</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#ff3333; font-weight:bold;">:conditions</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;want_mail = 1&quot;</span> <span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>user<span style="color:#006600; font-weight:bold;">|</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; UserMailer.<span style="color:#9900CC;">deliver_daily_mail</span><span style="color:#006600; font-weight:bold;">&#40;</span>user<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></div>
<p>The mail template was translated with the Rails I18n API like this:</p>
<div class="codecolorer-container rails twitlight cc-smaller-font" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="rails codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#006600; font-weight:bold;">&lt;%</span>= I18n.<span style="color:#9900CC;">t</span> <span style="color:#996600;">'daily_mail.hello'</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#0066ff; font-weight:bold;">@user</span>.<span style="color:#9900CC;">name</span> <span style="color:#006600; font-weight:bold;">%&gt;</span><br />
...</div></div>
<p>The problem was only that the mails were sent out in English because the web-sites default language (I18n.default_locale) was English and there was no &#8220;I18n.locale&#8221; set in &#8220;script/runner&#8221;.<br />
The easiest solution to that problem is to set the locale somewhere in your email setup:</p>
<div class="codecolorer-container ruby twitlight cc-smaller-font" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">class</span> UserMailer <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActionMailer::Base</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> daily_mail<span style="color:#006600; font-weight:bold;">&#40;</span>user<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; I18n.<span style="color:#9900CC;">locale</span> = user.<span style="color:#9900CC;">language</span><br />
&nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@recipients</span> &nbsp;= user.<span style="color:#9900CC;">email</span><br />
&nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@from</span> &nbsp; &nbsp; &nbsp; &nbsp;= <span style="color:#996600;">&quot;The Daily Mailer &lt;daily_mail@example.com&gt;&quot;</span><br />
&nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@subject</span> &nbsp; &nbsp; = I18n.<span style="color:#9900CC;">t</span> <span style="color:#996600;">'daily_mail.subject'</span><br />
&nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@sent_on</span> &nbsp; &nbsp; = <span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span><br />
&nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@body</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:user</span><span style="color:#006600; font-weight:bold;">&#93;</span> = user<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></div>
<p>Alternatively, it&#8217;s possible to set the language in the email template:</p>
<div class="codecolorer-container rails twitlight cc-smaller-font" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="rails codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#006600; font-weight:bold;">&lt;%</span>= I18n.<span style="color:#9900CC;">t</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'daily_mail.hello'</span>, <span style="color:#ff3333; font-weight:bold;">:locale</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@user</span>.<span style="color:#9900CC;">locale</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#0066ff; font-weight:bold;">@user</span>.<span style="color:#9900CC;">name</span> <span style="color:#006600; font-weight:bold;">%&gt;</span><br />
...</div></div>
<p>It&#8217;s more a logical then a technical problem, but it shows how (logically) complicated multi-language web-sites can be.</p>
]]></content:encoded>
			<wfw:commentRss>http://frane.offbyte.com/2009/04/07/rails-i18n-and-emails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows server lockout</title>
		<link>http://frane.offbyte.com/2009/03/11/windows-server-lockout/</link>
		<comments>http://frane.offbyte.com/2009/03/11/windows-server-lockout/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 01:44:52 +0000</pubDate>
		<dc:creator>Frane</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://frane.offbyte.com/?p=143</guid>
		<description><![CDATA[Since there are not only unix-based servers out there in the web, I sometimes also encounter Windows servers which I have to maintain.
Usually, you connect to a Windows server using Microsoft&#8217;s &#8220;Remote Desktop Connection&#8221; (RDC) client. If you&#8217;re not running a terminal server, the number of allowed sessions on the server is limited to two [...]]]></description>
			<content:encoded><![CDATA[<p>Since there are not only unix-based servers out there in the web, I sometimes also encounter Windows servers which I have to maintain.</p>
<p>Usually, you connect to a Windows server using Microsoft&#8217;s &#8220;Remote Desktop Connection&#8221; (RDC) client. If you&#8217;re not running a terminal server, the number of allowed sessions on the server is limited to two sessions at a time.</p>
<p>Unfortunately a session isn&#8217;t ended and closed if you close your RDC client window, but only if you log off, i.e. by clicking on &#8220;Start&#8221; -> &#8220;Log Off&#8221;. So if you just close your RDC window without to log yourself really off, there&#8217;s a good chance that you lock yourself out from the server and thus get the following message &#8220;Terminal Server Has Exceeded the Maximum Number of Allowed Connections&#8221;.</p>
<p>If you have access to your server, you can easily log on to the server on-site and remove all &#8220;dead&#8221; sessions, but if your server is somewhere on this planet where you can&#8217;t just go over to, you should be served by using the following command:</p>
<div class="codecolorer-container text twitlight cc-smaller-font" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C:\&gt;mstsc -v:your_server_name_or_ip -admin</div></div>
<p>This command gives you access to a special session, namely the session 0 and you should be able to log in as &#8220;Administrator&#8221; and remove the dead sessions.</p>
<p>This two sessions at a time restriction is really annoying and it gets even more annoying if other people also use the server and don&#8217;t log off correctly. Having such stupid problems is probably one reason why many people get mad a Microsoft and their products. It&#8217;s simply a licensing issue you don&#8217;t have on Linux and *BSD systems <img src='http://frane.offbyte.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://frane.offbyte.com/2009/03/11/windows-server-lockout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing Eject Volume</title>
		<link>http://frane.offbyte.com/2009/02/21/introducing-eject-volume/</link>
		<comments>http://frane.offbyte.com/2009/02/21/introducing-eject-volume/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 16:05:50 +0000</pubDate>
		<dc:creator>Frane</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Dashboard]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[Eject Volume]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://frane.offbyte.com/?p=138</guid>
		<description><![CDATA[I&#8217;ve written my first MacOS X Dashboard widget today. It&#8217;s called Eject Volume and provides a handy way to eject volumes which are mounted on your system.
More information about the widget and a download option is provided here.

]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written my first MacOS X Dashboard widget today. It&#8217;s called Eject Volume and provides a handy way to eject volumes which are mounted on your system.<br />
More information about the widget and a download option is provided <a href="http://frane.offbyte.com/eject-volume/">here</a>.</p>
<p><img src="http://frane.offbyte.com/wp-content/uploads/2009/02/screenshot.png" alt="Eject Volume Screenshot" title="Eject Volume Screenshot" width="202" height="227" class="alignleft size-full wp-image-75" /></p>
]]></content:encoded>
			<wfw:commentRss>http://frane.offbyte.com/2009/02/21/introducing-eject-volume/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading Debian Etch to Lenny</title>
		<link>http://frane.offbyte.com/2009/02/19/upgrading-debian-etch-to-lenny/</link>
		<comments>http://frane.offbyte.com/2009/02/19/upgrading-debian-etch-to-lenny/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 20:49:11 +0000</pubDate>
		<dc:creator>Frane</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Etch]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://frane.offbyte.com/?p=63</guid>
		<description><![CDATA[On last Saturday Debian 5.0 &#8220;Lenny&#8221; has been released as stable. This probably means a lot of updating work for many administrators. I was updating a couple of servers during the last days. Due to Debian&#8217;s APT system it&#8217;s a pretty easy process.
Step 1:
Edit your /etc/apt/sources.list. Replace every occurrence of &#8220;etch&#8221; (I assume you&#8217;re updating [...]]]></description>
			<content:encoded><![CDATA[<p>On last Saturday <a href="http://www.debian.org">Debian</a> 5.0 &#8220;<a href="http://debian.org/News/2009/20090214">Lenny</a>&#8221; has been released as stable. This probably means a lot of updating work for many administrators. I was updating a couple of servers during the last days. Due to Debian&#8217;s APT system it&#8217;s a pretty easy process.</p>
<p><strong>Step 1:</strong><br />
Edit your <em>/etc/apt/sources.list</em>. Replace every occurrence of &#8220;etch&#8221; (I assume you&#8217;re updating from Debian &#8220;Etch&#8221;) with &#8220;lenny&#8221;. Your sources.list should now be looking roughly like that:</p>
<div class="codecolorer-container text twitlight cc-smaller-font" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">deb http://ftp.de.debian.org/debian/ stable main<br />
deb-src http://ftp.de.debian.org/debian/ stable main<br />
<br />
deb http://security.debian.org/ stable/updates main contrib<br />
deb-src http://security.debian.org/ stable/updates main contrib</div></div>
<p><strong>Step 2:</strong><br />
Simply run <em>apt-get update</em>and you should probably get something like this:</p>
<div class="codecolorer-container text twitlight cc-smaller-font" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">srv:~# apt-get update<br />
Get:1 http://ftp.de.debian.org stable Release.gpg [386B]<br />
Hit http://ftp.de.debian.org stable Release &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
Get:2 http://security.debian.org stable/updates Release.gpg [189B]<br />
Hit http://security.debian.org stable/updates Release<br />
...<br />
Hit http://security.debian.org stable/updates/main Sources<br />
Hit http://security.debian.org stable/updates/contrib Sources<br />
Fetched 2B in 0s (15B/s)<br />
Reading package lists... Done<br />
W: There is no public key available for the following key IDs:<br />
4D270D06F42584E6<br />
W: You may want to run apt-get update to correct these problems</div></div>
<p>Apparently, this means you need to get the public key for 4D270D06F42584E6. <img src='http://frane.offbyte.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />   This can easily be done with the following commands.</p>
<div class="codecolorer-container text twitlight cc-smaller-font" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">srv:~# gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 4D270D06F42584E6<br />
gpg: directory `/root/.gnupg' created<br />
gpg: can't open `/gnupg/options.skel': No such file or directory<br />
gpg: keyring `/root/.gnupg/secring.gpg' created<br />
gpg: keyring `/root/.gnupg/pubring.gpg' created<br />
gpg: requesting key F42584E6 from hkp server wwwkeys.eu.pgp.net<br />
gpg: /root/.gnupg/trustdb.gpg: trustdb created<br />
gpg: key F42584E6: public key &quot;Lenny Stable Release Key &lt;debian-release@lists.debian.org&gt;&quot; imported<br />
gpg: no ultimately trusted keys found<br />
gpg: Total number processed: 1<br />
gpg: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; imported: 1<br />
srv:~# apt-key add /root/.gnupg/pubring.gpg <br />
OK</div></div>
<p><em>Please note that the key ID and though the public key needed on your system can differ from this one.</em></p>
<p><strong>Step 3</strong><br />
Finally, you can rerun the package-list update and run the actual upgrade.</p>
<div class="codecolorer-container text twitlight cc-smaller-font" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">srv:~# apt-get update<br />
srv:~# apt-get dist-upgrade</div></div>
<p>Depending on your machine&#8217;s capacity and your internet connection speed the upgrade can take from about 15 minutes to some hours. The avarege time my updates took was 30 minutes. After that you can reboot your freshly upgraded system with the new kernel and you&#8217;re done.</p>
]]></content:encoded>
			<wfw:commentRss>http://frane.offbyte.com/2009/02/19/upgrading-debian-etch-to-lenny/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Basic Authentication problems with Phusion Passanger (mod_rails)</title>
		<link>http://frane.offbyte.com/2009/01/30/basic-authentication-problems-with-phusion-passanger-mod_rails/</link>
		<comments>http://frane.offbyte.com/2009/01/30/basic-authentication-problems-with-phusion-passanger-mod_rails/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 18:39:01 +0000</pubDate>
		<dc:creator>Frane</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[mod_rails]]></category>
		<category><![CDATA[Phusion Passenger]]></category>

		<guid isPermaLink="false">http://frane.offbyte.com/?p=55</guid>
		<description><![CDATA[Phusion Passenger aka. &#8220;mod_rails&#8221; is great! It makes Rails deployment pretty easy and time-saving.
Unfortunately it has a bug in it&#8217;s current 2.0.6 version which breaks Basic Authentication. Though this bug is fixed in the unreleased 2.1 version (see here) you need to care about the problem by yourself for now.
The only working solution for me [...]]]></description>
			<content:encoded><![CDATA[<p>Phusion Passenger aka. &#8220;mod_rails&#8221; is great! It makes Rails deployment pretty easy and time-saving.<br />
Unfortunately it has a bug in it&#8217;s current 2.0.6 version which breaks Basic Authentication. Though this bug is fixed in the unreleased 2.1 version (<a href="http://code.google.com/p/phusion-passenger/issues/detail?id=94">see here</a>) you need to care about the problem by yourself for now.<br />
The only working solution for me was to user Rails&#8217; Basic Authentication functionality by hacking the following into my application controller:</p>
<div class="codecolorer-container rails twitlight cc-smaller-font" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="rails codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">class</span> ApplicationController <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#CC00FF; font-weight:bold;"><span style="color:#6666ff; font-weight:bold;">ActionController::Base</span></span><br />
<br />
&nbsp; <span style="color:#5A0A0A; font-weight:bold;">before_filter</span> <span style="color:#ff3333; font-weight:bold;">:http_auth</span> &nbsp;<br />
&nbsp; <br />
&nbsp; ...<br />
<br />
&nbsp; <span style="color:#9900CC;">private</span> <br />
&nbsp; <br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> http_auth<br />
&nbsp; &nbsp; authenticate_or_request_with_http_basic <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>user_name, password<span style="color:#006600; font-weight:bold;">|</span><br />
&nbsp; &nbsp; &nbsp; user_name == <span style="color:#996600;">&quot;JohnDoe&quot;</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> password == <span style="color:#996600;">&quot;secret123&quot;</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></div>
<p>At this point you can be as creative as you want with reading the user name and password form a file or database and checking hashed passwords instead of plain text.<br />
For my purposes this was just enough, so I didn&#8217;t waste any more time on it.<br />
At the end of this post be warned: Basic Authentication through Rails does only protect your application, but it does <em>not</em> protect the static content in your public directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://frane.offbyte.com/2009/01/30/basic-authentication-problems-with-phusion-passanger-mod_rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Archiving Thunderbird e-mails</title>
		<link>http://frane.offbyte.com/2009/01/02/archiving-thunderbird-e-mails/</link>
		<comments>http://frane.offbyte.com/2009/01/02/archiving-thunderbird-e-mails/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 13:24:10 +0000</pubDate>
		<dc:creator>Frane</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[e-mail]]></category>
		<category><![CDATA[erchive]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://frane.offbyte.com/?p=45</guid>
		<description><![CDATA[Looking for a smart way to archive your e-mails from Thunderbird?
There are many advices like copy your &#8220;/home/(username)/.mozilla/&#8230;&#8221; directory, which (in my opinion) are not very smart.
After googling quite a while, I found a very cool TB extension called SmartSave and it lives up to its name!
It needed less than ten seconds to export 1900 [...]]]></description>
			<content:encoded><![CDATA[<p>Looking for a smart way to archive your e-mails from <a href="http://www.getthunderbird.com">Thunderbird</a>?<br />
There are many advices like copy your &#8220;/home/(username)/.mozilla/&#8230;&#8221; directory, which (in my opinion) are not very smart.<br />
After googling quite a while, I found a very cool TB extension called <a href="https://addons.mozilla.org/de/thunderbird/addon/2887">SmartSave</a> and it lives up to its name!<br />
It needed less than ten seconds to export 1900 mails with a total size of 150 MB.<br />
I like it!</p>
]]></content:encoded>
			<wfw:commentRss>http://frane.offbyte.com/2009/01/02/archiving-thunderbird-e-mails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What your customers shouldn&#8217;t see&#8230;</title>
		<link>http://frane.offbyte.com/2008/12/29/what-your-customers-shouldnt-see/</link>
		<comments>http://frane.offbyte.com/2008/12/29/what-your-customers-shouldnt-see/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 15:37:23 +0000</pubDate>
		<dc:creator>Frane</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[customer]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[mail]]></category>

		<guid isPermaLink="false">http://frane.offbyte.com/?p=19</guid>
		<description><![CDATA[If you&#8217;re running mailing lists for your customers you should invest a fair amount of time in configuring your mail server and lists properly. Above all your should test your configuration intensively to make sure that your server and customer data is secure and that your customers don&#8217;t experience unwanted effects.
Like this&#8230;

]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re running mailing lists for your customers you should invest a fair amount of time in configuring your mail server and lists properly. Above all your should test your configuration intensively to make sure that your server and customer data is secure and that your customers don&#8217;t experience unwanted effects.<br />
Like this&#8230;</p>
<p><a href="http://frane.offbyte.com/wp-content/uploads/2008/12/gravis-error-mail.png" rel="lightbox[19]"><img src="http://frane.offbyte.com/wp-content/uploads/2008/12/gravis-error-mail-300x287.png" alt="Gravis error mail" title="Gravis error mail" width="300" height="287" class="size-medium wp-image-12" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://frane.offbyte.com/2008/12/29/what-your-customers-shouldnt-see/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>After three months of KDE 4</title>
		<link>http://frane.offbyte.com/2008/10/15/after-three-months-of-kde-4/</link>
		<comments>http://frane.offbyte.com/2008/10/15/after-three-months-of-kde-4/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 15:32:14 +0000</pubDate>
		<dc:creator>Frane</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://frane.offbyte.com/?p=39</guid>
		<description><![CDATA[I&#8217;m quite happy with the new KDE release. It&#8217;s well structured, the applications are redisigned and simplified and the unsability has done a big step up the ladder.
BUT I still miss some basic functions from the old 3.5 version, some applications crash unexpectedly and the probably most annoying thing for me: the lack real desktop [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m quite happy with the new KDE release. It&#8217;s well structured, the applications are redisigned and simplified and the unsability has done a big step up the ladder.<br />
BUT I still miss some basic functions from the old 3.5 version, some applications crash unexpectedly and the probably most annoying thing for me: the lack real desktop icons. The &#8220;Folder View&#8221; desklet which is intended to replace teh classical desktop icons is not a really good replacement.<br />
I&#8217;m looking forward to the next major release of KDE, namely 4.2, which is announced for January 2009. I will bring a lot of new and old features back to KDE. Most notably it will bring back the good old desktop icons!</p>
]]></content:encoded>
			<wfw:commentRss>http://frane.offbyte.com/2008/10/15/after-three-months-of-kde-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back from vacation</title>
		<link>http://frane.offbyte.com/2008/09/01/back-from-vacation/</link>
		<comments>http://frane.offbyte.com/2008/09/01/back-from-vacation/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 12:59:03 +0000</pubDate>
		<dc:creator>Frane</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Croatia]]></category>
		<category><![CDATA[vacation]]></category>

		<guid isPermaLink="false">http://frane.offbyte.com/?p=42</guid>
		<description><![CDATA[I&#8217;ve been the last five weeks in Croatia on vacation. I had great time there as every year and I&#8217;m looking forward to my next vacation there in the next summer.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been the last five weeks in <a href="http://croatia.hr/English/Home/Naslovna.aspx">Croatia</a> on vacation. I had great time there as every year and I&#8217;m looking forward to my next vacation there in the next summer.</p>
]]></content:encoded>
			<wfw:commentRss>http://frane.offbyte.com/2008/09/01/back-from-vacation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
