Archive for the 'GNU/Linux' Category

Differences between Ubuntu and Redhat Linux

magnet December 3rd, 2008

The following Blog is a short summary on Redhat and ubuntu and some differences between them, we have also provided a some commands and file names on how to configure network in RedHat PCs and in Ubuntu PCs, so you could understand that configuring network in both of them is different.


 

Red Hat Enterprise Linux is not free, and its also used for business.Red Hat Linux, assembled by the company Red Hat, was a popular Linux based operating system.
Red Hat Linux 1.0 was released on November 3, 1994. It was originally called “Red Hat Commercial Linux”[2] It is the first Linux distribution to use the packaging system, the RPM Package Manager as its packaging format, and over time has served as the starting point for several other distributions, such as Mandriva Linux and Yellow Dog Linux.


Red Hat’s Features:
Red Hat Linux introduced a graphical installer called Anaconda, intended to be easy to use for novices, and which has since been adopted by some other Linux distributions. It also introduced a built-in tool called Lokkit for configuring the firewall capabilities.

 It uses .rpm package called Red Hat Package Manager.

Definition rpm: The RPM Package Manager (RPM) is a powerful command linedriven package management system capable of installing, uninstalling, verifying, querying, and updating software packages. Each software package consists of an archive of files along with information about the package like its version, a description, etc.

 

Now What is yum? yum, also called Yellow dog Updater Modified, is a Linux utility which is use to install RPM packages/Binary Files (.rpm files). You can use yum with the following options.

 

Installing packages(.rpm):- To install any .rpm packages follow these command.

# yum install packagename

  # rpm -ivh packagename.rpm

 

Networking

etworking Files are that files by which system get connected in the Network.

By editing these files system will be get connected in Network.

 To set IP Address

# system-config-network

  or in the below file:

# cat /etc/sysconfig/network-scipts/ifcfg-eth0

To set gateway

# system-config-network

or in the below file:

# cat /etc/sysconfig/network

To set DNS

 #cat /etc/resolv.conf

To set hostname

# hostname yourcomputerName

# cat /etc/sysconfig/network

 

Booting Files

 

# cat /boot/grub/grub.confAbout grub.conf :- Grub Conf is a Gnome2 based GRUB configuration editor. It provides an easy to use interface allowing effortless modification of OS’s and the flexibility to configure the most obscure options. Designed to require minimal user interaction while providing tools for the most adventurous user.

To see the version of Operating System:

# cat /etc/redhat-release

To on services permanently:

# chkconfig servicename on

                                                                 Ubuntu Ubuntu is an operating system, like windows.Ubuntu is a Linux distribution that starts with the breadth of Debian and adds regular releases (every six months), a clear focus on the user and usability (it should “Just Work”, TM) and a commitment to security updates with 18 months of support for every release. Ubuntu ships with the latest Gnome release as well as a selection of server and desktop software that makes for a comfortable desktop experience off a single installation CD.

Ubuntu uses the.deb apt package:- Ubuntu uses .deb package for package installation as like .rpm of Red Hat.

Ubuntu also uses apt-get package installer to install packages by using command mode.
To install package Graphically, synaptic package manager.

Installing Packages (.deb)

# apt-get install packagename

# dpkg -i packagename.deb

To install packages Graphically by synaptic:

System -> Administrator -> Synaptic Package Manager

Networking

Some files to get connected system in Network.To set IP Address & Gatway

# cat /etc/network/interfaces

To set DNS

# cat /etc/resolv.conf

To set hostname

# cat /etc/hostname

Powered by ScribeFire.

Fetchmail and large emails

nirav April 29th, 2006

When came to office on Saturday, I wanted to spend some time on OpenCerti and complete the pending ActionScript work. But there was a problem waiting! The emails were stuck, and we were getting duplicate emails.

Let me give you some background. We have a set of Linux servers in the office. The magnet-i.com site is hosted in a NOC in USA. We have a few POP accounts on the server and a catchall. The catchall captures emails for most of the users. POP accounts are primarily used by people who travel and need roaming access etc. We download emails to local server using Fetchmail. The internet connection is via cable modem and DSL.

Now this kind of problems have happened before. I remember in the dialup days, if we had a large number of emails, and if the internet connection drops while fetchmail is running, it would start downloading all the emails again the next time you connect. Resulting in duplicate emails.

This time around, we have a major recruitment drive going on. The catchall account was more than 85MB in size. And fetchmail was giving up on it. It was not only the size, but also the number of messages that was big. And the mails were not only for the HR, but also for other people in the organization.

