Friday, May 29, 2009

Installation of Sun xVM VirtualBox on Ubuntu 8.10 Intrepid Ibex and Ubuntu9.04 Jaunty Jackalope

This tutorial shows how you can install Sun xVM VirtualBox on Ubuntu 8.10 Intrepid lbex desktop and on Ubuntu9.04 Jaunty Jackalope . VirtualBox is similar to Mvware,

Using Virtualbox you can create and run guest operating systems virtual Machines such as Linux and Windows under a host operating system.

- Install Sun Virtualbox on Ubuntu9.04 Jaunty Jackalope

you will have just to use this command :

sudo apt-get install virtualbox 

For Ubuntu 8.10 Intrepid Ibex desktop

First we have to add virtualbox repository to our apt installation the 3 line together one after one :

/bin/echo "# VirtualBox repository for Ubuntu 8.10 Intrepid Ibex
deb intrepid non-free" \
 | /usr/bin/sudo /usr/bin/tee /etc/apt/sources.list.d/intrepid-virtualbox.list
Then we install the key for this repository :
/usr/bin/wget -O- | sudo apt-key add -

Now we have to update our package :

/usr/bin/sudo /usr/bin/apt-get update

At the end install VirtualBox :

/usr/bin/sudo /usr/bin/apt-get install virtualbox-2.0

Now you will find the application on your ubuntu start menu:

Applications > System Tools

To be sure that everything will work good, we will recompile the necessary kernels for this software :

/usr/bin/sudo /etc/init.d/vboxdrv setup 

We advice people that has problem to run the application , to use the command above because will force

to lunch the application. Now we will add the users that has permission to use VirtualBox :

/usr/bin/sudo /usr/sbin/adduser $USER vboxusers 
If you will use immediately the application, use the commands below  
/usr/bin/sudo /etc/init.d/udev reload /usr/bin/sudo /sbin/modprobe vboxdrv /bin/su -c /usr/bin/VirtualBox $USER 

And is done :)

Now we are ready to install virtual machines on our VirtualBox, below will describe how to use VirtualBox

 to install RHEl 5

First open your VirtualBox from Applications > System Tools see pic1

Click next and choose to install RHEL 5, give a name to the virtual machine see pic2 :


Next you have to choose how much memory you want to give to RHEL 5 (better shoose standard) see and click next

Next you have to create partition for RHEL 5 pic4 (me i did soose 2Go) and click next

Then choose fixed size image (pic4) and click next

and then choose the image and  finish.

Now before to click finish insert the cd of Rhel 5 then click on finish, a new screen will ask you
from where you want to install RHEL 5,choose CD/DVD : 
Then the installation of RHEL will run automaticaly from the CD/DVD 
Now follow the normal installation procedure of RHEL 5
Now RHEL 5 is installed on your Ubuntu Enoy !!!!!!!!!!!!!!!!!

Tuesday, May 19, 2009

Brasero Burner On Ubuntu

Brasero now supports multi session, joilet extension, can write an image to a hard drive, and check disc file integrity for data CDs and DVDs. Features for burning audio CDs include write CD-TEXT information, on-the-fly burning, use all audio files handled by Gstreamer local installation (ogg, flac, mp3, ...), and search for audio files inside dropped folders. Using the Brasero burner CD/DVD copy option you can copy a CD/DVD to the hard drive, copy CD and DVD on the fly, use single-session data DVD, and really supports any type of CD. Other features you'll want to take note of are erase CD/DVD feature, save/load projects, burn CD/DVD images and cue files, song image and video previewer, and device detection, and more.

Here you can see Brasero burner is located under Applications --- Sound & Video --- Brasero Disc Burning on the Ubuntu desktop.

brasero burner on ubuntu 8.04 hardy heron

After opening Brasero CD/DVD burning program you can see in the screen shot below four options. Create a traditional audio CD, data CD/DVD, copy CD/DVD, and Burn an image to CD/DVD.

create a new project with brasero burner on ubuntu 8.04 hardy heron

You may be asked to make Brasero burner your default burning application, here you may select yes or no and additionally don't show this dialogue again.

make brasero burner your default ubuntu 8.04 hardy heron burning application

