How to delete some commands in the output ‘history’ in Linux/Unix?

•August 19, 2008 • Leave a Comment

try: ‘ history -c ‘
more at : man history  OR man bash
================================================================================================
history [n]
history -c
history -d offset
history -anrw [filename]
history -p arg [arg ...]
history -s arg [arg ...]
With  no  options,  display  the  command  history list with line numbers.
Lines listed with a * have been modified.  An argument of n lists only the
last  n  lines.  If the shell variable HISTTIMEFORMAT is set and not null,
it is used as a format string for strftime(3) to display  the  time  stamp
associated  with  each  displayed  history entry.  No intervening blank is
printed between the formatted time stamp and the history line.   If  file-
name  is supplied, it is used as the name of the history file; if not, the
value of HISTFILE is used.  Options, if supplied, have the following mean-
ings:
-c     Clear the history list by deleting all the entries.
-d offset
Delete the history entry at position offset.
-a     Append  the  ‘‘new’’ history lines (history lines entered since the
beginning of the current bash session) to the history file.
-n     Read the history lines not already read from the history file  into
the  current history list.  These are lines appended to the history
file since the beginning of the current bash session.
-r     Read the contents of the history file and use them as  the  current
history.
-w     Write the current history to the history file, overwriting the his-
tory file’s contents.
-p     Perform history substitution on the following args and display  the
result  on  the standard output.  Does not store the results in the
history list.  Each arg must be quoted to  disable  normal  history
expansion.
-s     Store  the  args  in  the history list as a single entry.  The last
command in the history list is removed before the args are added.

If the HISTTIMEFORMAT is set, the time stamp information  associated  with
each  history entry is written to the history file.  The return value is 0
unless an invalid option is encountered, an error occurs while reading  or
writing  the history file, an invalid offset is supplied as an argument to
-d, or the history expansion supplied as an argument to -p fails.
================================================================================================

CCIE Time Line

•August 2, 2008 • Leave a Comment

Written Exam [Pending] : 24~30 Aug,2008

First Attempt [Pending] :  24~30 Dec,2008

Days In Hand: 145 days for D-Day

Days In Hand: 23 for Gate pass to D-Day

Inside CCIE Lab: Ensure All Physical Interfaces Are Up Initially

•August 2, 2008 • Leave a Comment

