Friday, 3 May 2013

CCNA COMMAND

|0 comments

Command
descriptions

switch>?
The ? works here the same as in a router Used to get the list of all available commands

switch>enable
User mode, same as a router

switch#
Privileged mode

switch#disable
Leaves privileged mode

switch>exit
Leaves user mode

switch#show version
Displays information about software and hardware.

switch#show flash:
Displays information about flash memory (will work only for the 2900/2950 series).

switch#show mac-address-table
Displays the current MAC address forwarding table
.

switch#show running-config
Displays the current configuration in DRAM.

switch#show startup-config
Displays the current configuration in NVRAM.

switch#show vlan
Displays the current VLAN configuration.

switch#show interfaces
Displays the interface configuration and status of line: up/up, up/down, admin down.

switch#show interface vlan1
Displays setting of virtual interface VLAN 1, the default VLAN on the switch.

To Reset Switch Configuration

Switch#delete flash:vlan.dat
Removes the VLAN database from flash memory.

Delete filename [vlan.dat]?
Press Enter

Delete flash:vlan.dat? [confirm]
Press Enter

Switch#erase startup-config
Erases the file from NVRAM.

Switch#reload
Restarts the switch.

To Set Host Names

Switch#configure terminal
Moves to global configuration mode

Switch(config)#hostname Switch1
Creates a locally significant host name of the switch. This is the same command as the router.

Switch1(config)#


To Set Passwords

Switch(config)#enable password vinita
Sets the enable password to vinita

Switch(config)#enable secret nikki
Sets the encrypted secret password to nikki

Switch(config)#line console 0
Enters line console mode

Switch(config-line)#login
Enables password checking

Switch(config-line)#password vinita
Sets the password to vinita

Switch(config-line)#exit
Exits line console mode

Switch(config-line)#line vty 0 4
Enters line vty mode for all five virtual ports

Switch(config-line)#login
Enables password checking

Switch(config-line)#password vinita
Sets the password to vinita

Switch(config-line)#exit
Exits line vty mode

Switch(config)#


To Set IP Addresses and Default Gateways

Switch(config)#interface vlan1
Enters the virtual interface for VLAN 1, the default VLAN on the switch

Switch(config-if)#ip address 192.168.0.10 255.255.255.0
Sets the IP address and netmask to allow for remote access to the switch

Switch(config-if)#exit


Switch(config)#ip default-gateway 192.168.0.5
Allows IP information an exit past the local network

To Set Interface Descriptions

Switch(config)#interface fastethernet 0/1
Enters interface configuration mode

Switch(config-if)#description Finance VLAN
Adds a description of the interface

To Set Duplex Operation

Switch(config)#interface fastethernet 0/1
Moves to interface configuration mode

Switch(config-if)#duplex full
Forces full-duplex operation

Switch(config-if)#duplex auto
Enables auto-duplex config

Switch(config-if)#duplex half
Forces half-duplex operation

To Set Operation Speed

Switch(config)#interface fastethernet 0/1


Switch(config-if)#speed 10
Forces 10-Mbps operation

Switch(config-if)#speed 100
Forces 100-Mbps operation

Switch(config-if)#speed auto
Enables autospeed configuration

MAC Address Table

switch#show mac address-table
Displays current MAC address forwarding table

switch#clear mac address-table
Deletes all entries from current MAC address forwarding table

switch#clear mac address-table dynamic
Deletes only dynamic entries from table

Switch(config)#vlan 10
Creates VLAN 10 and enters VLAN configuration mode for further definitions.
Switch(config-vlan)#name Sales
Assigns a name to the VLAN. The length of the name can be from 1 to 32 characters.
Switch(config-vlan)#exit
Applies changes, increases the revision number by 1, and returns to global configuration mode.
Switch(config)#interface fastethernet 0/1
Moves to interface configuration mode
Switch(config-if)#switchport mode access
Sets the port to access mode
Switch(config-if)#switchport access vlan 10
Assigns this port to VLAN 10
Switch#show vlan
Displays VLAN information
Switch#show vlan brief
Displays VLAN information in brief
Switch#show vlan id 10
Displays information about VLAN 10 only
Switch#show vlan name sales
Displays information about VLAN named sales only
Switch#show interfaces vlan x
Displays interface characteristics for the specified VLAN
Switch#delete flash:vlan.dat
Delete filename [vlan.dat]?
Delete flash:vlan.dat? [confirm]
Switch#
Removes the entire VLAN database from flash.
Make sure there is no space between the colon (:) and the characters vlan.dat. You can potentially erase the entire contents of the flash with this command if the syntax is not correct. Make sure you read the output from the switch. If you need to cancel, press ctrl+c to escape back to privileged mode:
Switch(config)#interface fastethernet 0/5
Moves to interface configuration mode.
Switch(config-if)#no switchport access vlan 5
Removes port from VLAN 5 and reassigns it to VLAN 1—the default VLAN.
Switch(config-if)#exit
Moves to global configuration mode.
Switch(config)#no vlan 5
Removes VLAN 5 from the VLAN database.
Switch#copy running-config startupconfig
Saves the configuration in NVRAM
Switch(config-if) #switchport mode trunk
Puts the interface into permanent trunking mode and negotiates to convert the link into a trunk link.
Switch(config)#vtp mode server
Changes the switch to VTP server mode.
Switch(config)#vtp mode client
Changes the switch to VTP client mode.
Switch(config)#vtp mode transparent
Changes the switch to VTP transparent mode.
Switch(config)#no vtp mode
Returns the switch to the default VTP server mode.
Switch(config)#vtp domain domain-name
Configures the VTP domain name. The name can be from 1 to 32 characters long.
Switch(config)#vtp password password
Configures a VTP password
.
Switch(config)#vtp pruning
Enables VTP pruning
Switch#show vtp status
Displays general information about VTP configuration
Switch#show vtp counters
Displays the VTP counters for the switch






