2018/04/17

bring back 'telnet' into HighSierra.

Recent update for OS X 10.13.4, nicer looks for common desktop users.. but actually quite annoying for network engineer.

basic function 'telnet' is missing from HS.

well, there's always a way around for it.. (thank you tech guys wherever y'guys are)

1st step: need to install Homebrew.
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following existing directories will be made group writable:
/usr/local/bin
/usr/local/sbin
/usr/local/share
/usr/local/share/man
/usr/local/share/man/man1
==> The following existing directories will have their owner set to xxx:
/usr/local/bin
/usr/local/sbin
/usr/local/share
/usr/local/share/man
/usr/local/share/man/man1
==> The following existing directories will have their group set to admin:
/usr/local/bin
/usr/local/sbin
/usr/local/share
/usr/local/share/man
/usr/local/share/man/man1
==> The following new directories will be created:
/usr/local/Cellar
/usr/local/Homebrew
/usr/local/Frameworks
/usr/local/etc
/usr/local/include
/usr/local/lib
/usr/local/opt
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var
==> The Xcode Command Line Tools will be installed.

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/bin /usr/local/sbin /usr/local/share /usr/local/share/man /usr/local/share/man/man1
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/bin /usr/local/sbin /usr/local/share /usr/local/share/man /usr/local/share/man/man1
==> /usr/bin/sudo /usr/sbin/chown xxx /usr/local/bin /usr/local/sbin /usr/local/share /usr/local/share/man /usr/local/share/man/man1
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/bin /usr/local/sbin /usr/local/share /usr/local/share/man /usr/local/share/man/man1
==> /usr/bin/sudo /bin/mkdir -p /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown xxx /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==> /usr/bin/sudo /bin/mkdir -p /Users/xxx/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/xxx/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown xxx /Users/xxx/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/mkdir -p /Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown xxx /Library/Caches/Homebrew
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> Installing Command Line Tools (macOS High Sierra version 10.13) for Xcode-9.3
==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ (macOS\ High\ Sierra\ version\ 10.13)\ for\ Xcode-9.3
Software Update Tool


Downloading Command Line Tools (macOS High Sierra version 10.13) for Xcode
Downloaded Command Line Tools (macOS High Sierra version 10.13) for Xcode
Installing Command Line Tools (macOS High Sierra version 10.13) for Xcode
Done with Command Line Tools (macOS High Sierra version 10.13) for Xcode
Done.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
==> Downloading and installing Homebrew...
remote: Counting objects: 100037, done.
remote: Total 100037 (delta 0), reused 1 (delta 0), pack-reused 100036
Receiving objects: 100% (100037/100037), 22.80 MiB | 1.09 MiB/s, done.
Resolving deltas: 100% (72796/72796), done.
From https://github.com/Homebrew/brew
 * [new branch]          master     -> origin/master
 * [new tag]             0.1        -> 0.1
 * [new tag]             0.2        -> 0.2
 * [new tag]             0.3        -> 0.3
 * [new tag]             0.4        -> 0.4
 * [new tag]             0.5        -> 0.5
 * [new tag]             0.6        -> 0.6
 * [new tag]             0.7        -> 0.7
 * [new tag]             0.7.1      -> 0.7.1
 * [new tag]             0.8        -> 0.8
 * [new tag]             0.8.1      -> 0.8.1
 * [new tag]             0.9        -> 0.9
 * [new tag]             0.9.1      -> 0.9.1
 * [new tag]             0.9.2      -> 0.9.2
 * [new tag]             0.9.3      -> 0.9.3
 * [new tag]             0.9.4      -> 0.9.4
 * [new tag]             0.9.5      -> 0.9.5
 * [new tag]             0.9.8      -> 0.9.8
 * [new tag]             0.9.9      -> 0.9.9
 * [new tag]             1.0.0      -> 1.0.0
 * [new tag]             1.0.1      -> 1.0.1
 * [new tag]             1.0.2      -> 1.0.2
 * [new tag]             1.0.3      -> 1.0.3
 * [new tag]             1.0.4      -> 1.0.4
 * [new tag]             1.0.5      -> 1.0.5
 * [new tag]             1.0.6      -> 1.0.6
 * [new tag]             1.0.7      -> 1.0.7
 * [new tag]             1.0.8      -> 1.0.8
 * [new tag]             1.0.9      -> 1.0.9
 * [new tag]             1.1.0      -> 1.1.0
 * [new tag]             1.1.1      -> 1.1.1
 * [new tag]             1.1.10     -> 1.1.10
 * [new tag]             1.1.11     -> 1.1.11
 * [new tag]             1.1.12     -> 1.1.12
 * [new tag]             1.1.13     -> 1.1.13
 * [new tag]             1.1.2      -> 1.1.2
 * [new tag]             1.1.3      -> 1.1.3
 * [new tag]             1.1.4      -> 1.1.4
 * [new tag]             1.1.5      -> 1.1.5
 * [new tag]             1.1.6      -> 1.1.6
 * [new tag]             1.1.7      -> 1.1.7
 * [new tag]             1.1.8      -> 1.1.8
 * [new tag]             1.1.9      -> 1.1.9
 * [new tag]             1.2.0      -> 1.2.0
 * [new tag]             1.2.1      -> 1.2.1
 * [new tag]             1.2.2      -> 1.2.2
 * [new tag]             1.2.3      -> 1.2.3
 * [new tag]             1.2.4      -> 1.2.4
 * [new tag]             1.2.5      -> 1.2.5
 * [new tag]             1.2.6      -> 1.2.6
 * [new tag]             1.3.0      -> 1.3.0
 * [new tag]             1.3.1      -> 1.3.1
 * [new tag]             1.3.2      -> 1.3.2
 * [new tag]             1.3.3      -> 1.3.3
 * [new tag]             1.3.4      -> 1.3.4
 * [new tag]             1.3.5      -> 1.3.5
 * [new tag]             1.3.6      -> 1.3.6
 * [new tag]             1.3.7      -> 1.3.7
 * [new tag]             1.3.8      -> 1.3.8
 * [new tag]             1.3.9      -> 1.3.9
 * [new tag]             1.4.0      -> 1.4.0
 * [new tag]             1.4.1      -> 1.4.1
 * [new tag]             1.4.2      -> 1.4.2
 * [new tag]             1.4.3      -> 1.4.3
 * [new tag]             1.5.0      -> 1.5.0
 * [new tag]             1.5.1      -> 1.5.1
 * [new tag]             1.5.10     -> 1.5.10
 * [new tag]             1.5.11     -> 1.5.11
 * [new tag]             1.5.12     -> 1.5.12
 * [new tag]             1.5.13     -> 1.5.13
 * [new tag]             1.5.14     -> 1.5.14
 * [new tag]             1.5.2      -> 1.5.2
 * [new tag]             1.5.3      -> 1.5.3
 * [new tag]             1.5.4      -> 1.5.4
 * [new tag]             1.5.5      -> 1.5.5
 * [new tag]             1.5.6      -> 1.5.6
 * [new tag]             1.5.7      -> 1.5.7
 * [new tag]             1.5.8      -> 1.5.8
 * [new tag]             1.5.9      -> 1.5.9
 * [new tag]             1.6.0      -> 1.6.0
 * [new tag]             1.6.1      -> 1.6.1
