Wednesday, 11 January 2012

User & Group Management in Linux


User and Group Management
·        See the /etc/passwd and /etc/shadow files
These files contain the information about the user login and password and other variables.
·        Make a new user “tux” with default home directory and password “pakistan”
sudo useradd -p pakistan tux
·        See the changes in /etc/passwd and /etc/shadow
Both of the files contain last row as tux user.
tux:x:1001:1002::/home/tux:/bin/sh
tux:pakistan:15249:0:99999:7:::
·        Create a group “BIT10” with group ID 99 and change tux’s group to “BIT10"
sudo groupadd -gid 99 BIT10A
sudo gpasswd -a tux BIT10A;    sudo usermod -g BIT10A tux
·        Move the user’s current home directory to the new directory “/studentHome”
sudo usermod -d /sohaibHome tux

·        Change this user’s password to “d!g!t@l” with following settings:-
Lock the account if it has been inactive for 5 days
Minimum 2 days must be past before the user can change hi/her/its password
sudo usermod -p 'd!g!@|' –f 5 tux;
chage –i 5 –m 2 tux;
·        See the changes in /etc/passwd and /etc/shadow and /etc/group files
Both show changes for tux
·        Delete the group “BIT10” and delete the account of “tux”
groupdel BIT10A

Tuesday, 10 January 2012

Pir Pagara DIed in London - Geo News Video

Sunday, 8 January 2012

Your Cellphone can be hacked by international hackers-TV9, Mobile Phone Hacking News

This is very Important News that is announced by Indian channel

Linux Partitions of Disk, fdisk for Partitions in Linux, Ubuntu partitions


1.     Manage Partitions with fdisk
·        Use fdisk to create a new partition table
o   1st primary partition (100 MB)
o   2nd primary partition (1 GB)
o   3rd primary partition (4 GB)
·        Commit these changes
·        Reboot and install Linux on the new partition table, mounting them as:-
·        1st primary partition as /boot (reiserfs)
·        3rd primary partition as / (ext3)
sudo fdisk /dev/sda
delete all partitions 1 ,2 using d then press w to write changes
Press n to create a new partition and press p for primary then 1 for partition 1 and then press enter for default starting cylinders then +100M as required for partition 1.
Press n to create a new partition and press p for primary then 2 for partition 2 and then press enter for default starting cylinders then +1G as required for partition 2.
Press n to create a new partition and press p for primary then 3 for partition 3 and then press enter for default starting cylinders then +4G as required for partition 3.
press w for write changes
mount /dev/sda1 /boot; mount /dev/sda3 /;
reboot and install new linux and use the existing file system. And make changes in sda1 as file system reiserfs and mount point /boot; sd2 as file system ext3 and mount point /
then install ubnuntu; this will load new file systems and partition table.

2.     Create Partitions with fdisk
·        Using fdisk, create a new extended partition with all the remaining space in the HDD
·        Create a new logical partitions:-
o   1st logical partition (100 MB)
o   2nd logical partition (1 GB)
·        Commit these changes
·        Load the new partition table into the kernel by using partprobe utility
fdisk /dev/sda
type n for new partition; select e for extended partition and it will create new extended partition on rest of the space.
type n for new logical partition. it will make logical partition sd5 in sda4 extended partition. press enter for default starting cylinder and +100M for 100MB partition.
type n for new logical partition. it will make logical partition sda6 in sda4 extended partition. press enter for default starting cylinder and enter for allocating rest of space for this partition.
press w for commit changes
load partition table using sudo partprobe /dev/sda

3.     Create File Systems
·        From the command line, format the new partitions as:-
o   1st logical partition as reiserfs
o   2nd logical partition as ext2
·        From the command line, mount the new partitions as:-
·        1st logical partition as /moodle
·         2nd logical partition as /moodledata
mkfs –t reiserfs /dev/sda5 ; mkfs –t ext2 /dev/sda6
sudo mkdir /moodle; sudo mkdir /moodledata;
mount /dev/sda5 /moodle; mount /dev/sda6 /moodledata;

Linux Emacs editor, emacs commands examples



·        emacs
·        Given a buffer full of English text, answer the following questions:
a.     How would you change every instance of his to hers?
press M-x . Then enter:
hers  RET his RET hers

M-x replace-string
            his 
            hers


b.     How would you make this change only in the final paragraph?

      Through “M-h” select paragraph then “M-x replace-string his  hers”


c.      Is there a way to look at every usage in context before changing it?

      ESC %

d.     d. How would you deal with the possibility that His might begin a sentence?


     Esc <

 
Free Host | lasik surgery new york