I and Vishal looked at the problem and first tried to delete unwanted mails via webmail. We got it down to 55MB, but this was still too big for fetchmail to handle on our internet connection.

The next step we generally take is to take the mbox file, bzip2 it, download it over web, append to the local mbox, and let the mails flood into the email client. This time, we couldn’t do it because it was not only one user account that the emails were destined too. But this is the track that we take up.

The mbox file contains all the mails in a single file. So we SSH’ed to the server, located the catchall account (something like /home/user/mail/domainname/emailaccount/ on cpanel servers) mailbox. Doing a bzip2 on it, got the file size down to 11MB. (OT: I wonder why they didn’t add compression in POP/SMTP. That would have saved a lot of traffic).

Downloading this via web (so that we can resume the download if it gets broken) did not work. Somehow our server did not allow direct file downloads. (Guess it was me only who disabled hot links like this..) We didn’t have too much time to go reconfigure the server, so we simply FTP’ed the file to one of our servers that we use for exchanging files with clients. Downloaded the 11MB file to local machine and posted it on the mail server.

Now what?

Idea! What if we configure fetchmail to connect to the local POP server? We could create a new user and push the downloaded mails into the new user’s mbox file. When fetchmail connects to the local server to fetch emails, it will fetch emails from this new account. And it can deliver them to the local users as per the original configuration!

The idea was right, and we tested it with one or two messages in the mbox file. First it bounced back, saying there’s a “mail forwarding loop”. We removed the “no dns, aka magnet-i.com” part from the fetchmail config, and it started pushing the emails to the postmaster. At least it did not bounce back! A few trials later - and inspecting the logs and the postmaster emails - we figured it out. We need to have the “aka magnet-i.com” line in, and have the mbox file of the server.

So set this up, ran fetchmail, and it went chopping the mbox like crazy and delivering emails to the local users. If we used some other method (like downloading only new messages with UIDL etc), it would have taken 5 times more time to download the emails, and we would have to monitor the process.

This gets us the best practices for handling large emails that are stuck on the server.

  • Bzip the mbox file. Download it via web.
  • Unzip the mbox file on local server. And process it there.
  • If it’s a single email account, simply append the mbox file to local mbox file. And let the user dowload emails via her email client.
  • If there are multiple email accounts in the mbox file (mbox of a catchall), create a new account on local server and append the mbox to it. Add a rule in .fetchmailrc to use local server as POP3 and fetch emails for the new account created. And then distribute it to “* here”
  • You can use “fetchmail -v” for verbose output.
  • Monitor /var/log/maillog and /var/log/fetchmail.log for info. Also check the postmaster account (we run Postfix) for error reports.

Good troubleshooting for the day! I am off to something bigger now!

Mark Shuttleworth at Mumbai Linux Users Group

nirav January 23rd, 2006

Mark Shuttleworth at Mumbai Linux Users Group

Mark Shuttleworth spoke at the Mumbai LUG yesterday. The event was attended by around 60 people. Mark was late due to traffic but he spoke well about Ubuntu, community building and his experiences of India. The question a lot of people wanted to ask: “How do you manage to send out so many free CDs?” was aptly answered when Mark remarked at the end: “(cause) I can afford it!”

But Mark is really an inspiring person. I was moved by how he spoke, answered the questions, and achieved so much at this age. I wish he could speak more and there was more time for interaction.

And yes, people ran to grab the Ubuntu CDs!

The pictures will be available on the LUG site soon!

Mark Shuttleworth visiting India

nirav January 17th, 2006

Mark Shuttleworth of Ubuntu is on the Asia Business Tour, and will be in Mumbai this weekend. (21st and 22nd January). He is going to speak during the GNU/Linux Users meet on Sunday and people are all excited about the event.

I was not paying close attention to the thread on the mailing list, until I saw BG’s post giving a strong piece of advice ;-)

I knew Mark is the founder of Canonical and Ubuntu. Ubuntu changed the whole Linux distribution model and lot of people have switched to Ubuntu - including us. For me, Ubuntu was a friendly Debian and it rocked! So I went ahead to read more about him.

And boy, was I surprised! This guy founded Thawte! We have been using Thawte certificates for a while and I never knew Mark was the founder, sitting in South Africa! Mark, true to his surname, has also been an astronaut. He runs a venture capital firm, and has a lot of other community interests. I am thrilled!

I am sure it’s going to be inspirational to meet him!