Thursday, September 29, 2011

Picasa Install

To install Picasa on your Scientific linux machine follow the steps below

1. Run the following two commands when by one in terminal by logging in as root.
    wget https://dl-ssl.google.com/linux/linux_signing_key.pub
    rpm --import linux_signing_key.pub

2. Create Google repo as shown below
    First create a repo file called google.repo
    vi /etc/yum.repos.d/google.repo

    Now insert the following lines in google.repo file
    [google]
    name=google
    baseurl=http://dl.google.com/linux/rpm/stable/i386
    enabled=1
    gpgcheck=1

   Save the file

3. Run command
    yum update

4  Install Picasa using the command
    yum install picasa









Friday, September 23, 2011

Scientific Linux Settings

Changing the host name
------------------------------------------------------
To change the hostname to your preferred name, you need to edit the network file

Steps:
Log in as root in terminal

cd /etc/sysconfig/
vi network

Change the HOSTNAME to your preferred name

Then save the file and reboot the computer

Menu Editor for GNOME

 alacarte

Alacarte is a simple menu editor for GNOME that lets you edit, add, and delete any menu entry. 



Install

-----------
Log in as root in terminal and type the following command 
yum install alacarte 


Run

------------
To run the alacarte program just type 'alacarte' 


Desktop Shortcut

----------------------
Create shortcut for 'alacarte' application in desktop
 

Right click on Desktop and click 'Create Launcher'
Type the following in interface
Type: Application
Name: Alacarte
Command:/usr/bin/alacarte

Wednesday, September 21, 2011

Trash Icon missing

If Trash icon is missing in desktop then here are the steps to enable

1. Click on 'Configuration Editor' found under 'System Tools'
   If 'Configuration Editor' option is not present, then you need to install it.
   Use the command 'yum install gconf-editor' to install
  
2. Click apps ---> click nautilus ---->click desktop

3. Check/Mark on 'trash_icon_visible'
This will create an icon linking to the trash  on the desktop.

Monday, September 19, 2011

Create yum repository from Scientific Linux DVD

Create yum repository from Scientific Linux DVD without copying the contents to hard disk

Steps:

1. Create a directory to mount DVD
    mkdir /mnt/dvd

2. Mount the Scientific Linux DVD
    mount /dev/cdrom /mnt/dvd

3. Create yum repo setting file at /etc/yum.repos.d/dvd.repo
    vi  /etc/yum.repos.d/dvd.repo

4. Copy the following contents into dvd.repo
[MyRepo]
name=MyRepo
baseurl=file:///mnt/dvd
enabled=1
gpgcheck=0

5. Run the following command to create yum database
createrepo /mnt/

Note: To run  'createrepo /mnt/' command 'createrepo' package should be installed first.







Saturday, September 17, 2011

Install FTP client Filezilla in Linux

First download the FileZilla package from here

The downloaded package will be like FileZilla_3.5.1_i586-linux-gnu.tar.bz2

Now open terminal and log in as root.
Go to the folder where the package is saved
Extract the package using the command
tar -jxvf FileZilla_3.5.1_i586-linux-gnu.tar.bz2

The extracted files will be saved in FileZilla3 folder

Copy the folder 'FileZilla3' into /opt directory

Now create a shortcut in Desktop

Right click on Desktop and click 'Create Launcher'
Type the following in interface
Type: Application
Name: FileZilla
Command:/opt/FileZilla3/bin/filezilla

Double click on the Shortcut to launch





Friday, September 16, 2011

Install RAR package


Download the RAR package from

http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz



Now log in as root in terminal

Go to the folder where you have saved the file 'rarlinux-3.6.0.tar.gz' using terminal

Extract the file using the following command

tar -zxvf rarlinux-3.6.0.tar.gz



Go into the extracted folder

cd rar

Type the following in terminal

./unrar



Then copy the rar and unrar file to /bin

cp rar unrar /bin



Now when you right click over the rar files which you want to extract, you will be get extracted file without any issue


Monday, September 12, 2011

Update Firefox Browser in Scientific Linux

Scientific linux/Redhat linux instal Firefox bowser by default. However if you want to use the latest version of the browser you need to follow the steps given below

1. Download the latest Firefox package form the link
 The downloaded package will be with .tar.bz2 format (like firefox-6.0.2.tar.bz2)

2. Using terminal extract the package using following command
  tar -jxvf firefox-6.0.2.tar.bz2
 A folder named 'firefox' will be created

3. Now log in as root in terminal and copy the folder 'firefox' into '/opt' folder.
cp -Raf firefox /opt

4. Finally we will create a shortcut for our new firefox browser
Right click on Desktop and click 'Create Launcher'
Type the following in interface
Type: Application
Name: Firefox
Command:/opt/firefox/firefox

A new shortcut will be created in Desktop

Sunday, September 11, 2011

