Friday, May 31, 2013

Install Grub Customizer

To install Grub-Customizer open Terminal and copy the following commands in the Terminal:


  #sudo add-apt-repository ppa:danielrichter2007/grub-customizer 
  #sudo apt-get update 
  #sudo apt-get install grub-customizer


open Grub customizer -> go to General setting  -> click the radio button predefined

Here you can change the desire OS of you wish.


Saturday, May 18, 2013

Disable Auto logon in opensuse


#cd /etc/sysconfig
edit file displaymanager

go to the
#DISPLAYMANAGER_AUTOLOGIN="fabien"



edit the file and empty out the
#DISPLAYMANAGER_AUTOLOGIN=""  .......variable like this: save &exit

Friday, May 17, 2013

TAR


What is .tar.gz format?

                    Under Unix, tar archives are the most common means of distributing bundles of files, and gzip is the most common compression program.

                    A .tar.gz file is simply a bundle of files packaged with tar, gzip (GNU zip) is a compression utility designed to be a replacement for compress.gzip produces files with a .gz extension

Creating a tar gzip file !



     -z : compress the resulting archive with gzip command
     -c : create an new archive
     -v : verbose output i.e. show progress and file names while extracting files
     -f : use archive file.


How can I extract a tar.gz or .tgz file?


     -z : Uncompress the resulting archive with gzip command.
     -x : Extract to disk from the archive.
     -v : Produce verbose output .
     -f : data.tar.gz : Read the archive from the specified file called data.tar.gz.
   
  
More information please use man tar command


   

Tuesday, May 14, 2013

Enabling Root account

               Enabling the Root account is rarely necessary. Almost everything you need to do as administrator of an Ubuntu system can be done via sudo or gksudo. If you really need a persistent Root login, the best alternative is to simulate a Root login shell using the following command.

To enable the Root account (i.e. set a password) use:  




Changing Hostname in Suse Linux

    To get started open yast2

Then select System in the left pane and click Network settings on the right pane.


Then select the Hostname/DNS tab, and change the hostname to whatever you want. Also uncheck the box to ‘Change Hostname via DHCP’ and click OK to save.




The change take immediately.Go and open a terminal window.you can see andromeda hostname .

 

Monday, May 13, 2013

LINUX File Permission


Permission Groups
Each file and directory has three user based permission groups:
  • owner - The Owner permissions apply only the owner of the file or directory, they will not impact the actions of other users.
  • group - The Group permissions apply only to the group that has been assigned to the file or directory, they will not effect the actions of other users.
  • all users - The All Users permissions apply to all other users on the system, this is the permission group that you want to watch the most.
Permission Types
Each file or directory has three basic permission types:
  • read - The Read permission refers to a user's capability to read the contents of the file.
  • write - The Write permissions refer to a user's capability to write or modify a file or directory.
  • execute - The Execute permission affects a user's capability to execute a file or view the contents of a directory.

You can view the access permissions of a file by doing the long directory listing with the ls -l command


                 What does the output of ls -l mean? The very first column, the one that looks like a bunch of shows the file type and permissions. The second column shows the number of links (directory entries that refer to the file), the third one shows the owner of the file, and the fourth one shows the group the file belongs to. The other columns show the file's size in bytes, date and time of last modification, and the filename.
  

The first column is organized into four separate groups, although it certainly doesn't look very organized.

The first group consists of only one character and it can be any of these:



d = directory
- = regular file
l = symbolic link
s = Unix domain socket
p = named pipe
c = character device file
b = block device file



                         The next nine characters show the file's permissions, divided into three groups, each consisting of three characters. 



  • The first group of three characters shows the read, write, and execute permissions for user, the owner of the file.
  • The next group shows the read, write, and execute permissions for the group of the file.
  • Similarly, the last group of three characters shows the permissions for other, everyone else.

In each group, the first character means the read permission, the second one write permission, and the third one execute permission.


The characters are pretty easy to remember.
r = read permission
w = write permission
x = execute permission
- = no permission





 As you already noticed, dir is a directory, because the first column begins with a d.

The owner of this directory is user fabien and the group owner is users.

The first three characters, rwx, indicate the directory's owner, fabien in this case, has full access to the directory. The user fabien is able to access, view, and modify the files in that directory.

