Pages

Saturday, July 14, 2012

To create keyboard shortcut for terminal in linux

open the terminal then type

>gnome-keybinding-properties

Then an window will pop up that window can be used to create custom keyboard shortcuts.

Click add and give name for the entry and terminal command which should be activated with shortcut and click Apply

now in the window backward an entry such as custom entry will appear and now click in shortcut then the disabled option changes to New shortcut .now press the needed shortcut it will be set.

command for terminal is gnome-terminal and give needed shortcuts

Resizable linux partions --LVM-logical volume management

In linux we can can create resizable partition  which can be resized if free space is available. That type of partitions logical volumes.
lvm-digram

1.-------->First we need to create normal logical partitions.
i have a partion  /dev/sda4  in /dev/sda
2.--------->Then we need to select the partition and change the partition type to 0x8e or create the partition as physical volume using given option in palimpsest
using fdisk command we could change the partion type to 0x8e . we could use the 't' option in fdisk to change the type ,after seleting the 't' option it will prompt for the partition no of which type need to be changed .using the 'l' option will list types of  partition type.
fdisk /dev/sda
At the Linux fdisk command prompt,

  1. press n to create a new disk partition,

  2. press p to create a primary disk partition,

  3. press 1 to denote it as 1st disk partition,

  4. press ENTER twice to accept the default of 1st and last cylinder – to convert the whole secondary hard disk to a single disk partition,

  5. press t (will automatically select the only partition – partition 1) to change the default Linux partition type (0×83) to LVM partition type (0x8e),

  6. press L to list all the currently supported partition type,

  7. press 8e (as per the L listing) to change partition 1 to 8e, i.e. Linux LVM partition type,

  8. press p to display the secondary hard disk partition setup. Please take note that the first partition is denoted as /dev/hdb1 in Linux,

  9. press w to write the partition table and exit fdisk upon completion.


3.-------->Next, this LVM command will create a LVM physical volume (PV) on a regular hard disk or partition:
pvcreate /dev/sda4

4---------->Now, another LVM command to create a LVM volume group (VG) called vg0 with a physical extent size (PE size) of 16MB:
vgcreate -s 16M vg0 /dev/hdb1

 

5---------->Create a 400MB logical volume (LV) called lvol0 on volume group vg0:
lvcreate -L 400M -n lvol0 vg0

This lvcreate command will create a softlink /dev/vg0/lvol0 point to a correspondence block device file called /dev/mapper/vg0-lvol0.

6----------->Formatting the partition to the needed type ..here i am going to format it to ext4 type

mkfs.ext4 /dev/vg0/lvol0
Finally mounting the partition to the needed place.here i will be mounting the partition to /data

mkdir  /data

mount /dev/vg0/lvol0 /data

some of the useful commands in this are

pvs

vgs

lvs

pvdisplay

vgdisplay

lvdisplay

more useful commands are lvextend and lvreduce

reduced should be used carefully because  cutting of the file system may cause data loose if not done properly

Tuesday, June 19, 2012

Gcc for windows-Install the MinGW (GCC) Compiler Suite and Cygwin prompt

This Gcc compiler doesn't exactly replaces the normal Linux gcc compiler .First download the file from following link and run it to install MinGW (Minimalist GNU for Windows).We need net connection to install this

http://sourceforge.net/projects/mingw/files/MinGW/





in latest MinGW you will have c compiler in the list .Select the needed components and select the path to which you need to install it.After the installation we need to set the environment .

Create a directory (e.g. C:\MinGW), download all packages to C:\MinGW, extract the files from each package, and add C:\MinGW\bin; to your PATH environment variable using C:\> set PATH=C:\MinGW\bin;%PATH%" .or set it normally with properties of mycomputer>Environment variables.

To get more linux effect in windows install Cygwin from http://www.cygwin.com/install.html to get a terminal effect.and install needed packages as needed in cygwin.to install cygwin also we need internet connection

http://www.eecg.utoronto.ca/~aamodt/ece242/cygwin.html