Here we see the data CD creation interface. One nice feature is the many ways that files can be added to the window on the right especially drag and drop to add or remove files. burn a new data disc with brasero burner on ubuntu 8.04 hardy heron

When you've added all of the data files you want, select the burn button.

Now just specify where you're burning to, how many copies you want, your discs label, and other options. Click burn and you're done.

disc burning setup and options in brasero burner on ubuntu 8.04

Tomcat6 Installation on Ubuntu

If you are running Ubuntu and want to use the Tomcat servlet container, you should not use the version from the repositories as it just doesn't work correctly. Instead you'll need to use the manual installation process that I'm outlining here.Before you install Tomcat you'll want to make sure that you've installed Java. I would assume if you are trying to install Tomcat you've already installed java, but if you aren't sure you can check with the dpkg command like so:
dpkg –get-selections | grep sun-java

This should give you this output if you already installed java:

install sun-java6-bin

install sun-java6-jdk

install sun-java6-jre

If that command has no results, you'll want to install the latest version with this command:

sudo apt-get install sun-java6-jdk


Now we'll download and extract Tomcat from the apache site. You should check to make sure there's not another version and adjust accordingly.



tar xvzf apache-tomcat-6.0.14.tar.gz

The best thing to do is move the tomcat folder to a permanent location. I chose /usr/local/tomcat, but you could move it somewhere else if you wanted to.

sudo mv apache-tomcat-6.0.14 /usr/local/tomcat

Tomcat requires setting the JAVA_HOME variable. The best way to do this is to set it in your .bashrc file. You could also edit your file if you so chose.

The better method is editing your .bashrc file and adding the bolded line there. You'll have to logout of the shell for the change to take effect.

nano ~/.bashrc

Add the following line:

export JAVA_HOME=/usr/lib/jvm/java-6-sun

At this point you can start tomcat by just executing the script in the tomcat/bin folder.

Automatic Starting

To make tomcat automatically start when we boot up the computer, you can add a script to make it auto-start and shutdown.

sudo nano /etc/init.d/tomcat6

Now paste in the following:

# Tomcat auto-start
# description: Auto-starts tomcat
# processname: tomcat
# pidfile: /var/run/

export JAVA_HOME=/usr/lib/jvm/java-6-sun

case $1 in
sh /usr/local/tomcat/bin/
sh /usr/local/tomcat/bin/
sh /usr/local/tomcat/bin/
sh /usr/local/tomcat/bin/
exit 0

You'll need to make the script executable by running the chmod command:

sudo chmod 755 /etc/init.d/tomcat6

The last step is actually linking this script to the startup folders with a symbolic link. Execute these two commands and we should be on our way.

sudo ln -s /etc/init.d/tomcat /etc/rc1.d/K99tomcat6
sudo ln -s /etc/init.d/tomcat /etc/rc2.d/S99tomcat6

Features of Ubuntu 9.04 Server Edition

The new version of Ubuntu 9.04 is out and users are looking forward to use it. Here are some of the features that you can expect in Ubuntu 9.04 Server Edition.

1. Ubuntu 9.04 server edition has extended hardware compatibility that ensures it easier for users to deploy it for their needs.

2. OEMs can now pre-install their own default first-boot configuration of Ubuntu Server Edition. This configuration can be replicated across all the Ubuntu servers in their organization.

3. Ubuntu 9.04 server edition on Amazon EC2 makes it happen for businesses to deploy services to external clouds.

4. Ubuntu 9.04 server edition comes with new mail server features that include shared user authentication and enhanced spam protection.

5. Ubuntu 9.04 server edition encourages interoperability by integrating OpenChange and Microsoft Exchange.

For more details about Ubuntu 9.04 server edition, click this link.

How to Install OpenOffice 3.0 on Ubuntu 8.10

I think everyone has the answer about why OpenOffice 3.0 is not include in Ubuntu 8.10 (Intrepid Ibex). This is because the delay of OpenOffice 3.0 release and the developer didn't have time to test it, but don't worry they will include the OpenOffice 3.0 for the next Ubuntu.

Below is the how to install OpenOffice 3.0 on Ubuntu 8.10 (Intrepid Ibex).

