Thursday, January 21, 2010

How to verify if a service is running

1.Type this command to see all the services status:
sudo service --status-all
2.To verify the status of one service type:
sudo service cups status
2.The service command can be used to start or stop a service if you know the service name :
sudo service cups stop (stops the printing service)
sudo service cups start (starts the printing service)

Hot to manage Services in Ubuntu the easy way

If you are tiered to start or stop a service running /etc/init.d/apache2 start  {start|stop|restart} you can do this:

Step 1 :
Install the service manager utility sysv-rc-conf like this:
sudo apt-get install sysv-rc-conf
Step 2:
Run the application :
sudo sysv-rc-conf
= - start a service from the list
-   - stop a service from the list
SPACE key - to stop automatic start of a service in diffrent runlevels
q - exit application
h - help


Thursday, January 14, 2010

What should I do if I can't remove or reinstall Microsoft Office ?

For Office XP or Office 2003

1. Insert the first disk of your Office CD set in the CD-ROM drive.
2.Right click and open the cd. DO NOT RUN THE INSTALLER.
3. Search for the file : Offcln.exe.(you can use the search from explorer).Run it.

Wednesday, January 13, 2010

Hot to change the runlevel in Ubuntu 9.10

1.To change the runlevel you must edit this file rc-sysinit.conf.

Edit the file as administrator like this:

sudo gedit /etc/init/rc-sysinit.conf

Find the folowing line an put the runlevel number you want.


Carefull do not let spaces between equal sign and the number.That is it.Reboot and done.

2.If you want to change runlevels just for this session do this:
sudo init 3         (runlevel  numbers 2-5)
runlevel            (this command will show you what runlevel you are running in now)

Grub 2 Bootloader File Structure

GRUB 2 incorporates a totally revised folder and file hierarchy. The menu.lst of GRUB legacy is no longer used.
To find out where GRUB 2 is installed, the user can run the following commands: sudo grub-probe -t device /boot/grub for the device and sudo grub-probe -t fs_uuid /boot/grub for the UUID.

The main folders and files used by GRUB 2 include:

This is the file most closely resembling GRUB's /boot/grub/menu.lst. This file contains the GRUB 2 menu information but unlike GRUB's menu.lst the grub.cfg file is not meant to be edited.
Each section is clearly delineated with "(### BEGIN)" and references the file in the /etc/grub.d folder from which the information was generated.
grub.cfg is updated by running the update-grub command as root. The update-grub command is a stub for sudo grub-mkconfig -o /boot/grub/grub.cfg. For standardization, the command update-grub will be employed, run as "root" with the sudo.
The file is automatically updated with kernel installations/removals or other updates which would affect its output.
By default, and whenever the update-grub command is executed, this file is made "read-only". This is in keeping with the intent that the file should not be edited manually.
The user will also see a multitude of *.mod files in the /boot/grub folder. These files relect the modular nature of GRUB 2 and are loaded as necessary by the GRUB 2 bootloader.
This configuration file contains information formerly contained in the upper section of GRUB Legacy's menu.lst and items contained on the end of the kernel line. The entries in this file can be edited by a user with administrator (root) privileges and are incorporated into grub.cfg when it is updated. Specific configuration settings are detailed in the Configuring GRUB 2 later in this section.
/etc/grub.d/ (folder)
The files in this folder are read during execution of the update-grub command and their instructions are incorporated into /boot/grub/grub.cfg.
The placement of the menu items in the grub.cfg menu is determined by the order in which the files in this folder are run. Files with a leading numeral are executed first, beginning with the lowest number. 10_linux is run before 20_memtest, which would run before 40_custom. If files with alphabetic names exist, they are run after the numerically-named files.
Custom entries can be added to the 40_custom file or in a newly created file. Based on its name, 40_custom entries by default appear at the bottom of the menu. A custom file beginning with 06_ would appear at the top of the menu since its alphanumeric sorting would place it ahead of 10_ through 40_ files.
Only executable files generate output to grub.cfg during execution of update-grub.

The default files in this folder are:
00_header Sets initial appearance items such as the graphics mode, default selection, timeout, etc. These settings are normally imported from information from /etc/default/grub. Users normally do not need to make changes to this file.
05_debian_theme The settings in this file set splash image, text colors, selection highlighting and themes. In the absence of a splash image, this file sets a monochromatic theme for the initial menu display. How to set font renderings and splash images are discussed in detail in the Splash Images & Themes section.
10_hurd Locates Hurd kernels. Not currently used.
10_linux Locates kernels on the root device for the operating system currently in use. It takes this information and establishes the names displayed on the menu for these kernels.
20_memtest86+ Searches for /boot/memtest86+.bin and includes it as an option on the GRUB 2 boot menu. There is currently no line option to remove this entry from the menu. The display of memtest86+ can be inhibited by removing the executable bit from this file: sudo chmod -x /etc/grub.d/20_memtest86+ and then running sudo update-grub.
30_os-prober This file with os-prober, which searches for Linux and other operating systems. Results are placed in grub.cfg based on the scripts in this file. The file is divided into 4 sections, representing the types of operating systems handled by the scripts: Windows, Linux, OSX, and Hurd. Variables in this file determine the format of the displayed names in /boot/grub/grub.cfg and on the GRUB 2 menu. Users familiar with basic scripting can alter these variables to change the format of the displayed menu entries. Alternatively, the user can insert an entry into /etc/default/grub which disables this script. (See below)
40_custom A template for adding custom menu entries which will be inserted into grub.cfg upon execution of the update-grub2 command. The contents of this file, below the "exec tail -n +3 $0" line and the default comments, are imported directly into /boot/grub/grub.cfg without any changes.
Files in these folders must be executable to be used by update-grub. Files which are not executable will be ignored. To make a file executable, run sudo chmod +x /etc/grub.d/folder/filename

Linux runlevels

There are six default runlevels in the Linux base system.

0 (zero) is basically the shutdown runlevel.

1 (one) is single user mode.

2 (two) is a multi-user mode, minus NFS support.

3 (three) is a multi-user, command line based mode.

4 (four) user-defined / undefined.

5 (five) multi-user, graphical mode. This is generally the default runlevel on desktop / laptop machines.

6 (six) is basically the reboot runlevel.