import java.io.*;
import java.lang.*;
public class VowelsExample {
public static void main(String[] args) throws IOException {
BufferedReader input = new BufferedReader (new InputStreamReader(System.in));
int count = 0;
int i;
char[] vowel= {'a','e','i','o','u','A','E','I','O','U'};
System.out.println("Enter a string :");
String in = input.readLine();
for (i=0; i<in.length(); i++){
vowel[in.length()] = in.charAt(i);
if(vowel[in.length()]=='a' || vowel[in.length()]=='A' || vowel[in.length()]=='e' || vowel[in.length()]== 'E' || vowel[in.length()]=='i' || vowel[in.length()]=='I' || vowel[in.length()]=='o' || vowel[in.length()]=='O' || vowel[in.length()]=='u' || vowel[in.length()]=='U')
count ++;
}
System.out.println(in.contains(in));
System.out.println(String.valueOf(vowel));
System.out.println("total vowels are : " +count);
}
}
Monday, October 31, 2011
Java Programming for find vowels character in a string
Cisco ISO Restoring via XModem
Once in ROMmon, change the console baud rate from 9600 bps to 115200 bps to speed up the download time. Use the confreg command and complete the instructions presented on the screen.
rommon 1 >confreg
Configuration Summary
enabled are:
break/abort has effect
console baud: 9600
boot: the ROM Monitor
do you wish to change the configuration? y/n [n]: y
enable "diagnostic mode"? y/n [n]:
enable "use net in IP bcast address"? y/n [n]:
enable "load rom after netboot fails"? y/n [n]:
enable "use all zero broadcast"? y/n [n]:
disable "break/abort has effect"? y/n [n]:
enable "ignore system config info"? y/n [n]:
change console baud rate? y/n [n]: y
enter rate: 0 = 9600, 1 = 4800, 2 = 1200, 3 = 2400
4 = 19200, 5 = 38400, 6 = 57600, 7 = 115200 [0]: 7
change the boot characteristics? y/n [n]:
Configuration Summary
enabled are:
break/abort has effect
console baud: 115200
boot: the ROM Monitor
do you wish to change the configuration? y/n [n]:
You must reset or power cycle for new config to take effect.
rommon 2 >
Once the router boots up in ROMmon, the HyperTerminal sessions start to display illegible characters. You need to exit the current terminal session and start a new one at a data rate of 115200 bps to match the console rate as in step 2.
You are now ready to issue the xmodem command. However, before issuing the xmodem command, ensure that you have the new Cisco IOS software image on your PC.
rommon 1 >
rommon 1 >xmodem -?
xmodem: illegal option -- ?
usage: xmodem [-cyrx] <destination filename>
-c CRC-16
-y ymodem-batch protocol
-r copy image to dram for launch
-x do not launch on download completion
rommon 2 >
rommon 2 >
rommon 2 > xmodem -c c2600-is-mz.122-10a.bin
!--- Note that [-s datarate] is not available here since you are set
for 115200 bps.
Do not start the sending program yet...
File size Checksum File name
9939820 bytes (0x97ab6c) 0x4991 c2600-is-mz.122-7a.bin
Warning:
All existing data in bootflash will be lost!
Invoke this application only for disaster recovery.
Do you wish to continue?
y/n [n]: y Ready to receive file c2600-is-mz.122-10a.bin ...
From the HyperTerminal menu bar, select Transfer > Send and specify the image name/location and xmodem protocol as in steps 3 and 4 and start the transfer.
Once the transfer is complete, these messages appear:
Erasing flash at 0x60fc0000
program flash location 0x60990000
Download Complete!
Notice how the Flash gets erased towards the end automatically compared to Cisco C1600. Therefore, the reason why the f option is not required here. Finally, ensure that you reset the console speed back to 9600 and change the boot sequence back to default by changing the configuration register back to 0x2102:
rommon 12 > confreg 0x2102
You must reset or power cycle for new config to take effect
rommon 2 >reset
System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1)
Copyright (c) 1999 by cisco Systems, Inc.
TAC:Home:SW:IOS:Specials for info
C2600 platform with 65536 Kbytes of main memory
program load complete, entry point: 0x80008000, size: 0x995ec8
Self decompressing the image : ################################
##################################################################
##################################################################
######################## [OK]
............................
Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-IS-M), Version 12.2(10a),
RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2002 by cisco Systems, Inc.
Compiled Tue 21-May-02 14:16 by pwade
Image text-base: 0x80008088, data-base: 0x810ABB08
cisco 2620 (MPC860) processor (revision 0x100)
with 61440K/4096K bytes of memory.
Processor board ID JAB03110MUB (3691217154)
M860 processor: part number 0, mask 49
Bridging software.
X.25 software, Version 3.0.0.
1 FastEthernet/IEEE 802.3 interface(s)
2 Voice FXS interface(s)
32K bytes of non-volatile configuration memory.
16384K bytes of processor board System flash (Read/Write)
Press RETURN to get started!
.........................
Xmodem Procedure for Downloading a Cisco IOS Software Image onto a Cisco 3600 Router
Use this xmodem procedure in order to download a Cisco IOS software image onto a Cisco 3600 Series Router.
The standard procedure uses the default console speed of 9600 bits per second. Xmodem is a slot transfer protocol, and the transfer of a file as large as a Cisco IOS software image could take an unacceptably long time. An increase to the console speed on the 3600 router helps decrease the time it takes to do the xmodem file transfer.
When in ROMMON mode, complete this procedure using the ROMMON confreg utility.
rommon 2 > confreg
do you wish to change the configuration? y/n [n]: y
enable "diagnostic mode"? y/n [n]: n
enable "use net in IP bcast address"? y/n [n]: n
disable "load rom after netboot fails"? y/n [n]: n
enable "use all zero broadcast"? y/n [n]: n
enable "break/abort has effect"? y/n [n]: n
enable "ignore system config info"? y/n [n]: n
change console baud rate? y/n [n]: y
enter rate: 0 = 9600, 1 = 4800, 2 = 1200, 3 = 2400
4 = 19200, 5 = 38400, 6 = 57600, 7 = 115200 [7]: 7
change the boot characteristics? y/n [n]: y
enter to boot:
0 = ROM Monitor
1 = the boot helper image
2-15 = boot system
[0]: 0
Configuration Summary
enabled are:
load rom after netboot fails
console baud: 115200
boot: the ROM Monitor
do you wish to change the configuration? y/n [n]: n
You must reset or power cycle for new config to take effect
rommom 2 > reset
Open a new hyperterminal with these settings:
Bits per second - 115200
Data bits - 8
Parity - None
Stop bits - 1
Flow control - Hardware
After setting the hyperterminal, you receive a rommon prompt. Enter the xmodem command. Before you enter an xmodem command, there should be a software image residing in your terminal or your local hard drive.
rommon 2 > xmodem -c c3640-i-mz.121-7.bin
Do not start the sending program yet...
File size Checksum File name
4936800 bytes (0x4b5460) 0x2dd7 c3640-i-mz.121-7.bin
(bad checksum: 0x13eb)
WARNING: All existing data in flash will be lost!
Invoke this application only for disaster recovery.
Do you wish to continue? y/n [n]: y
Ready to receive file c3640-i-mz.121-7.bin ...
After this message appears, you have to download the file using xmodem and this procedure:
Go to Hyperterminal and click the Transfer menu.
Select Send File.
In the dialog box which appears, click on browse and look for the file name on your local hard drive.
Under the filename field is the Protocol drop-down box. Choose Xmodem.
Click Send to initiate the file transfer.
After the transfer completes, the router will reload itself. When the reload completes, press the return key to be taken to a prompt and to reset the configuration register and the console line speed.
Router> enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#configure terminal
Router(config)#config-register 0x2102
Router(config)#line con 0
Router(config-line)# speed 9600
Upon changing the console speed, you will lose connectivity. Go to your terminal program, change the baud rate to 9600, and reconnect to the router console.
Router(config-line)#ctrl z
Router #write mem
Router #reload
Saturday, October 29, 2011
Fastest way to restore an IOS image to the Cisco router
The IOS can also be restored from a TFTP session. Downloading the image using TFTP from ROMmon is the fastest way to restore an IOS image to the router. This is done by setting environmental variables and then using the tftpdnld command.
Since the ROMmon has very limited functions, no configuration file is loaded during boot. The router therefore has no IP or interface configuration. The environmental variables provide a minimal configuration to allow for the TFTP of the IOS. The ROMmon TFTP transfer works only on the first LAN port so a simple set of IP parameters are set for this interface. To set a ROMmon environment variable, the variable name is typed, then the equal sign (=), and the value for the variable (VARIABLE_NAME=value). For example, to set the IP address to 10.0.0.1, type IP_ADDRESS=10.0.0.1 at the ROMmon prompt.
Note: All variable names are case sensitive.
The minimum variables required to use tftpdnld are:
- IP_ADDRESS – The IP address on the LAN interface
- IP_SUBNET_MASK – The subnet mask for the LAN interface
- DEFAULT_GATEWAY – The default gateway for the LAN interface
- TFTP_SERVER – The IP address of the TFTP server
- TFTP_FILE – The IOS filename on the server
To check the ROMmon environment variables, the set command can be used.
Once the variables are set for the IOS download, the tftpdnld command is entered with no arguments. The ROMmon will echo the variables and then a confirmation prompt will appear with a warning that this will erase the flash.
As each datagram of the IOS file is received, a “!” will be displayed. When the complete IOS file has been received, the flash will be erased and the new IOS image file written. Appropriate messages will be displayed as the process is completed.
When the new image is written into flash and the ROMmon prompt is displayed, the router can be restarted by typing i. The router should now boot from the new IOS image in flash.
Subscribe to:
Posts (Atom)