The next three characters, r-x, indicate that all users belonging to group users have read and execute permissions to the directory. They can change into the directory, execute files, and view its contents. However, because they don't have write permissions, they can't make any changes to the directory content.

Finally, the last three characters, r-x, indicate that all the users who are not fabien or don't belong into group users, have read and execute permissions in the directory.


How to set file permissions - numeric mode
       
                   You can set file permissions with the chmod command. Both the root user and the file's owner can set file permissions. Chmod
                    In the numeric mode, the file permissions aren't represented by characters. Instead, they are represented by a three-digit octal number.

4 = read (r)
2 = write (w)
1 = execute (x)
0 = no permission (-)



Let's have an example.


The highlight line you can see the file have full access to the owner,group and others.

when command # chmod 754 test1 entered 

The permission has been changed and now the owner have ull read, write, and execute permissions (4+2+1 = 7 ) ----- 7

The group would have read and execute permissions (4+0+1=5) -----5

The others would have only read permissions as well(4+0+0=4) -----4


rwx 7
rw 6
r-x 5
r-- 4
-wx 3
-w- 2
--x 1
--- 0

Monday, April 22, 2013

Linux Desktop Environments


              The most popular fully featured Linux Graphical Desktop Environment are GNOME and KDE.We will begin a comprehensive head-to-head clash between these leading desktop environments.
 
GNOME


                 The GNOME (pronounced "Gah-NOME") GNU Network Object Model Environment is a user-friendly desktop based entirely on free software. The combination of good situational awareness and clear presentation of desktop elements makes GNOME he most task-efficient desktop for the widest range of users.

                  Every Six month GNOME Foundation releases a new version.GNOME had moved from the traditional desktop Environment like the one we seen in Windows and Mac OS to shell based user Interface.The version 2.x used the traditional desktop while the new version 3.x uses Shell interface

Let see the different with 2.x and 3.x.

Gnome 2.x 

                 GNOME version 2.x has dual taskbars know as panels.One panel is located at the top of the screen in the form of a menu bar and an additional panel is found at the bottom of the screen.Because of this,some people would say that GNOME 2.z more closely resembles with Mac OS X in appearance.Regarding system resources usage,Gnome 2.x requires less RAM but more CPU than GNOME 3.x. 

RED HAT Gnome 2.x interface
Gnome 3.x

                The classic look of GNOME 2.x shell evolved and in GNOME 3.x we see GNOME Shell user Interface.In the GNOME 3.x shell,there is only one panel located at the top of the desktop,and there is no longer a traditional menu.To open programs users can either press the windows keys or they can click on the "Activities" found on the left side of the panel.This gives the options of a program launchr that appears on the left side of the desktopn,an "Applications" option found on the upper left part of the desktop  or they can search for programs using the search box on the upper right of the desktop. Additionally, when clicking on "Activities," a desktop switcher appears on the right side of the desktop.

 
GNOME 3.x shell Interface


                Another change involves the buttons on the windows; in GNOME 2.x, and practically every other desktop environment or window manager, there are at least three buttons found at the top of each window: one to exit the window, one to maximize the window, and one to minimize the window. However, in the default GNOME 3.x shell, there is only one button that is used to exit the window, which really takes some getting used to. If you want your laptop or desktop to look and behave like a cell phone or tablet, then the GNOME 3.x shell might be for you. Overall, the GNOME 3.x shell is a very simple, clean, and visually pleasing desktop.  


GNOME Window Button


Window Manager: Mutter (GNOME 3.x shell)
Widget Toolkit: GTK+
File Manager:Nautilus
Office Suite: GNOME Office(which includes AbiWord and Gnumeric)
Music Player: Rhythmbox
Video Player: Totem

KDE

This is one of the older Linux desktop environments, and once a bitter rival of Gnome 2. In many ways, KDE (K Desktop Environment) in its default configuration is very similar in appearance to Microsoft Windows.

OpenSUSE KDE Desktop


Each major release of KDE has brought a large set of new features and modifications. KDE 1 had a wide range of features that made it a complete desktop environment. KDE 2 brought the internet to a Linux user’s desktop.Howvever it's KDE 3’s releases many features, such as new desktop and icon themes, integration with third-party applications, and support for LDAP and Exchange.KDE 3 also boosted support for multiple platforms, including Mac OS X.

KDE menu bar


