<?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>Zein&#039;s place on the net &#187; Linux</title>
	<atom:link href="http://ahmed.elze.in/blog/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://ahmed.elze.in/blog</link>
	<description>my views on Australia, Egypt, Linux and other stuff</description>
	<lastBuildDate>Tue, 19 Apr 2011 04:40:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Virgin Mobile Broadband with Ubuntu</title>
		<link>http://ahmed.elze.in/blog/2009/12/27/virgin-mobile-broadband-with-ubuntu/</link>
		<comments>http://ahmed.elze.in/blog/2009/12/27/virgin-mobile-broadband-with-ubuntu/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 07:33:43 +0000</pubDate>
		<dc:creator>Ahmed</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.azein.com/blog/?p=185</guid>
		<description><![CDATA[I have being meaning to get myself a mobile broadband USB modem for casual use. It makes sense if you do not want to shell out $15-$20 for wifi an hour. Whenever I take my family for a holiday on the cost, or find myself waiting at an airport I can just get online. The [...]]]></description>
			<content:encoded><![CDATA[<p>I have being meaning to get myself a mobile broadband USB modem for casual use. It makes sense if you do not want to shell out $15-$20 for wifi an hour. Whenever I take my family for a holiday on the cost, or find myself waiting at an airport I can just get online. The only catch is that you either shell out $150 for 1 year and 10GB of data. or you plan ahead and use $15 to get 500MB valid for 30 days prior to your vacation.</p>
<p>After much deliberation and googling, I decided to go with the Optus network as it has reasonable coverage and has many resellers. I found Virgin Mobile offering their Huawei E1762 modem for $89. This is a 7.2MB modem. It has a microSD slot that supports up to 8GB cards and it even has an external antenna connection.</p>
<p>It works fine in ubuntu 9.10 (that&#8217;s all I have tested). But I first had to activate my account via a windows machine. I don&#8217;t believe that windows based activation is a necessary step except that I needed a working connection to get the correct setting to configure the ubuntu netbook.</p>
<p>I started off with the default setting offered by network-manager. I then edited the connection and changed the APN to: virginbroadband (was VirginInternet) and disabled all the authentication mechanisms except PAP.</p>
<p>And there you go&#8230; it works&#8230; I am using it to type this <img src='http://ahmed.elze.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ahmed.elze.in/blog/2009/12/27/virgin-mobile-broadband-with-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 9.10 is great</title>
		<link>http://ahmed.elze.in/blog/2009/12/17/ubuntu-9-10-is-great/</link>
		<comments>http://ahmed.elze.in/blog/2009/12/17/ubuntu-9-10-is-great/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 04:02:29 +0000</pubDate>
		<dc:creator>Ahmed</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.azein.com/blog/?p=181</guid>
		<description><![CDATA[I just updated 3 machines to ubuntu 9.10. My Desktop, my netbook and my mythtv machine. All of them were updated flawlessly except my notebook where the grub2 configuration was not updated&#8230; Chaos followed until I figured out that the kernel being booted was messed up and subsequently figured out that I needed to fixup [...]]]></description>
			<content:encoded><![CDATA[<p>I just updated 3 machines to ubuntu 9.10. My Desktop, my netbook and my mythtv machine. All of them were updated flawlessly except my notebook where the grub2 configuration was not updated&#8230; Chaos followed until I figured out that the kernel being booted was messed up and subsequently figured out that I needed to fixup the grub2 config file.</p>
<p>Since grub2 is not a standard ubuntu installation (this was done by Dell) I don&#8217;t blame them. In all I find ubuntu 9.10 to be pleasant and in particular I am very happy with 3 things:</p>
<li> pulseaudio is much better integrated with the sound controls.
<li> mythtv 0.22 rocks. The clutter interface is much better.
<li> flash works much better using a lot less resources. Now I can actually watch ABC ivew on my netbook.
<p>Good on you ubuntu team on a job well done.</p>
]]></content:encoded>
			<wfw:commentRss>http://ahmed.elze.in/blog/2009/12/17/ubuntu-9-10-is-great/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wistrons Pursebook with Arabic Keyboard. Cool.</title>
		<link>http://ahmed.elze.in/blog/2009/04/04/wistrons-pursebook-with-arabic-keyboard-cool/</link>
		<comments>http://ahmed.elze.in/blog/2009/04/04/wistrons-pursebook-with-arabic-keyboard-cool/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 08:46:15 +0000</pubDate>
		<dc:creator>Ahmed</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Me]]></category>
		<category><![CDATA[small laptops]]></category>

		<guid isPermaLink="false">http://www.azein.com/blog/?p=157</guid>
		<description><![CDATA[I was looking at the new Pursebook at engadget [link] and I noticed that the keyboard had Arabic characters. Kind of exciting I as I am planing to get myself one of these new ARM netbooks when they come out later this year. Having an Arabic enabled keyboad would be a big plus.]]></description>
			<content:encoded><![CDATA[<p>I was looking at the new Pursebook at engadget [<a href="http://www.engadget.com/2009/04/03/wistrons-snapdragon-powered-pursebook-gets-demoed/">link</a>] and I noticed that the keyboard had Arabic characters. Kind of exciting I as I am planing to get myself one of these new ARM netbooks when they come out later this year. Having an Arabic enabled keyboad would be a big plus.</p>
]]></content:encoded>
			<wfw:commentRss>http://ahmed.elze.in/blog/2009/04/04/wistrons-pursebook-with-arabic-keyboard-cool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Book Collection Managment for Linux</title>
		<link>http://ahmed.elze.in/blog/2008/09/26/book-collection-managment-for-linux/</link>
		<comments>http://ahmed.elze.in/blog/2008/09/26/book-collection-managment-for-linux/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 07:56:43 +0000</pubDate>
		<dc:creator>Ahmed</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mybooklist]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.azein.com/blog/?p=133</guid>
		<description><![CDATA[Once upon a time, the options available to Linux users interested in managing their book collections were limited. The situation was so bleak that I attempted to create my own web-based application. That app was fine until I tried to host it on my 64MB VPS and failed (RoR had a footprint of 60MB all [...]]]></description>
			<content:encoded><![CDATA[<p>Once upon a time, the options available to Linux users interested in managing their book collections were limited. The situation was so bleak that I attempted to create <a href="http://mybooklist.sourceforge.net/">my own web-based application</a>. That app was fine until I tried to host it on my <a href="http://www.azein.com/blog/2007/10/06/stretching-64mb-as-much-as-you-can/">64MB VPS</a> and failed (RoR had a footprint of 60MB all by itself)! </p>
<p>Lately, I have been missing the ability to browse through my books. I started thinking about having another attempt at a book collection manger. Maybe this time I would try and write a desktop application. I could use python or even try out mono. So today I did a bit of googling and stumbled upon <a href="http://alexandria.rubyforge.org/">Alexandria</a>, a book collection manager for GNOME.</p>
<p>This application is brilliant! It is almost the perfect application. All I needed to do was get a list of books in my old app:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;select isbn from books;&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> sqlite3 mybooklist_production.sqlite <span style="color: #000000; font-weight: bold;">&gt;</span> import-list.txt</pre></div></div>

<p>I was then able to import all my old books into Alexandria using the import ISBN list feature. I would like to recommend this app to anyone who is looking for a book collection manger for Linux. The site also has deb packages for those who use Debian or Ubuntu.</p>
]]></content:encoded>
			<wfw:commentRss>http://ahmed.elze.in/blog/2008/09/26/book-collection-managment-for-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dell Mini 9: Good Netbook but Pricing All Wrong</title>
		<link>http://ahmed.elze.in/blog/2008/09/06/dell-mini-9-good-netbook-but-pricing-all-wrong/</link>
		<comments>http://ahmed.elze.in/blog/2008/09/06/dell-mini-9-good-netbook-but-pricing-all-wrong/#comments</comments>
		<pubDate>Sat, 06 Sep 2008 01:03:14 +0000</pubDate>
		<dc:creator>Ahmed</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Me]]></category>
		<category><![CDATA[small laptops]]></category>

		<guid isPermaLink="false">http://www.azein.com/blog/2008/09/06/dell-mini-9-good-netbook-but-pricing-all-wrong/</guid>
		<description><![CDATA[I have not found a netbook that I feel 100% comfortable with. All the products out there have either too much or too little. The EEEPC901 comes the closest but is a bit too expensive for my taste (I would guess it is all the extra SSD). Zein&#8217;s perfect netbook: o Linux based (No Windows [...]]]></description>
			<content:encoded><![CDATA[<p>I have not found a netbook that I feel 100% comfortable with. All the products out there have either too much or too little. The EEEPC901 comes the closest but is a bit too expensive for my taste (I would guess it is all the extra SSD).</p>
<h4>Zein&#8217;s perfect netbook:</h4>
<p>o Linux based (No Windows tax for me!)<br />
o 9&#8243; or 10&#8243; screen.<br />
o Atom 1.6Ghz<br />
o 1GB RAM<br />
o Large track pad (the Acer for example is too small)<br />
o 4GB (at least and 8GB at most) of storage.<br />
o 4 hours (at least) battery life.<br />
o 1.3 MP Webcam<br />
o Wifi<br />
o bluetooth (optional)</p>
<p>And so I got very excited when I saw that the Dell Mini 9 had been released. The Dell is a lot more customizable at purchase time them the EEEPC, Aspire One or the MSI Wind and therefore a lot cheaper since you only  pay for what you want. I got a surprise when I discovered that the Linux and Windows XP versions are identical in price!!</p>
<p>Here are screen shots of the 2 systems after configuration. Both are $US 454 (after $40 instant savings on the XP version) and while that is a lot less then an EEEPC 901. I am baffled to as why I am not saving by not paying any windows tax! I would have expected the Linux version to be at least $US 50 less than the windows version. </p>
<p><a href='http://www.azein.com/blog/wp-content/uploads/2008/09/dell-mini-linux.png' title='dell-mini-linux.png'>The Linux version</a><br />
<a href='http://www.azein.com/blog/wp-content/uploads/2008/09/dell-mini-xp.png' title='dell-mini-xp.png'>The XP version</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ahmed.elze.in/blog/2008/09/06/dell-mini-9-good-netbook-but-pricing-all-wrong/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The year of the low cost Linux machines</title>
		<link>http://ahmed.elze.in/blog/2008/01/17/the-year-of-the-low-cost-linux-machines/</link>
		<comments>http://ahmed.elze.in/blog/2008/01/17/the-year-of-the-low-cost-linux-machines/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 21:51:03 +0000</pubDate>
		<dc:creator>Ahmed</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[small laptops]]></category>

		<guid isPermaLink="false">http://www.azein.com/blog/2008/01/17/the-year-of-the-low-cost-linux-machines/</guid>
		<description><![CDATA[Is this a poor geeks dream or what? It is like I have been dreaming for a small low cost laptop for years and then all at once every one wants in on this market. Acer is looking to enter the low cost laptop market with 8&#8243; &#8211; 9&#8243; designs. Gigabyte also announced that it [...]]]></description>
			<content:encoded><![CDATA[<p>Is this a poor geeks dream or what? It is like I have been dreaming for a small low cost laptop for years and then all at once every one wants in on this market.</p>
<p>Acer is looking to <a href="http://www.engadget.com/2008/01/16/eee-pc-killer-coming-from-acer/">enter the low cost laptop market</a> with 8&#8243; &#8211; 9&#8243; designs. <a href="http://www.engadget.com/2008/01/17/gigabyte-announces-plans-to-launch-low-cost-computer-in-june/">Gigabyte also announced</a> that it will produce what seams to be a low cost laptop due in June. Linux is not mentioned in either case but given the success of the other low cost machines with Linux I would say it is reasonable to assume that there would be a Linux version of both laptops.</p>
<p>In other news, Everex plans to <a href="http://www.engadget.com/2008/01/17/everex-to-stun-the-world-with-9-inch-cloudbook-devbook-mini-de/">expand their cloudbook line</a> with some nifty ideas.</p>
]]></content:encoded>
			<wfw:commentRss>http://ahmed.elze.in/blog/2008/01/17/the-year-of-the-low-cost-linux-machines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Even more low cost Linux PCs</title>
		<link>http://ahmed.elze.in/blog/2008/01/11/even-more-low-cost-linux-pcs/</link>
		<comments>http://ahmed.elze.in/blog/2008/01/11/even-more-low-cost-linux-pcs/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 01:12:28 +0000</pubDate>
		<dc:creator>Ahmed</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.azein.com/blog/2008/01/11/even-more-low-cost-linux-pcs/</guid>
		<description><![CDATA[If the cool (and cheap) Linux laptops were not enough, Shuttle is going to produce $200 Linux PCs. Sure the specs are not so good, but that looks like a good mythtv frontend to me. Or maybe a NAS that doesn&#8217;t have to live in the closet?]]></description>
			<content:encoded><![CDATA[<p>If the cool (and cheap) <a href="http://www.azein.com/blog/2008/01/10/the-perfect-laptop/">Linux laptops</a> were not enough, Shuttle is going to produce <a href="http://www.news.com/8301-10784_3-9847365-7.html?tag=nefd.only">$200 Linux PCs</a>. Sure the specs are not so good, but that looks like a good <a href="http://www.mythtv.org/">mythtv</a> frontend to me. Or maybe a NAS that doesn&#8217;t have to live in the closet?</p>
<p><img src='http://www.azein.com/blog/wp-content/uploads/2008/01/shuttlekpcblue_270x202.JPG' alt='Smiley $200 Linux PC' /><br />
<img src='http://www.azein.com/blog/wp-content/uploads/2008/01/shuttlekpcred_270x202.JPG' alt='Flower $200 Linux PC' /></p>
]]></content:encoded>
			<wfw:commentRss>http://ahmed.elze.in/blog/2008/01/11/even-more-low-cost-linux-pcs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The perfect Laptop</title>
		<link>http://ahmed.elze.in/blog/2008/01/10/the-perfect-laptop/</link>
		<comments>http://ahmed.elze.in/blog/2008/01/10/the-perfect-laptop/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 02:18:21 +0000</pubDate>
		<dc:creator>Ahmed</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Me]]></category>

		<guid isPermaLink="false">http://www.azein.com/blog/2008/01/10/the-perfect-laptop/</guid>
		<description><![CDATA[Different people like different things. Different people fantasize about buying different things. I fantasize about gadgets. My latest fantasies have been about the ASUS EeePC. The 4G model sells for $399, has a 7&#8243; 800&#215;640 screen, runs Linux and looks beautiful. This is the sort of laptop that I have always dreamed of having yet [...]]]></description>
			<content:encoded><![CDATA[<p>Different people like different things. Different people fantasize about buying different things. I fantasize about gadgets. My latest fantasies have been about the <a href="http://en.wikipedia.org/wiki/ASUS_Eee_PC">ASUS EeePC.</a> The 4G model sells for $399, has a 7&#8243; 800&#215;640 screen, runs Linux and looks beautiful.<br />
<a href='http://www.azein.com/blog/wp-content/uploads/2008/01/230px-asus_eee_white_alt.jpg' title='EeePC'><img src='http://www.azein.com/blog/wp-content/uploads/2008/01/230px-asus_eee_white_alt.jpg' alt='EeePC' /></a><br />
This is the sort of laptop that I have always dreamed  of having yet could never afford. The only thing that is not perfect is the relatively low 800&#215;640 resolution. At <a href="http://en.wikipedia.org/wiki/Consumer_Electronics_Show">CES</a> this year, ASUS have announced 8&#8243; and 8.9&#8243; versions of the EeePC. The 7&#8243; and 8&#8243; EeePCs are the <a href="http://jkkmobile.blogspot.com/2008/01/asus-eee-pc-with-8-inch-screen.html">same size and the screens have the same 800&#215;640 resolution</a>. I am hoping that the 8.9&#8243; EeePC has a 1024&#215;600 resolution. Interestingly ASUS EeePcs have been seen running <a href="http://www.engadget.com/2008/01/09/asus-eeepc-spotted-running-splashtop-instant-on-os/">splashtop</a> (an instant on Linux based OS). Could things get crazier ? </p>
<p>Also of interest is the Everex cloudbook (also $399) based on the <a href="http://www.via.com.tw/en/initiatives/spearhead/nanobook/">VIA nanobook</a> design.  It has been <a href="http://gizmodo.com/342808/everex-cloudbook-coming-to-walmartcom">announced</a> to start selling on the 25th of this month. The cloud book as a longer battery life and a 30GB HDD (vs the 4GB SSD on the EeePC). If after looking at the pictures, you are wondering where the touch pad is then take a look at <a href="http://jkkmobile.blogspot.com/2007/11/easynote-xs-video-review.html">this video</a><br />
<a href='http://www.azein.com/blog/wp-content/uploads/2008/01/everex_cloudbook_ce1200v.jpg' title='Cloudbook'><img src='http://www.azein.com/blog/wp-content/uploads/2008/01/everex_cloudbook_ce1200v.jpg' alt='Cloudbook' /></a><br />
Anyway between them there should be a very cool laptop waiting to be bought when I visit the USA in July. If you are as interested as I am then suscribe to the RSS feeds of <a href="http://www.cloudbooker.com">Cloudbooker</a> and <a href="http://www.eeeuser.com/">Eeeuser</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ahmed.elze.in/blog/2008/01/10/the-perfect-laptop/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The perfect email setup&#8230; for me</title>
		<link>http://ahmed.elze.in/blog/2007/10/17/the-perfect-email-setup-for-me/</link>
		<comments>http://ahmed.elze.in/blog/2007/10/17/the-perfect-email-setup-for-me/#comments</comments>
		<pubDate>Wed, 17 Oct 2007 08:31:19 +0000</pubDate>
		<dc:creator>Ahmed</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Me]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://www.azein.com/blog/2007/10/17/the-perfect-email-setup-for-me/</guid>
		<description><![CDATA[Email has always been a problem for me. Using web interfaces is a pain. Even the new JavaScript, single-page apps nowadays are bloated and slow. You can&#8217;t compare them to evolution, thunderbird or even outlook Most Email Service Providers (ESPs) do provide POP3, but POP3 doesn&#8217;t support folders and is not a good option if [...]]]></description>
			<content:encoded><![CDATA[<p>Email has always been a problem for me. Using web interfaces is a pain. Even the new JavaScript, single-page apps nowadays are bloated and slow. You can&#8217;t compare them to evolution, thunderbird or even outlook <img src='http://ahmed.elze.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Most Email Service Providers (ESPs) do provide POP3, but POP3 doesn&#8217;t support folders and is not a good option if you would like to access your mail from multiple locations.</p>
<p>So what is the solution? <a href="http://en.wikipedia.org/wiki/Internet_Message_Access_Protocol">IMAP</a> or the Internet Message Access Protocol gives me all the features I need:</p>
<ul>
<li>
<h4>Multiple clients simultaneously connected to the same mailbox</h4>
<p>         I check my  email from my Desktop, Laptop and PC at Uni.
</li>
<li>
<h4>supports folders</h4>
<p>can&#8217;t live without them. I don&#8217;t believe in labels, and virtual folders. I want to physically partition my mail.
</li>
<li>
<h4><del datetime="2007-10-18T03:26:23+00:00">Read/Write Support</del> 2-way Synchronization</h4>
<p>I am not sure what this is really called but you know how POP3 supports downloading only? Well with IMAP you can upload emails to you mailbox. This also allows you to copy emails between folders or even accounts. It also allows you to do things like have your sent mail folder in your mailbox and have all your clients upload the sent mail there.
</li>
</ul>
<p>So what is the problem then? Most ESPs do not support IMAP. My old ESP (<a href="http://www.gawab.com">gawab.com</a>) did, but due to the stability issues of gawab, I had to look elseware.</p>
<p>Now I didn&#8217;t get your hopes up just to let you down! Remember that $5/month VPS I have? It is time to get some more use out of it!</p>
<p>The plan is to have an IMAP server on my VPS, I don&#8217;t want to have the responsibility of running a my own SMTP server, just the IMAP server. I would also like to consolidate my email addresses into one mailbox. This seams like a simple plan.. a good one too, if I don&#8217;t say so my self <img src='http://ahmed.elze.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Solving the SMTP Issue</h3>
<p>So I don&#8217;t want the responsibility of running a SMTP server so I will pass the buck to google. <a href="http://www.google.com/a">Google Apps</a> provides email for your domain so you don&#8217;t have to worry about 99.99% availability and all that.</p>
<h3>Installing and Configuring the IMAP Server</h3>
<p>I decided on <a href="http://www.dovecot.org/">Dovecot</a> for the IMAP server because of it&#8217;s low memory footprint as well as it&#8217;s stability and good reputation.<br />
in ubuntu all I needed was to:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">apt-get install dovecot-imapd</pre></div></div>

<p>I wanted to set up IMAP over SSL for better security so I needed to create a SSL certificate</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl
openssl genrsa <span style="color: #000000;">1024</span> <span style="color: #000000; font-weight: bold;">&gt;</span> private<span style="color: #000000; font-weight: bold;">/</span>domain.key
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">400</span> private<span style="color: #000000; font-weight: bold;">/</span>domain.key
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-x509</span> <span style="color: #660033;">-nodes</span> <span style="color: #660033;">-sha1</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">365</span> <span style="color: #660033;">-key</span> private<span style="color: #000000; font-weight: bold;">/</span>domain.key <span style="color: #000000; font-weight: bold;">&gt;</span> certs<span style="color: #000000; font-weight: bold;">/</span>domain.cert</pre></div></div>

<p>I new that I planned to use a passwd like password file for authentication so I created one right away:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dovecot<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">passwd</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">&lt;</span>EOF
user<span style="color: #000000; font-weight: bold;">@</span>domain:<span style="color: #7a0874; font-weight: bold;">&#123;</span>plain<span style="color: #7a0874; font-weight: bold;">&#125;</span>password
EOF</pre></div></div>

<p>Then you need to configure dovecot by editing <code>/etc/dovecot/dovecot.conf</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">protocols = imaps
&nbsp;
## Logging
log_timestamp = &quot;%Y-%m-%d %H:%M:%S &quot;
&nbsp;
## SSL settings
ssl_cert_file = /etc/ssl/certs/domain.cert
ssl_key_file = /etc/ssl/private/domain.key
&nbsp;
## Login processes
login_user = dovecot
&nbsp;
## Mailbox locations and namespaces
mail_location = maildir:/var/lib/mail/%d/%n
mail_extra_groups = mail
&nbsp;
## Mail processes
first_valid_uid = 107
last_valid_uid = 107
&nbsp;
## IMAP specific settings
protocol imap {
  login_greeting_capability = yes
}
&nbsp;
## Authentication processes
auth_debug = yes
auth_debug_passwords = yes
&nbsp;
auth default {
  mechanisms = plain
  user = root
  passdb passwd-file {
    # Path for passwd-file
    args = /etc/dovecot/passwd
  }
  userdb static {
    args = uid=dovecot gid=mail domain=domain home=/var/lib/mail/%d/%u
  } 
}
&nbsp;
## Dictionary server settings
plugin {
}</pre></div></div>

<p>That's all</p>
<h3>Consolidating my Email Accounts</h3>
<p>I expected to have to learn the mysteries of fetchmail but I was lucky to find <a href="http://pyropus.ca/software/getmail/">getmail4</a>, a simpler replacement.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> getmail4
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>getmail
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> dovecot:mail <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>getmail</pre></div></div>

<p>create a getmailrc file </code><code>/etc/getmail/domain-user</code> that <a href="http://pyropus.ca/software/getmail/configuration.html#configuring">describes the retrieval and delivery phases</a><br />
It will look something like:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[retriever]
type = SimplePOP3SSLRetriever
server = pop.gmail.com
username = user@domain
port = 995
password = your_password
&nbsp;
[destination]
type = Maildir
path = /var/lib/mail/domain/user/
&nbsp;
[options]
delete = false
verbose = 0
delete_after = 0
read_all = false</pre></div></div>

<p>test it with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-u</span> dovecot getmail <span style="color: #660033;">--getmaildir</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>getmail  <span style="color: #660033;">--rcfile</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>getmail<span style="color: #000000; font-weight: bold;">/</span>domain-user</pre></div></div>

<p>if all is OK then create a cron job to run say every 15 minutes</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Crontab for getmail. Download mail every 15 minutes
0,15,30,45 * * * *    dovecot getmail --getmaildir=/etc/getmail  --rcfile=/etc/getmail/domain1-user1
5,20,35,50 * * * *    dovecot getmail --getmaildir=/etc/getmail  --rcfile=/etc/getmail/domain2-user2</pre></div></div>

<p>And there you have it! Just one nifty IMAP mailbox that contains all you email from all your accounts.</p>
]]></content:encoded>
			<wfw:commentRss>http://ahmed.elze.in/blog/2007/10/17/the-perfect-email-setup-for-me/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Making the most out of a 64MB VPS</title>
		<link>http://ahmed.elze.in/blog/2007/10/06/stretching-64mb-as-much-as-you-can/</link>
		<comments>http://ahmed.elze.in/blog/2007/10/06/stretching-64mb-as-much-as-you-can/#comments</comments>
		<pubDate>Sat, 06 Oct 2007 13:52:29 +0000</pubDate>
		<dc:creator>Ahmed</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://www.azein.com/blog/2007/10/06/stretching-64mb-as-much-as-you-can/</guid>
		<description><![CDATA[About 2 months ago I got myself a Virtual Private Server(VPS) from http://www.vpsvillage.com. I am paying $5 a month for a Xen virtual machine with 64MB of RAM and a 4GB hard disk. I have lots of plans for my VPS. The most essential is hosting my website (basically this blog plus a small rails [...]]]></description>
			<content:encoded><![CDATA[<p>About 2 months ago I got myself a Virtual Private Server(VPS) from http://www.vpsvillage.com. I am paying $5 a month for a Xen virtual machine with 64MB of RAM and a 4GB hard disk. I have lots of plans for my VPS. The most essential is hosting my website (basically this blog plus a small rails app). I immediately installed a LAMP environment and had my blog up and running in no time. </p>
<p>Now I have a very small number of hits per day&#8230; So small that I am embarrassed to post that number here:). Suffice to say that it would be better to calculate per week or month <img src='http://ahmed.elze.in/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Anyhow my site site kept dieing on me. The Out of Memory thread (OOM) kept killing off processes on my server.</p>
<p>Rather that tune apache I decided to install <a href="http://www.lighttpd.net/">lighttpd</a> and try and tune the rest of my system. So I did a fresh install of 64-bit ubuntu (actually I now feel that the 64-bit part was a mistake but I am not sure enough to go through the whole install process again). I will attempt to describe how I went through the process of tuning my 64MB VPS.</p>
<h3>Tuning Tools</h3>
<p>I installed <a href="http://munin.projects.linpro.no/">munin</a> as it produces lovely graphs. The graphing process it quite heavy so to lower its impact I removed all unnecessary plugins (I kept: cpu, load, memory and swap only) and I also modified the cron script so that the graphs and html files are updated every 15 minutes (munin updates every 5 minutes)</p>
<p>I am now able to look at nice graphs of my memory usage<br />
<a href='http://www.azein.com/blog/wp-content/uploads/2007/09/bigbirdazeincom-memory-week.png' title='memory graph'><img src='http://www.azein.com/blog/wp-content/uploads/2007/09/bigbirdazeincom-memory-week.png' alt='memory graph' /></a></p>
<p>you can see munin in progress <a href="http://munin.azein.com/">here</a></p>
<h3>Tune Linux</h3>
<p>Next thing I did was to try and tune the virtual memory subsystem (ie <code>/proc/sys/vm/*</code>). I fist tried to lower the swappiness value but that did not have the result I expected! You see I thought that a lower swappiness value would decrease the systems tendency to swap caches to disk. It in fact decreases the tendency to swap anything to disk. I was getting OOM with swap only a quarter full.<br />
What I did at the end was:</p>
<ul>
<li>leave swappiness at the default value of 60</li>
<li>set vfs_cache_pressure to 200</li>
<li>set max_map_count to 1000</li>
</ul>
<p>No doubt further understanding of the VM subsystem would allow more efficient tuning, but that will have to wait for another day.</p>
<h3>Tune Lighttpd</h3>
<p>With the small load I have and the small memory footprint of lighty (less than 1MB), I can&#8217;t see much to be done here! I have setup php o run as a fast-cgi process. I have set max-procs to 1 in lighty with PHP_FCGI_CHILDREN=1. This means we will have 2 php-cgi processes, one is the parent monitoring process (PP) and the other will actually serve requests (SP). I might increase PHP_FCGI_CHILDREN to 2 in the future.</p>
<h3>Tune php</h3>
<p>I wanted to see what I could do to decrease the memory footprint for my php-cgi processes so I hit my site with:<br />
<code>ab -n 50 http://azein.com/</code> and fired up top (using M to sort by memory usage) and got<br />
<code><br />
 2163 www-data  16   0 77396  13m 3100 S  0.0 21.6   0:08.36 php-cgi<br />
 2162 www-data  23   0 69212 6132 3668 S  0.0  9.4   0:00.00 php-cgi<br />
</code></p>
<p>I then edited my php.ini file and modified the following values:<br />
<code><br />
memory_limit = 16M<br />
register_long_arrays = Off<br />
;engine = On<br />
</code><br />
I also commented out the loading of the mysqli, pdo and pdo_mysql modules as I don&#8217;t use them.</p>
<p>I tried again with <code>ab -n 50 http://azein.com/</code>and got:<br />
<code><br />
 2278 www-data  16   0 71096  12m 3016 S 11.3 20.2   0:09.36 php-cgi<br />
 2277 www-data  24   0 62660 3596 3528 S  0.0  5.5   0:00.00 php-cgi<br />
</code><br />
so we have a small decrease in memory foot print.</p>
<h3>Tune MySQL</h3>
<p>1st thing to do before you even start to tune your parameters is to <code>skip-innodb</code> this by itself is supposed to decrease the memory foot print by 100MB.</p>
<p>The 1st parameter I will tune is the <code>key_buffer</code>. This describes the amount of memory used to cache the tables keys and indexes. The sum of my *.MYI files are about 80K so I will set the <code>key_buffer</code> size to 512KB with lots of room for expansion.</p>
<p>The 2nd set of parameters are the threads and concurrency group, now I plan to have no more than 2 php-cgi threads running at any time so it make no sense to have more than 2 mysqld threads running for now. I also set the max connections to 10 as I do not expect any more than that.<br />
<code><br />
max_connections        = 20<br />
thread_concurrency     = 2<br />
</code></p>
<p>The 3rd set of parameters are the query cache configuration group. I do not have many queries that I think need to be cached. I suppose the front page of my blog (about 10 posts) is all that will benefit from this.<br />
<code><br />
query_cache_limit       = 64K<br />
query_cache_size        = 512K<br />
</code><br />
mysqld now consumes just under 7MB but I will take a look at my hit/miss stats in a few days to how the query cache parameters are doing.</p>
<p>Last thing I did was turn off binary logging and I do not plan to use it. </p>
<h3>Final Comments</h3>
<p>No mater what I did I couldn&#8217;t get my rails app running without the system coming to a halt! The rails app has a memory footprint of 30MB and I don&#8217;t have the energy to see if it possible to bring that down and what the minimal memory footprint of a rails app is!</p>
<p>I could upgrade my VPS to 128MB RAM, but I think that 64M should be sufficient and I will continue trying to make the most out of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://ahmed.elze.in/blog/2007/10/06/stretching-64mb-as-much-as-you-can/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>

