Jeff's Online Examples

These are small online examples of how to do things in C, Perl, C++, Java, Emacs and other things. This will be ever growing (I hope.)


27 December 1999
Word Wrap in Emacs

To enable word wrap in emacs add a hook to activate auto-fill in your .emacs file. Set the fill-column to some number less than or equal to 80. This example wraps words that go past the 75th column when in html mode. It should be added to your .emacs file.

(add-hook 'html-mode-hook 'turn-on-auto-fill)
(setq fill-column 75) 
Similar code can be added for different modes too. Changing "html-mode-hook" to "text-mode-hook" would enable this in text mode.

11 January 2000
Password Recovery on a Cisco 6500 MSFC Supervisor module

If the passwords are lost on a Cisco MSFC Supervisor, then you can reset the switch's password's by simply doing a

clear config
system reset
Reseting the configuration on the MSFC (router) part of the switch is harder. Do the following assuming that your MSFC is accessed via virtual module 15.
reset 15
switch console
# If physically on the console port you send a "real" break key sequence
# If you are telneted a console server which gives you access to the switch console
# port then do a Ctrl ] to return to the telnet> prompt.... then type "send break" 
# at the > prompt to boot from flash type
o/r 0x42
#to change the password
o/r 0x41
# at the next > prompt type
i
# you will be in the router


13 January 2000
Redirecting both STDOUT and STDERR to the same file

My friend PaulG hooked me up with this one! This is how you redirect both STDOUT and STDERR to the same file. This is nice when capturing output from system commands like traceroute.

command > file 2>&1


Eric Downing and I began the Tech Tip idea when working together at Xionics. It began as an effort to on Eric's part to answer all of my annoying questions. See Eric's original tech tips page.


[ Jeff's Home Page ]