KDE (SC) 4 was based on the much-improved Qt 4, toolkit for KDE.It include the new desktop UI (Plasma) and a built-in compositing effect window manager (KWin).

KDE Plasma workspace


Window Manager:KWin
Widget Toolkit: Ot 4
File Manager:Dolphin
Office Suite: LibreOffice
Music Player: Amarok
Video Player: Kaffeine


                                      KWin provides your windows with a more natural feel. New desktop effects like the "Cube Desktop Switcher" and "Magic Lamp Minimize Animation" have been added. Improvements in the existing effects make window management smoother than ever. 






Summary: Linus Torvalds, creator of the Linux kernel, has switched by the Gnome 3, saying GNOME better than KDE 







Wednesday, April 17, 2013

X Window System


Back in 1970 when Unix was released,it comes with CLI (command line interface) which is to some extent, pretty user-hostile .Nowadays every operating system have a GUI subsystem.They are several reason to use a GUI over CLI,it gives more control over how things are displayed on-screen and it's multitasking nature gives a lot of programs running at any given time.Historically, UNIX has developed a lot by academic project. One such project, Athena project at the Massachusetts Institute of Technology (MIT) developed X Window System.



Later an entity called the "X Consortium" took over X .This is how XFree86 came. Now X project are lead by X.Org Foundation. This consortium developed X windows system current protocol (X11version) and it's been used by all major Linux distributors.
  
http://en.wikipedia.org/wiki/XFree86#Release_history

X Window overview


X is designed as a client/server architecture. The clients communicate to the X server using the X11 network protocol. Clients can run locally to the Xserver or remotely on other machines



The applications (window manager,xterm) themselves are the clients; they communicate with the server and issue requests such as "create a rectangular box", or "render this string of text, using this font, at this position on-screen".



X server is in charge of actual graphics display,includes reading the mouse and keyboard. Client only concern is to create a rectangular box in some X by Y pixel in size,it's the server decide where to create the box.

1.The screen is your whole ``desktop''
2.The root window is the background of your screen.
3.The window manager is the main interface between the X Window system and the user.




 
The X server basic services are : input handling, window services, graphics, text and fonts.



Input handling services taking keyboard and mouse inputs to clients as events via the window manager, which X regards as just another client. Window services are requests by clients to the X server to provide information about windows or to create or destroy them .Graphics services are the drawing of lines and shapes.

Window manager

Now X server creates the rectangular box,however X server doesn't handles manipulation such aschanging size, maximize or minimize windows. The program that decides where to place windows, control the windows' appearance, position and size, window titles, and buttons is called Window Manager. windows manager is a X client application





Window manager which is essentially the component which controls the appearance of windows and provides the means by which the user can interact with them.



Windows manager : Sawmill, Metacity, Mutter





Toolkit

Windows manages gives the appearance,but where did the decorations of the windows come from. This job is done by Widget toolkits. Widget toolkits are library function an API which include decorative menus, buttons, radio buttons, scroll bars, and canvases. In simple terms windows managers arrange the windows and toolkits provides the decoration. Toolkit is another X client application





The widely known toolkit which is used is GTK+,it was originally designed and used in the GNU Image Manipulation Program (GIMP) project. Another famous toolkit is QT.



Toolkit widgets : GTK+, QT





Upto this point we are talking about X server/client architecture. In this server/client architecture we see several window managers and lot of widget toolkit libraries. Let say that a User opened 3 different application each using a different window manager and toolkit. This means each application varies from one window manager to other. This create a mess. This is resolved by Desktop Environment



Desktop Environment



A Desktop Environment provides a range of integrated utilities and applications such as panels(or starting applications and displaying status ) a desktop (where data and applications can be placed), windows manages and toolkit.



The most popular Linux desktop environments are GNOME and KDE.



GNOME uses MUTTER as windows manager and GTK+ as widget toolkit library. On the other hand KDE uses KWin as their window manager and QT as widget toolkit





So these all create a desktop in your Linux Box.Seem overwhelming? It's definitely a different experience than Windows where you just install the OS and go.


Tuesday, April 9, 2013

Linux Partitioning Scheme

                
                        There are many reasons for partitioning a large hard disk into several smaller partitions.  For a home user  a single Linux partition (plus swap)  can be a reasonable choice.But for a server installation  multiple partitions provide additional safety and performance benefits,so if you're planning to install a web server of a database server i would recommend six partitions.