Doing couple of dynamips lab has englighted me with the following insides:
1. Logical interface will not come up, unless physical interface is not up. [ Don't Forget it Ever :D ]
so, always follow:

int s1/0
no shut
int s1/0.1 point-to-point
….

It’s better to configure all physical port of the gears  ON initially:

Rack1SW1#sh int desc
Interface                      Status         Protocol Description
Fa1/0                          up             down
Fa1/1                          up             up
Fa1/2                          up             down
Fa1/3                          up             up
Fa1/4                          up             down
Fa1/5                          up             up
Fa1/6                          up             down
Fa1/7                          up             up       To SW2 F1/7
Fa1/8                          up             up       To SW2 F1/8
Fa1/9                          up             up       To SW2 F1/9
Fa1/10                         up             up
Fa1/11                         up             up
Fa1/12                         up             up
Fa1/13                         up             up       To SW4 F1/7
Fa1/14                         up             up       To SW4 F1/8
Fa1/15                         up             up       To SW4 F1/9
Vl1                            up             up
Vl7                            up             down
Vl77                           up             down
Lo0                            up             up
Rack1SW1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Rack1SW1(config)#int ran fa1/0 – 15
Rack1SW1(config-if-range)#no shut
Rack1SW1(config-if-range)#exit
Rack1SW1(config)#exit
Rack1SW1#

2. Start debugging  with Bottom-to-Top approach, i.e. ensure physical connectivity before configuring layer 2. Unless you
have a consistent and configured layer two, don’t mess up,
starting to configure layer 3 (IGP). And unless you have full
igp reachablbility, don’t start configuring BGP.

3. Don’t trust anything, until you have an explanation.
4. Don’t take it easy.
5. Don’t Lose your hope either.

Good luck!!

Escape Character of IOS

•July 22, 2008 • Leave a Comment

By default, [Ctrl]+V is the escape sequence of Cisco IOS.
Like, if you are asked to use non-alphaneumaric characters
as password to configure, then press [Ctrl]+[V] and than
press the character.

Like: to use password like ‘ch?angeme!’ as password the key
stroke would be :
[c][h][ [Ctrl]+[v] ][?][a][n][g][e][m][e][ [Ctrl]+[v] ][?]

Inside CCIE Lab: Using Terminal Server

•July 21, 2008 • 1 Comment

In the Lab, You will get Terminal Server to access Routers & Switches.
Normally people log on to Terminal Server and then reverse telnet to
individual gears to access it.
Use the configuration mode command, [ ip host "hostname" [port] Router-id ]
to configure host to ip mapping. Like, [ip host R1 23 150.1.1.1 ] to map
Router1 to map with R1 string. Use the above command to configure all
accessible boxes in the lab.

Now use exec command “hostname” to connect the host, like [type]“R1″–>[Enter]
to connect to R1. Type [Ctrl]+[Shift]+6 to disconnect the current connection.
Repeat this process to connect all accessible boxes in the lab.
See the activity log at dynamips:
Connected to Dynamips VM “TermServ” (ID 13, type c3600) – Console port

Router>R1
Translating “R1″
Trying R1 (169.254.0.1, 2001)… Open …[[Ctrl]+[Shift]+6]

Router>R2
Translating “R2″
Trying R2 (169.254.0.1, 2002)… Open …[[Ctrl]+[Shift]+6]

[Repeatative

Router>BB3
Translating "BB3"
Trying BB3 (169.254.0.1, 2013)... Open ...[[Ctrl]+[Shift]+6]

Router>w
Conn Host                Address             Byte  Idle Conn Name
1 R1                  169.254.0.1            0     0 R1
2 R2                  169.254.0.1            0     0 R2
3 R3                  169.254.0.1            0     0 R3
4 R4                  169.254.0.1          220     0 R4
5 R5                  169.254.0.1            0     0 R5
6 R6                  169.254.0.1          235     0 R6
7 SW1                 169.254.0.1            0     0 SW1
8 SW2                 169.254.0.1          220     0 SW2
9 SW3                 169.254.0.1            0     0 SW3
10 SW4                 169.254.0.1          220     0 SW4
11 BB1                 169.254.0.1            0     0 BB1
12 BB2                 169.254.0.1            0     0 BB2
* 13 BB3                 169.254.0.1            0     0 BB3

Router>1
[Resuming connection 1 to R1 ... ]
Connected to Dynamips VM “R1″ (ID 0, type c3600) – Console port

Rack1R1#sh ver
Cisco IOS Software, 3600 Software (C3640-JK9O3S-M), Version 12.4(5a), RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2006 by Cisco Systems, Inc.
Compiled Fri 13-Jan-06 21:33 by alnguyen

ROM: ROMMON Emulation Microcode
ROM: 3600 Software (C3640-JK9O3S-M), Version 12.4(5a), RELEASE SOFTWARE (fc3)

Rack1R1 uptime is 6 minutes

………………..[Output discarded]……………………

By now you have basic understanding on how to use Terminal Server.
You can read this detail guide at Cisco.
Using The Terminal Server or Use the Google to fine the current one.

Inside CCIE Lab : Using SecureCRT

•July 21, 2008 • Leave a Comment

On the D-day, you will get SecureCRT, most probably version 3/4 on the desktop of Windows XP .

There will be  icon of SecureCRT for individual routers and switches along with Terminal Server.

You can either open individual shortcut link to R1 to R6, SW1 to SW4 and TermServ but not to Backbone routers.  But if you learn the default keyboard shortcuts of SecureCRT  [Menu: Help --> Contents --> "Table of Keymap" ], it will save a lot of time. Apart from it,  You can map Scroll bar/Menu/Telnet/Vt/ssh functions or even map macros to keyboard shortcuts. You will find the detail from Help Menu or at this link.

Brian Dennis, CCIE5 #2210 Suggest the following:

Even though you won’t have the latest version of SecureCRT you can make some basic changes to the default settings.  Here are a few common ones:

1) Set the screen scrollback buffer to the maximum

2) Log the screen output to a file

3) Map the menu function of copy-paste to the ~ key using the keymap editor.  This means you can just highlight something with the mouse and then hit the ~ key to paste the highlighted data.

4) Change the screen color from black on white to green on black. “

Tips: Go through the Help Documentation of SecureCRT for available features in the Lab. I found it the best

source to learn expert using of SecureCRT features.

Hello world!

•April 19, 2008 • 1 Comment

In this blog, I’ll share my experience toward CCIE certification. Hop you will enjoy it.