Showing posts with label Commands. Show all posts
Showing posts with label Commands. Show all posts

Wednesday, October 27, 2010

How to set, run update automatically in linux with yum

If you need keep you Linux PC up to date, you have to update your system every time.
But if you can set this thing happens automatically you do not want to worry by manually updating your system. Here i show how do we can enable or set the yum update manager to run start up as a service.

To run the yum update service at the system start up, you have to enable it. Issue the following command to enable it.
# chkconfig --level 345 yum-updatesd on

If you want to verify your configuration issue,
# chkconfig  --list yum-updatesd
or
# service yum-updatesd status       // this gives whether the service running or not

Friday, August 6, 2010

Puppy 5.0

Puppy Linux is one of light weight distribution of Linux. Live-CD of this Puppy Linux distribution is only 85MB.
But it includes all GUI applications.Being so small, Puppy Linux usually loads completely into the RAM. This increase the speed. You can find more details about Puppy Linux by it's website : www.puppylinux.com.

You can download you free copy from http://www.puppylinux.com/download/index.html

Tuesday, August 3, 2010

Create a GRUB Boot Splash Background

Here i show you how to change the background of GRUB Boot splash. To do this you have follow some requirement. They are
  • It must be sized at 640x480. 
  • It must be a .xpm format image file.
  • It must contain no more than 14 colors.


Now we start, Suppose that you got a image in .png format. How do you convert it into .xpm format. You should have to installed ImageMagick and issue following command syntax to convert .png image to .xpm image.

# convert sampleimage.png  -colors 14 -resize 640x480  sampleimagee.xpm

First convert .xpm image to gz. Then copy that .xpm image in to /boot/grub directory

Convert sampleimage.xpm to gz
           # gzip sampleimage.xpm

Copy sampleimage.xpm.gz to /boot/grub
           # cp sampleimage.xpm.gz /boot/grub

Now configure the grub.conf to set your image.
           splashimage=(hd0,0)/boot/grub/sampleimage.xpm.gz

Now reboot the system and see whether you Grub Boot Splash Background has change !

Saturday, July 31, 2010

Install Audio/Video codec in Linux

People who use Linux distribution have to face one common problem. That is playing multimedia files in Linux. Most time MP3 and most video codec are not include in Linux distributions.

So you have to download the all necessary codec and install them. The best codec pack for Linux i’ve got is the Gstreamer Codec Pack. This package includes most popular codec. You can download them all from http://gstreamer.freedesktop.org/download/. All of them are source packages. After you download, unzip, configure, compile and install them. Here are the command that you need

Unzip : tar –zxvf gstreamer-0.10.30.tar.gz

Configure : ./configure

Compile the package : make

To Install : make install

Tuesday, July 13, 2010

Installing Binary and Scripts (.bin/.sh) Files

Here are the commands that you need to install binary(.bin) or Scripts(.sh) files

For .bin files
01. Make sure that the file is set to "executable" .
      chmod +x file_name
02. Then run the file
      ./file_name

For .sh files
01. Make sure that the file is set to "executable" do the step 01 above.
02.Then run the file either with the same command use as previous installing on .bin file or like this:
     sh file_name


Using VI editor on Linux

Here are the commands that you need to Use VI editor on Linux

Open the terminal and issue,
 # vi


Eg : # vi myfirstfile

Insert Text in to the file Using i, a, o, and O

The first way to switch to insert mode is to type the letter i, which, mnemonically enough,inserts text into the file. The other commands that accomplish more or less the same thingare a, to append text to the file; o, to open up a line below the current line; and O, to open up a line above the current line.

Deleting Text

The simplest form of the delete command is the x command, which functions as though you are writing an X over a letter you don’t want on a printed page: It deletes the character under the cursor. Type x five times, and you delete five characters.

Writing A little shell scripting

Here we are going to write a little shell Program.
First open the terminal and then issue following commands
vi firstscript.sh

Now you are created a file called "firstscript" and going to enter shell programming syntax. Enter following simple script.

#!/bin/bash //make this document a script file
# Display text using a function
function textdis
{
echo "Welcome to my Shell Scripting world";
}
textdis; //execute the function



Press Ctrl^d // on your keyboard to save the document

Now give permission for execution -> chmod +x firstscript.sh
Now execute the script file -> ./firstscript.sh



Installing Source files

Sources files comes as ".tar.gz", "tar.bz2" and ".zip" files. So what we want to do is unzip these zip files. It is better to use "usr/local/src" directory to unzip them.
  • For .tar.gz -> use : tar -zxvf < file_name_of_zip>
  • For tar.bz2 -> use : tar -jxvf < file_name_of_zip>
  • For .zip -> use : unzip < file_name_of_zip>
Now go in to the unzip file directory and issue follwing commands.(It is better read README.txt or INSTALL.txt files before you installing the source packages).
  • First configure the source -> ./configure
  • Then compile the source -> make
  • Last install the source -> make install
  • To clean up temp files -> make clean