HEAD is now at 6233b9d19 Merge pull request #4072 from reitermarkus/cask-refactoring
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 4730, done.
remote: Compressing objects: 100% (4523/4523), done.
remote: Total 4730 (delta 54), reused 631 (delta 20), pack-reused 0
Receiving objects: 100% (4730/4730), 3.84 MiB | 1.11 MiB/s, done.
Resolving deltas: 100% (54/54), done.
Tapped 4526 formulae (4,772 files, 12MB)
==> Cleaning up /Library/Caches/Homebrew...
==> Migrating /Library/Caches/Homebrew to /Users/xxx/Library/Caches/Home
==> Deleting /Library/Caches/Homebrew...
Already up-to-date.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics.html

==> Next steps:
- Run `brew help` to get started
- Further documentation: 
    https://docs.brew.sh
2nd step: install telnet using homebrew.
$ brew install telnet
==> Downloading https://homebrew.bintray.com/bottles/telnet-54.50.1.high_sierra.
######################################################################## 100.0%
==> Pouring telnet-54.50.1.high_sierra.bottle.1.tar.gz
🍺  /usr/local/Cellar/telnet/54.50.1: 4 files, 246KB
your telnet is ready.

2018/04/09

Reset CISCO Catalyst 3750 to Factory Defaults

Similar to my previous-post, this one is with c3750 product.
Just got it from piles of catalysts that no longer use ;p

Here's simple steps to set CISCO Catalyst 3750 to Factory Defaults.

1. "unplug" the switch.

2. while holding the "mode" button (on the front left of the switch), plug-in the power-cord.
    notice the "green" led is blinking, release mode button after it flashes "amber"
The system has been interrupted prior to initializing the flash file system. The following commands will initialize the flash file system and finish loading the operating system software:
 
flash_init
load_helper
boot
3. issue the "flash_init" command:
    switch: flash_init   
Initializing Flash...
mifs[2]: 12 files, 1 directories
mifs[2]: Total bytes : 2097152
mifs[2]: Bytes used : 755200
mifs[2]: Bytes available : 1341952
mifs[2]: mifs fsck took 2 seconds.
mifs[3]: 0 files, 1 directories
.......
mifs[6]: 455 files, 8 directories
mifs[6]: Total bytes : 57671680
mifs[6]: Bytes used : 42235904
mifs[6]: Bytes available : 15435776
mifs[6]: mifs fsck took 48 seconds.
...done Initializing Flash.
4. search for the startup configuration file (config.text) and rename it: 
switch: dir flash:
 
Directory of flash:/
2 -rwx 118939 config.text
3 -rwx 5656 vlan.dat
4 drwx 512 c3750e-universalk9-mz.122-58.SE1
459 -rwx 3833 private-config.text
460 -rwx 117555 config.text.backup
461 -rwx 3833 private-config.text.backup
462 -rwx 20437248 c3750e-universalk9-mz.150-2.SE8.bin
463 -rwx 15384 multiple-fs
15435776 bytes available (42235904 bytes used)
 
switch: rename flash:config.text flash:config.text.old
5. boot catalyst:
switch: boot
 
Loading
"flash:/c3750e-universalk9-mz.1502.SE8.bin" ...@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
POST: PortASIC RingLoopback Tests : Begin
POST: PortASIC RingLoopback Tests : End, Status Passed
extracting front_end/front_end_ucode_info (309 bytes)
SM: Detected stack cables at PORT1 PORT2
Waiting for Stack Master Election...
SM: Waiting for other switches in stack to boot...
######################################################
Election Complete
Switch 1 booting as Master
Waiting for Port download...Complete
6. delete pre-config files:
    switch: del flash:config.text.old
    switch: del flash:vlan.dat
    switch: wr
7. reboot catalyst
    switch: boot
    loading "flash:xxxxxxx"

Good to go..