Friday, 19 April 2013

Product key changed in Window XP

|0 comments

  1. Click on Start and then Run.
  2. In the text box in the Run window, type regedit and click OK. This will open the Registry Editor program.
  3. Locate the HKEY_LOCAL_MACHINE folder under My Computer and click on the (+) sign next the folder name to expand the folder.
  4. Continue to expand folders until you reach the HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\Current Version\WPAEvents registry key.
  5. Click on the WPAEvents folder.
  6. In the results that appear in the window on the right, locate OOBETimer.
  7. Right-click on the OOBETimer entry and choose Modify from the resulting menu.
  8. Change at least one digit in the Value data text box and click OK. This will deactivate Windows XP.
Feel free to close Registry Editor at this point.
  1. Click on Start and then Run.
  2. In the text box in the Run window, type the following command and click OK.
%systemroot%\system32\oobe\msoobe.exe /a
  1. When the Let's activate Windows window appears, choose Yes, I want to telephone a customer service representative to activate Windows and then click Next.
  2. Click the Change Product Key button at the bottom of the window.
Don't worry about filling anything out on this screen.
  1. Type your new, valid Windows XP product key in the New key: text boxes and then click the Update button.
  2. You should now reactivate Windows XP by following the instructions on the Activate Windows by phone window which you should now be seeing or via the Internet by clicking the Back button and following the instructions on that screen.
If you'd rather postpone activating Windows XP until a later date, you can click the Remind me later button.
  1. After activating Windows XP, you can verify that activation was successful by repeating steps 9 and 10 above.
The Windows Product Activation window that appears should say "Windows is already activated. Click OK to exit."
Tips:
  1. Do all these registry changes and commands make you a bit uneasy? Don't worry, it's really not that difficult if you follow each step exactly.
If you'd like some help, you should look at my Step by Step Guide to Changing the Windows XP Product Key. It's a complete walk-through of the process, with each step accompanied by a screen shot of exactly what you'll see plus a thorough description of what to do.
  1. Still not comfortable making registry changes? Luckily there is another option if you need to change your Windows XP product key code. Winkeyfinder, a popular free product key finder program, also has the ability to easily change the Windows XP product key.
Winkeyfinder is an excellent alternative solution to changing the Windows XP product key code manually.
  1. Not a Windows XP user? See How Do I Change My Windows Product Key? for specific instructions for your version of Windows.

How to install SFTP in LINUX

|0 comments

How do I install vsftpd?
Simply type the following command as a superuser (root):
# yum install vsftpd
Description: http://figs.cyberciti.biz/warning-40px.pngWARNING! These examples open your computer to insecure ftp protocol. If possible use SFTP ftp secure sever which is inbuilt into OpenSSH SSHD server.
Turn on vsftpd ftp service
Type the following command:
# chkconfig vsftpd on
How do I start vsftpd ftp server?
Type the following command:
# service vsftpd start
How do I stop vsftpd ftp server?
Type the following command:
# service vsftpd stop
How do I restart vsftpd ftp server?
Type the following command:
# service vsftpd restart
Open FTP port
Open /etc/sysconfig/iptables file, enter:
# vi /etc/sysconfig/iptables
Append following line to open ftp port 21 before REJECT line:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
Save and close the file. Restart the firewall:
# service iptables start
Test ftp server
Type the following command:
$ ftp localhost
$ ftp ftp.server.com
$ ftp 202.54.1.1
How do I configure vsftpd server?
The default configuration file is /etc/vsftpd/vsftpd.conf file. You can open file with vi text editor:
# vi /etc/vsftpd/vsftpd.conf

Linux Commands

|0 comments

Linux Commands :