let me explain the need for these partition :- 

 /
This is called the root partition; the most important partition, where all the system files are stored.if this partition runs out the system hangs,5 to 10 GB is sufficient in most cases.

 /boot
The partition mounted on /boot/ contains the operating system kernel along with files used during the bootstrap process. For most users, a 250 MB boot partition is sufficient. 

/home
 To store user data separately from system data,you should  create a dedicated partition to holds all of the users' configuration files, all their saved documents and their desktop folder.

/var
The /var directory holds content for a number of applications, including the Apache web server. It also is
used to store downloaded update packages on a temporary basis. Ensure that the partition containing the /var directory has enough space to download pending updates and hold your other content. 

/tmp
Some programs write temporary data files here. Usually, they are quite small. However, if you run computationally intensive jobs, like science or engineering applications, hundreds of megabytes could be required for brief periods of time. In this case, keep /tmp in a different partition than /.

swap
Our need one partition that will be used as Linux swap space. This is space on your hard drive that can be used as virtual memory. Virtual memory allows your computer to run large programs and perform complex tasks even if it does not have enough physical RAM to do the job. (It is a lot slower, but it works.)

 A good rule of thumb is that your swap space should be two or three times as much as the available physical memory (RAM).Currently, the maximum size of a swap partition is architecture-dependent. For i386, m68k, ARM and PowerPC, it is "officially" 2Gb

    Systems with 4GB of ram or less require a minimum of 2GB of swap space
    Systems with 4GB to 16GB of ram require a minimum of 4GB of swap space
    Systems with 16GB to 64GB of ram require a minimum of 8GB of swap space
    Systems with 64GB to 256GB of ram require a minimum of 16GB of swap space




Monday, April 8, 2013

Linux Hard Disk Layout


                            A typical PC has either two IDE or SCSI controllers,Linux named the IDE as "hdd" and SCSI as "s" in place of "h" and each of these controllers can have two drives connected to it.thus 4 hard drives can be connected,a primary master named as (/dev/hda),a primary slave (/dev/hdb),Secondary master(/dev/hdc),secondary slave(/dev/hdd).




                         The partition scheme for PC hard disks allowed only four partitions.These partitions are called primary partitions. To work around this limitation and allow more than four partitions, a new partition type was created, the extended partition,these extended partition further sub-divided into logical partiton.
 

                           Linux  numbers primary or extended partitions as 1 through 4,so dev/hda may have four primary partitions, /dev/hda1, /dev/hda2, /dev/hda3, and /dev/hda4.Or it may have a single primary partition /dev/hda1 and an extended partition /dev/hda2. If logical partitions are defined, they are numbered starting at 5, so the first logical partition on /dev/hda will be /dev/hda5,Although the theoretical maximum number of partitions on an IDE drive is now limited to 15 for kernels with hotplug



below example you can see Hard disk 1 and 2 are primary partition and 3rd is extended
partition which start the number 5. 





Saturday, April 6, 2013

Linux File System : Ext2 vs Ext3 vs Ext4

         
                                      Linux can read and write several file systems because linux work on VFS (Virtual file system )layer that is a data abstraction layer between the kernel and the programs in userspace that issue file system commands.Famous Linux file system are Ext2,Ext3,Ext4.


Ext2 :

                      Ext2 was the standard file system for linux Kernel 1.0.Ext2 stands for second extended file system..Ext2 is flexible,can handle file system up to 4 TB,and supports long filenames up to 1012 characters.Drawback in ext2 filesystem is when  a file system is uncleanly mounted(system crash) ,the whole file system must be checked.This takes a long time on large file systems.


Ext2 does not have journaling feature.
On flash drives, usb drives, ext2 is recommended, as it doesn’t need to do the over head of journaling.
Ext3 support 16 TiB of maximum file system size and 2 TiB of maximum file size.


Ext3 : 

                     Ext3 is basically ext2 + a journal.After an unexpected power failure or system crash (also called an unclean system shutdown), each mounted ext2 file system on the machine must be checked for consistency by the e2fsck program.This is a time-consuming process.Ext3′s uses journaling filesystem which keeps a journal or log of the changes that are being made to the filesystem during disk writing.This allows a computer to be rebooted much more quickly after a system crash.Maintaining the journal adds a certain amount of overhead , but improves filesystem reliability and reduces fsck times