1. Go to System -> Administration -> Software Sources
Go to the second tab, "Third-Party Software," click on the "Add" button, and paste the line below.

deb intrepid main

3. Then, click the “Close” button, then the “Reload” one and wait for the application to close!

4. When the Software Sources window will close itself, the update icon will appear in the system tray

5. Click on it and update your system!. Your open source office suite will be up-to-date from now on. Take a look below for some shots of 3.0 in Ubuntu 8.10 (Intrepid Ibex).

Friday, May 15, 2009

Some Usefull scripts

A nice script to find out the no of connection from a particular IP address to the apache

root@sahab-desktop# netstat -n|grep :80|awk {'print $5'}|awk -F: {'print $1'}>netlist;for i in `sort -u netlist` ;do echo -n$i"->";grep -c $i netlist; done;

How to remove frozen messages from mail queue?(exim)

This command will help you to remove the frozen messages from the mail queue.

exim -bp|grep '*** frozen ***' |awk {'print $3'} |xargs exim -Mrm

Command to find all of the files which have been accessed within the last 10 days

The following command will find all of the files which have been accessed within the last 10 days

find / -type f -atime -10 > Monthname.files

This command will find all the files under root, which is ‘/’, with file type is file. ‘-atime -30′ will give all the files accessed less than 10 days ago. And the output will put into a file call Monthname.files.

Find and Remove the editor backup files

find . -name '*~' -type f -print

find . -name '*~' -type f -print |xargs rm -f

Wednesday, May 13, 2009

Team Viewer on ubuntu


TeamViewer establishes connections to any PC or server all around the world within just a few seconds. It work perfect on windows OS. But I have tried it for ubuntu but no .deb packages available. So I used wine for running this application on ubuntu.

Installing Wine Run in terminal

sudo apt-get install wine

Download the team viewer .exe

Select and right click the TeamViewer_setup.exe, there select "open with wine windows program Loader", then follow as-usual steps for installation.

Now the team viewer is ready to use as you like.

Thursday, May 7, 2009

Run a Command without SUDO password - Ubuntu


Today I have tried my client PC run shutdown and reboot command without being enter sudo password. The details given below

Use the command "sudo visudo" to edit the file. Now look for the line "# User alias specification" and add a list of users as follows:#

 User alias specification
User_Alias USERS = user1, user2, user3
Now look for the line "# Cmnd alias specification" and add a command list as follows:

# Cmnd alias specification
Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/reboot, /sbin/halt
Now look for the line "%admin ALL=(ALL) ALL" and add the command which will let USERS give SHUTDOWN_CMDS without a password
:%admin ALL=(ALL) ALL
Now those specified users can use the commands "sudo shutdown", "sudo halt", and "sudo reboot" without being asked for your password.

EDIT: By the way, the reason that these commands can't be used by normal users is that Linux was designed as a multi-user system. You don't want one user shutting down the system while others are using it!

Monday, May 4, 2009

How to Effectively Use Your Bandwidth

This blog tries to help you use your ISP bandwidth wisely! You might be the system administrator of a company who always wanted to limit your fellow workers from downloading the media files, limiting the access of streaming videos which are available in YouTube and wanted to share adequate bandwidth to your SMTP and HTTP Servers. This blog is for those persons.

To Readers: All those starting with # are run by root user and ;'s are comments inside the configuration files

We are going to use the delay_pools TAG in squid.
Before going straight into the configuration, I would like to write some theory.

What exactly are delay pools?

They are simply pools which make a delayed response.
They are essentially bandwidth buckets!
Some of you might have quizzically raised your eyebrows when you read buckets, I know! I too was very much confused about this bucket concept! But I think I can clarify the whole concept for you!

Imagine bandwidth bucket has a normal plastic bucket used to storing water! Instead of water these buckets store bandwidth! Initially it will be full! Initially means when no one is using your bandwidth. When a user requests a page, he will get the respone only if theres enough bandwidth available from the bucket he is using. Bucket actually stores traffic! Bandwidth is expressed in terms of how much data is available in one second, like 1Mb/s (1Mbps)
Traffic is expressed in terms of total data, like 1MB.