Most of you will be using X-Windows and various GUI tools or possibly even Webmin.  What follows are some very basic commands for manipulating files. There are much better resources out on the web than this. See the man pages for each command for more information as well.
Create, Copy, & Delete
cp [from] [to]
Copy files/directories from one location to another.
mv [from] [to]
Move files/directories from one location to another. Can also be used for renaming.
rm [options] [file]
Remove files/directories. Wildcards supported for [file].
mkdir [name]
Create a directory.
rmdir [name]
Remove a directory.
touch [name]
Creates the [name] if it does not exist or updates the time stamp.
Display
ls [options]
List files/directories. Commonly used options:
-l = full information
-a = show files who's name begins with . (aka hidden files)
find dir_to_start_in -name file_to_find -print
Seach for a file. Wildcards accepted.
pwd
Print the current directory path you are in.
df [options]
Show space available on disk. Without options shows for all mounted file systems
du
Show space used by current directory and sub-directories.
Modify Attributes
chown [name] [file]
Change the owner of the files/directories. Wildcards supported for [file].
chgrp [name] [file]
Change the group of the files/directories. Wildcards supported for [file].
chmod [permissions] [dir_or_file]
Change the access permissions of the files/directories. Wildcards supported for [dir_or_file].
A few common values for [permissions]:
777 = owner [rwx] group [rwx] world [rwx]
775 = owner [rwx] group [rwx] world [r-x]
"Sticky-bits":
0### = clear all sticky-bits
1### = only owner of file can do things to it
2### = group that "owns" directory will be assigned to all files created inside
4### =
This may give you more information.
Environment Variables
printenv
Show all environment variables
export [variable]="[value]"
Set an environment variable
unset [variable]
Remove a variable
Misc
ln [options] [target] [linkname]
Makes links to selected [target]s. Default is hard links. Typically you use -s, an option, for symbolic links.
rpm [do what] [options] [file]
Use RH's package manager to install, upgrade, or remove packages. Wildcards supported for [file].
Install = rpm -ivh [file]
Upgrade or install if not exist = rpm -Uvh [file]
Upgrade but don't install if not exist = rpm -Fvh [file]
Query = rpm -q [package name] (ex: rpm -q sendmail)
Query with grep = rpm -qa | grep [name]
Information = rpm -qi [package name]
Remove = rpm -e [package]
For options you can use, in most cases:
--nodep: ignore dependencies
--replacefiles: replace conflicting files
More info that you care to know about RPM http://www.rpm.org/max-rpm/index.html
e2fsck [options] [device]
Check and/or repair the file system. Use e2fsck --help for a full list of options.
mke2fs [options] [device]
Create a file system on a partion (aka format).
Example - check for bad blocks, ext3, 1% reserved, label:
mke2fs -c -j -m1 -L [label] /dev/hdxx
diff [options] original changed >patch_file
Make a patch of changed (a) file(s). Example:
diff -u3 -r file.c.orig file.c >file.patch
free
Display memory usage.
tar
A directory and sub directories & compress it:
With the directory name while you are in the parent:
tar clf - ./dir_name | compress > name.tar.Z
To list the contents of the resulting file:
zcat name.tar.Z | tar tvf - | more
top
Display process information real-time. Use h for help and q to quit.
Check the traffic:
/usr/sbin/tcpdump –n arp –I eth0

SSH:
 Ssh –l username <ip of machine>

Transfer files between two linux machines:
Scp  <file name>  <usrname>@<ip of machine where to send the file>:/<path to send the file>

******[To transfer a directory we have to zip it and then use scp command]*****

*** how to tar and zip a dir?

Eg:   cd   /tmp
        Mkdir  testdir
        Tar –cvf  testdir.tar testdir
         Bzip2 testdir testdir.tar 
***To unzip and untar a dir:

Bunzip2 testdir.tar
Tar –xvf testdir.tar

To automatically compress the tar file add z flag:
Eg:    Tar cvzf  testdir.tar.gz


FTP:
ftp <ip add of machine>
>ha
>bi
>mget <file name>
>bye    *******-to exit*****


To check the user ‘s process:
Ps –u <username>

Cat /proc/partitions

Cat /proc/version

/usr/sbin/system-config-network

/usr/sbin/system-config-nfs

env

cat  /proc/swaps

rm  –rf <dir name>   ****This command is used to delete a directory which is not empty***

mozilla &   *****to open a  browser*****

ps  -aux | grep  portmap *****to check portmap status******

dmesg

·  What daemon is responsible for tracking events on your system?
syslogd
The syslogd daemon is responsible for tracking system information and saving it to specified log files.

Echo $SHELL








httpd2 install in LINUX

|0 comments

01 yum install httpd (if it isn't already installed--yum checks for you)
02 yum install mysql-server (if it isn't already installed--yum checks for you)
03 yum install php
04 yum install php-mysql
05 yum install php-mbstring
06 yum install php-pear
07 yum install php-devel      (* see explanation at the bottom of this page)
08 yum install yum-priorities    (*)
09 rpm -hUv http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm   (*)
10 yum install php-pecl-zip     (*)
11 yum install php-gd (Optional, for automatic image resizing and manipulation)
12 yum install php-ldap (Optional, if you need LDAP support)

Step 2: Environment considerations

Note that in some versions of CentOS, a firewall is installed by default which will block access to port 80, on which Apache runs. The following command will open this port:
1 iptables -I RH-Firewall-1-INPUT -p tcp --dport 80 -j ACCEPT

You might as well have to install unzip to handle eFront's bundle:
1 yum install unzip