<?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>Rayhan's blog (raynux.com) &#187; Linux</title>
	<atom:link href="http://raynux.com/blog/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://raynux.com/blog</link>
	<description>Rayhan's Personal Web Blog Site</description>
	<lastBuildDate>Mon, 11 Apr 2011 06:33:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Send Mail From Unix/Linux Bash Shell Script</title>
		<link>http://raynux.com/blog/2011/04/11/send-mail-from-unixlinux-bash-shell-script/</link>
		<comments>http://raynux.com/blog/2011/04/11/send-mail-from-unixlinux-bash-shell-script/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 06:30:28 +0000</pubDate>
		<dc:creator>rayhan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://raynux.com/blog/?p=240</guid>
		<description><![CDATA[Bash shell script is very popular and widely used in Unix world for command automation and task scheduling using cron. Sometime it is very important to know the status of these scripts to make sure that they are working exactly the way you want and if any script fails you can take prompt actions. The [...]]]></description>
			<content:encoded><![CDATA[<p>Bash shell script is very popular and widely used in Unix world for command automation and task scheduling using <em>cron</em>. Sometime it is very important to know the status of these scripts to make sure that they are working exactly the way you want and if any script fails you can take prompt actions.</p>
<p>The <em>mail</em> command, available in most of the Unix, Linux and Macs, can be used to send the status message right from your bash script so that you always know about your script&#8217;s activity.</p>
<p>In this article I am going to share some simple but important tricks on sending mail form shell script. Proper use of these tricks will increase the accountability of your scripts and let you relax at your work.</p>
<p>Simple shell script to send one line status mail.</p>
<pre><code>#!/bin/bash
echo "Message Body!" | /usr/bin/mail -s "Message Title" example@example.com</code></pre>
<p>What if you want to send a multi-line message? you can wrap your lines in a shell function and use the following code.</p>
<pre><code>#!/bin/bash
function mystatus {
    echo "Script started successfully"
    echo "Backup operation completed successfully"
    echo "File transferred successfully"
}
mystatus | /usr/bin/mail -s "Message Title" example@example.com</code></pre>
<p>Alternatively you can store messages in a temporary file and load the message body from the file</p>
<pre><code>#!/bin/bash

TMPFILE="/tmp/mailbody.txt"
echo "Script started successfully" &gt; $TMPFILE
echo "Backup operation completed successfully" &gt;&gt; $TMPFILE
echo "File transferred successfully" &gt;&gt; $TMPFILE

/usr/bin/mail -s "Message Title" example@example.com &lt; $TMPFILE</code></pre>
<p>A real example: how you can get the status email whether your MySQL database is backed up properly or not.</p>
<pre><code>#!/bin./bash
function mysqlbackup {
    echo "Script started successfully"
    if (mysqldump -uusername -ppassword database_name &gt; data.sql); then
        echo "MySQL database backed up successfully"
    else
        echo "Error: Could not take database backup!"
    fi

}
mysqlbackup | /usr/bin/mail -s "Backup Status" example@example.com</code></pre>
<p>For more details about bash scripting read this <a title="Advance Bash-Scripting Guide" href="http://tldp.org/LDP/abs/html/">Advance Bash-Scripting Guide</a>.</p>
<p>Hope this simple  script will be helpful for you. Please let us know your feedback.</p>
]]></content:encoded>
			<wfw:commentRss>http://raynux.com/blog/2011/04/11/send-mail-from-unixlinux-bash-shell-script/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IPTABLES quick command list</title>
		<link>http://raynux.com/blog/2009/04/15/iptables-quick-command-list/</link>
		<comments>http://raynux.com/blog/2009/04/15/iptables-quick-command-list/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 06:09:34 +0000</pubDate>
		<dc:creator>rayhan</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://raynux.com/blog/?p=86</guid>
		<description><![CDATA[Iptables is the default and powerful firewall that works on almost all Linux version including Ubuntu and Fedora. Here I have listed some important commands and a short description of each command for quick help. It can help people who already know little Iptables. manage chain: # iptables -N new_chain // create a chain # [...]]]></description>
			<content:encoded><![CDATA[<p>Iptables is the default and powerful firewall that works on almost all Linux version including Ubuntu and Fedora. Here I have listed some important commands and a short description of each command for quick help. It can help people who already know little Iptables.</p>
<pre><code>
manage chain:
# iptables -N new_chain				// create a chain
# iptables -E new_chain old_chain  		// edit a chain
# iptables -X old_chain				// delete a chain

redirecting packet to a user chain:
# iptables -A INPUT -p icmp -j new_chain

listing rules:
# iptables -L					// list all rules of all tables
# iptables -L -v				// display rules and their counters
# iptables -L -t nat				// display rules for a specific tables
# iptables -L -n --line-numbers			// listing rules with line number for all tables
# iptables -L INPUT -n --line-numbers		// listing rules with line number for specific table

manage rules:
# iptables -A chain				// append rules to the bottom of the chain
# iptables -I chain [rulenum]			// insert in chain as rulenum (default at the top or 1)
# iptables -R chain rulenum			// replace rules with rules specified for the rulnum
# iptables -D chain	rulenum			// delete rules matching rulenum (default 1)
# iptables -D chain				// delete matching rules

change default policy:
# iptables -P chain target			// change policy on chain to target
# iptables -P INPUT DROP			// change INPUT table policy to DROP
# iptables -P OUTPUT DROP			// change OUTPUT chain policy to DROP
# iptables -P FORWARD DROP			// change FORWARD chain policy to DROP
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://raynux.com/blog/2009/04/15/iptables-quick-command-list/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Update your social networking status from command line</title>
		<link>http://raynux.com/blog/2009/02/28/update-your-social-networking-status-from-command-line/</link>
		<comments>http://raynux.com/blog/2009/02/28/update-your-social-networking-status-from-command-line/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 07:27:21 +0000</pubDate>
		<dc:creator>rayhan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://raynux.com/blog/?p=61</guid>
		<description><![CDATA[This is my first python script, Throughout the learning process I want to make something use full and I know that the best way to learn a new programming language is to start with some real project. Updating your social networking status is now a frequent job. To make this job easier there are lots [...]]]></description>
			<content:encoded><![CDATA[<p>This is my first python script, Throughout the learning process I want to make something use full and I know that the best way to learn a new programming language is to start with some real project.</p>
<p>Updating your social networking status is now a frequent job. To make this job easier there are lots of web services, desktop applications, mobile applications, plug-ins available to the users. Some people wants to update there status from a single place. Like others <a href="http://ping.fm/">Ping.fm</a>, <a href="http://hellotxt.com/">Hellotxt.com</a> are providing single place service with a variety of options. But I think that updating status from command line is the easiest way for most of the Linux users who loves their terminal.</p>
<p>I have used ping.fm REST API for my script as a result It can update all the services registered with ping.fm at once or a single service putting additional parameter. You just need the Internet connection and terminal to put the command.</p>
<p>File: <strong><em>~/bin/raypm</em></strong></p>
<pre>
<code>#! /usr/bin/env python
"""
A Simple program to update your social networking status using ping.fm

This program will update all your social networking sites via ping.fm.

requirements
	- sign for a account at ping.fm
	- setup ping.fm for desired social networking sites.
	- get your developer api key http://www.ping.fm/developers
	- get your user key from http://www.ping.fm/key

@example
	- shell > raypm "your message text to update your all social networking status, like twitter, facebook, linkedin"
	- shell > raypm twitter "your message text to update twitter status only"
	- shell > raypm facebook "your message text to update facebook status only"

@author		: Md. Rayhan Chowdhury
@email		: ray@raynux.com
@website	: www.raynux.com
@license	: GPL
@copy		: All right are reserved
"""

import urllib
import urllib2
import sys
from xml.etree import ElementTree as ET

# modify __apiKey__ with your own
# get your apiKey from http://www.ping.fm/developers
__apiKey__ = 'YOUR DEVELOPER API KEY HERE' 

# modify __userKey__ with your own user key
# get your user key from http://www.ping.fm/key
__UserKey__ = "YOUR USER APP KEY HERE"

__apiUrl__ = 'http://api.ping.fm/v1/'

# debug
# 1 - will not update your status, dump xml response text
# 0 - will update your status
debug = 0

class RayStatus:

	def __init__(self, msg = None, service = None):
		"create message"    

		global debug

		data = {	'api_key'		: __apiKey__,
					'user_app_key'	: __UserKey__,
					'post_method'	: 'default',
					'body'			: msg,
					'debug'			: debug
                  }
		if service is not None:
			data['service'] = service		

		#Encode the data to be posted
		data = urllib.urlencode(data)	

		print "Loading..."
		# post the data
		req = urllib2.Request(__apiUrl__ + 'user.post', data)
		try:
			response = urllib2.urlopen(req)

			responseXML = response.read()

			# parse response data
			result = ET.XML(responseXML)
			if result.attrib is not None:
				if result.attrib['status'] == 'OK':
					print 'Congratulations! your message posted successfully!';
				else:
					print 'Error: ' + result[2].text

			if debug:
				print
				print "debug info: "
				print responseXML

		except urllib2.URLError, e:
			if hasattr(e, 'reason'):
				print 'Could not connect to the server.'
				print 'Reason: ', e.reason
			elif hasattr(e, 'code'):
				print 'The server couldn\'t fulfill the request.'
				print 'Error code: ', e.code
		else:
			print

if __name__ == '__main__':
	try:
		if (len(sys.argv) == 2):
			RayStatus(sys.argv[1], None)
		elif (len(sys.argv) == 3):
			RayStatus(sys.argv[2], sys.argv[1])
	except IndexError:
		print "Please enter your desired message to be posted."
</code></pre>
<p>To make the script working, you need to sign up for a <a href="http://ping.fm">ping.fm</a> user account, and registrar for services you want, they support all major social networking sites including <a href="http://www.twitter.com">twitter</a>, <a href="http://www.facebook.com">facebook</a>, <a href="http://www.linkedin.com">linkedIn</a>. </p>
<p>You will need to get these two keys.<br />
- developer api_keys from <a href="http://ping.fm/developers/">http://ping.fm/developers/</a><br />
- user app key from  <a href="http://ping.fm/key/">http://ping.fm/key/</a></p>
<p>I have my developer api key from <a href="http://ping.fm/">ping.fm</a> which will work for you, but I can&#8217;t disclose it openly. It will be great to have your own api key  and user key is unique for each user. </p>
<p>Installation:</p>
<ol>
<li>create a directory inside your home folder named <strong>bin</strong></li>
<li>create a file named <strong>raymp</strong> inside the bin folder and copy and paste the code</li>
<li>replace <strong>api key</strong> and <strong>user key</strong> with your own.</li>
<li>make the file executable with this command<br />
                <code># chmod +x ~/bin/raypm</code></li>
<li>you may need to restart the system to add the newly added bin folder to PATH.</li>
</ol>
<p>&#038; done.</p>
<p>now you can update your status with the following commands<br />
<code># raypm "update all social networking status at once"</code><br />
or<br />
<code># raypm twitter "update twitter status only"</code><br />
or<br />
<code># raypm facebook "update facebook status only"</code></p>
]]></content:encoded>
			<wfw:commentRss>http://raynux.com/blog/2009/02/28/update-your-social-networking-status-from-command-line/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Mac on my ubuntu laptop</title>
		<link>http://raynux.com/blog/2009/02/19/mac-in-my-laptop/</link>
		<comments>http://raynux.com/blog/2009/02/19/mac-in-my-laptop/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 10:06:33 +0000</pubDate>
		<dc:creator>rayhan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mac4lin]]></category>

		<guid isPermaLink="false">http://raynux.com/blog/?p=49</guid>
		<description><![CDATA[Mac4Lin is a great project which brings mac user interface to linux desktop. Yesterday I installed Mac4Lin on my laptop running ubuntu intrepid idex. Installation needs some advance configuration which is not suitable for newbie right now even I couldn&#8217;t install screenlets desktop widget. But still it&#8217;s cool and I am really impressed with the [...]]]></description>
			<content:encoded><![CDATA[<p>Mac4Lin is a great project which brings mac user interface to linux desktop. Yesterday I installed Mac4Lin on my laptop running ubuntu intrepid idex. Installation needs some advance configuration which is not suitable for newbie right now even I couldn&#8217;t install screenlets desktop widget. But still it&#8217;s cool and I am really impressed with the new mac like interface on my laptop. I have added couple of screenshots on my <a href="http://www.flickr.com/photos/raynux">flickr photo-stream</a>.</p>
<p><a href="http://www.flickr.com/photos/raynux/3292686432/" title="5 by rayhan_wm, on Flickr"><img src="http://farm4.static.flickr.com/3626/3292686432_af5b598087.jpg" width="500" height="313" alt="5" /></a></p>
<p>More Photos: <a href="http://www.flickr.com/photos/raynux/tags/mac4lin/">http://www.flickr.com/photos/raynux/tags/mac4lin/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://raynux.com/blog/2009/02/19/mac-in-my-laptop/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Install Additional softwares by a single command on Ubuntu</title>
		<link>http://raynux.com/blog/2008/11/21/install-additional-softwares-by-a-single-command-on-ubuntu/</link>
		<comments>http://raynux.com/blog/2008/11/21/install-additional-softwares-by-a-single-command-on-ubuntu/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 20:49:15 +0000</pubDate>
		<dc:creator>rayhan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Bash Script]]></category>
		<category><![CDATA[Install]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://raynux.com/blog/?p=45</guid>
		<description><![CDATA[I have created a bash script file to install almost all necessary softwares to run and work on a Ubuntu box. I have tried this script in Ubuntu 8.04 Hardy Heron and Ubuntu 8.10 Intrepid Ibex. Softwares I have placed in this script covers PHP-MySQL development and desktop applications for graphics, multimedia, to Internet applications. [...]]]></description>
			<content:encoded><![CDATA[<p>I have created a bash script file to install almost all necessary softwares to run and work on a Ubuntu box. I have tried this script in Ubuntu 8.04 Hardy Heron and Ubuntu 8.10 Intrepid Ibex. Softwares I have placed in this script covers PHP-MySQL development and desktop applications for graphics, multimedia,  to Internet applications. You can also add your favourite softwares in the script.</p>
<p>File: <strong><em>RayInstall.sh</em></strong></p>
<pre><code>
# RayInstall.sh
#
# Ubuntu Intrepid &amp; Hardy
#
# A very simple Bash Script file to automate installation of necessary
# softwares for PHP-MySQL development and desktop uses in a ubuntu box
#
# This may take several hours or even days depending on your internet connection speed.
#	It tooks 8 Hours for me with about 70-130 KBps of speed
#
# @uses Aplication -&gt; Accesories -&gt; Terminal
#		Now write following command "sudo sh ./RayInstall.sh" without quotes
#		and press enter button on your keyboard
#
# @author ray@raynuxcom
# @licence GPL

#
# For PHP-MySQL Based Development
#

# Install Apache version 2 web server
apt-get -y install apache2 apache2-doc

# Install PHP with necessary modules
apt-get -y install php5 libapache2-mod-php5 php5-cli
apt-get -y install php5-curl php5-dev php5-gd php5-gmp php5-imap php5-ldap php5-mcrypt php5-mhash php5-ming php5-odbc php5-pspell php5-snmp php5-sybase php5-tidy curl libwww-perl imagemagick

# Install MySQL Database server
apt-get -y install mysql-server php5-mysql mysql-gui-tools-common

#Restart apache
/etc/init.d/apache2 restart

# Install Webmin, A web based frontend for linux box.
apt-get -y install webmin

# Install Subversion &amp; Rapidsvn a subversion gui client tools
apt-get -y install subversion subversion-tools libapache2-svn
apt-get -y install rapidsvn

#Restart apache
/etc/init.d/apache2 restart

#Install Doxygen, An documentation tools for PHP Application
apt-get -y install doxygen doxygen-gui doxygen-doc graphviz

# Install Phpmyadmin, A web based mysql administration tools
apt-get -y install phpmyadmin

# Install Java runtime for Eclipse PDT to work properly
apt-get -y install sun-java6-bin sun-java6-jdk sun-java6-jre

# Install Eclipse PDT
# Just download the pdt-all-in-one peckage from zend site
# http://downloads.zend.com/pdt/all-in-one/pdt-1.0.3.R20080603_debugger-5.2.14.v20080602-all-in-one-linux-gtk.tar.gz
# Unpack it in a suitable location.
# run eclipse/eclipse from the unpacked folder and you are done
# Now install Subclipse plugin using eclipse update tools

#
# Graphics, 2D and 3D Modeling Softwares &amp; tools
#

# Install inkscape, An Illustrator alternative
apt-get -y install inkscape

# Install dia and graphical UML modeling tools
apt-get -y install dia

# Install Scribus, An alternative to Adobe Pagemaker
apt-get -y install scribus

# Install Cheese,  Webcam Software, a video and photo shoot application with cool effects for the GNOME desktop
apt-get -y install webcam cheese

# Install QCAD, and linux alternative to CAD Program.
apt-get -y install qcad

# Install Blender, Linux alternative for 3D Modeling
apt-get -y install blender

#
# Misc. Tools
#

# Install Wine, to run windows program
apt-get -y install wine

# Install XChm to read CHM Help file and Manual
apt-get -y install xchm

#
# Multimedia Players and codec
#

# Install GStreamer restricted codec to run mp3 and other media file
apt-get -y install gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad

# XMMS2 Media player
apt-get -y install xmms2 gxmms2

# Install vlc player, An alternative media player. Can play DVD file with title
apt-get -y install vlc vlc-plugin-*

# Install Amarok music player
apt-get -y install amarok

# Install k3b, A dvd burner application
apt-get -y install k3b

#
# Network and internet tools
#

# Install OpenSSH server to access your ubuntu box remotely
apt-get -y install openssh-server openssh-client

#Install gnome-network-admin, not available in default ubuntu 8.10
apt-get -y install gnome-network-admin

# Install Webhttrack, Website copier tools for linux
apt-get -y install webhttrack

# Install kopete instant messenger
apt-get -y install kopete

# install Internet Explorer in Ubuntu (Experimental)
apt-get -y install wine cabextract msttcorefonts

#run the following command manually to install IE
# wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
# tar zxvf ies4linux-latest.tar.gz
# cd ies4linux-*
# ./ies4linux
</code>
</pre>
<p>If you are using Ubuntu on your computer and want to automate the installation process utilising this script then perform the following steps:</p>
<ul>
<li>Create a file name <em>RayInstall.sh</em> in you home folder.</li>
<li>Copy and paste the above code inside the the file and save it.</li>
<li>Open a terminal window from <em>Applications -&gt; Accessories -&gt; Terminal</em></li>
<li>Write the following command</li>
<li><code>sudo sh ./RayInstall.sh</code></li>
<li>press <em>Enter</em></li>
<li>Now it will start installing all the softwares listed in the script and you may need to provide some information during installation process when needed.</li>
</ul>
<p>This script may be helpful for newbies. If you have any comment or suggestion regarding this script please let me know as I am also a newbie in Ubuntu.</p>
]]></content:encoded>
			<wfw:commentRss>http://raynux.com/blog/2008/11/21/install-additional-softwares-by-a-single-command-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Recovering Ubuntu or Fedora Linux after installing windows</title>
		<link>http://raynux.com/blog/2008/09/21/recovering-ubuntu-or-fedora-linux-after-installing-windows/</link>
		<comments>http://raynux.com/blog/2008/09/21/recovering-ubuntu-or-fedora-linux-after-installing-windows/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 19:40:26 +0000</pubDate>
		<dc:creator>rayhan</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Boot]]></category>
		<category><![CDATA[GRUB]]></category>
		<category><![CDATA[Troublshooting]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://raynux.com/blog/?p=41</guid>
		<description><![CDATA[Running linux with windows in dual boot mode is not hassle free at all. Specially if you reinstall or repair windows, your linux system will disappear. As a newbie you may stop using linux or reinstall it again instead of solving the problem. In this article I will share my experience on how to recover [...]]]></description>
			<content:encoded><![CDATA[<p>Running linux with windows in dual boot mode is not hassle free at all. Specially if you reinstall or repair windows, your linux system will disappear. As a newbie you may stop using linux or reinstall it again instead of solving the problem. In this article I will share my experience on how to recover the boot option for linux. I will cover two well known linux distro ubuntu 8 and fedora 7. I will try to cover the fail safe situation here.</p>
<p>In both Fedora and Ubuntu this task includes two basic steps. These are:</p>
<ul>
<li><strong>Enter into your existing hard disk linux system.</strong></li>
<li><strong>Setup GRUB Boot Loader using GRUB program.</strong></li>
</ul>
<p><strong>a. Enter into your existing hard disk linux system.</strong></p>
<p>Fedora 7:</p>
<p>In fedora recovering grub is easy task as fedora automatically mount the existing system image to /mnt/sysimage in rescue mode.</p>
<ol>
<li>Insert the fedora installation cd to boot from cd.</li>
<li>When the boot menu appear enter the rescue mode. A message will be prompt saying mounting the existing fedora system on /mnt/sysimage, click ok.</li>
<li>In rescue mode you will be in a shell</li>
<li>Enter the following command<br />
<code>#chroot /mnt/sysimage</code></li>
<li>Now you are in your existing fedora operating system.</li>
</ol>
<p>Ubuntu 8.04 LTS:</p>
<p>In ubuntu you will have to mount the existing system image manually.</p>
<ol>
<li>Insert the ubuntu live cd and start a live session from cd.</li>
<li>open the terminal window</li>
<li>the following command will display currently mounted device or harddisk partitions<br />
<code>#df -h</code></li>
<li>get the device name for <em>/boot</em> if exists or <em>/</em> (root) partition say <em>/dev/sda9</em>.</li>
<li>enter the following command<br />
<code>#sudo mkdir ubuntu<br />
#sudo mount -t ext3 /dev/sda9 ubuntu</code></li>
<li>If you have separate <em>/usr</em> partition say <em>/dev/sda7</em> enter the following command too.<br />
<code>#sudo mount -t ext3 /dev/sda7 ubuntu/usr<br />
</code></li>
<li>Enter the following command to mount <em>/proc</em> and <em>/dev</em> and change chroot.<br />
<code>#sudo mount -t proc none ubuntu/proc<br />
#sudo mount -o bind /dev/ ubuntu/dev<br />
#sudo chroot ubuntu /bin/bash</code></li>
<li>Now you are in your existing ubuntu operating system.</li>
</ol>
<p><strong>b. Setup GRUB Boot Loader using GRUB program.</strong></p>
<p>In grub you are mainly required to find the boot device and set the root to bood device.</p>
<ol>
<li>Insert the ubuntu live cd and start a live session from cd.<br />
<code>#grub</code></li>
<li>Find the existing boot device using following command. Which will out put something like (hd0,0) or (hd0,5) say (hdX,Y).<br />
<code>#grub&gt; find /boot/grub/stage1</code></li>
<li>Use the above output in the following two commands.<br />
<code>#grub&gt; root (hdX,Y)<br />
#grub&gt; setup (hdX)<br />
#grub&gt; quit</code></li>
<li>if everything is ok then you are done. just reboot the system.</li>
</ol>
<p>This article is completely based on my current experience and I am still a newbie in linux environment. so there may have sevaral other options to do the same task.</p>
]]></content:encoded>
			<wfw:commentRss>http://raynux.com/blog/2008/09/21/recovering-ubuntu-or-fedora-linux-after-installing-windows/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Listen MP3 on Fedora Linux box.</title>
		<link>http://raynux.com/blog/2008/07/20/listen-mp3-on-fedora-linux-box/</link>
		<comments>http://raynux.com/blog/2008/07/20/listen-mp3-on-fedora-linux-box/#comments</comments>
		<pubDate>Sat, 19 Jul 2008 18:03:00 +0000</pubDate>
		<dc:creator>rayhan</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Reference]]></category>

		<guid isPermaLink="false">http://raynux.com/blog/?p=37</guid>
		<description><![CDATA[I receives lots of call from my friends to help them fixing mp3 problem in fedora. Some of them already have internet connection to their fedora box. Here is a single command what can solve the problem if you have internet connection. # yum -y install gstreamer* This command will automatically find, download and install [...]]]></description>
			<content:encoded><![CDATA[<p>I receives lots of call from my friends to help them fixing mp3 problem in fedora. Some of them already have internet connection to their fedora box. </p>
<p>Here is a single command what can solve the problem if you have internet connection.</p>
<p><code><br />
# yum -y install gstreamer*<br />
</code></p>
<p>This command will automatically find, download and install the GStreamer mp3 codec for you. Then you can enjoy the mp3 song with your favorite music player.</p>
<p>You can download xmms one of the popular mp3 player on your fedora system. It is a Winamp alternative to linux. To install this software enter the following command.</p>
<p><code><br />
# yum -y install xmms*<br />
</code></p>
<p>After installing xmms you will find the menu Application -> Sound &#038; Video -> Audio Player to launch the xmms player.</p>
]]></content:encoded>
			<wfw:commentRss>http://raynux.com/blog/2008/07/20/listen-mp3-on-fedora-linux-box/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>GPRS Connection from fedora linux using my moto L6</title>
		<link>http://raynux.com/blog/2008/07/19/gprs-connection-from-fedora-linux-using-my-moto-l6/</link>
		<comments>http://raynux.com/blog/2008/07/19/gprs-connection-from-fedora-linux-using-my-moto-l6/#comments</comments>
		<pubDate>Sat, 19 Jul 2008 16:19:55 +0000</pubDate>
		<dc:creator>rayhan</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[GPRS]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://raynux.com/blog/?p=36</guid>
		<description><![CDATA[This is how I connect to internet from fedora box using my motorola L6 GPRS modem. I use this procedure with Teletalk connection. After a fresh fedora installation I enter the following command in the shell. This command creates a wvdial configuration file for my modem. # wvdialconf /etc/wvdial.conf Now I need to modify some [...]]]></description>
			<content:encoded><![CDATA[<p>This is how I connect to internet from fedora box using my motorola L6 GPRS modem. I use this procedure with Teletalk connection.</p>
<p>After a fresh fedora installation I enter the following command in the shell. This command creates a wvdial configuration file for my modem.<br />
<code><br />
# wvdialconf /etc/wvdial.conf<br />
</code><br />
Now I need to modify some contents of wvdial.conf file. To do so I open the /etc/wvdial.conf using VI or other text editor. And replace the content of the file with the following text and save it.</p>
<pre>
<code>
[Dialer Defaults]
Modem = /dev/ttyACM0
Baud = 460800
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &amp;C1 &amp;D2 +FCLASS=0
ISDN = 0
Modem Type = USB Modem
Phone = *99#
Username = A
Password = B
Stupid Mode = 1
</code>
</pre>
<p>I make sure to set  username = A, Password=B and Stupid Mode = 1 and do not modify the line<br />
<code><br />
Modem = .....<br />
</code><br />
as this is my device name (this line can very with your phone set). Now whenever I need to connect to internet I just enter the following command to the shell.<br />
<code><br />
# wvdial<br />
</code><br />
Thats all. Same way you can turn your mobile set to internet from fedora with no or little modification.</p>
]]></content:encoded>
			<wfw:commentRss>http://raynux.com/blog/2008/07/19/gprs-connection-from-fedora-linux-using-my-moto-l6/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