Size of bucket determines how much bandwidth is available to a client(s). If a bucket starts out full, a client can take as much traffic as it needs until the bucket becomes empty. Client then recieves bucket allotment at the 'fill rate'. (I will tell about the fill rate later, just remember that word in mind).

There are three types of delay pools.

Class 1 => Single aggregate bucket (Totally shared among the members of the bucket)

Class 2 => To understand it better, assume its applied to Class C networks.
Theres one bucket for each network and 256 individual buckets for each ips of every network. Size of individual bucket cannot exceed the network bucket!

Class 3 => One aggregate bucket, 256 network buckets, 65536 individual buckets. (Class B networks)

Now into configuration,

Firstly we need to define how many delay pools we are doing to declare.

delay_pools 2
This means that we have two delay pools.

delay_class 1 3
This means that the first pool is a class 3 pool (Class B networks)

delay_class 2 1
This means that the second pool is a class 1 pool (Single aggregate bucket)

For each pool we should have a delay_class line.

Now we need to define each pools parameters, like the capacity of each pool and fill rate.

delay_parameters 1 7000/15000 3000/4000 1000/2000
this is delay pool parameters for the pool 1
Pool 1 was a class 3 pool. Class 3 pool has 3 buckets, one aggregate bucket, one for 256 networks and one for 65536 individual ips!

delay_parameters 2 2000/8000
The second pool of type class 1. Class 1 has only one aggregate bucket!

Now whats this 2000/8000?
Each bucket is recognized by its rate/size
Here 8000 means that the maximum capacity of the bucket!
And it refills at the rate of 2000 bytes/second
This means that if the bucket is empty, it takes 4 seconds for the bucket to get full if no clients are accessing it!

If you find a declaration like this,
delay_paramters 2 -1/-1
This means theres no limitation to the bucket!

Now lets take an example.

Our ISP connection is 12Mbps and we want our machines to have a maximum of 4 Mbps at peak time.
The rest we dedicate for SMTP or other production servers. We are going to define only one delay pool of class 1

What is actually 12Mbps?

1Mbps = 1 Megabits per second => 1/8 Megabytes per second (8 bits = 1 byte)
1/8 Megabytes per second => 1/8 * 1024 Kilobytes per second => 128Kilobytes per second => 128KBps
so 1 Mbps => 128 KBps
so 12 Mbps => 128 * 12 = 1536 KBps => 1.5 MBps
To sum up
so 12 Mbps = 12/8 MBps => 1.5 MBps

So with this ISP connection we can download a 6 MB file in 4 seconds!

So here the maximum bandwidth available to machines must be 4 Mbps only! (4Mbps ~ 0.5 MBps ~ 512 KBps)

delay_pools 1
delay_class 1 1
delay_parameters 1 524288/1048576

524288 => 524288/1024 KB => 512 KB => 512/1024 MB => 0.5 MB => 0.5*8 => 4Mb

1048576 => 1048576/1024 KB => 1024 KB => 1 MB

Initially the bucket will be full (1 MB traffic). Now a client makes a request to download a 5 MB file.
It will get the maximum speed(12 Mbps) until it downloads 1 MB, but after that it gets only 0.5 MBps
For 1 MB, it takes 1 second as full bucket is available at first. As the bucket drains, it fills at the rate of 0.5 MBps only.
So 0.5 MBps will only be available after 1 MB has been downloaded!
So the file will get downloaded in 9 seconds. (This is all in theory :P)

There another TAG associated with delay_pools.
delay_initial_bucket_level => this parametes expects a value in percentage(%)
This parameter specifies how much bandwidth is put in each bucket when squid service starts.
By default, the value will be 50%, which means that in the previous example, the client will
download at full speed till the download reaches 0.5 MB


acl throttled src
delay_pools 1
delay_class 1 1
delay_parameters 1 524288/1048576
delay_access 1 allow throttled

Note: delay_access is very similar to http_access. It determines which delay pool a request falls into!

Hope this was useful for you!

Friday, May 1, 2009

Review and Future of Ubuntu Jaunty 9.04

Jaunty is very good. Its the first version of a linux distribution that I'd pretty much recommend to anyone to try (with only a few minor caveats about possible hardware issues and the fact that Linux users still can't watch netflix). It has made vast improvements over Hardy from a year ago. Its stable, snappy, and quite a number of annoyances that I onced experienced have been fixed or minimized. Below I go through these in more detail. Now, though I want to focus on what I hope for the next version of Ubuntu (codenamed "Karmic Koala").