It was introduced in 2001. Developed by Stephen Tweedie.
Starting from Linux Kernel 2.4.15 ext3 was available.
In ext3 a directory can have at most 32,000 subdirectories
You can convert a ext2 file system to ext3 file system directly


Ext4 : 

                   The ext4 file system is designed with many new advanced features.Ext4such as the ones destined to store the file data.unlike Ext3  mostly about adding journaling to Ext2,Ext4 made some important data structures modification in the filesystem.Ext4 fully 64-bit capable,but only uses 48 bit block addressing which can support volumes with sizes up to 1 exbibyte and files with sizes up to 16 tebibytes.It also add checksum to the journal which make the journal more reliable.it uses "multiblock allocator",In Ext3 when a new data is written it uses a Block allocator decide whcih free blocks is used to write the date and it only allocate one block at a time(4KB),means if it had to write a data of 10MB ,it has to call the block allocator 2560 times.With the multiblock allocator it allocate many blocks in a single call,instead of single block per call.

Maximum volumes sizes up to 1 exbibyte
Maximum files with sizes up to 16 tebibytes
Backward compatibility
In ext4 a directory can have at most 64,000 subdirectories
Ext4 uses checksums in the journal to improve reliability

Wednesday, April 3, 2013

Beginners Basic Linux Commands


ls                       - List files in the current working directory
ls -al                  - List all files  in long listing format showing permissions, ownership, size, and time.
pwd                   - Print working directory is used to output the path of the current working directory.
cd                      - Change directory
cd   /                  - Moves from the current directory to "/" directory.
cd ~                   - Takes you back to your home directory.
mkdir                - Creates a directory
mkdir Rem       - Creates a directory with name Rem
rmdir                 - Removes a directory
rmdir Rem        - Removes a directory Rem
cp                      - Copy one or more files to another location   
clear                  - Clear terminal screen
cfdisk                - Partition table manipulator for Linux
date                   - Display or change the date & time
df                       - Display free disk space
du                      - Estimate file space usage
history              - Command History
hostname          - Print or set system name
tty                     - Print filename of terminal on stdin
uname              - Print system information
whereis            - Report all known instances of a command
who                  - Print all usernames currently logged in
whoami            - Print the current user id and name (`id -un')
man                 - Help manual
exit                  - Exit the shell

Tuesday, April 2, 2013

Linux Kernel Version Numbering

                              
                                 The Linux foundation is a consortium who is responsible for the kernel Developments. Greg Kroah-Hartman and chris wright is the current Linux Kernel maintainer for the stable release

                                The initial Linux kernels numbers released by Torvalds in September 1991 are simple numbering system starts from 0.01,0.02.The numbering system Linux kernel have was began in the late 1994 starts from 1.0.After that Linux kernel is identified by a set of four numbers. First three number related to the kernel release version and revisions where the last number mention its bugs fixes version. A new type of numbering system was announced by Linux Torvalds back in 2011.
 
Let me explain:

Latest Stable Kernel release is : 3.8.5

First Number – Kernel version (3)
                              
                               The kernel version changes only when substantially major changes are made in the kernel code. This happen thrice in Linux kernel history. First in 1994 (1.0),then 1996 (2.0) the last happen in 2011(3.0)

Second Number – Major Revision (8)

                                When a new stable kernel was introduce say (3.7) .it opens a 2 weeks merge window for the next development cycle At this time merge window accepts codes,experimental trees, driver updates from the developers fraternity. After 2 weeks, Linus Torvalds will declare that the window is closed and release the first of the "rc" (release candidate)kernels with an incremented number (3.8.rc1).This is called pre-patch release .From here onwards it only accepts bug fixes and around each week Linux releases 3.8-rc2,-rc3, ... continuing until he is satisfied that there are no new bugs. Then they release the new Mainline Linux kernel 3.8 where all all new features are introduced.

Third Number – Minor Revision (5)

                                 Once a Mainline release 3.8 is made, its ongoing maintenance is passed off to the "stable team," currently consisting of Greg Kroah-Hartman.This teams who fixes bugs and other serious problem and the updates the kernel with a release 3.8.1,3.8.2......3.8.5 where there is no bugs at all,they release 3.8.5 as the stable Linux