<?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>Ali&#039;s Blog &#187; Linux</title>
	<atom:link href="http://www.almahdi.cc/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.almahdi.cc</link>
	<description>Made from the best stuff on earth</description>
	<lastBuildDate>Tue, 24 Jan 2012 10:16:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Extend LVM Partition online</title>
		<link>http://www.almahdi.cc/linux/extend-lvm-partition-online/</link>
		<comments>http://www.almahdi.cc/linux/extend-lvm-partition-online/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 07:24:57 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.almahdi.cc/?p=574</guid>
		<description><![CDATA[I have been facing this recently at work. Luckily, we run a private cloud on VMWare Infrastructure with Storage on EMC SAN. I&#8217;ve got some production machines running RHEL and CentOS RHEL Clone. Recently, some of them started running out of disk space. Luckily, setup was done using default install. So, LVM was used by [...]]]></description>
			<content:encoded><![CDATA[<p>I have been facing this recently at work. Luckily, we run a private cloud on VMWare Infrastructure with Storage on EMC SAN. I&#8217;ve got some production machines running RHEL and CentOS RHEL Clone. Recently, some of them started running out of disk space. Luckily, setup was done using default install. So, LVM was used by default.</p>
<p>So, I asked the VMWare admin to add an extra virtual disk for me on each of those machines. and I extended (/) partition to the new disk.</p>
<p>Keeping in mind to follow the procedure is: /dev/sda was the only disk for each machine. So, when we added an extra disk, it was assigned /dev/sdb</p>
<p>Using fdisk, create a new partition:</p>
<blockquote><p>fdisk /dev/sdb</p></blockquote>
<p>Make sure you make your choices as primary and assign it first partition.</p>
<p>So, once created, it shall be assigned /dev/sdb1</p>
<blockquote><p>pvcreate /dev/sdb1</p></blockquote>
<p>This will create a physical volume for the LVM.</p>
<p>And after creating the physical volume we attach it to our existing Volume Group.</p>
<blockquote><p>vgextend VolGroup00 /dev/sdb1</p></blockquote>
<p>Then we extend the Logical Volume which is mounted to (/) by 20GB, make sure you change the number to the attached disk storage.</p>
<blockquote><p>lvextend -L +20G /dev/VolGroup00/LogVol00</p></blockquote>
<p>Then we resize the filesystem, since we are running default installs, it runs ext3, so extending it online using the command below:</p>
<blockquote><p>resize2fs /dev/VolGroup00/LogVol00</p></blockquote>
<p>Verify the new storage size using:</p>
<blockquote><p>df -h</p></blockquote>
<p>It must show the extra 20GB or whatever disk size you added.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.almahdi.cc%2Flinux%2Fextend-lvm-partition-online%2F&amp;title=Extend%20LVM%20Partition%20online" id="wpa2a_2"><img src="http://www.almahdi.cc/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.almahdi.cc/linux/extend-lvm-partition-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I bought myself a Dell Streak</title>
		<link>http://www.almahdi.cc/internet/i-bought-myself-a-dell-streak/</link>
		<comments>http://www.almahdi.cc/internet/i-bought-myself-a-dell-streak/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 22:32:59 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Phones]]></category>
		<category><![CDATA[Ali]]></category>
		<category><![CDATA[Ali Almahdi]]></category>
		<category><![CDATA[ali almahdi blog]]></category>
		<category><![CDATA[ali almahdi twitter]]></category>
		<category><![CDATA[ali blog]]></category>
		<category><![CDATA[Almahdi]]></category>
		<category><![CDATA[almahdi twitter]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[dell streak]]></category>
		<category><![CDATA[eclair]]></category>
		<category><![CDATA[foryo]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[streak]]></category>

		<guid isPermaLink="false">http://almahdi.cc/?p=465</guid>
		<description><![CDATA[Few days ago, I sold my iPad.. For few reasons.. 1st, I couldn&#8217;t find a proper use for it. I used it for browsing, but its size was too big for me. I thought of purchasing the Galaxy Tab, since its 7-inch&#8230; I went and I grabbed one and I tested holding it and walking [...]]]></description>
			<content:encoded><![CDATA[<p>Few days ago, I sold my iPad.. For few reasons.. 1st, I couldn&#8217;t find a proper use for it. I used it for browsing, but its size was too big for me. I thought of purchasing the Galaxy Tab, since its 7-inch&#8230; I went and I grabbed one and I tested holding it and walking with it. Didn&#8217;t wasn&#8217;t good either. The Dell Streak is the perfect size, yet, good screen. I immediately fell in love with the Streak. So, I bought one.</p>
<p><a href="http://almahdi.cc/wp-content/uploads/2011/01/dell-streak.jpg"><img class="alignnone size-medium wp-image-473" title="dell-streak" src="http://almahdi.cc/wp-content/uploads/2011/01/dell-streak-300x248.jpg" alt="" width="300" height="248" /></a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.almahdi.cc%2Finternet%2Fi-bought-myself-a-dell-streak%2F&amp;title=I%20bought%20myself%20a%20Dell%20Streak" id="wpa2a_4"><img src="http://www.almahdi.cc/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.almahdi.cc/internet/i-bought-myself-a-dell-streak/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Replace text in many files using perl</title>
		<link>http://www.almahdi.cc/linux/replace-text-in-many-files-using-perl/</link>
		<comments>http://www.almahdi.cc/linux/replace-text-in-many-files-using-perl/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 05:51:27 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux replace text]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[replace text]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://almahdi.cc/?p=402</guid>
		<description><![CDATA[Last night, I have several files containing the same text and I wanted that text to be replaced. I used perl one liner to do the job and I thought it may be useful for someone else so here it is: perl -e &#8220;s/text/replacewith/g;&#8221; -pi.orig *.txt This is going to save a backup of the [...]]]></description>
			<content:encoded><![CDATA[<p>Last night, I have several files containing the same text and I wanted that text to be replaced. I used perl one liner to do the job and I thought it may be useful for someone else so here it is:</p>
<blockquote><p>perl -e &#8220;s/text/replacewith/g;&#8221; -pi.orig *.txt</p></blockquote>
<p>This is going to save a backup of the files with .orig extension and do the replace. If you don&#8217;t want backup, then remove the .orig from the line.</p>
<p>Also, if you want to replace text in all files in a directory, then use:</p>
<blockquote><p>perl -e &#8220;s/text/replacewith/g;&#8221; -pi.orig $(find . -type f)</p></blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.almahdi.cc%2Flinux%2Freplace-text-in-many-files-using-perl%2F&amp;title=Replace%20text%20in%20many%20files%20using%20perl" id="wpa2a_6"><img src="http://www.almahdi.cc/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.almahdi.cc/linux/replace-text-in-many-files-using-perl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setup unixODBC on Linux for Oracle and Sybase</title>
		<link>http://www.almahdi.cc/linux/setup-unixodbc-on-linux-for-oracle-and-sybase/</link>
		<comments>http://www.almahdi.cc/linux/setup-unixodbc-on-linux-for-oracle-and-sybase/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 12:09:21 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[odbc linux]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sybase]]></category>
		<category><![CDATA[unixodbc]]></category>

		<guid isPermaLink="false">http://almahdi.cc/?p=353</guid>
		<description><![CDATA[I have been working this week on configuring a Linux server to connect to Oracle and Sybase using unixODBC to be used by a System running on PHP. So, I thought of sharing my /etc/odbc.ini and /etc/odbcinst.ini since I had a bit of hard time writing them. It may help someone who is trying to [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working this week on configuring a Linux server to connect to Oracle and Sybase using unixODBC to be used by a System running on PHP.</p>
<p>So, I thought of sharing my /etc/odbc.ini and /etc/odbcinst.ini since I had a bit of hard time writing them. It may help someone who is trying to figure out how to connect using ODBC on Linux.</p>
<p>Packages Required on CentOS</p>
<blockquote><p>httpd php unixODBC</p></blockquote>
<p>Manually Install Oracle Instant Client 11.1 RPM Packages and Install Sybase ASE from the TGZ File.</p>
<p>For Oracle you need to copy all the libs to /usr/lib</p>
<blockquote><p>cp /usr/lib/oracle/11.1/client/lib /usr/lib/</p></blockquote>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 108px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">/usr/lib/oracle/11.1/client/lib</div>
<p>/etc/odbcinst.ini Contents:</p>
<blockquote>
<p>[Oracle]<br />
Description     = Oracle ODBC Connection<br />
Driver          = /usr/lib/oracle/11.1/client/lib/libsqora.so.11.1<br />
Setup           =<br />
FileUsage<span style="white-space:pre"> </span>=<br />
CPTimeout<span style="white-space:pre"> </span>=<br />
CPReuse         =</p>
<p>[Sybase]<br />
Description = Sybase ODBC Driver<br />
Driver = /opt/sybase/DataAccess/ODBC/lib/libsybdrvodb.so<br />
FileUsage = -1</p></blockquote>
<p>/etc/odbc.ini Contents:</p>
<blockquote><p>[Oracle]<br />
Application Attributes = T<br />
Attributes = W<br />
BatchAutocommitMode = IfAllSuccessful<br />
CloseCursor = F<br />
DisableDPM = F<br />
DisableMTS = T<br />
Driver = Oracle<br />
EXECSchemaOpt =<br />
EXECSyntax = T<br />
Failover = T<br />
FailoverDelay = 10<br />
FailoverRetryCount = 10<br />
FetchBufferSize = 64000<br />
ForceWCHAR = F<br />
Lobs = T<br />
Longs = T<br />
MetadataIdDefault = F<br />
QueryTimeout = T<br />
ResultSets = T<br />
ServerName = //serverip:port/dbname<br />
SQLGetData extensions = F<br />
Translation DLL =<br />
Translation Option = 0<br />
UserID =</p>
<p>[Sybase]<br />
Driver = Sybase<br />
Server = serverip<br />
Port = serverport<br />
Database = dbname</p></blockquote>
<p>PHP Script to Test ODBC Connectivity:</p>
<blockquote><p>&lt;?php</p>
<p>$query = &#8220;select * from table_name&#8221;;</p>
<p>$conn = odbc_pconnect(&#8220;DSN&#8221;, &#8220;username&#8221;, &#8220;password&#8221;);</p>
<p>if(!$conn) die(&#8220;Connection failed&#8221;);</p>
<p>if($result = odbc_exec($conn, $query)) {</p>
<p><span style="white-space: pre;"> </span>echo &#8220;Query returned : &#8221; . odbc_num_rows($result) . &#8220;rows&#8221;;</p>
<p><span style="white-space: pre;"> </span>odbc_result_all($result);</p>
<p><span style="white-space: pre;"> </span>}</p>
<p>?&gt;</p></blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.almahdi.cc%2Flinux%2Fsetup-unixodbc-on-linux-for-oracle-and-sybase%2F&amp;title=Setup%20unixODBC%20on%20Linux%20for%20Oracle%20and%20Sybase" id="wpa2a_8"><img src="http://www.almahdi.cc/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.almahdi.cc/linux/setup-unixodbc-on-linux-for-oracle-and-sybase/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Webserver in Python</title>
		<link>http://www.almahdi.cc/linux/simple-webserver-in-python/</link>
		<comments>http://www.almahdi.cc/linux/simple-webserver-in-python/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 14:01:18 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://almahdi.cc/?p=296</guid>
		<description><![CDATA[Sometimes I need a simple webserver for serving files for my kickstart installations. I have found a simple solution: python -m SimpleHTTPServer 80 This creates a simple Webserver on port 80 and its root path is the directory it ran from. For more details about it, visit python docs: http://docs.python.org/library/simplehttpserver.html]]></description>
			<content:encoded><![CDATA[<p>Sometimes I need a simple webserver for serving files for my kickstart installations. I have found a simple solution:</p>
<blockquote><p>python -m SimpleHTTPServer 80</p></blockquote>
<p>This creates a simple Webserver on port 80 and its root path is the directory it ran from. For more details about it, visit python docs:<a href="http://docs.python.org/library/simplehttpserver.html"> http://docs.python.org/library/simplehttpserver.html</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.almahdi.cc%2Flinux%2Fsimple-webserver-in-python%2F&amp;title=Simple%20Webserver%20in%20Python" id="wpa2a_10"><img src="http://www.almahdi.cc/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.almahdi.cc/linux/simple-webserver-in-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dealing with winmail.dat in Linux</title>
		<link>http://www.almahdi.cc/linux/dealing-with-winmaildat-in-linux/</link>
		<comments>http://www.almahdi.cc/linux/dealing-with-winmaildat-in-linux/#comments</comments>
		<pubDate>Sun, 17 May 2009 11:02:41 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://almahdi.cc/?p=260</guid>
		<description><![CDATA[Today, I have received an email from a Windows User using Outlook and he was using Rich Mode instead of plain text or html. Thus, when sending attachments, it comes as winmail.dat file. Winmail.dat file is like an archive file contains all the attachments, thus it can be extracted. There is a wonderful tool called [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I have received an email from a Windows User using Outlook and he was using Rich Mode instead of plain text or html. Thus, when sending attachments, it comes as winmail.dat file. Winmail.dat file is like an archive file contains all the attachments, thus it can be extracted. There is a wonderful tool called <a href="http://sourceforge.net/projects/ytnef/" target="_blank">ytnef</a> which I used to extract the attachments from the email I got.</p>
<p>A simple how to use:</p>
<ol>
<li>Save the winmail.dat to your home directory, probably a temp folder in your home directory.</li>
<li>Open the terminal and change the directory to the place where the winmail.dat is saved.</li>
<li>Run the command:<br />
<span style="color: #ff0000;">ytnef -f . winmail.dat</span><br />
It will save the files in the current directory.</li>
</ol>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.almahdi.cc%2Flinux%2Fdealing-with-winmaildat-in-linux%2F&amp;title=Dealing%20with%20winmail.dat%20in%20Linux" id="wpa2a_12"><img src="http://www.almahdi.cc/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.almahdi.cc/linux/dealing-with-winmaildat-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download RealMedia Files and Convert them to MP3 in Linux</title>
		<link>http://www.almahdi.cc/linux/download-realmedia-files-and-convert-them-to-mp3-in-linux/</link>
		<comments>http://www.almahdi.cc/linux/download-realmedia-files-and-convert-them-to-mp3-in-linux/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 09:59:17 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://almahdi.cc/?p=215</guid>
		<description><![CDATA[This morning I woke up and one of Fayrooz songs was playing in my head! I thought of Downloading all of them. So, I found a good website (http://www.6rb.com/music/Singers-13/525.html) with many Fayrooz songs ( I can&#8217;t say all because I don&#8217;t know them all). Anyway, that&#8217;s how I downloaded the Songs and converted them to [...]]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } 		A:link { so-language: zxx } --></p>
<p style="margin-bottom: 0in;">This morning I woke up and one of Fayrooz songs was playing in my head! I thought of Downloading all of them. So, I found a good website (http://www.6rb.com/music/Singers-13/525.html) with many Fayrooz songs ( I can&#8217;t say all because I don&#8217;t know them all). Anyway, that&#8217;s how I downloaded the Songs and converted them to MP3</p>
<p style="margin-bottom: 0in;"><span id="more-215"></span>You will require those packages:</p>
<blockquote>
<p style="margin-bottom: 0in;">wget, grep, mplayer, and lame</p>
</blockquote>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;">Procedure:</p>
<p style="margin-bottom: 0in;">First, I wanted a list of the files to be extracted from the website, so I save the page as a text file:</p>
<blockquote>
<p style="margin-bottom: 0in;">wget -O output.txt “<a href="http://www.6rb.com/music/Singers-13/525.html">http://www.6rb.com/music/Singers-13/525.html</a>”</p>
</blockquote>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;">Secondly, extract the links: (Assuming you know what is grep and cut)</p>
<blockquote>
<p style="margin-bottom: 0in;">grep .rm output.txt|grep http|cut -d\&#8221; -f4 &gt; links.txt</p>
</blockquote>
<p style="margin-bottom: 0in;">Now, we require to download the songs:</p>
<blockquote>
<p style="margin-bottom: 0in;">wget -i links.txt</p>
</blockquote>
<p style="margin-bottom: 0in;">Grab a cup of coffee and wait till download is done!</p>
<p style="margin-bottom: 0in;">Since I wanted the files to be MP3&#8242;s instead of real media to burn them on a CD for my car, so we have to convert them to MP3&#8242;s.</p>
<p style="margin-bottom: 0in;">The idea is to convert them to waves using Mplayer and then encode them using lame.</p>
<p style="margin-bottom: 0in;">To Convert one file to wave:</p>
<blockquote>
<p style="margin-bottom: 0in;">mplayer filename.rm -ao pcm:file=filename.wav -vc dummy -vo null</p>
</blockquote>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;">Then encode,</p>
<blockquote>
<p style="margin-bottom: 0in;">lame -m m filename.wav filename.mp3</p>
</blockquote>
<p style="margin-bottom: 0in;">I created a script to convert all the files in one directory so simplify the process for me.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.almahdi.cc%2Flinux%2Fdownload-realmedia-files-and-convert-them-to-mp3-in-linux%2F&amp;title=Download%20RealMedia%20Files%20and%20Convert%20them%20to%20MP3%20in%20Linux" id="wpa2a_14"><img src="http://www.almahdi.cc/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.almahdi.cc/linux/download-realmedia-files-and-convert-them-to-mp3-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu DVD Release</title>
		<link>http://www.almahdi.cc/linux/ubuntu-dvd-release/</link>
		<comments>http://www.almahdi.cc/linux/ubuntu-dvd-release/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 15:08:57 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://almahdi.cc/linux/ubuntu-dvd-release/</guid>
		<description><![CDATA[The reason that made me look away from Ubuntu was due to the CD release targeting desktop users and leaving developers, and when I install Ubuntu, I have to do tons of Downloads to make my desktop ready! Ubuntu had a DVD release that got almost all the software I require and it will be [...]]]></description>
			<content:encoded><![CDATA[<p>The reason that made me look away from Ubuntu was due to the CD release targeting desktop users and leaving developers, and when I install Ubuntu, I have to do tons of Downloads to make my desktop ready! Ubuntu had a DVD release that got almost all the software I require and it will be a minimal download for me. I never knew about it!! So, I downloaded the Ubuntu DVD iso image, and I will be using it on my laptop, My desktop stays multi-booting FreeBSD, Slackware and Fedora.<br />
Link to Ubuntu DVD Release: <a href="http://cdimage.ubuntu.com/releases/intrepid/release/" title="http://cdimage.ubuntu.com/releases/intrepid/release/">http://cdimage.ubuntu.com/releases/intrepid/release/</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.almahdi.cc%2Flinux%2Fubuntu-dvd-release%2F&amp;title=Ubuntu%20DVD%20Release" id="wpa2a_16"><img src="http://www.almahdi.cc/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.almahdi.cc/linux/ubuntu-dvd-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clone Disks using Linux dd</title>
		<link>http://www.almahdi.cc/linux/clone-disks-using-linux-dd/</link>
		<comments>http://www.almahdi.cc/linux/clone-disks-using-linux-dd/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 09:56:16 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://almahdi.cc/linux/clone-disks-using-linux-dd/</guid>
		<description><![CDATA[Yesterday, Mohammed my friend asked me on how to clone disks since he remembers me cloning disks using Linux over Network. I thought of writing the way I do it so everyone could benefit from it. Simply, dd is tool to convert or copy a file.. And what is lovely about *NIX based systems have [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, Mohammed my friend asked me on how to clone disks since he remembers me cloning disks using Linux over Network. I thought of writing the way I do it so everyone could benefit from it.</p>
<p><span id="more-56"></span>Simply, dd is tool to convert or copy a file.. And what is lovely about *NIX based systems have disks and most hardware as hardware nodes accessible as files! Usually, on Linux, hard disks are accessible via /dev/hd[a] (For ATA Drives) or /dev/sd[a] (For SCSI or SATA Drives).</p>
<p>First Scenario is to image the hard drive to a USB disk, Assuming that we have booted a Linux Live CD, The USB Disk mounted to /media/disk and the hard disk is accessible via /dev/sda.</p>
<p>We run:</p>
<blockquote><p>dd if=/dev/sda of=/media/disk/hard-disk-image-name.img</p></blockquote>
<p>Note: if = input file, and of = output file</p>
<p>Now, lets say we want to restore the image to hard disk:</p>
<blockquote><p>dd if=/media/disk/hard-disk-image-name.img of=/dev/sda</p></blockquote>
<p>What if we want to save the image compressed and restore it from a compressed file, Assuming that you know gzip.</p>
<p>Disk to image compressed:</p>
<blockquote><p>dd if=/dev/sda | gzip -9 | dd of=/media/disk/hard-disk-image-name.img.gz</p></blockquote>
<p>Restore compressed Image to disk:</p>
<blockquote><p>dd if=/media/disk/hard-disk-image-name.img.gz | gzip -d | dd of=/dev/sda</p></blockquote>
<p>Ok, now all the above is about saving to an image on a USB disk, how about we want to write to an image or disk over the network, we have two options here, using SSH or Netcat!</p>
<p>I will be providing examples using Netcat, however, over SSH is similar, Its the same concept.</p>
<p>Disk to Disk or image over network (Its a matter of chaning the output file), assuming that we have booted a Live CD and we have a network configured on both linux machines on Network: 10.0.0.0/24, Master Machine IP: 10.0.0.1, and slave Machine is 10.0.0.2</p>
<p>Disk to disk over network, as I said above, it could be written to a USB disk image by changing the output file:</p>
<p>On Slave:</p>
<blockquote><p>nc -l -p 9000 | dd of=/dev/sda</p></blockquote>
<p>Note: Netcat options are as follows: -l is to listen to a port, -p to specify the port number to listen on.</p>
<p>On Master:</p>
<blockquote><p>dd if=/dev/sda | nc 10.0.0.2 9000</p></blockquote>
<p>Note: Netcat is going to connect to the slave machine IP and port as specified above.</p>
<p>Now, you can even using gzip over network if you are conservative about the bandwidth!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.almahdi.cc%2Flinux%2Fclone-disks-using-linux-dd%2F&amp;title=Clone%20Disks%20using%20Linux%20dd" id="wpa2a_18"><img src="http://www.almahdi.cc/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.almahdi.cc/linux/clone-disks-using-linux-dd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Choosing a Linux Distro &#8212; Mandriva is a good choice</title>
		<link>http://www.almahdi.cc/linux/choosing-a-linux-distro-mandriva-is-a-good-choice/</link>
		<comments>http://www.almahdi.cc/linux/choosing-a-linux-distro-mandriva-is-a-good-choice/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 23:28:43 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://almahdi.cc/linux/choosing-a-linux-distro-mandriva-is-a-good-choice/</guid>
		<description><![CDATA[I formated my laptop after experimenting with Mac OSX, I wanted a good distro to be used on my laptop. Keeping in mind that I have a very good experience with Unix like systems, Especially Linux and FreeBSD. On my desktop, I have been dual booting Slackware Linux and FreeBSD. I used to use Fedora [...]]]></description>
			<content:encoded><![CDATA[<p>I formated my laptop after experimenting with Mac OSX, I wanted a good distro to be used on my laptop. Keeping in mind that I have a very good experience with Unix like systems, Especially Linux and FreeBSD.<br />
On my desktop, I have been dual booting Slackware Linux and FreeBSD. I used to use Fedora on my laptop before experimenting with Mac.<br />
Since I experiment a lot with my laptop, I wanted a distro that got everything on its DVD, like Slackware or Fedora. For <strong>Slackware</strong>, I will require to do lots of Customizations which I don&#8217;t have time for on my laptop. <strong>Fedora</strong> is perfect, however, I hate those almost daily updates which are huge in size. Few Months ago, I have tried <strong>Mandriva</strong>, and I really liked it, however, I had to do some experiments and I formatted on my older laptop. Today, I have installed <strong>Mandriva</strong>.</p>
<p><strong>The Installation:</strong></p>
<p>It&#8217;s really nice, very fast and responsive.. It gave me the option to copy the DVD to the hard drive, it really improves the install time!</p>
<p><strong>Updates:</strong><br />
After a full install, the whole update for my all packages was only about 530MB to download! Unlike Fedora that required 1.2GB of downloads!!</p>
<p><strong>Overall:</strong><br />
Mandriva is a very good Distro, everything comes on the DVD. Giving the option to have a full running system to do your job even without internet connection. Unlike Ubuntu!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.almahdi.cc%2Flinux%2Fchoosing-a-linux-distro-mandriva-is-a-good-choice%2F&amp;title=Choosing%20a%20Linux%20Distro%20%26%238212%3B%20Mandriva%20is%20a%20good%20choice" id="wpa2a_20"><img src="http://www.almahdi.cc/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.almahdi.cc/linux/choosing-a-linux-distro-mandriva-is-a-good-choice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change file names case from upper case to lower case</title>
		<link>http://www.almahdi.cc/linux/change-file-names-case-from-upper-case-to-lower-case/</link>
		<comments>http://www.almahdi.cc/linux/change-file-names-case-from-upper-case-to-lower-case/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 23:59:56 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://almahdi.cc/linux/change-file-names-case-from-upper-case-to-lower-case/</guid>
		<description><![CDATA[A friend of mine asked me a good question, he copied files from a Windows Partition to his Linux partition, and some of the files had upper case letters. He wanted to convert all file names to lower case, and they were lots of files, thus he didn&#8217;t want to change them one by one. [...]]]></description>
			<content:encoded><![CDATA[<p>A friend of mine asked me a good question, he copied files from a Windows Partition to his Linux partition, and some of the files had upper case letters. He wanted to convert all file names to lower case, and they were lots of files, thus he didn&#8217;t want to change them one by one. He asked me how to do it, and I helped him out.<br />
Its a simple line to convert all files from upper case to lowercase</p>
<blockquote><p>for i in `ls`; do old=$i; new=`echo $i | tr [:upper:] [:lower:]`; mv $old $new; done;</p></blockquote>
<p>And all files in the same directory are converted to lower case.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.almahdi.cc%2Flinux%2Fchange-file-names-case-from-upper-case-to-lower-case%2F&amp;title=Change%20file%20names%20case%20from%20upper%20case%20to%20lower%20case" id="wpa2a_22"><img src="http://www.almahdi.cc/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.almahdi.cc/linux/change-file-names-case-from-upper-case-to-lower-case/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improve Laptop Battery life in Linux</title>
		<link>http://www.almahdi.cc/linux/improve-laptop-battery-life-in-linux/</link>
		<comments>http://www.almahdi.cc/linux/improve-laptop-battery-life-in-linux/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 16:42:50 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://almahdi.cc/linux/improve-laptop-battery-life-in-linux/</guid>
		<description><![CDATA[Since I bought my Laptop HP Pavilion DV6353, I couldn&#8217;t get more than 2 hours using its battery. When I upgraded to Fedora 10, My battery lasts for only an hour and half. So I decided to increase my battery life. After long time of hours reading and reading about saving power, I came up [...]]]></description>
			<content:encoded><![CDATA[<p>Since I bought my Laptop HP Pavilion DV6353, I couldn&#8217;t get more than 2 hours using its battery. When I upgraded to Fedora 10, My battery lasts for only an hour and half. So I decided to increase my battery life. After long time of hours reading and reading about saving power, I came up with a list of stuff that I have done and improved my battery life to almost 3 hours!!</p>
<p><span id="more-75"></span></p>
<p>1. eth0 driver is doing 100 interrupts per second.<br />
after reading &#8220;modinfo forcedeth&#8221;, I had to create a file in /etc/modprobe.d/forcedeth and have the following line in it:</p>
<blockquote><p>options forcedeth poll_interval=65534</p></blockquote>
<p>This reduced the number of interrupts.</p>
<p>2. nvidia driver was consuming much of power too.. After reading its manual and searching the internet. I had to modify my /etc/X11/xorg.conf to have the following:<br />
In the driver section:<br style="background-color: #cccccc;" /></p>
<blockquote><p>Option &#8220;RegistryDwords&#8221; &#8220;PowerMizerEnable=0&#215;1; PerfLevelSrc=0&#215;2222; PowerMizerDefault=0&#215;3; PowerMizerDefaultAC=0&#215;2&#8243;</p></blockquote>
<p>What I have done here is I have disabled Nvidia powermizer and I have set the clock to the lowest speed when running on battery and on mid speed when running on AC.</p>
<p>In the Screen section:</p>
<blockquote><p>Option &#8220;OnDemandVBlankInterrupts&#8221; &#8220;True&#8221;</p></blockquote>
<p>3. Kernel Tuning for laptop&#8230;<br />
I. Enable laptop mode:</p>
<blockquote><p>echo 5 &gt; /proc/sys/vm/laptop_mode</p></blockquote>
<p>II. Virtual Memory:</p>
<blockquote><p>echo 40 &gt; /proc/sys/vm/dirty_ratio<br style="font-style: italic; background-color: #cccccc;" />echo 10 &gt; /proc/sys/vm/dirty_background_ratio<br style="font-style: italic; background-color: #cccccc;" />echo 1500 &gt; /proc/sys/vm/dirty_writeback_centisecs</p></blockquote>
<p>4. Laptop mode tools:</p>
<blockquote><p><a href="http://samwel.tk/laptop_mode/">http://samwel.tk/laptop_mode/</a></p></blockquote>
<p>For Kernel tuning, I have created a script that got the default values for kernel parameters and the tuned values so that I run the script with parameters to switch between modes.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.almahdi.cc%2Flinux%2Fimprove-laptop-battery-life-in-linux%2F&amp;title=Improve%20Laptop%20Battery%20life%20in%20Linux" id="wpa2a_24"><img src="http://www.almahdi.cc/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.almahdi.cc/linux/improve-laptop-battery-life-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keep your Linux Workstation/Server time accurate using &#8220;rdate&#8221;</title>
		<link>http://www.almahdi.cc/linux/keep-your-linux-workstationserver-time-accurate-using-rdate/</link>
		<comments>http://www.almahdi.cc/linux/keep-your-linux-workstationserver-time-accurate-using-rdate/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 18:14:08 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://almahdi.cc/linux/keep-your-linux-workstationserver-time-accurate-using-rdate/</guid>
		<description><![CDATA[Last night, I was using my Laptop until I drained the battery. Today, I plugged in the power and started using it. I found that the time is missed up!! It got yesterdays date and time of my last use! So I decided to sync my Laptop clock to NTP server to keep my time [...]]]></description>
			<content:encoded><![CDATA[<p>Last night, I was using my Laptop until I drained the battery. Today, I plugged in the power and started using it. I found that the time is missed up!! It got yesterdays date and time of my last use! So I decided to sync my Laptop clock to NTP server to keep my time accurate.</p>
<p>rdate uses NTP to get time from network and set it or print it on the workstation/server.</p>
<p><span id="more-76"></span>To use rdate:</p>
<blockquote><p>$ rdate [options] [ntpserver]</p></blockquote>
<blockquote><p>[options]:<br />
-s Set the system time to the returned time.<br />
-p Print the time returned by the remote machine.</p></blockquote>
<p>The next step was to find an NTP server. So I found a good list in <a href="http://tf.nist.gov/service/time-servers.html">NIST Internet Time service.</a></p>
<p>So, I run the command:</p>
<blockquote><p>$ rdate -s time-a.nist.gov</p></blockquote>
<p>And my clock is synchronised.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.almahdi.cc%2Flinux%2Fkeep-your-linux-workstationserver-time-accurate-using-rdate%2F&amp;title=Keep%20your%20Linux%20Workstation%2FServer%20time%20accurate%20using%20%26%238220%3Brdate%26%238221%3B" id="wpa2a_26"><img src="http://www.almahdi.cc/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.almahdi.cc/linux/keep-your-linux-workstationserver-time-accurate-using-rdate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