Cloud computing is the wave of the future, so I'm very happy this development cycle is making this a focus. But I'm doubtful they will go far enough to really make a lot of difference for most people. What people want now is to be able to sync up there data with various computers they possess and with online services they rely on. To this effect:

  1. Evolution needs to sync seamlessly with Google calander, email, and contacts.

  2. Evolution also needs to sync seamlessly with services like "Remember the Milk". Tasque does this ok presently on Linux, but it has a way to go to be really polished

  3. Tomboy needs to be able to sync across multiple computers. Yes, there is the beginning of such functionality already built into it, but its hard to set up, and even when it is, it doesn't sync automatically.

  4. Thank god for Dropbox, an excellent program that should be further promoted

Certain features need to be implimented consistantly:

  1. I really like the new notification system, but programs like Firefox and Amarok have not been made to use this system.

  2. Pulseaudio is MUCH better than it was a year ago, but it still causes problems on occasion. Hammer out the rest of the details so we can move on!

  3. Wireless connectivity has also improved greatly, but I still sometimes have problems connecting (or dropping) when those people around me on a Mac or Windows have no problem. On occasion I've had to abandon Network Manager altogether for WICD, which sometimes works when the former doesn't

Either switch to better programs, or put money towards the impovement of certain obvious deficiencies.

  1. Its time to give up on Rhythmbox, Banshee is fast outgrowing the maintainance only iterations of Rhythmbox. That said, if Banshee doesn't include a watch folders option in the next release, I will totally take back this claim.

  2. Tracker Search Tool is my least favorite program on Ubuntu. It sucks so bad it hurts. But Beagle is a memory hog, so at present there doesn't seem like a good search tool on linux (esp one with tens of thousands of files like mine).

  3. Evolution is not a pleasure to use. I'm waiting for Thunderbird 3 to come out and put real pressure on Evolution developers to make it a better program. It needs to seamlessly integrate with online services. A makeover is really overdue as well.

  4. Multimedia editing is slowly progressing overall. A year ago I couldn't find a video editor I liked, whereas now I'm quite a fan of Kdenlive. Audacity didn't work at all, but now does. Keep up the good work here!

Reviewing Previous Annoyances

  • A GUI wrapper for utf: gutf is pretty good except that I still haven't figured out how to set up internet connection sharing with it. But Firestarter works fine, so I'm going to mark this one off the list.

  • Two-way synchronization between evolution and Google Calander: Calander synchronization is there, but I don't quite trust it until its been tested and advertised by developers.

  • Advanced Desktop settings already pre-installed (or some simplified version of it). NO. Still an annoyance, but I've gotten bored enough with configuring it that I no longer do

  • Tracker Search Tool needs to have a phrase search. NO. HAHA, tracker isn't even included in Jaunty. And that is for the better. Tracker Search Tool still sucks ass.

Bug fixes and Feature Requests:

What I want to see included in the next iteration of Ubuntu:

  • OpenOffice 3.1 - This should be there. Every major improvement of OOo is an important step, though I wonder when they will finally get to beautifying the program and optimizing the speed

  • Firefox 3.1 - This should be ready I believe (though I'm less than certain) - it should be a pretty big improvement.

  • Hopefully most of the rest of KDE applications will be ported to QT 4. I'm looking at you: Quanta Plus and K3B

  • Amarok 2.1 - Amarok 2.0 was somewhat of a disappointment, but it did leave lots of room for potential. Version 2.1 is the first major step to actualizing that potential, it looks like a very good improvement

  • Songbird 1.2 - Until it makes it into the Repos, I'm not holding my breath

  • Moonlight 2.0 - I doubt it will be ready in time, but when this comes out it will be huge. There will be no reason we cannot finally get Netflix on Linux.

  • Last time I evalutated Ubuntu, I lemented that there wasn't a decent ebook manager out there for linux (eKitaab still doesn't work). But now there is a program that is in heavily development that looks really good called calibre. It looks to become one of the best cross-platform ebook managers around. Kudos to the developers.