Install Opera Browser in Scientific Linux

Access the Opera browser Download Page by clicking here

Download Opera browser 11.51 rpm package
The downloaded RPM package will be named as opera-11.51-1087.i386.rpm

Using terminal, log in as root and then go to the folder where RPM package  is downloaded
Type the following command in terminal  to install.
yum install opera-11.51-1087.i386.rpm

After the dependencies are resolved Opera browser will be installed successfully

You can then access the application from Internet section

Install Adobe Reader in Scientific Linux


Access the Abobe Reader Download Page by clicking here

Download Adobe Reader 9.4.2 rpm package
The downloaded RPM package will be named as AdbeRdr9.4.2-1_i486linux_enu.rpm

Using terminal log in as root and then go to the folder where RPM package  is downloaded.
Type the following command in terminal  to install.
yum install AdbeRdr9.4.2-1_i486linux_enu.rpm

After the dependencies are resolved Adobe Reader will be installed successfully

You can then access the application from Office section



EPEL software repository

EPEL packages are  free open source software. It is  EPEL community effort from the Fedora project to create a repository of high-quality add-on packages
 
su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm'

Friday, September 9, 2011

Enable GUI after booting

Some times when we boot our linux systems, we get terminal screen(tty) instead of GUI screen or windows X screen.

To have graphical screen we have to manually do this by typing command 'init 5' as root.

If you do not want this manual method and want your system to automatically do this to you whenever you boot your system, you need to configure as given in steps below

Steps:
1. Log in as root
2. Open file /etc/inittab
    Command: vi /etc/inittab
2. You will find a line 'id:3:initdefault:'  at the end. Edit the line by changing it to 'id:5:initdefault:'




Sunday, June 26, 2011

Install Libreoffice


Go to the following site and download the rpm
http://www.libreoffice.org/download/

You have to extract the downloaded package

Assuming that the extracted folder will be LibO_3.3.0rc1_Linux_x86_install-rpm_en-US (might be any folder name)

Steps
1. Open terminal and login as root
   # su -

2. Go to folder LibO_3.3.0rc1_Linux_x86_install-rpm_en-US
   # cd LibO_3.3.0rc1_Linux_x86_install-rpm_en-US

3. There will be some folders including RPMS
   Go to RPMS
   # cd RPMS

4. Run the command
   su -c 'yum install *.rpm'

Some part of installation is complete

5. Go into folder desktop-integration
   # cd desktop-integration

6. su -c 'yum install libreoffice3.3-redhat-menus-3.3-301.noarch.rpm'

Installation is complete

Saturday, May 28, 2011

Linux File Systems

In Linux, file system begins with root (/). This is at the top of the file system which means it is the starting point directory structure . Under root (/) there exists other files/folders.

Important Directories



Home Directory

/root

This is the root's home directory ie superuser's home directory.
/home/username

This is a directory in Linux system where each user a special directory. This is the default location when the user logs into the system. Eg: If a user of the system is called student, the home directory of tom will be /home/student

User Executables

/bin
This directory contains the most important programs that the system needs to operate, such as the shells, ls, grep, and other essential things.

/usr/bin
This directory contains applications for the system's users. Utilities like compilers, firefox browser and openoffice go into /usr/bin.

/usr/local/bin
Common executable application files ie software compared from source code goes here

In some cases it really doesn't make much difference if you put the program in /bin or /usr/bin .

System Executables

/sbin, /usr/sbin

This is where system programs are installed.  Most system administration programs are stored in these directories. You must run these programs as the root user. These include fdisk, tools to make partitions, certain network tools, etc

Mountpoints

The different physical storage devices  must be attached to some directory in the file system tree before they can be accessed. This attaching is called mounting, and the directory where the device is attached is called the mount point.

/mnt

Filesystems that are non-removable media will be mounted here

Eg:harddisk

/media

Filesystems that are removable media will be mounted here

Eg:cdrom

Configuration

/etc

The configuration files are stored in this directory .In /etc/ we can find the system's password file, group lists, user skeletons, cron jobs etc.

Temporary files

/tmp

This is the default location to place files for temporary use. When you install a program, it uses /tmp/ to put files during installation that won't be needed once the program is installed. The /tmp directory allows all users access to additional space to meet short term needs without charging the space against their quota. All files placed in this directory are deleted automatically after a few days.

Bootloader

/boot

This is the directory where Linux keeps information that it needs when booting up.

Server Data

/var

This contains administrative files such as log files, locks, spool files, and temporary files used by various utilities

/srv

This contains server data's such as databases and webpages

System Information

/proc

This is a virtual directory which contains information about the kernel. It doesn't contain 'real' files but runtime system information.

/sys

This gives information about hardware

Shared Libraries

/lib, /usr/lib

Important system libraries are stored here. 

Friday, May 27, 2011

process, kill

A process is a program in execution. It has several properties including priority. In Linux a process is identified by its PID (Process ID).

