Skip to content

Instantly share code, notes, and snippets.

@vista-
Created October 30, 2018 19:36
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vista-/3fa22724b8c5f5147e6cfb70b9169f27 to your computer and use it in GitHub Desktop.
Save vista-/3fa22724b8c5f5147e6cfb70b9169f27 to your computer and use it in GitHub Desktop.
Cisco Linux color / highlight guide
Highlighting Cisco keywords/output on Linux
======================================================
As you might know, one of the most favorite tools of sysadmins and netadmins around the world, SecureCRT, does not work that well on Linux (sadly).
The most powerful feature (in my opinion), keyword highlighting, does not work on the Linux version.
So, I made my own hacked-together version of SecureCRT, with blackjack and hookers.
**UPDATE 2018/07/15** *Saria Hajjar* has rewritten ChromaTerm to be faster, better, more stable and generally maintained - meet [**ChromaTerm--**](https://github.com/hSaria/ChromaTerm--)!
The guide has been updated to use his tool instead of the old ChromaTerm.
The setup
---------
For the terminal emulator, I chose *gnunn1's* [**Tilix**](https://github.com/gnunn1/tilix), which supports tabs out of the box. For the more CLI-adept, *tmux* or *screen* is a valid choice as well.
Inside Tilix, I run the [**ChromaTerm--**](https://github.com/hSaria/ChromaTerm--) colorizer (made by *Saria Hajjar*).
As you might not want your normal bash output to be colorized, try using the following aliases and functions instead:
function ctssh {
ssh $@ | ct
}
function cttelnet {
telnet $@ | ct
}
Those with GNS3 can use the following console command to combine Tilix and ChromaTerm--:
`tilix -t "%d" -e "bash -c 'telnet %h %p | ct'"`
The config
----------
The lion's share of the work was creating a proper configuration for ChromaTerm--. Using [feral packet's SecureCRT highlight config](http://feralpacket.org/?p=299) as a reference, I also added some new keywords that I found to
be handy.
The complete configuration can be either downloaded from [here](https://static.notx.ml/u/.chromatermrc--), or you can find an archived version of it as a [Gist](https://gist.github.com/vista-/88c90110dd320be4c78da4f55783b41a), in
case this site ever goes down. I am open to improvements or changes, it'd be really nice to see this config flourish over the years.
To use this config, just copy the configuration file to your home directory and rename it to `.chromatermrc`.
The result
----------
Why bother putting this together, you might ask? You haven't even seen what the setup looks like!
RIB:
<img src="https://static.notx.ml/u/d85fe58ad8.png">
BGP routes:
<img src="https://static.notx.ml/u/ac59aad68d.png">
BGP flap:
<img src="https://static.notx.ml/u/b866f4c6ea.png">
IP and IPv6 addresses:
<img src="https://static.notx.ml/u/f8c44e14f3.png">
Interface statistics:
<img src="https://static.notx.ml/u/3fbd95608b.png">
Coloring is not very useful / that great on configuration listings, feel free to send me a pull request /
message in case you have improved the script on this front (or in any way!)
Legacy setup
---------
For the terminal emulator, I chose *gnunn1's* [**Tilix**](https://github.com/gnunn1/tilix), which supports tabs out of the box. For the more CLI-adept, *tmux* or *screen* is a valid choice as well.
Inside Tilix, I run the [**ChromaTerm**](https://github.com/tunnelsup/chromaterm) shell wrapper (from the guys at [*TunnelsUp*](https://www.tunnelsup.com/chromaterm/))
As you might not want your normal bash output to be colorized, try using the following aliases and functions instead:
function ctssh {
SHELL="ssh $@" ct
}
function cttelnet {
SHELL="telnet $@" ct
}
alias ct="ct -G"
Those with GNS3 can use the following console command to combine Tilix and ChromaTerm:
`tilix -t "%d" -e "bash -c 'SHELL=\"telnet %h %p\" ct -G' "`
Legacy config
----------
The old config can be found below in case you would like to use the old ChromaTerm:
The complete configuration can be either downloaded from [here](https://static.notx.ml/u/.chromatermrc), or you can find an archived version of it as a [Gist](https://gist.github.com/vista-/7882bc223e3bb209664103fd4736ab7f), in
case this site ever goes down. I am open to improvements or changes, it'd be really nice to see this config flourish over the years.
To use this config, just copy the configuration file to your home directory.
Legacy caveats
-------
As you can see, any entered input is immediately parsed, which, for example, causes the letter(s) **r** to be immediately highlighted.
I haven't found a good solution for this yet, this is most likely ChromaTerm's limitation.
[Large amounts of output *might* lock up ChromaTerm](https://github.com/tunnelsup/chromaterm/issues/1), I haven't experienced this bug yet myself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment