Friday, March 1, 2013

How Redirect Console / Terminal output to File and Console Both in Linux


1 . >> operator [redirect all output to file]

    #./a.out >> op.txt

2. | tee [redirect all output to file & Console both]

    #./a.out | tee op.txt

How to reactivate Windows 7

Steps:
1. open command prompt (run as administrator)
2. type: slmgr -rearm (press enter)
3. reboot system

How to install grub for Ubuntu


LIVE BOOT with ubuntu 64 BIT only

lauch Gparted check ext4 parition of ubuntu note down (e.g. /dev/sda7 then let x=a and y=7)

First, open the Terminal and execute below commands

Mount partition
sudo mount /dev/sdXY /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt

Install Grub 
grub-install /dev/sdX
grub-install --recheck /dev/sdX
update-grub

Now unmount all
exit
sudo umount /mnt/dev
sudo umount /mnt/dev/pts
sudo umount /mnt/proc

sudo umount /mnt/sys
sudo umount /mnt
All done!! just reboot your system

How to change boot order Linux UBUNTU FEDORA CENTOS

STEPS:

  1. Note the serial number (x) of the desired default OS during grub loading start counting from zero (0).
  2. Edit /boot/grub/grub.conf
  3. change default value to x
  4. Save and reboot.

Command to check SSH LOG in LINUX UBUNTU



1. Open terminal  type below command and hit enter.

        last | head

Monday, November 12, 2012

Object Oriented (OO) to Relational Mapping – Guidelines


1. Classes: If there is a class called Class_A:

a. Create a table Table_A
b. Include all the attributes of the class Class_A as columns of the table table_A.
c. Add a surrogate key to Table_A.
d. Add semantic constraints to the Table_A (unique key, NOT NULL, value
constraints, etc.)
2. 1:N Association: If there is a 1:N relationship between two classes Class_A and Class_B:
a. Add the surrogate key of Table_A as foreign key in Table_B.
b. The name of the foreign key should be the name of the role.
3. N:1 Association: Same as 1:N Association above but in reverse
4. M:N Association: If there is a M:N relationship between two classes Class_A and Class_B:
a. Create a new table Table_C having the same name as the association name.
b. Add the surrogate keys of Table_A and Table_B as composite key of the new
table.
c. Add a surrogate key to Table_C
d. Add any association attributes that may be present as columns of Table_C
5. Association attributes: If there is a 1:N relationship between two classes
Class_A and Class_B and there are association attributes represented by
association class called Class_C:
a. Apply guidelines applicable for 1:N association given above
b. Create a new table Table_C corresponding to the association class Class_C.
c. Add the attributes of the association class Class_C as columns Table_C
d. Add the surrogate key key of Table_C.
e. Add a surrogate key to the new table Table_C
6. Aggregation: If there is aggregation relationship between Class_A (whole) and
Class_B (part):
a. Treat it as 1:N association between Class_A and Class_B
7. Composition: If there is aggregation relationship between Class_A (whole) and Class_B (part):
a. add the surrogate key of Table_A as foreign key in Table_B.
b. Add a NOT null constraint on the foreign key
c. Ensure CASCADE DELETE is done whenever deleting data
8. Inheritance: If Class_A is the super class and Class_B is the subclass:
a. Make the surrogate key of Table_B both as a primary key and as a foreign key that references Table_A..
b. Add a discriminant attribute to Table_A to indicate the name of the subclass to which a given instance belongs

Command to install grub (of Fedora)


Insert Fedora CD/DVD

Run below commmand

$chroot /mnt/sysimage

$grub-install /dev/sda