To view the information about active process we use 'ps'. This command gives status and properties of process.

syntax

ps [options]

 -e              Select all processes

 -u             Selects the processes whose user name or ID is in userlist.

 -o            user-defined format.

Eg: ps -eo pid,comm,%cpu

Output:

.
....
1516 evolution-excha  0.0
1557 notify-osd       0.0
1573 update-notifier  0.0
1611 firefox-bin     17.2
1671 plugin-containe  2.2
1935 gnome-terminal   1.2
.............
.......
..

ps -eo pid,s,user

Here 's' gives process state codes

D    Uninterruptible sleep (usually IO)
R    Running or runnable (on run queue)
S    Interruptible sleep (waiting for an event to complete)
T    Stopped, either by a job control signal or because it is being traced.
W    paging (not valid since the 2.6.xx kernel)
X    dead (should never be seen)
Z    Defunct ("zombie") process, terminated but not reaped by its parent.
Kill

'kill' command sends a signal to processes, causing them to
terminate.

kill PID

Eg: kill 2016

This command will terminate the process whose PID is 2016

Eg:kill 9 2016

This will forcefully terminate the process whose PID is 2016

Regular Expressions - regex

A regular expression (regex) is a string for describing a search pattern. Regular expression generally uses special characters called meta characters to represent something.

^  represents beginning of the line

$ represents end of the line

grep '^I'  test3.txt

Here the lines starting with 'I ' letter from the file 'test3.txt' will be displayed in the screen

grep '6$' marks.txt

Here the lines ending with '6'  from the file marks.txt will be displayed on the screen

To find the lines that starts with either letter 'a' or 'r' then use

grep -i '^[ar]' test.txt

To find the lines that doesn't starts with either letter 'a' or 'r' then use

grep -i '^[^[ar]]' test.txt

Also you can use '\<' and '\>' to search a particular word

Eg: If you want to replace the word 'in' with 'out' and if you use the following command

sed 's/in/out/gi' sample.txt

then this will replace all 'in' with 'out'. If the sample.txt has a word 'initial' it will be also replaced as 'outitial'. Here we wanted replace only 'in' word and so we have to alter the command

sed 's/\/out/gi' sample.txt

This will replace only the full words 'in' and not 'in' included in other words

sed - Stream Editor

'sed' is a stream editor.  A stream editor is used to perform basic text
transformations on an input stream. It doesn't alter the file contents.

Format is

sed OPTIONS... [SCRIPT] [INPUTFILE...]

sed  's/He/She/' letter.txt

Here 'letter.txt' is a filename where 'He' will be replaced by 'She' and displayed in the screen. 's' is a separator.

'sed' makes a maximum of one change per line

To have multiple changes per line we have to use as follows

sed  's/He/She/g' letter.txt

Also 'sed' searches are case sensitive and hence in-order to make search in-case sensitive we have to use the command as follows

sed  's/He/She/gi' letter.txt

To make many changes on a file, we can use the command as

sed -e  's/He/She/gi' -e  's/handsome/beautiful/gi' letter.txt

To make changes only on particular lines then use

sed '2,6s/He/She/g' letter.txt

Here entire letter.txt will be displayed on the screen but only lines '2' and '6' will be replaced by 'He' to 'She'.

We can also give starting and ending word  and search and replace the word in lines between words

sed  '/Dear/,/waiting/s/He/She/gi' letter.txt

Thursday, May 26, 2011

Logging into a Linux System

In Linux system we should remember that 'root' is the superuser.

We can log in to the root by giving following information

Login User:root

Password: Will be the password given at the time of installation

To log in to sub-user we can either log in to other virtual console or can switch in the same console using 'su' command.

Eg: Consider that you have logged in as root in console 1 (tty1) . Now you have to log in  as a sub user (Eg: student1)

If you want to login in other console 2, then press 'CTRL+ALT+F2'. You will get a shell prompt asking for username and password.

If you want to log in to sub user (student1) in same console 1 then there are 2 types of log in.

1. Log in by changing your current working directory

2. Log in without changing your current working directory

- Log in by changing your current working directory

Consider that you are logged in as root and your working directory will be root and you want to switch to user 'student1'. Then you have to use the following command

su - student1

Now you are logged in as 'student1' and your current working directory will be home (~)  folder of 'student1'.

Note: Since you are switching from 'root' to 'student1' the shell prompt will not ask for password to log in since root will be having full permission to access other users. However if you want to switch from subuser  to other subuser or root (eg student1 to student2) shell prompt will be asking for password to log in.

- Log in without changing your current working directory

Consider that you are logged in as root and your working directory will be root and you want to switch to user 'student1'. Then you have to use the following command

su  student1

Now you are logged in as 'student1' ,  however your current working directory will be unchanged that is it will be root folder
Powered By Blogger

Followers