mirror of https://github.com/garabik/grc.git
Compare commits
182 Commits
Author | SHA1 | Date |
---|---|---|
Radovan Garabík | f4a579e08d | |
Radovan Garabík | c81ae202b1 | |
Radovan Garabík | f79a3dc650 | |
Radovan Garabík | 47e7daa155 | |
Radovan Garabík | 223732e54b | |
Radovan Garabík | ab22533a16 | |
Radovan Garabík | ea4aa18200 | |
Radovan Garabík | 6f0a553c76 | |
Radovan Garabík | d8fc493d72 | |
Radovan Garabík | 09793f88a6 | |
Radovan Garabík | e277b6e960 | |
Radovan Garabík | 1d7de7ea44 | |
Radovan Garabík | cffdc86127 | |
Radovan Garabík | 30ecf4688f | |
Radovan Garabík | db55a51206 | |
Radovan Garabík | 64c1ba6a0d | |
Radovan Garabík | 9dd0d18f62 | |
Radovan Garabík | c367041dcc | |
Radovan Garabík | 4ea874b224 | |
Vitaliy Perekhovy | ae9cecb66c | |
Joeky | b7e96762b4 | |
Radovan Garabík | 06afa277e0 | |
Radovan Garabík | e0c5ab25c8 | |
Radovan Garabík | ca8acefed8 | |
Radovan Garabík | cb0ee756ca | |
Radovan Garabík | acd749e705 | |
Radovan Garabík | 7cd8fff5e1 | |
Radovan Garabík | 357e686aa6 | |
Radovan Garabík | 2fc38520fc | |
Radovan Garabík | 1844de085c | |
Radovan Garabík | 4e796fbb8d | |
hjpotter92 | 7eaacb5c4a | |
Radovan Garabík | a31019fd81 | |
Radovan Garabík | 98f483068a | |
Radovan Garabík | f2ace18191 | |
Radovan Garabík | 61c070db25 | |
Radovan Garabík | ce4f6290d8 | |
Radovan Garabík | eaf4203de1 | |
Radovan Garabík | 8f7adc0eee | |
Radovan Garabík | e969eeef72 | |
Radovan Garabík | 826422fad6 | |
hjpotter92 | 757515996f | |
hjpotter92 | 8eb0e6614b | |
hjpotter92 | 8275543560 | |
Raizo62 | 4cdaaceb3e | |
Raizo62 | ec1eab4f64 | |
Radovan Garabík | 70f4178f37 | |
Adrian Papari | 5ee2461214 | |
Adrian Papari | 5fefb0602f | |
Radovan Garabík | 8f5b15e55a | |
Radovan Garabík | b16ae2647d | |
Radovan Garabík | 371f85a580 | |
Radovan Garabík | 9f61e86374 | |
Radovan Garabík | f7b36ed2c0 | |
Radovan Garabík | 7704a1824e | |
Andrei Buzoianu | 4e1e9d7fdc | |
Andrei Buzoianu | dfb89f2e15 | |
Andrei Buzoianu | 95da0c8e3a | |
Andrei Buzoianu | 3f3fc2932e | |
Andrei Buzoianu | 499fdbff0e | |
Radovan Garabík | 8263f4f63b | |
Radovan Garabík | 8c2a0ace74 | |
Radovan Garabík | e5f43bf3d8 | |
Radovan Garabík | 892c6f6671 | |
Radovan Garabík | 023c88b37b | |
Radovan Garabík | fb14b1a0a0 | |
Wayne Walker | 0c615d2904 | |
Justin J. Novack | f2ec76166e | |
Justin J. Novack | 92e48627f8 | |
Justin J. Novack | a51b7f0a7b | |
Justin J. Novack | 448f19652a | |
Radovan Garabík | 01a21de7fa | |
Radovan Garabík | 7d04c05cd0 | |
Radovan Garabík | 3101bb9eb3 | |
Rostyslav Polishchuk | fba1ba22b5 | |
Radovan Garabík | c910742ee6 | |
Radovan Garabík | 23c1802b4a | |
Raizo62 | 6006304f28 | |
Vincent Milum Jr | f6788db3e1 | |
Vincent Milum Jr | 0a8a163c03 | |
Vincent Milum Jr | 43092396e8 | |
Raizo62 | 1a8a777ee0 | |
Radovan Garabík | 30606591b7 | |
Luis Davim | 77414a6d18 | |
Radovan Garabík | 763fa396b1 | |
Luis Davim | 02f22d4cf4 | |
Radovan Garabík | 01af1fdceb | |
Luis Davim | 36ef164987 | |
Luis Davim | ad91fc4b2e | |
Luis Davim | e83a11599c | |
Luis Davim | 074fe6e3b1 | |
Radovan Garabík | c414dfd3b4 | |
Radovan Garabík | 9367d03d9f | |
Radovan Garabík | 75e255c730 | |
Radovan Garabík | 98b4df7bd2 | |
Radovan Garabík | eafbb9dded | |
Radovan Garabík | 5c9d5abec4 | |
Radovan Garabík | 5981e2ac1c | |
Radovan Garabík | 8267bab647 | |
Radovan Garabík | c71b244b80 | |
Ricardo J. Barberis | ee07d1bd15 | |
Ricardo J. Barberis | 7df059ed67 | |
raizo62 | 270e11cb83 | |
raizo62 | edee9e7591 | |
Dave Wikoff | 9302d75f06 | |
Radovan Garabík | b11c36fcba | |
Radovan Garabík | 5ca81657ab | |
raizo62 | 4a37b7fc7c | |
Radovan Garabík | ae79db506e | |
Radovan Garabík | 677295cb8f | |
Radovan Garabík | b5726877be | |
Radovan Garabík | c7856d4068 | |
Radovan Garabík | f32d8a1432 | |
Miha Frangež | 2b98e0767d | |
Alexander Kapshuna | dd7ecc05d6 | |
Alexander Kapshuna | 3abfc841db | |
Alexander Kapshuna | 7a5f76aeee | |
Radovan Garabík | ae88b81759 | |
Radovan Garabík | c1cb9b8941 | |
Radovan Garabík | 04665c00b5 | |
Radovan Garabík | 50174b2336 | |
Radovan Garabík | 5bc9f4e70f | |
Radovan Garabík | 047bcc6c7a | |
Erik Valdivieso | f3f76ad382 | |
Florian Beer | 918df658c2 | |
Isaias Pina | 1d07328d38 | |
g0tmi1k | 98ec00d036 | |
Radovan Garabík | d64b7c6523 | |
Radovan Garabík | 681408c3a5 | |
Radovan Garabík | e0033c0a23 | |
Radovan Garabík | 8ec2f1a310 | |
Alex Jahraus | d713c4fbce | |
Felix Yan | 692cd20fba | |
Tasnad Kernetzky | fc39736c78 | |
Tasnad Kernetzky | 90de144c31 | |
Tasnad Kernetzky | 66efc0dc3a | |
Isaias Pina | e9fc71c699 | |
Isaias Pina | e88d90ff0a | |
Isaias Pina | 4c8b5a799a | |
Alexander Kapshuna | 9c4796ff65 | |
Radovan Garabík | 375b6c3443 | |
Radovan Garabík | 92aac170d0 | |
Radovan Garabík | ec91099255 | |
Radovan Garabík | 98612d8fb5 | |
Radovan Garabík | aa6871479c | |
Radovan Garabík | 99c13d1fa5 | |
Radovan Garabík | 337794041b | |
Radovan Garabík | 98302aaf75 | |
Radovan Garabík | d0420ed646 | |
Radovan Garabík | 5d7c715ea9 | |
Radovan Garabík | dbd246f57a | |
Radovan Garabík | c244781df8 | |
Radovan Garabík | 59509cff15 | |
Radovan Garabík | ad736f824e | |
Radovan Garabík | 869a5ebe93 | |
Radovan Garabík | e1c94357fe | |
Radovan Garabík | f47677d6e4 | |
Alexander Kapshuna | c91450d0fb | |
xPMo | 50ba64c8bc | |
xPMo | fdea4dc477 | |
xPMo | f4ecb7249b | |
Benoit Hamon | bde2b3140a | |
Yurii Myronchuk | 481e097c76 | |
Isaias Piña | cc1880e6d9 | |
Isaias Pina | d927c5db24 | |
Radovan Garabík | a110dd51bd | |
Radovan Garabík | c43e6a2ca3 | |
Radovan Garabík | 4b76c139a5 | |
Radovan Garabík | 1d661756f0 | |
Radovan Garabík | b281df72c4 | |
Radovan Garabík | a734ae32a4 | |
Radovan Garabík | b1d36b1f19 | |
Radovan Garabík | a67ef384ab | |
codydiehl | aa33a0dd6a | |
Isaias Piña | da6c77164d | |
Isaias Piña | 471e841d19 | |
Radovan Garabík | 582a18533d | |
Radovan Garabík | 1f05d78f45 | |
Radovan Garabík | 5609f1dc42 | |
NoSuck | d13808f5bd | |
Radovan Garabík | ddc03abfdb | |
Radovan Garabík | 160ea4ba1a |
|
@ -161,9 +161,9 @@ there can be more attributes per line (separated by space), e.g.
|
|||
|
||||
will display pathnames in bold blinking green
|
||||
|
||||
## Python 3 compatibility
|
||||
## Python 2 & 3 compatibility
|
||||
|
||||
There is some preliminary python3 support, meaning that both grc and grcat will run under both python2 and python3. However, all the regular expressions are strings, and grcat works on string input (not bytes). Therefore it will miserably fail if fed input with invalid UTF-8 characters.
|
||||
both grc and grcat are targetted towards python3 now; there is an attempt at python2 compatibility, meaning that both grc and grcat will run under both python2 and python3. However, all the regular expressions are strings, and grcat works on string input (not bytes).
|
||||
|
||||
## Hints
|
||||
|
||||
|
@ -179,13 +179,16 @@ or, if you have recent BSD tail:
|
|||
|
||||
## Automatic aliases
|
||||
|
||||
You can start using grc automatically with supported commands. The following assumes that `grc.<bashrc|zsh|fish>` is in `/etc`. The location may differ (i. e. `/usr/local/etc` when installed with homebrew).
|
||||
You can start using grc automatically with supported commands. The following assumes that `grc.<sh|zsh|fish>` is in `/etc`. The location may differ (i. e. `/usr/local/etc` when installed with [homebrew](https://formulae.brew.sh/formula/grc)); or the `grc.sh` can be placed into `/etc/profile.d/` (this is in fact the default). Be aware this is somewhat invasive and better test it before deploying.
|
||||
|
||||
### Bash
|
||||
|
||||
To set aliases for supported commands, append to your `~/.bashrc`:
|
||||
|
||||
[[ -s "/etc/grc.bashrc" ]] && source /etc/grc.bashrc
|
||||
GRC_ALIASES=true
|
||||
[[ -s "/etc/profile.d/grc.sh" ]] && source /etc/grc.sh
|
||||
|
||||
If the file `/etc/default/grc` exists, it is sourced first, therefore you can place a line saying `GRC_ALIASES=true` there.
|
||||
|
||||
### ZSH
|
||||
|
||||
|
@ -199,3 +202,11 @@ Add to `~/.config/fish/config.fish` or in a new file in `~/.config/fish/conf.d/`
|
|||
|
||||
source /usr/local/etc/grc.fish
|
||||
|
||||
## Dynamic aliases
|
||||
|
||||
By running the follow code, it will check to see what programs are already installed on your OS (based on your `$PATH`), and echo out the result. This could then be added to your shell resource file as a one off. Alternatively, by removing the `echo` in the code, it could be placed into your shell resource file directly, and it will create the necessarily aliases each time:
|
||||
|
||||
for cmd in g++ gas head make ld ping6 tail traceroute6 $( ls /usr/share/grc/ ); do
|
||||
cmd="${cmd##*conf.}"
|
||||
type "${cmd}" >/dev/null 2>&1 && echo alias "${cmd}"="$( which grc ) --colour=auto ${cmd}"
|
||||
done
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
#compdef grc
|
||||
|
||||
setopt localoptions extended_glob
|
||||
|
||||
local environ e cmd
|
||||
local -a args
|
||||
local -a _comp_priv_prefix
|
||||
|
||||
zstyle -a ":completion:${curcontext}:" environ environ
|
||||
|
||||
for e in "${environ[@]}"
|
||||
do local -x "$e"
|
||||
done
|
||||
|
||||
args=(
|
||||
'(-e --stderr)'{-e,--stderr}'[redirect stderr; do not automatically redirect stdout]'
|
||||
'(-s --stdout)'{-s,--stdout}'[redirect stdout; even with -e/--stderr]'
|
||||
'(-c <name>--config=<name>)'{-c+,--config=-}'[use <name> as configuration file for grcat]:file:_files'
|
||||
'--colour=-[colourize output]:colour:(on off auto)'
|
||||
'(-h --help)'{-h,--help}'[display help message and exit]'
|
||||
'--pty[run command in pseudotermnial (experimental)]'
|
||||
'*::arguments:{ _normal }'
|
||||
)
|
||||
|
||||
_arguments -s $args
|
|
@ -8,16 +8,24 @@ colours=unchanged,underline green,bright_green
|
|||
======
|
||||
# UUID
|
||||
regexp=\sUUID="([^"]+)
|
||||
colours=default,blue
|
||||
colours=bold yellow,blue
|
||||
======
|
||||
#UUID_SUB
|
||||
regexp=\sUUID_SUB="([^"]+)
|
||||
colours=green,bright_green
|
||||
======
|
||||
# TYPE
|
||||
regexp=TYPE="([^"]+)
|
||||
colours=default,cyan
|
||||
colours=bold cyan,cyan
|
||||
======
|
||||
# LABEL
|
||||
regexp=LABEL="([^"]+)
|
||||
colours=default,bright_cyan
|
||||
regexp=\sLABEL="([^"]+)
|
||||
colours=bold bright_cyan,bright_cyan
|
||||
======
|
||||
# PARTLABEL
|
||||
regexp=\sPARTLABEL="([^"]+)
|
||||
colours=bold green,red
|
||||
# PARTUUID
|
||||
regexp=PARTUUID="([^"]+)
|
||||
colours=default,magenta
|
||||
colours=green,magenta
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
# Green Words
|
||||
regexp=[Ee]nabled?|[Oo]k|[Rr]unning|[Tt]rue
|
||||
colour=green
|
||||
-
|
||||
# Red Words
|
||||
regexp=[Dd]isabled?|[Ee]rrors?|[Ss]topped|[Ff]alse
|
||||
colour=red
|
||||
-
|
||||
# Yellow Words
|
||||
regexp=[Ww]arning
|
||||
colour=yellow
|
|
@ -0,0 +1,72 @@
|
|||
# curl grc colorizer configuration
|
||||
===
|
||||
# Outgoing Headers
|
||||
regexp=^(>) ([\w\-]+): (.*)
|
||||
colours=default, bright_green, bright_blue, bright_cyan
|
||||
===
|
||||
# Incoming Headers
|
||||
regexp=^(<) ([\w\-]+): (.*)
|
||||
colours=default, bright_yellow, bright_blue, bright_cyan
|
||||
===
|
||||
# Incoming 200
|
||||
regexp=(HTTP/[\d\.]+) 2\d{2} [\w\s]+
|
||||
colours=bright_green on_blue, bright_white on_blue
|
||||
===
|
||||
# Incoming 300
|
||||
regexp=(HTTP/[\d\.]+) 3\d{2}[\w\s]*
|
||||
colours=bright_green on_blue, bright_white on_blue
|
||||
===
|
||||
# Incoming 400
|
||||
regexp=(HTTP/[\d\.]+) 4\d{2} [\w\s]+
|
||||
colours=bright_red on_blue, bright_white on_blue
|
||||
===
|
||||
# Incoming 500
|
||||
regexp=(HTTP/[\d\.]+) 5\d{2} [\w\s]+
|
||||
colours=bright_red on_blue, bright_white on_blue
|
||||
===
|
||||
# Server certificate
|
||||
regexp=\* (Server certificate):
|
||||
colours=magenta, bright_magenta
|
||||
===
|
||||
# Certificate Headers
|
||||
regexp=\* ([a-z][\w\s\d]+): (.*)
|
||||
colours=magenta, bright_blue, bright_cyan
|
||||
===
|
||||
# SSL certificate problem
|
||||
regexp=SSL certificate problem:( .*)
|
||||
colours=bright_red, bright_red
|
||||
===
|
||||
# SSL certificate verify result: self signed certificate (18), continuing anyway.
|
||||
regexp=SSL certificate verify result:(.*)
|
||||
colours=bright_magenta, bright_yellow
|
||||
===
|
||||
# SSL certificate verify ok.
|
||||
regexp=SSL certificate verify (ok)
|
||||
colours=bright_magenta, bright_green
|
||||
===
|
||||
# Verbose Logging
|
||||
regexp=^([{}\*])\s
|
||||
colours=default, bright_magenta
|
||||
count=more
|
||||
===
|
||||
# Outgoing
|
||||
regexp=^>\s
|
||||
colours=bright_green
|
||||
count=more
|
||||
===
|
||||
# Incoming
|
||||
regexp=^<\s
|
||||
colours=bright_yellow
|
||||
count=more
|
||||
===
|
||||
# SSL connection
|
||||
regexp= (SSL connection) using (.*) / (.*)
|
||||
colours=magenta, bright_magenta, bright_magenta, bright_magenta
|
||||
===
|
||||
# Connected to...
|
||||
regexp=(Connected) to (.*) \(([\d\.]+)\) port (\d+)
|
||||
colours=magenta, bright_magenta, bright_magenta, bright_magenta, bright_magenta
|
||||
===
|
||||
# Outgoing METHOD
|
||||
regexp=(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH) (/.*) HTTP/[\d\.]+
|
||||
colours=bright_white on_blue, bright_white on_blue, bright_yellow on_blue
|
|
@ -1,44 +1,44 @@
|
|||
# FS
|
||||
#regexp=^.*?\s
|
||||
regexp=^(?!Filesystem).*?\s
|
||||
colours=green
|
||||
regexp=^(?!Filesystem)(\/[-\w\d.]+)+\s
|
||||
colours=blue,bold blue
|
||||
======
|
||||
# Size 'K'
|
||||
regexp=\s\d*[.,]?\dKi?\s
|
||||
regexp=\s\d*[.,]?\d(K|B)i?\s|\b\d{1,3}\b
|
||||
colours=green
|
||||
======
|
||||
# Size 'M'
|
||||
regexp=\s\d*[.,]?\dMi?\s
|
||||
regexp=\s\d*[.,]?\dMi?\s|\b\d{4,6}\b
|
||||
colours=yellow
|
||||
======
|
||||
# Size 'G'
|
||||
regexp=\s\d*[.,]?\dGi?\s
|
||||
regexp=\s\d*[.,]?\dGi?\s|\b\d{7,9}\b
|
||||
colours=red
|
||||
======
|
||||
# Size 'T'
|
||||
regexp=\s\d*[.,]?\dTi?\s
|
||||
regexp=\s\d*[.,]?\dTi?\s|\b\d{10,12}\b
|
||||
colours=bold red
|
||||
======
|
||||
# Mounted on
|
||||
regexp=/[-\w\d./]*$
|
||||
colours=bold green
|
||||
regexp=\/$|(\/[-\w\d. ]+)+$
|
||||
colours=green,bold green
|
||||
======
|
||||
# Use 0-60%
|
||||
regexp=[1-6][0-9]?%|0%
|
||||
regexp=\s[1-6]?[0-9]%\s
|
||||
colours=green
|
||||
======
|
||||
# Use 70-90%
|
||||
regexp=[7-9][0-9]%
|
||||
# Use 70-89%
|
||||
regexp=\s[78][0-9]%\s
|
||||
colours=yellow
|
||||
======
|
||||
# Use 90-95
|
||||
regexp=[9][0-5]%
|
||||
# Use 90-97%
|
||||
regexp=\s9[0-7]%\s
|
||||
colours=red
|
||||
======
|
||||
# Use 95-100
|
||||
regexp=[9][5-9]%|100%
|
||||
# Use 98-100%
|
||||
regexp=\s9[89]%|100%\s
|
||||
colours=bold red
|
||||
|
||||
======
|
||||
# tmpfs lines
|
||||
regexp=^tmpfs.*
|
||||
colours=bright_black
|
||||
|
|
|
@ -1,31 +1,23 @@
|
|||
#ipv6
|
||||
regexp=(([0-9a-fA-F]{1,4})?\:\:?[0-9a-fA-F]{1,4})+
|
||||
colours=green
|
||||
=======
|
||||
#time
|
||||
regexp=\s[0-9]{1,6}\s
|
||||
colours=red
|
||||
=======
|
||||
#type
|
||||
regexp=[A-Z]{1,4}
|
||||
colours=cyan
|
||||
=======
|
||||
#in
|
||||
regexp=(IN|CH)
|
||||
colours=yellow
|
||||
=======
|
||||
#domain
|
||||
regexp=[a-z0-9-]+\.
|
||||
colours=magenta
|
||||
=======
|
||||
#ip address
|
||||
regexp=[\S]+\.
|
||||
colours=bright_magenta
|
||||
-
|
||||
#line
|
||||
regexp=^(\S+).*?(\d+)\t(\w+)\t(\w+)\t
|
||||
colours=unchanged,magenta,red,yellow,cyan
|
||||
-
|
||||
#ip4 address
|
||||
regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
|
||||
colours=green
|
||||
=======
|
||||
-
|
||||
#ipv6
|
||||
regexp=\t(([0-9a-fA-F]{1,4})?\:\:?[0-9a-fA-F]{1,4})+
|
||||
colours=dark green
|
||||
-
|
||||
#comments
|
||||
regexp=^;;\s\w*\s*\w*
|
||||
regexp=^;;[\s\w]+
|
||||
colours=yellow
|
||||
=======
|
||||
-
|
||||
#Title
|
||||
regexp=; <<>> DiG (\d+\.\d+\.\d+).*<<>>\s(\S+)$
|
||||
colours=default,green,bold magenta
|
||||
regexp=; <<>> DiG.* <<>> (\S+)
|
||||
colours=default,bold magenta
|
||||
|
|
|
@ -16,7 +16,7 @@ colours=red
|
|||
======
|
||||
# PORTS
|
||||
regexp=((?:\d{1,3}\.){3}\d{1,3}):(\d+)
|
||||
colours=default,blue,bold blue
|
||||
colours=default,blue,bold blue
|
||||
======
|
||||
# Error Line
|
||||
regexp=^error\s(?:\w+\s)+([a-z\-_0-9]+):(.*)$
|
||||
|
|
|
@ -1,43 +1,63 @@
|
|||
# HEADERS
|
||||
regexp=(?:\s|^)(REPOSITORY|TAG|IMAGE ID|CREATED|SIZE)(?:\s|$)
|
||||
colours=default,underline
|
||||
=====
|
||||
# REPO, TAG
|
||||
regexp=^([a-z]+\/?[^\s]+)\s+([^\s]+)
|
||||
colours=default,bold white,cyan,bold black
|
||||
=======
|
||||
# REPO, TAG, IMAGE ID
|
||||
regexp=^([a-z]+\/?[^\s]+)\s+([^\s]+)\s+(\w+)
|
||||
colours=default,bold white,bright_cyan,bright_black
|
||||
=====
|
||||
# latest
|
||||
regexp=\s+(latest)\s+
|
||||
colours=unchanged,cyan
|
||||
regexp=(?<=\s)latest(?=\s+)
|
||||
colours=dark cyan
|
||||
=====
|
||||
# REPOSITORY (Image name)
|
||||
regexp=^(?:([a-z\-_0-9]+)/)*([a-z\-_0-9]+)\s
|
||||
regexp=^(?:(\S+)\/)*(\S+)\s
|
||||
colours=default,yellow,bright_white
|
||||
=====
|
||||
# images without name
|
||||
regexp=^<none>.*$
|
||||
colours=bold red
|
||||
=====
|
||||
# images without tag
|
||||
regexp=\s+(<none>)\s+
|
||||
colours=unchanged,bold red
|
||||
=====
|
||||
# Size 'K'
|
||||
regexp=\s\d*[\.,]?\d*\sKB?
|
||||
regexp=(?<=\s)\d+[.,]?\d*\s?(KB?|B)
|
||||
colours=green
|
||||
======
|
||||
# Size 'M', 2 digits
|
||||
regexp=\s\d{1,2}[\.,]?\d*\sMB?
|
||||
regexp=(?<=\s)\d{1,2}[.,]?\d*\s?MB?
|
||||
colours=green
|
||||
======
|
||||
# Size 'M' 3+ digits
|
||||
regexp=\s\d{3,4}[\.,]?\d*\sMB?
|
||||
regexp=(?<=\s)\d{3,4}[.,]?\d*\s?MB?
|
||||
colours=yellow
|
||||
======
|
||||
# Size 'G'
|
||||
regexp=\s\d*[\.,]?\d*\sGB?
|
||||
regexp=(?<=\s)\d+[.,]?\d*\s?GB?
|
||||
colours=red
|
||||
=====
|
||||
# CREATED seconds/minutes
|
||||
regexp=[\da-f]{12}\s+((?:About a|\d+) (?:seconds?|minutes?) ago)
|
||||
colours=unchanged,on_green bold white
|
||||
======
|
||||
# Date Ago
|
||||
regexp=(?:\s{2}|^)(?:\w+\s)+ago
|
||||
colours=cyan
|
||||
# CREATED About a minute ago
|
||||
regexp=\s+(About a minute ago)\s\w+
|
||||
colours=unchanged,on_green bold white
|
||||
======
|
||||
# CREATED hours
|
||||
regexp=\s+(\d+\shours\s\w+)
|
||||
colours=unchanged,bright_green
|
||||
======
|
||||
# CREATED days
|
||||
regexp=\s+(\d+\sdays\s\w+)
|
||||
colours=unchanged,green
|
||||
======
|
||||
# CREATED weeks
|
||||
regexp=\s+(\d+\sweeks\s\w+)
|
||||
colours=unchanged,yellow
|
||||
======
|
||||
# CREATED months
|
||||
regexp=\s+(\d+\smonths\s\w+)
|
||||
colours=unchanged,red
|
||||
=====
|
||||
# HEADERS
|
||||
regexp=(?:\s|^)(REPOSITORY|TAG|IMAGE ID|CREATED|SIZE)(?:\s|$)
|
||||
colours=default,underline
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# Main Nodes
|
||||
regexp=^(\S[^:]+):\s(.*)$
|
||||
regexp=^(\S[^:]+):\s?(.*)?$
|
||||
colours=default,cyan
|
||||
======
|
||||
# Sub Nodes
|
||||
regexp=^\s([^:]+):\s(.*)$
|
||||
regexp=^\s([^:]+):\s?(.*)?$
|
||||
colours=default,magenta
|
||||
======
|
||||
# Warning
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
# HEADERS
|
||||
regexp=(?:\s|^)(NETWORK ID|NAME|DRIVER)(?:\s|$)
|
||||
regexp=(?:\s|^)(NETWORK ID|NAME|DRIVER|SCOPE)(?:\s|$)
|
||||
colours=default,underline
|
||||
-
|
||||
# Line
|
||||
regexp=^(?!NETWORK)(\S+)\s+(\S+)
|
||||
colours=default,green,bright_blue
|
||||
colours=unchanged,bright_black,bright_blue
|
||||
-
|
||||
# Bridge
|
||||
regexp=bridge\s+$
|
||||
colours=cyan
|
||||
# Driver BRIDGE
|
||||
regexp=^\S+\s+\S+\s+(bridge)
|
||||
colours=unchanged,bright_cyan
|
||||
-
|
||||
# host
|
||||
regexp=host\s+$
|
||||
colours=bright_cyan
|
||||
# Driver HOST
|
||||
regexp=^\S+\s+\S+\s+(host)
|
||||
colours=unchanged,cyan
|
||||
-
|
||||
# overlay
|
||||
regexp=overlay\s+$
|
||||
colours=magenta
|
||||
# Driver OVERLAY
|
||||
regexp=^\S+\s+\S+\s+(overlay)
|
||||
colours=unchanged,magenta
|
||||
-
|
||||
# null
|
||||
regexp=null\s+$
|
||||
colours=red
|
||||
# Driver NULL
|
||||
regexp=^\S+\s+\S+\s+(null)
|
||||
colours=unchanged,on_red white
|
||||
|
|
|
@ -1,34 +1,53 @@
|
|||
# This is for docker ps and docker-compose ps
|
||||
# Headers
|
||||
regexp=(?:\s{2}|^)(CONTAINER ID|IMAGE|COMMAND|CREATED|STATUS|PORTS|NAMES|Name|Command|State|Ports)(?:\s|$)
|
||||
# HEADERS
|
||||
regexp=(?:\s|^)(CONTAINER ID|IMAGE|COMMAND|CREATED|STATUS|PORTS|NAMES)(?:\s|$)
|
||||
colours=default,underline
|
||||
======
|
||||
# Commands (docker ps)
|
||||
regexp=(?:\s{2}|^)(?:\s\")(.*)(?:\")(?:\s{2}|$)
|
||||
colours=magenta
|
||||
=======
|
||||
# Date Ago (docker ps)
|
||||
regexp=(?:\s{2}|^)(?:\w+\s)+ago
|
||||
colours=cyan
|
||||
# IMAGE NAME (as docker image)
|
||||
regexp=\s{2,}(?:([a-z\-_0-9]+)\/)*([a-z\-_0-9]+)(:\S+)?\s{2,}\"
|
||||
colours=unchanged,yellow,bright_white,cyan
|
||||
======
|
||||
# IMAGE
|
||||
regexp=^(?!CONTAINER)(\w+)\s+([^\s]+)\s+(".*")\s+(.*(?=(?:Up|Exited|Created|Restarting)))
|
||||
colours=unchanged,bright_black,unchanged,bright_black,cyan
|
||||
======
|
||||
# Statuses - Created
|
||||
regexp=\sCreated\s
|
||||
colours=blue
|
||||
======
|
||||
# Statuses
|
||||
# https://github.com/docker/docker/blob/e5a3f86e447dd659da3c2e759f3c088a0bfcfe3d/container/state.go#L40
|
||||
# Up
|
||||
regexp=(?:\s{2}|^)(?:Up|Restarting)(?:(?:\s[\w,\d,(,)]+)+)?
|
||||
regexp=(?:\s{2}|^)(?:Up|Restarting)(?:(?:\s[\w,\d]+)+)?
|
||||
colours=bold green
|
||||
======
|
||||
# Exited
|
||||
regexp=(?:\s{2}|^)(?:Exited|Exit|Dead|Removal In Progress)(?:(?:\s[\w,\d,(,)]+)+)?
|
||||
# Health - healthy
|
||||
regexp=\s\(healthy\)
|
||||
colours=bold green
|
||||
======
|
||||
# Health - starting
|
||||
regexp=\s\(health: starting\)
|
||||
colours=bold yellow
|
||||
======
|
||||
# Health - unhealthy
|
||||
regexp=\s\(unhealthy\)
|
||||
colours=bold red
|
||||
=======
|
||||
# Ip Addresses / Ports
|
||||
regexp=(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(\:)?(\d{1,5}))?(->)?(\d{1,5})(\/)(\w+)
|
||||
colours=blue,default,bright_green,default,bright_green,default,bright_blue
|
||||
=======
|
||||
# Name and command in docker-compose ps.
|
||||
regexp=(?:\s{2}|^)(?:[a-z\-_0-9]+)(?:\s{2}|$)(?:\s+(.+?)\s{2,})?
|
||||
colours=bold yellow,magenta
|
||||
=======
|
||||
# Container ID / Image ID and Image. Need to be together to override the "name" regex.
|
||||
regexp=(?:\s{2}|^)([a-z0-9]+)\s{2,}((?:(?:[a-z\-_0-9\.]+)+(\/|:)?)+)
|
||||
colours=default,cyan,default
|
||||
======
|
||||
# Statuses - Exited
|
||||
regexp=Exited\s.(\d+).+?(?=\s{2,})
|
||||
colours=bold red,red
|
||||
======
|
||||
# Statuses - Restarting
|
||||
regexp=Restarting\s.(\d+).+?(?=\s{2,})
|
||||
colours=bold blue
|
||||
======
|
||||
# Ip Addresses
|
||||
regexp=(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(\:)?
|
||||
colours=default,blue,default
|
||||
======
|
||||
# Ports
|
||||
regexp=(\d{1,5})?(-)?(\d{1,5})?(->)?(\d{1,5})(-)?(\d{1,5})?(\/)(tcp|udp)
|
||||
colours=default,bright_green,default,bright_green, default, bright_green,default,bright_green,default,cyan
|
||||
======
|
||||
# NAMES
|
||||
regexp=(?:([a-z\-_0-9]+)\/)*([a-z\-_0-9]+)$
|
||||
colours=default,yellow,on_blue white
|
||||
|
|
|
@ -7,19 +7,31 @@ regexp=\s+[\.\/]+([\w\s\-\_\.]+)(\/.*)?$
|
|||
colours=default,bold blue,blue
|
||||
======
|
||||
# Size 'K'
|
||||
regexp=^\d*[.,]?\dKi?\s
|
||||
regexp=^\d{1,3}\s
|
||||
colours=green
|
||||
======
|
||||
regexp=^ ?\d*[.,]?\dKi?\s
|
||||
colours=green
|
||||
======
|
||||
# Size 'M'
|
||||
regexp=^\d*[.,]?\dMi?\s
|
||||
regexp=^\d{4,6}\s
|
||||
colours=yellow
|
||||
======
|
||||
regexp=^ ?\d*[.,]?\dMi?\s
|
||||
colours=yellow
|
||||
======
|
||||
# Size 'G'
|
||||
regexp=^\d*[.,]?\dGi?\s
|
||||
regexp=^\d{7,9}\s
|
||||
colours=red
|
||||
======
|
||||
regexp=^ ?\d*[.,]?\dGi?\s
|
||||
colours=red
|
||||
======
|
||||
# Size 'T'
|
||||
regexp=^\d*[.,]?\dTi?\s
|
||||
regexp=^\d{10,12}\s
|
||||
colours=bold red
|
||||
======
|
||||
regexp=^ ?\d*[.,]?\dTi?\s
|
||||
colours=bold red
|
||||
======
|
||||
# Total
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# for testing purposes, do match but do not change anything
|
||||
regexp=([a-g]+)
|
||||
colour=''
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
# Size 'K'
|
||||
regexp=\s\d*[.,]?\dKi?
|
||||
regexp=\s\d*[.,]?\dKi?|\b\d{1,3}\b
|
||||
colours=green
|
||||
======
|
||||
# Size 'M'
|
||||
regexp=\s\d*[.,]?\dMi?
|
||||
regexp=\s\d*[.,]?\dMi?|\b\d{4,6}\b
|
||||
colours=yellow
|
||||
======
|
||||
# Size 'G'
|
||||
regexp=\s\d*[.,]?\dGi?
|
||||
regexp=\s\d*[.,]?\dGi?|\b\d{7,9}\b
|
||||
colours=red
|
||||
======
|
||||
# Size 'T'
|
||||
regexp=\s\d*[.,]?\dTi?
|
||||
regexp=\s\d*[.,]?\dTi?|\b\d{10,12}\b
|
||||
colours=bold red
|
||||
======
|
||||
# Mem
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#
|
||||
#
|
||||
regexp=\b(g?cc|[gc]\+\+|g?as|ld)\b
|
||||
colours=white bold
|
||||
count=once
|
||||
.........
|
||||
#
|
||||
#
|
||||
regexp=^[^:\s]*?:\d+:
|
||||
colours=bold magenta
|
||||
.........
|
||||
|
@ -11,7 +11,7 @@ regexp=^[^:\s]*?:
|
|||
colours=cyan
|
||||
count=once
|
||||
.........
|
||||
#
|
||||
#
|
||||
regexp=\`[A-Za-z0-9_():&*]+( const)?\'
|
||||
colours=magenta
|
||||
.........
|
||||
|
@ -28,7 +28,7 @@ regexp=\-o\s[^\s]+
|
|||
colours=yellow
|
||||
.........
|
||||
# warning and error won't work, unless you redirect also
|
||||
# stderr to grcat
|
||||
# stderr to grcat
|
||||
#
|
||||
# warning
|
||||
regexp=[Ww]arning[:\b]
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
# go-test grc colorizer configuration
|
||||
regexp==== RUN .*
|
||||
colour=bright_blue
|
||||
-
|
||||
regexp=--- PASS: .* (\(\d+\.\d+s\))
|
||||
colour=green, yellow
|
||||
-
|
||||
regexp=^PASS$
|
||||
colour=bold white on_green
|
||||
-
|
||||
regexp=^(ok|FAIL)\s+.*
|
||||
colour=default, magenta
|
||||
-
|
||||
regexp=--- FAIL: .* (\(\d+\.\d+s\))
|
||||
colour=red, yellow
|
||||
-
|
||||
regexp=^FAIL$
|
||||
colour=bold white on_red
|
||||
-
|
||||
regexp=[^\s]+\.go(:\d+)?
|
||||
colour=cyan
|
|
@ -16,7 +16,7 @@ regexp=\d+(\.\d+)?\s(T|G|M|K|)i?B
|
|||
colours=yellow
|
||||
=======
|
||||
# interface
|
||||
regexp=^([a-z0-9]{2,}\d*):?\s
|
||||
regexp=^([a-z0-9.]{2,}\d*):?\s
|
||||
colours=bold green
|
||||
=======
|
||||
#ip disc
|
||||
|
|
|
@ -36,7 +36,7 @@ colours=red
|
|||
# "linkdown"
|
||||
regexp=linkdown
|
||||
colours=bold red
|
||||
-
|
||||
-
|
||||
|
||||
# "src"
|
||||
regexp=src \S+
|
||||
|
|
|
@ -3,8 +3,12 @@ regexp=inet\s([^\/]+)\/(\d+)
|
|||
colours=default,bold yellow,bold magenta
|
||||
=====
|
||||
# broadcast
|
||||
regexp=brd\s([^}s]+)
|
||||
colours=default,dark
|
||||
regexp=brd\s([^}\s]+)
|
||||
colours=default,dark cyan
|
||||
=====
|
||||
# dynamic
|
||||
regexp=\bdynamic\b
|
||||
colours=dark green
|
||||
=====
|
||||
# IP6
|
||||
regexp=inet6\s([^\/]+)\/(\d+)
|
||||
|
@ -34,6 +38,10 @@ colours=default,bright_white,bold cyan,cyan
|
|||
regexp=\s<([^>]+)>
|
||||
colours=default,cyan
|
||||
=====
|
||||
# NO-CARRIER
|
||||
regexp=NO-CARRIER
|
||||
colours=bold red
|
||||
=====
|
||||
# Master dev
|
||||
regexp=\smaster\s(\S+)\s
|
||||
colours=default,on_blue white
|
||||
|
|
|
@ -22,6 +22,10 @@ colours=default,magenta,bold magenta
|
|||
regexp=(proto)\s(\S+)\s
|
||||
colours=default,default,dark yellow
|
||||
=====
|
||||
# metric
|
||||
regexp=(metric)\s(\d+)\b
|
||||
colours=default,default,bold white
|
||||
=====
|
||||
# linkdown
|
||||
regexp=linkdown
|
||||
colours=bold red
|
||||
|
|
|
@ -24,7 +24,7 @@ colours=bold green
|
|||
=======
|
||||
# everything in parentheses
|
||||
regexp=\(.+?\)
|
||||
colours=green
|
||||
colours=green
|
||||
count=more
|
||||
=======
|
||||
# channel name
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
# no wireless extensions
|
||||
regexp=\bno wireless extensions
|
||||
colours=red
|
||||
=======
|
||||
# Frequency
|
||||
regexp=[0-9\.]{1,10} GHz
|
||||
colours=bold green
|
||||
=======
|
||||
# Type
|
||||
regexp=802\.11([a-z]+)
|
||||
colours=bold yellow
|
||||
=======
|
||||
# Speed
|
||||
regexp=[0-9\.]+ Mb/s
|
||||
colours=bold yellow
|
||||
=======
|
||||
# Tx-Power
|
||||
regexp=\-?[0-9]+ dBm
|
||||
colours=bold green
|
||||
=======
|
||||
# ipv4
|
||||
regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
|
||||
colours=bold green
|
||||
=======
|
||||
# ipv6
|
||||
regexp=\b[0-9a-fA-F]{1,4}(\:\:?[0-9a-fA-F]{1,4})+
|
||||
colours=bold green
|
||||
=======
|
||||
# hwaddr
|
||||
regexp=(\d|[a-f]){2}(\:(\d|[a-f]){2}){5}
|
||||
colours=yellow
|
||||
=======
|
||||
# size
|
||||
regexp=\d+(\.\d+)?\s(T|G|M|K|)i?B
|
||||
colours=yellow
|
||||
=======
|
||||
# interface
|
||||
regexp=^([a-z0-9]{2,}\d*):?\s
|
||||
colours=bold green
|
||||
=======
|
||||
#ip disc
|
||||
regexp=(inet6?|netmask|broadcast)
|
||||
colours=cyan
|
||||
=======
|
||||
#flags
|
||||
regexp=(?<=[,<])[^,]+?(?=[,>])
|
||||
colours=blue
|
||||
=======
|
||||
# mtu
|
||||
regexp=(?i)mtu(\s|\:)\d+
|
||||
colours=green
|
||||
=======
|
||||
# quality/level/sensitivity
|
||||
regexp=(\d+/\d+)
|
||||
colours=bold yellow
|
||||
=======
|
||||
#errors
|
||||
regexp=errors(\s|\:)\d+
|
||||
colours=red
|
||||
=======
|
||||
regexp=dropped(\s|\:)\d+
|
||||
colours=white
|
||||
=======
|
||||
regexp=overruns(\s|\:)\d+
|
||||
colours=green
|
||||
=======
|
||||
regexp=frame(\s|\:)\d+
|
||||
colours=white
|
||||
=======
|
||||
regexp=carrier(\s|\:)\d+
|
||||
colours=cyan
|
||||
=======
|
||||
regexp=collisions(\s|\:)\d+
|
||||
colours=red
|
|
@ -0,0 +1,9 @@
|
|||
# BASH
|
||||
regexp=\[(\d+)\](.) +(\d+)?\s?
|
||||
colour=unchanged, cyan, yellow, magenta
|
||||
-
|
||||
regexp=Running.*
|
||||
colour=bold green
|
||||
-
|
||||
regexp=Stopped.*
|
||||
colour=red
|
|
@ -0,0 +1,75 @@
|
|||
# Green Words
|
||||
regexp=\b(Ready|Running|[Tt]rue|Active|Available|Approved|created)\b
|
||||
colour=unchanged,green
|
||||
-
|
||||
# Master
|
||||
regexp=\smaster\s
|
||||
colour=on_green bold white
|
||||
-
|
||||
# Red Words
|
||||
regexp=\b([Dd]isabled?|[Ee]rrors?|[Ss]topped|[Ff]alse|none|ErrImagePull|[a-zA-Z]+BackOff|OOMKilled|[Tt]erminated|[Ff]aile?d?)\b
|
||||
colour=unchanged,red
|
||||
-
|
||||
# Yellow Words
|
||||
regexp=\b([Ww]arning|[Pp]ending|[Ww]aiting|ContainerCreating|Released|Bound|already exists)\b
|
||||
colour=unchanged,yellow
|
||||
-
|
||||
# Completed Jobs
|
||||
regexp=\b(Completed)\b
|
||||
colour=unchanged,dark green
|
||||
-
|
||||
# Misc IP
|
||||
regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(/\d{1,2})?
|
||||
colour=cyan,magenta
|
||||
-
|
||||
# Ports
|
||||
regexp=(\d+)(:\d+)?/(TCP|UDP)
|
||||
colour=unchanged,yellow,bold green,magenta
|
||||
-
|
||||
# Type/Name
|
||||
regexp=^([^/ ]+)/(\S+)
|
||||
colour=unchanged,yellow,bright_white
|
||||
-
|
||||
# No running Instances
|
||||
regexp=\s(0/[1-9]+)\b
|
||||
colour=unchanged,bold red
|
||||
-
|
||||
# Labels
|
||||
regexp=([\w\d\-_\/.]+)=([\w\d\-_./]+)(,| |$)
|
||||
colour=unchanged,blue,bright_yellow
|
||||
-
|
||||
# YAML First level (PSEUDO)
|
||||
regexp=^([\w\d \-]+):
|
||||
colours=unchanged,bright_blue
|
||||
-
|
||||
# YAML Nested
|
||||
regexp=^[ \-]+(\S+):
|
||||
colours=unchanged, blue
|
||||
-
|
||||
# YAML number
|
||||
regexp=: (\d+)$
|
||||
colours=unchanged, yellow
|
||||
-
|
||||
# Explicit String
|
||||
regexp="(\S*)(?=")
|
||||
colours=default,cyan
|
||||
-
|
||||
# Empy
|
||||
regexp=(\<?[Nn]one\>?|null)
|
||||
colours=magenta
|
||||
-
|
||||
# Events title
|
||||
regexp=\s+(Type)\s+(Reason)\s+(Age)\s+(From)\s+(Message)
|
||||
colours=cyan, cyan, cyan, cyan, cyan, magenta
|
||||
-
|
||||
# Title separator
|
||||
regexp=\s+\-{3,}
|
||||
colours=dark white
|
||||
-
|
||||
# HELP Highlight
|
||||
regexp=( --[^= ]+| -[a-zA-Z]( |,))
|
||||
colour=bright_green
|
||||
-
|
||||
# Higlight (Tested in kubectl config get-contexts)
|
||||
regexp=^\*.+$
|
||||
colour=bold white
|
|
@ -1,5 +1,5 @@
|
|||
# Intended for colouring LDIF output (from ldap tools)
|
||||
# comments
|
||||
# comments
|
||||
regexp=^#.*
|
||||
colours=green
|
||||
count=stop
|
||||
|
|
|
@ -16,14 +16,16 @@ regexp=.*last message repeated \d+ times$
|
|||
colours=yellow
|
||||
count=stop
|
||||
======
|
||||
# this is date
|
||||
regexp=^... (\d| )\d \d\d:\d\d:\d\d(\s[\w\d]+?\s)
|
||||
# this is date and hostname
|
||||
# 'Jun 3 22:44:55 neutronium '
|
||||
# 'Jun 3 22:44:55 neutronium-02.my-domain.io '
|
||||
regexp=^... (\d| )\d \d\d:\d\d:\d\d(\s[-.\w\d]+?\s)
|
||||
colours=green, green, red
|
||||
count=once
|
||||
======
|
||||
# everything in parentheses
|
||||
regexp=\(.+?\)
|
||||
colours=green
|
||||
regexp=\(.*?\)
|
||||
colours=blue
|
||||
count=more
|
||||
======
|
||||
# everything in `'
|
||||
|
@ -31,9 +33,18 @@ regexp=\`.+?\'
|
|||
colours=bold yellow
|
||||
count=more
|
||||
======
|
||||
# everything in "
|
||||
regexp=\".*?\"
|
||||
colours=blue
|
||||
======
|
||||
# this is probably a pathname
|
||||
regexp=/[\w/\.]+
|
||||
colours=bold green
|
||||
regexp=\s/[a-zA-Z_/\.\-\?\d\=\&]+
|
||||
colours=blue
|
||||
count=more
|
||||
======
|
||||
# everything in <>
|
||||
regexp=\<.*?\>
|
||||
colours=blue
|
||||
count=more
|
||||
======
|
||||
# name of process and pid
|
||||
|
@ -41,13 +52,44 @@ regexp=([\w/\.\-]+)(\[\d+?\])
|
|||
colours=bold blue, bold red
|
||||
count=more
|
||||
======
|
||||
# ip number
|
||||
regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
|
||||
colours=bold magenta
|
||||
# IPv4 or IPv4:Port
|
||||
regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?
|
||||
colours=bold yellow
|
||||
count=more
|
||||
======
|
||||
# IPv6
|
||||
regexp=(([0-9a-fA-F]{1,4})?\:\:?[0-9a-fA-F]{1,4})+
|
||||
colours=bold yellow
|
||||
=======
|
||||
# Email address
|
||||
regexp=[a-zA-z0-9\.\-\+]+\@[\w\-\.]+
|
||||
colours=green
|
||||
======
|
||||
# HTTP verbs
|
||||
regexp=GET|POST|PUT|DELETE|PATCH|HEAD
|
||||
colours=green
|
||||
======
|
||||
# 2xx status
|
||||
regexp=\s\b2\d{2}\b\s
|
||||
colours=green
|
||||
======
|
||||
# 3xx status
|
||||
regexp=\s\b3\d{2}\b\s
|
||||
colours=yellow
|
||||
======
|
||||
# 4xx status
|
||||
regexp=\s\b4\d{2}\b\s
|
||||
colours=red
|
||||
======
|
||||
# 5xx status
|
||||
regexp=\s\b5\d{2}\b\s
|
||||
colours=red
|
||||
======
|
||||
# status deferred
|
||||
regexp=status\=deferred|Connection refused
|
||||
colours=red
|
||||
======
|
||||
# connect requires special attention
|
||||
regexp=connect
|
||||
colours=on_red
|
||||
count=more
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#Message
|
||||
regexp=([^\w\d]+)
|
||||
colours=unchanged
|
||||
======
|
||||
regexp=([a-zA-Z0-9]+)
|
||||
colours=default,green,yellow,red
|
||||
|
|
@ -5,15 +5,21 @@
|
|||
# Example lines:
|
||||
# -rw-r--r-- 1 user staff 344M Mar 22 22:51 MVI_8735.m4v
|
||||
# -rw-r--r-- 1 user staff 360050327 Mar 22 22:51 MVI_8735.m4v
|
||||
# -rw-r--r--. 1 user staff 1.0G Nov 23 16:13 testg
|
||||
# -rw-r--r--. 1 user staff 1.0K Nov 23 16:13 testk
|
||||
# -rw-r--r--. 1 user staff 1.0M Nov 23 16:13 testm
|
||||
# -rw-r--r--. 1 user staff 1073741824 Nov 23 16:13 testg
|
||||
# -rw-r--r--. 1 user staff 1024 Nov 23 16:13 testk
|
||||
# -rw-r--r--. 1 user staff 1048576 Nov 23 16:13 testm
|
||||
#
|
||||
# The regexp uses lookahead to match a date following the size
|
||||
|
||||
# size: 1M <= size < 10M
|
||||
regexp=\s+(\d{7}|\d([,\.]\d+)?M)(?=\s[A-Z][a-z]{2}\s)
|
||||
regexp=\s+(\d{7}|\d(?:[,.]?\d+)?[KM])(?=\s[A-Z][a-z]{2}\s)
|
||||
colours=green
|
||||
=======
|
||||
# size: 10M <= size < 100M
|
||||
regexp=\s+(\d{8}|\d\d([,\.]\d+)?M)(?=\s[A-Z][a-z]{2}\s)
|
||||
regexp=\s+(\d{8}|\d\d(?:[,.]?\d+)?M)(?=\s[A-Z][a-z]{2}\s)
|
||||
colours=yellow
|
||||
=======
|
||||
# size: 100M <= size < 1G
|
||||
|
@ -21,24 +27,17 @@ regexp=\s+(\d{9}|\d{3}M)(?=\s[A-Z][a-z]{2}\s)
|
|||
colours=red
|
||||
=======
|
||||
# size: 1G <= size
|
||||
regexp=\s+(\d{10,}|[\d\.,]+G)(?=\s[A-Z][a-z]{2}\s)
|
||||
regexp=\s+(\d{10,}|[\d.,]+G)(?=\s[A-Z][a-z]{2}\s)
|
||||
colours=bold red
|
||||
=======
|
||||
# device major minor numbers
|
||||
regexp=\s(\d+),\s+(\d+)\s
|
||||
colours=default,bright_yellow ,yellow
|
||||
=======
|
||||
# time
|
||||
regexp=(\s|^)[0-2]?\d(:[0-5]\d)(?=[\s,]|$)
|
||||
colours=white
|
||||
# Date-Time => G1=Month G2=Day G3=Hour G4=Minutes G5=Year
|
||||
regexp=([A-Z][a-z]{2})\s([ 1-3]\d)\s(?:([0-2]?\d):([0-5]\d)(?=[\s,]|$)|\s*(\d{4}))
|
||||
colours=unchanged,cyan,cyan,cyan,cyan,bold magenta
|
||||
=======
|
||||
# month
|
||||
#regexp=\s[A-Z][a-z]{2}\s
|
||||
#colours=yellow
|
||||
#=======
|
||||
#regexp=(?<=\d):(?=\d)
|
||||
#colours=bold yellow
|
||||
#=======
|
||||
# root
|
||||
regexp=\s(root|wheel)(?=\s|$)
|
||||
colours=unchanged,bold white on_red
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
# Filename
|
||||
regexp=\S+\s(\S+)
|
||||
colours=bold
|
||||
-
|
||||
# Normal
|
||||
regexp=[aAcCdDeijsStTu]
|
||||
colours=cyan
|
||||
|
@ -12,8 +8,16 @@ colours=bright_green
|
|||
-
|
||||
# Read Only
|
||||
regexp=[EhINXZ]
|
||||
colours=red
|
||||
colours=bold red
|
||||
-
|
||||
# Separators
|
||||
regexp=[\-]
|
||||
colours=dark
|
||||
-
|
||||
# Error
|
||||
regexp=(lsattr:) \w.*
|
||||
colours=default, bold red
|
||||
-
|
||||
# Filename
|
||||
regexp=(\/[-\w\d. ]+)+$
|
||||
colours=yellow,bold
|
||||
|
|
|
@ -11,23 +11,23 @@ regexp=\s+([├└─│]+|[\|\`\-]+)(\S+)
|
|||
colours=default,default,bright_cyan
|
||||
======
|
||||
# Type crypt
|
||||
regexp=\scrypt\s
|
||||
regexp=(?<=\s)crypt\b
|
||||
colours=on_magenta white
|
||||
======
|
||||
# Type disk
|
||||
regexp=\sdisk\s
|
||||
regexp=(?<=\s)disk\b
|
||||
colours=magenta
|
||||
======
|
||||
# Type lvm
|
||||
regexp=\slvm\s
|
||||
regexp=(?<=\s)lvm\b
|
||||
colours=bold cyan
|
||||
======
|
||||
# Type part
|
||||
regexp=\spart\s
|
||||
regexp=(?<=\s)part\b
|
||||
colours=cyan
|
||||
======
|
||||
# Type loop
|
||||
regexp=\sloop\s
|
||||
regexp=(?<=\s)loop\b
|
||||
colours=bright_red
|
||||
======
|
||||
# Size 'K'
|
||||
|
@ -46,10 +46,14 @@ colours=red
|
|||
regexp=\s\d*[.,]?\dTi?\s
|
||||
colours=bold red
|
||||
======
|
||||
# Mount
|
||||
regexp=\s\/.*$
|
||||
colours=bold yellow
|
||||
# Mount Path
|
||||
regexp=(?<=\s)(\/[^\/ ]*)+$
|
||||
colours=yellow,bold yellow
|
||||
======
|
||||
# Mount [SWAP]
|
||||
regexp=\s\[(SWAP)\]
|
||||
colours=default,bright_magenta
|
||||
======
|
||||
# UUID
|
||||
regexp=(?<=\s)\b([0-9a-fA-F-]{4,}|[\w-]{38})\b
|
||||
colours=default,dark cyan
|
||||
|
|
|
@ -3,7 +3,7 @@ regexp=^(..):(..).(.)
|
|||
colours=default,bright_green,bright_yellow,red
|
||||
-
|
||||
# Ethernet
|
||||
regexp=(Ethernet controller|Network controller)
|
||||
regexp=(Ethernet|Network) controller:
|
||||
colours=cyan
|
||||
-
|
||||
# Wireless
|
||||
|
@ -11,9 +11,26 @@ regexp=Wireless
|
|||
colours=bright_cyan
|
||||
-
|
||||
# SATA
|
||||
regexp=SATA controller
|
||||
regexp=SATA controller:
|
||||
colours=green
|
||||
-
|
||||
# Audio
|
||||
regexp=Audio device
|
||||
regexp=Audio device:
|
||||
colours=blue
|
||||
-
|
||||
# Video
|
||||
regexp=VGA compatible controller:
|
||||
colours=magenta
|
||||
-
|
||||
# Bridges
|
||||
regexp=(PCI|ISA|Host) bridge:
|
||||
colours=red
|
||||
-
|
||||
# any unspecified controller
|
||||
regexp=([A-Z].+?) controller:
|
||||
colours=blue
|
||||
-
|
||||
# For lspci -k
|
||||
regexp=Kernel (?:modules|driver in use): (.+)
|
||||
colours=default,bright_red
|
||||
-
|
||||
|
|
|
@ -3,9 +3,23 @@
|
|||
|
||||
regexp=^(.*) on (.*) type (.*) \((.*)\)
|
||||
colours=default,green,yellow,blue,magenta
|
||||
=====
|
||||
regexp=^cgroup.*
|
||||
colours=bright_black
|
||||
=====
|
||||
regexp=^tmpfs.*
|
||||
-
|
||||
# Devices
|
||||
regexp=^(\/[^\/ ]+)+
|
||||
colours=bold green, on_green black
|
||||
-
|
||||
# Mount Path
|
||||
regexp=(?<=on )(\/[^\/ ]+)+
|
||||
colours=unchanged,underline yellow
|
||||
-
|
||||
# RW
|
||||
regexp=(?<=\()rw
|
||||
colours=bold red
|
||||
-
|
||||
# RO
|
||||
regexp=(?<=\()ro
|
||||
colours=bold green
|
||||
-
|
||||
# Like comment, leave at end always
|
||||
regexp=^(cgroup|tmpfs).*
|
||||
colours=bright_black
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
#/full/path
|
||||
regexp=\s/[-\w\d.]+(\s|/[-\w\d./]+)
|
||||
colours=cyan
|
||||
=======
|
||||
#filesystem
|
||||
regexp=^\w+\s
|
||||
colours=yellow
|
||||
=======
|
||||
#type filesystem
|
||||
#regexp=(?<=type)\s*
|
||||
#colours=red
|
||||
#=======
|
||||
# /dev/sda
|
||||
regexp=^(/dev/)?[s]d[a-f][0-9]*(?=[^\w\d]|$)
|
||||
colours=bold green
|
||||
=======
|
||||
#mount options
|
||||
regexp=(?<=[,(])[^,]*(?=[,)])
|
||||
colours=green
|
|
@ -2,9 +2,9 @@
|
|||
regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
|
||||
colours=green
|
||||
=======
|
||||
# %
|
||||
regexp=[0-9]{1,2}\.\d{1}%
|
||||
colours=yellow
|
||||
# 0 Full Line | 1 Loss | 2 Snt | 3 Last | 4 Avg | 5 Best | 6 Worst | 7 stDev
|
||||
regexp=(\d+\.\d%)\s+(\d+)\s+(\d+\.\d)\s+(\d+\.\d)\s+(\d+\.\d)\s+(\d+\.\d)\s+(\d+\.\d)$
|
||||
colours=unchanged,yellow,unchanged,unchanged,blue,green,red,unchanged
|
||||
=======
|
||||
# unknow host
|
||||
regexp=\?\?\?
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
# time offset
|
||||
regexp=offset\s([0-9\.,\-]+\ssec)
|
||||
colours=unchanged,bold green
|
||||
======
|
||||
# server ip
|
||||
regexp=server\s([0-9a-fA-F\.:]+)
|
||||
colours=unchanged,yellow
|
||||
|
|
@ -1,45 +1,53 @@
|
|||
# name
|
||||
regexp=(?:[fF]rom|PING)\s(\S+)\s
|
||||
colours=default,blue
|
||||
# IP
|
||||
regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
|
||||
colours=bright_blue
|
||||
=======
|
||||
# ipv6 number
|
||||
regexp=(([0-9a-fA-F]{1,4})?\:\:?[0-9a-fA-F]{1,4})+
|
||||
colours=magenta
|
||||
=======
|
||||
# ip number, optional port
|
||||
regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(\:[0-9]{1,5})?
|
||||
colours=bright_blue
|
||||
=======
|
||||
# icmp_[sr]eq=#
|
||||
regexp=icmp_[sr]eq=(\d+)
|
||||
# icmp_seq=##
|
||||
regexp=icmp_seq=(\d+)
|
||||
colours=default,yellow
|
||||
=======
|
||||
# ttl=#
|
||||
regexp=ttl=(\d+)
|
||||
colours=default,magenta
|
||||
=======
|
||||
# name
|
||||
regexp=(?:[fF]rom|PING)\s(\S+)\s
|
||||
colours=default,blue
|
||||
=======
|
||||
# time
|
||||
regexp=([0-9\.]+)\s?ms
|
||||
colours=default,green
|
||||
colours=green,bold green
|
||||
=======
|
||||
# DUP
|
||||
regexp=DUP\!
|
||||
colours=red
|
||||
=======
|
||||
# Destination Host Unreachable
|
||||
regexp=Destination Host Unreachable
|
||||
# OK
|
||||
regexp= 0(\.0)?% packet loss
|
||||
colours=green
|
||||
=======
|
||||
# Errors
|
||||
regexp=(Destination Host Unreachable|100(\.0)?% packet loss)
|
||||
colours=red
|
||||
=======
|
||||
# unknown host
|
||||
regexp=.+unknown\shost\s(.+)
|
||||
colours=red,bold red
|
||||
-
|
||||
# statustics header
|
||||
regexp=--- \S+ ping statistics ---
|
||||
colours=bold
|
||||
# statistics header
|
||||
regexp=--- (\S+) ping statistics ---
|
||||
colours=bold, bold blue
|
||||
-
|
||||
# last line min/avg/max/mdev
|
||||
regexp=(min)/(avg)/(max)/(mdev)
|
||||
regexp=rtt (min)/(avg)/(max)/(mdev)
|
||||
colours=default,bright_yellow,bright_blue,bright_red,bright_magenta
|
||||
-
|
||||
# last line values
|
||||
regexp=\=\s([0-9\.\ mus]+)\/([0-9\. mus]+)\/([0-9\. mus]+)\/([0-9\. mus]+)
|
||||
regexp=\=\s([0-9\.]+)\/([0-9\.]+)\/([0-9\.]+)\/([0-9\.]+)
|
||||
colours=default,bright_yellow,bright_blue,bright_red,bright_magenta
|
||||
-
|
||||
# these are good for nping
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
regexp=(\s|^)\d+([.,]\d+)?\s?([kKMG][bB]|[bB]|[kKMG])(?=[\s,]|$)
|
||||
colours=yellow
|
||||
=======
|
||||
#
|
||||
#
|
||||
regexp=<=>
|
||||
colours=yellow
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
# Sensor name
|
||||
regexp=([a-z\-0-9]+)
|
||||
colours=underline yellow
|
||||
======
|
||||
# Data names
|
||||
regexp=(.+:)\s+(.+)
|
||||
colours=unchanged, bright_cyan, default
|
||||
======
|
||||
# Extra info
|
||||
regexp=.+\s+(\(.+\))
|
||||
colours=unchanged, bright_black
|
||||
======
|
||||
# Adapter name
|
||||
regexp=Adapter:(\s.*)
|
||||
colours=unchanged, yellow
|
||||
======
|
||||
# Low temperature (below 60)
|
||||
regexp=.+:\s+(\+[2345][0-9]\.[0-9]°C)
|
||||
colours=unchanged, green
|
||||
======
|
||||
# High temperature (above 60)
|
||||
regexp=.+:\s+(\+[67][0-9]\.[0-9]°C)
|
||||
colours=unchanged, bright_yellow
|
||||
======
|
||||
# Very high temperature (above 80)
|
||||
regexp=.+:\s+(\+[89][0-9]\.[0-9]°C)
|
||||
colours=unchanged, bright_red
|
||||
======
|
|
@ -0,0 +1,93 @@
|
|||
=======
|
||||
# CAPS LINE
|
||||
regexp=^[A-Z\s%]*([A-Z]{3})[A-Z\s%]*$
|
||||
colours=underline
|
||||
=======
|
||||
# root
|
||||
regexp=^root(?=\s|$)
|
||||
colours=bold red
|
||||
=======
|
||||
# non-root users
|
||||
regexp=^(?:(?!root|USER))([^\s]+)
|
||||
colours=bold yellow,unchanged
|
||||
=======
|
||||
# CMD
|
||||
regexp=^[a-zA-Z]+\w+\s+(\w+)\s+\d+
|
||||
colours=unchanged,bold cyan
|
||||
=======
|
||||
# FD
|
||||
regexp=^[a-zA-Z]+\w+\s+\w+\s+\d+\s+(\d+)
|
||||
colours=unchanged,yellow
|
||||
=======
|
||||
# PID
|
||||
regexp=^[a-zA-Z]+\w+\s+[a-zA-Z]+\w+\s+(\d+)
|
||||
colours=unchanged,bold magenta
|
||||
=======
|
||||
# PROTOCOLS
|
||||
regexp=(tcp4|udp4|tcp6|udp6|stream|dgram)
|
||||
colours=bold blue
|
||||
=======
|
||||
# hostname:service
|
||||
regexp=([\w\.\-]+):([\w\-]+)\b
|
||||
colours=yellow, bold green, bold yellow
|
||||
=======
|
||||
# hostname:port
|
||||
regexp=([\w\.\-]+):(\d+)\b
|
||||
colours=yellow, bold green, bold red
|
||||
=======
|
||||
# *:service
|
||||
regexp=(\*):([\w\-]+)\b
|
||||
colours=yellow, yellow, bold red
|
||||
=======
|
||||
# PATH
|
||||
regexp=\s\/.*\/(\S+)($| \(.*\))
|
||||
colours=green,bright_green,red
|
||||
=======
|
||||
# status
|
||||
regexp=FIN_WAIT.*
|
||||
colours=red
|
||||
=======
|
||||
# status
|
||||
regexp=SYN.*?
|
||||
colours=bold red
|
||||
=======
|
||||
# status
|
||||
regexp=LISTEN(ING)?
|
||||
colours=bold blue
|
||||
=======
|
||||
# status
|
||||
regexp=TIME_WAIT
|
||||
colours=bold red
|
||||
=======
|
||||
# status
|
||||
regexp=CLOS(E(_WAIT)?|ING)
|
||||
colours=red
|
||||
skip=yes
|
||||
=======
|
||||
# status
|
||||
regexp=LAST_ACK
|
||||
colours=red
|
||||
=======
|
||||
# status
|
||||
regexp=ESTAB.*?\b|CONNECTED
|
||||
colours=bold yellow
|
||||
=======
|
||||
# status
|
||||
regexp=FREE
|
||||
colours=bold green
|
||||
=======
|
||||
# status
|
||||
regexp=DISCONNECTING
|
||||
colours=red
|
||||
=======
|
||||
# status
|
||||
regexp=CONNECTING
|
||||
colours=green
|
||||
=======
|
||||
# status
|
||||
regexp=CONNECTING
|
||||
colours=green
|
||||
=======
|
||||
# status
|
||||
regexp=UNKNOWN
|
||||
colours=blink bold red
|
|
@ -1,6 +1,14 @@
|
|||
# Local Address:Port
|
||||
regexp=\s((?:\d+\.){3}\d+|\*|::1?|[\w\d\-\_\.]+):(\S+)\s+\s((?:\d+\.){3}\d+|\*|::1?|[\w\d\-\_\.]+):(\S+)
|
||||
colours=default,bright_green,bright_red,cyan,magenta
|
||||
# status
|
||||
regexp=\[.*\]
|
||||
colours=green
|
||||
=======
|
||||
# Local Address:Port Peer Address:Port
|
||||
regexp=\s((?:\d+\.){3}\d+|\*|\[?[\da-fA-F\.:]+\]?|[\w\d\-\_\.]+)(%[\w\d]+)?:(\S+)\s+\s((?:\d+\.){3}\d+|\*|\[?[\da-fA-F\.:]+\]?|[\w\d\-\_\.]+):(\S+)
|
||||
colours=default,bright_green,blue,bright_red,cyan,magenta
|
||||
=======
|
||||
# process name
|
||||
regexp=\("([^"]+)",
|
||||
colours=blue
|
||||
=======
|
||||
# ipx hostname
|
||||
regexp=^IPX.*[\dABCDEF]+:[\dABCDEF]+
|
||||
|
@ -67,10 +75,6 @@ colours=green
|
|||
regexp=UNKNOWN
|
||||
colours=blink bold red
|
||||
=======
|
||||
# status
|
||||
regexp=\[.*\]
|
||||
colours=green
|
||||
=======
|
||||
# path
|
||||
regexp=(\@)[\dabcdef]+
|
||||
colours=green, bold green
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
# Main
|
||||
regexp=(\w+)\.(\S+) = (.+)$
|
||||
colours=default,bright_green,cyan,yellow
|
||||
# Main & Last key
|
||||
regexp=(\w+)\.(\S+) = ?(.+)?$
|
||||
colours=default,green,cyan,yellow
|
||||
-
|
||||
# subcategory
|
||||
# subcategories
|
||||
regexp=\w+\.(\S+(?=\.))\.
|
||||
colours=unchanged,bright_cyan
|
||||
|
||||
|
||||
colours=unchanged,magenta
|
||||
-
|
||||
# error
|
||||
regexp=sysctl: permission denied on key '([^']+)'
|
||||
colours=red,bold red
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# hostname
|
||||
regexp=\s\w+[\w\-\.]+\w+
|
||||
colours=bright_yellow
|
||||
colours=bold white
|
||||
count=once
|
||||
-
|
||||
# ip number
|
||||
|
@ -24,10 +24,8 @@ regexp=\bDUP
|
|||
colours=red
|
||||
-
|
||||
# !S, !A, !H (host unreachable), etc.
|
||||
regexp=\b\![AFGNPSTU]
|
||||
regexp=\s\!([HNPSFXVC]|\d+)
|
||||
colours=red
|
||||
# just an example:
|
||||
#command=echo 'Network is down'| mail root
|
||||
-
|
||||
# ttl=...!
|
||||
regexp=ttl=\d+\!
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
# Time
|
||||
regexp=\sup(?:\s(\d+ days?),)?\s+(\d+ min|\d+:\d+),
|
||||
colours=default,yellow,green
|
||||
# Regular Up
|
||||
regexp=\sup(?: (\d+) days?,)? +(\d+ min|\d+:\d+)(?=,)
|
||||
colours=green,bold green, bold green
|
||||
-
|
||||
# users
|
||||
regexp=\s+(\d+)\susers
|
||||
regexp=\b(\d+) users?
|
||||
colours=yellow,bold yellow
|
||||
-
|
||||
# load average
|
||||
regexp=load average: (\d+\.\d+),\s(\d+\.\d+),\s(\d+\.\d+)
|
||||
regexp=load average: (\d+[\.,]\d+),\s(\d+[\.,]\d+),\s(\d+[\.,]\d+)
|
||||
colours=default,bright_cyan,cyan,dark cyan
|
||||
-
|
||||
# W Command section
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
# field
|
||||
regexp=^([\w\s])*:
|
||||
colours=bold white
|
||||
=======
|
||||
# data
|
||||
regexp=:\s[\w\s\W\S]*$
|
||||
colour=blue
|
||||
=======
|
||||
# comments
|
||||
regexp=^([;%])([\s\w\S\W])*$
|
||||
colours=yellow
|
||||
=======
|
||||
# comments
|
||||
regexp=(^(---)|(>>>))[\s\w\S\W]*$
|
||||
colours=yellow
|
||||
=======
|
||||
# domain
|
||||
regexp=(([\w\d]([\w\d-])+\.){1,})([\w\d-]{2,})
|
||||
colours=green
|
||||
=======
|
||||
# url
|
||||
regexp=http[s]?://(([\w\d]([\w\d-])+\.){1,})([\w\d-]{2,})(/[\w\d\S\s]*)*
|
||||
colours=bold green
|
||||
=======
|
||||
# phone
|
||||
regexp=\+([\d\.]*)
|
||||
colours=bold yellow
|
||||
=======
|
||||
# email
|
||||
regexp=([\d\w\S])+@(([\w\d]([\w\d-])+\.){1,})([\w\d-]{2,})
|
||||
colours=bold blue
|
||||
=======
|
||||
# date
|
||||
regexp=([\d]{4}[- ](([\d]{2})|([a-zA-Z]{3,}))[ -][\d]{2})|([\d]{2}[ -](([a-zA-Z]{3,})|([\d]{2}))[ -][\d]{4})
|
||||
colours=bold red
|
||||
=======
|
||||
# time
|
||||
regexp=[\d]{2}:[\d]{2}:[\d]{2}((\.[\d]*[Z]?)|(\+[\d]*))?
|
||||
colours=red
|
||||
=======
|
||||
# NOTICE
|
||||
regexp=NOTICE
|
||||
colours=bold blue
|
||||
=======
|
||||
# TERM OF USE
|
||||
regexp=TERMS OF USE
|
||||
colours=bold blue
|
||||
=======
|
||||
# registrar
|
||||
regexp=(Sponsoring )?[Rr]egistrar([\w\s\S])*:
|
||||
colours=bold cyan
|
||||
=======
|
||||
# registrant
|
||||
regexp=(Registry )?[Rr]egistrant([\w\s\S])*:
|
||||
colours=bold blue
|
||||
=======
|
||||
# admin
|
||||
regexp=(Registry )?[Aa]dmin([\w\s\S])*:
|
||||
colours=bold magenta
|
||||
=======
|
||||
# tech
|
||||
regexp=(Registry )?[Tt]ech([\w\s\S])*:
|
||||
colours=bold yellow
|
||||
=======
|
||||
# billing
|
||||
regexp=(Registry )?[Bb]illing([\w\s\S])*:
|
||||
colours=bold green
|
||||
=======
|
||||
# NS
|
||||
regexp=((nserver)|(Name Server)):
|
||||
colours=bold green
|
||||
=======
|
||||
# domain status
|
||||
regexp=(Domain Status)|(status)
|
||||
colours=bold red
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
# Document
|
||||
regexp=---
|
||||
colours=bold yellow
|
||||
-
|
||||
# First level
|
||||
regexp=^(\S+):
|
||||
colours=unchanged,blue
|
||||
-
|
||||
# Nested
|
||||
regexp=^ +(\S+):
|
||||
colours=unchanged,blue
|
||||
-
|
||||
# Set Var
|
||||
regexp=&\S+
|
||||
colours=bold green
|
||||
-
|
||||
# Use Var
|
||||
regexp=\*\S+
|
||||
colours=on_green black
|
||||
-
|
||||
# Array
|
||||
regexp=-\s
|
||||
colours=bold magenta
|
||||
-
|
||||
# << Inheritance
|
||||
regexp=<<
|
||||
colours=bold red
|
||||
-
|
||||
# Explicit String
|
||||
regexp="(\S*)(?=")
|
||||
colours=default,cyan
|
||||
-
|
||||
# Explicit Number
|
||||
regexp= (\d*)$
|
||||
colours=unchanged,yellow
|
|
@ -1,6 +0,0 @@
|
|||
grc
|
||||
----------------------
|
||||
|
||||
packaged as native package
|
||||
|
||||
-- Radovan Garabík <garabik@kassiopeia.juls.savba.sk>
|
|
@ -1,6 +1,53 @@
|
|||
grc (1.13.1-1) unstable; urgency=low
|
||||
|
||||
* fix `ip addr` broadcast colouring
|
||||
|
||||
-- Radovan Garabík <garabik@kassiopeia.juls.savba.sk> Sun, 22 Aug 2021 13:36:39 +0200
|
||||
|
||||
grc (1.13-2) unstable; urgency=medium
|
||||
|
||||
* Source only upload (closes: #983793)
|
||||
|
||||
-- Radovan Garabík <garabik@kassiopeia.juls.savba.sk> Fri, 20 Aug 2021 16:38:48 +0200
|
||||
|
||||
grc (1.13-1) unstable; urgency=low
|
||||
|
||||
* do not add sh aliases unless explicitly allowed in /etc/default/grc
|
||||
(closes: #984629)
|
||||
* several minor improvements
|
||||
|
||||
-- Radovan Garabík <garabik@kassiopeia.juls.savba.sk> Sat, 07 Aug 2021 17:37:55 +0200
|
||||
|
||||
grc (1.12-1) unstable; urgency=low
|
||||
|
||||
* add new configurations
|
||||
* improved zsh alias support
|
||||
* various small bugfixes and improvements
|
||||
|
||||
-- Radovan Garabík <garabik@kassiopeia.juls.savba.sk> Mon, 01 Mar 2021 09:41:35 +0100
|
||||
|
||||
grc (1.11.3-1) unstable; urgency=medium
|
||||
|
||||
* add new configurations
|
||||
* --colour=auto is now the default
|
||||
* add dh-python build dependency (closes: #896743)
|
||||
|
||||
-- Radovan Garabík <garabik@kassiopeia.juls.savba.sk> Sun, 29 Apr 2018 16:12:14 +0200
|
||||
|
||||
grc (1.11.2-1) unstable; urgency=low
|
||||
|
||||
* add ntpdate configuration command
|
||||
|
||||
-- Radovan Garabík <garabik@kassiopeia.juls.savba.sk> Sat, 23 Sep 2017 20:35:33 +0200
|
||||
|
||||
grc (1.11.1-2) unstable; urgency=low
|
||||
|
||||
* fixed python2 compatibility errors (forgotten old changelog commit)
|
||||
-- Radovan Garabík <garabik@kassiopeia.juls.savba.sk> Wed, 07 Jun 2017 15:01:11 +0200
|
||||
|
||||
grc (1.11.1-1) unstable; urgency=low
|
||||
|
||||
* better error handling if command is not found
|
||||
* fixed python2 compatibility errors
|
||||
|
||||
-- Radovan Garabík <garabik@kassiopeia.juls.savba.sk> Sun, 21 May 2017 16:01:51 +0200
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
9
|
||||
10
|
||||
|
|
|
@ -2,8 +2,8 @@ Source: grc
|
|||
Section: text
|
||||
Priority: optional
|
||||
Maintainer: Radovan Garabík <garabik@kassiopeia.juls.savba.sk>
|
||||
Standards-Version: 3.9.6
|
||||
Build-Depends: debhelper (>=9), python3
|
||||
Standards-Version: 4.5.1
|
||||
Build-Depends: debhelper (>=9), python3, dh-python
|
||||
|
||||
Package: grc
|
||||
Architecture: all
|
||||
|
|
|
@ -16,7 +16,10 @@ The original source can be found at:
|
|||
|
||||
It is released under GPL v2 or any later version, under Debian
|
||||
systems see /usr/share/common-licenses/GPL-2,
|
||||
with following additional condition:
|
||||
and I have nothing against adding following additional condition (this is
|
||||
however not the part of the license, which remains GPL v2 or any later
|
||||
version):
|
||||
|
||||
If you want to use, redistribute, modify, abuse and molest grc in any
|
||||
way, and you feel like it, you may add any clause to the license, as
|
||||
long as it does not put any additional responsibility for behaviour of
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
# add colourifying aliases for sh and bash shells
|
||||
# true or false
|
||||
#
|
||||
# since this is rather invasive, it defaults to false
|
||||
#
|
||||
# changing it makes your shell source /etc/profile.d/grc
|
||||
|
||||
GRC_ALIASES=false
|
||||
|
|
@ -19,8 +19,6 @@ install:
|
|||
|
||||
# Add here commands to install the package into debian/tmp.
|
||||
./install.sh `pwd`/debian/grc/usr `pwd`/debian/grc
|
||||
# this is too invasive, would be incluided in a next major version
|
||||
rm `pwd`/debian/grc/etc/profile.d/grc.bashrc
|
||||
|
||||
build: build-arch build-indep
|
||||
build-arch: build-stamp
|
||||
|
@ -39,18 +37,18 @@ binary-indep: build install
|
|||
dh_testroot
|
||||
# dh_installdebconf
|
||||
dh_installdocs
|
||||
dh_installexamples
|
||||
dh_installmenu
|
||||
# dh_installexamples
|
||||
# dh_installmenu
|
||||
# dh_installemacsen
|
||||
# dh_installpam
|
||||
# dh_installinit
|
||||
dh_installcron
|
||||
dh_installinit
|
||||
# dh_installcron
|
||||
dh_installman grc.1 grcat.1
|
||||
dh_installinfo
|
||||
# dh_installinfo
|
||||
# dh_undocumented
|
||||
dh_installchangelogs
|
||||
dh_link
|
||||
dh_strip
|
||||
# dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
# You may want to make some executables suid here.
|
||||
|
|
44
grc
44
grc
|
@ -6,11 +6,11 @@ import os, re, string, sys, getopt, signal
|
|||
|
||||
|
||||
def version():
|
||||
print ("Generic Colouriser 1.11.1")
|
||||
print ("Generic Colouriser 1.13")
|
||||
sys.exit()
|
||||
|
||||
def help():
|
||||
print("""Generic Colouriser 1.11.1
|
||||
print("""Generic Colouriser 1.13
|
||||
grc [options] command [args]
|
||||
Options:
|
||||
-e --stderr redirect stderr. If this option is selected,
|
||||
|
@ -26,7 +26,6 @@ Options:
|
|||
def catch_signal(signum, frame):
|
||||
"catch signal sent to grc and forward it to the original application"
|
||||
global pidp
|
||||
# print('signal')
|
||||
try:
|
||||
os.kill(pidp, signum)
|
||||
except OSError: # if the subprocess already died
|
||||
|
@ -46,7 +45,7 @@ stderrf = 0
|
|||
# configure file for grcat
|
||||
cfile = ""
|
||||
|
||||
colour = 1
|
||||
colour = sys.stdout.isatty()
|
||||
use_pty = 0
|
||||
|
||||
for i in optlist:
|
||||
|
@ -81,38 +80,33 @@ if stdoutf == 1:
|
|||
if use_pty:
|
||||
import pty
|
||||
|
||||
conffile = None
|
||||
if cfile == "":
|
||||
home = os.environ.get('HOME')
|
||||
xdg = os.environ.get('XDG_CONFIG_HOME')
|
||||
if not xdg and home:
|
||||
xdg = home + '/.config'
|
||||
|
||||
conffilenames = []
|
||||
conffilenames = ['/etc/grc.conf', '/usr/local/etc/grc.conf']
|
||||
if xdg:
|
||||
conffilenames += [xdg + '/grc/grc.conf']
|
||||
if home:
|
||||
conffilenames += [home + '/.grc/grc.conf']
|
||||
conffilenames += ['/usr/local/etc/grc.conf', '/etc/grc.conf']
|
||||
for i in conffilenames:
|
||||
# test if conffile exists, it can be also a pipe
|
||||
if os.path.exists(i) and not os.path.isdir(i):
|
||||
conffile = i
|
||||
break
|
||||
regexplist = []
|
||||
|
||||
if conffile:
|
||||
f = open(conffile, "r")
|
||||
while 1:
|
||||
l = f.readline()
|
||||
if l == "":
|
||||
break
|
||||
if l[0] == "#" or l[0] == '\012':
|
||||
continue
|
||||
regexp = l.strip()
|
||||
if re.search(regexp, ' '.join(args)):
|
||||
cfile = f.readline().strip()
|
||||
break
|
||||
for conffile in conffilenames:
|
||||
# test if conffile exists, it can be also a pipe
|
||||
if os.path.exists(conffile) and not os.path.isdir(conffile):
|
||||
f = open(conffile, "r")
|
||||
while 1:
|
||||
l = f.readline()
|
||||
if l == "":
|
||||
break
|
||||
if l[0] == "#" or l[0] == '\012':
|
||||
continue
|
||||
regexp = l.strip()
|
||||
if re.search(regexp, ' '.join(args)):
|
||||
cfile = f.readline().strip()
|
||||
break
|
||||
|
||||
|
||||
signal.signal(signal.SIGINT, catch_signal)
|
||||
|
||||
|
|
2
grc.1
2
grc.1
|
@ -13,7 +13,7 @@ with optional parameters
|
|||
.I "[args]"
|
||||
piping its stdout or stderr into
|
||||
.BR grcat ",
|
||||
with apropriate configuration file.
|
||||
with appropriate configuration file.
|
||||
|
||||
Configuration file for
|
||||
.BR grc
|
||||
|
|
555
grc.conf
555
grc.conf
|
@ -1,3 +1,295 @@
|
|||
# configure command
|
||||
^([/\w\.]+\/)?configure\b
|
||||
conf.configure
|
||||
|
||||
# ping command
|
||||
^([/\w\.]+\/)?(io|o|n|h|arp|l2)?ping[236]?\b
|
||||
conf.ping
|
||||
|
||||
# traceroute command
|
||||
^([/\w\.]+\/)?traceroute6?\b
|
||||
conf.traceroute
|
||||
|
||||
# gcc command
|
||||
^([/\w\.]+\/)?(g?cc|[gc]\+\+)\s
|
||||
conf.gcc
|
||||
|
||||
# make command
|
||||
^([/\w\.]+\/)?g?make\b
|
||||
conf.gcc
|
||||
|
||||
# netstat command
|
||||
^([/\w\.]+\/)?netstat\b
|
||||
conf.netstat
|
||||
|
||||
# stat command
|
||||
^([/\w\.]+\/)?stat\b
|
||||
conf.stat
|
||||
|
||||
# ss command
|
||||
^([/\w\.]+\/)?ss\b
|
||||
conf.ss
|
||||
|
||||
# diff command
|
||||
^([/\w\.]+\/)?diff\b
|
||||
conf.diff
|
||||
|
||||
# wdiff command
|
||||
^([/\w\.]+\/)?wdiff\b
|
||||
conf.wdiff
|
||||
|
||||
# last/who command
|
||||
^([/\w\.]+\/)?(lastb?|who|lastlog)\b
|
||||
conf.last
|
||||
|
||||
# ldap tools
|
||||
^([/\w\.]+\/)?ldap\b
|
||||
conf.ldap
|
||||
|
||||
# cvs command
|
||||
^([/\w\.]+\/)?cvs\b
|
||||
conf.cvs
|
||||
|
||||
# mount command
|
||||
^([/\w\.]+\/)?mount\b
|
||||
conf.mount
|
||||
|
||||
# findmnt command
|
||||
^([/\w\.]+\/)?findmnt\b
|
||||
conf.findmnt
|
||||
|
||||
# mtr command
|
||||
^([/\w\.]+\/)?mtr\b
|
||||
conf.mtr
|
||||
|
||||
# ps command
|
||||
^([/\w\.]+\/)?ps\b
|
||||
conf.ps
|
||||
|
||||
# dig command
|
||||
^([/\w\.]+\/)?dig\b
|
||||
conf.dig
|
||||
|
||||
# ifconfig command
|
||||
^([/\w\.]+\/)?ifconfig\b
|
||||
conf.ifconfig
|
||||
|
||||
# ls command
|
||||
^([/\w\.]+\/)?ls\s
|
||||
conf.ls
|
||||
|
||||
# mount
|
||||
^([/\w\.]+\/)?mount\b
|
||||
conf.mount
|
||||
|
||||
# df
|
||||
^([/\w\.]+\/)?df\b
|
||||
conf.df
|
||||
|
||||
# du
|
||||
^([/\w\.]+\/)?du\b
|
||||
conf.du
|
||||
|
||||
# ip addr/link
|
||||
^([/\w\.]+\/)?ip( -\w+)* a(d(d(r(e(ss?)?)?)?)?)?\b
|
||||
conf.ipaddr
|
||||
|
||||
^([/\w\.]+\/)?ip( -\w+)* l(i(nk?)?)?\b
|
||||
conf.ipaddr
|
||||
|
||||
# ip route
|
||||
^([/\w\.]+\/)?ip( -\w+)* r(o(u(te?)?)?)?\b
|
||||
conf.iproute
|
||||
|
||||
# ip neighbor
|
||||
^([/\w\.]+\/)?ip( -\w+)* n(e(i(g(h(b(o(ur?)?)?)?)?)?)?)?\b
|
||||
conf.ipneighbor
|
||||
|
||||
# ip command - rest of commands
|
||||
^([/\w\.]+\/)?ip\b
|
||||
conf.ip
|
||||
|
||||
# env
|
||||
^([/\w\.]+\/)?env\b
|
||||
conf.env
|
||||
|
||||
# systemctl show
|
||||
^([/\w\.]+\/)?systemctl show\b
|
||||
conf.env
|
||||
|
||||
# iptables
|
||||
^([/\w\.]+\/)?iptables\b
|
||||
conf.iptables
|
||||
|
||||
# lspci
|
||||
^([/\w\.]+\/)?lspci\b
|
||||
conf.lspci
|
||||
|
||||
# lsblk
|
||||
^([/\w\.]+\/)?lsblk\b
|
||||
conf.lsblk
|
||||
|
||||
# lsof
|
||||
^([/\w\.]+\/)?lsof\b
|
||||
conf.lsof
|
||||
|
||||
# blkid
|
||||
^([/\w\.]+\/)?blkid\b
|
||||
conf.blkid
|
||||
|
||||
# id
|
||||
^([/\w\.]+\/)?id\b
|
||||
conf.id
|
||||
|
||||
# iostat / sar
|
||||
^([/\w\.]+\/)?(iostat|sar)\b
|
||||
conf.iostat_sar
|
||||
|
||||
# fdisk
|
||||
^([/\w\.]+\/)?fdisk -l\b
|
||||
conf.fdisk
|
||||
|
||||
# free
|
||||
^([/\w\.]+\/)?free\b
|
||||
conf.free
|
||||
|
||||
------------
|
||||
# docker
|
||||
|
||||
# docker ps
|
||||
^([/\w\.]+\/)?docker(-compose)? ps\b
|
||||
conf.dockerps
|
||||
|
||||
^([/\w\.]+\/)?docker image(s| ls| list)\b
|
||||
conf.dockerimages
|
||||
|
||||
^([/\w\.]+\/)?docker search\b
|
||||
conf.dockersearch
|
||||
|
||||
#^([/\w\.]+\/)?docker pull\b
|
||||
#conf.dockerpull
|
||||
|
||||
^([/\w\.]+\/)?docker-machine ls\b
|
||||
conf.docker-machinels
|
||||
|
||||
^([/\w\.]+\/)?docker network ls\b
|
||||
conf.dockernetwork
|
||||
|
||||
^([/\w\.]+\/)?docker info\b
|
||||
conf.dockerinfo
|
||||
|
||||
^([/\w\.]+\/)?docker version\b
|
||||
conf.dockerversion
|
||||
------------
|
||||
|
||||
# journalctl command
|
||||
^([/\w\.]+\/)?journalctl\b
|
||||
conf.log
|
||||
|
||||
# KubeCTL
|
||||
^([/\w\.]+\/)?kubectl((?!edit|exec|run|go-template).)*$
|
||||
conf.kubectl
|
||||
|
||||
# sensors command
|
||||
^([/\w\.]+\/)?sensors\b
|
||||
conf.sensors
|
||||
|
||||
# systemctl command
|
||||
^([/\w\.]+\/)?systemctl\b
|
||||
conf.systemctl
|
||||
|
||||
# sysctl command
|
||||
^([/\w\.]+\/)?sysctl\b
|
||||
conf.sysctl
|
||||
|
||||
# tcpdump command
|
||||
^([/\w\.]+\/)?tcpdump\b
|
||||
conf.tcpdump
|
||||
|
||||
# tune2fs command
|
||||
^([/\w\.]+\/)?tune2fs\b
|
||||
conf.tune2fs
|
||||
|
||||
# lsmod
|
||||
^([/\w\.]+\/)?lsmod\b
|
||||
conf.lsmod
|
||||
|
||||
# lsattr
|
||||
^([/\w\.]+\/)?lsattr\b
|
||||
conf.lsattr
|
||||
|
||||
# semanage ---------------------------------
|
||||
^([/\w\.]+\/)?semanage boolean\b
|
||||
conf.semanageboolean
|
||||
^([/\w\.]+\/)?semanage fcontext\b
|
||||
conf.semanagefcontext
|
||||
^([/\w\.]+\/)?semanage (user|login|port)\b
|
||||
conf.semanageuser
|
||||
|
||||
# getsebool
|
||||
^([/\w\.]+\/)?getsebool\b
|
||||
conf.getsebool
|
||||
|
||||
# ulimit
|
||||
^([/\w\.]+\/)?ulimit\b
|
||||
conf.ulimit
|
||||
|
||||
# vmstat
|
||||
^([/\w\.]+\/)?vmstat\b
|
||||
conf.vmstat
|
||||
|
||||
# dnf
|
||||
^([/\w\.]+\/)?dnf\b
|
||||
conf.dnf
|
||||
|
||||
# nmap
|
||||
^([/\w\.]+\/)?nmap\b
|
||||
conf.nmap
|
||||
|
||||
# uptime | w
|
||||
^([/\w\.]+\/)?(uptime|w)\b
|
||||
conf.uptime
|
||||
|
||||
# getfacl
|
||||
^([/\w\.]+\/)?getfacl\b
|
||||
conf.getfacl
|
||||
|
||||
# ntpdate
|
||||
^([/\w\.]+\/)?ntpdate\b
|
||||
conf.ntpdate
|
||||
|
||||
# showmount
|
||||
^([/\w\.]+\/)?showmount\b
|
||||
conf.showmount
|
||||
|
||||
# apache ant command
|
||||
^([/\w\.]+\/)?ant\b
|
||||
conf.ant
|
||||
|
||||
# # apache maven command
|
||||
^([/\w\.]+\/)?mvn\b
|
||||
conf.mvn
|
||||
|
||||
# iwconfig command
|
||||
^([/\w\.]+\/)?iwconfig\b
|
||||
conf.iwconfig
|
||||
|
||||
# lolcat command
|
||||
^([/\w\.]+\/)?lolcat\b
|
||||
conf.lolcat
|
||||
|
||||
# whois
|
||||
^([/\w\.]+\/)?whois\b
|
||||
conf.whois
|
||||
|
||||
# go test
|
||||
^([/\w\.]+\/)?go test\b
|
||||
conf.go-test
|
||||
|
||||
# sockstat command
|
||||
^([/\w\.]+\/)?sockstat\b
|
||||
conf.sockstat
|
||||
|
||||
# anything to do with irc
|
||||
\b\w+\b.*irc.*
|
||||
conf.irclog
|
||||
|
@ -6,267 +298,4 @@ conf.irclog
|
|||
\b\w+\b.*log\b
|
||||
conf.log
|
||||
|
||||
# configure command
|
||||
(^|[/\w\.]+/)?configure
|
||||
conf.configure
|
||||
|
||||
# ping command
|
||||
(^|[/\w\.]+/)(io|o|n|h|arp|l2)?ping[236]?\s
|
||||
conf.ping
|
||||
|
||||
# traceroute command
|
||||
(^|[/\w\.]+/)traceroute6?\s
|
||||
conf.traceroute
|
||||
|
||||
# gcc command
|
||||
(^|[/\w\.]+/)(g?cc|[gc]\+\+)\s
|
||||
conf.gcc
|
||||
|
||||
# make command
|
||||
(^|[/\w\.]+/)g?make\s?
|
||||
conf.gcc
|
||||
|
||||
# netstat command
|
||||
(^|[/\w\.]+/)netstat\s?
|
||||
conf.netstat
|
||||
|
||||
# stat command
|
||||
(^|[/\w\.]+/)stat\s?
|
||||
conf.stat
|
||||
|
||||
# ss command
|
||||
(^|[/\w\.]+/)ss\s?
|
||||
conf.ss
|
||||
|
||||
# diff command
|
||||
(^|[/\w\.]+/)diff\s?
|
||||
conf.diff
|
||||
|
||||
# wdiff command
|
||||
(^|[/\w\.]+/)wdiff\s?
|
||||
conf.wdiff
|
||||
|
||||
# last/who command
|
||||
(^|[/\w\.]+/)(last|who)\s?
|
||||
conf.last
|
||||
|
||||
# ldap tools
|
||||
(^|[/\w\.]+/)ldap
|
||||
conf.ldap
|
||||
|
||||
# cvs command
|
||||
(^|[/\w\.]+/)cvs\s?
|
||||
conf.cvs
|
||||
|
||||
# mount command
|
||||
(^|[/\w\.]+/)mount\s?
|
||||
conf.mount
|
||||
|
||||
# findmnt command
|
||||
(^|[/\w\.]+/)findmnt\s?
|
||||
conf.findmnt
|
||||
|
||||
# mtr command
|
||||
(^|[/\w\.]+/)mtr\s?
|
||||
conf.mtr
|
||||
|
||||
# ps command
|
||||
(^|[/\w\.]+/)ps\s?
|
||||
conf.ps
|
||||
|
||||
# dig command
|
||||
(^|[/\w\.]+/)dig\s?
|
||||
conf.dig
|
||||
|
||||
# ifconfig command
|
||||
(^|[/\w\.]+/)ifconfig\s?
|
||||
conf.ifconfig
|
||||
|
||||
# ls command
|
||||
(^|[/\w\.]+/)ls\s
|
||||
conf.ls
|
||||
|
||||
# mount
|
||||
(^|[/\w\.]+/)mount\s?
|
||||
conf.mount
|
||||
|
||||
# df
|
||||
(^|[/\w\.]+/)df\s?
|
||||
conf.df
|
||||
|
||||
# du
|
||||
(^|[/\w\.]+/)du\s?
|
||||
conf.du
|
||||
|
||||
# ip addr/link
|
||||
(^|[/\w\.]+/)ip a(ddr)*\s?
|
||||
conf.ipaddr
|
||||
|
||||
(^|[/\w\.]+/)ip ?(-.)* ?l(ink)*\s?
|
||||
conf.ipaddr
|
||||
|
||||
# ip route
|
||||
(^|[/\w\.]+/)ip r(oute)*\s?
|
||||
conf.iproute
|
||||
|
||||
# ip neighbor
|
||||
(^|[/\w\.]+/)ip n(eighbor)*\s?
|
||||
conf.ipneighbor
|
||||
|
||||
# ip command - rest of commands
|
||||
(^|[/\w\.]+/)ip?\s
|
||||
conf.ip
|
||||
|
||||
# env
|
||||
(^|[/\w\.]+/)env\s?
|
||||
conf.env
|
||||
|
||||
# systemctl show
|
||||
(^|[/\w\.]+/)systemctl show\s?
|
||||
conf.env
|
||||
|
||||
# iptables
|
||||
(^|[/\w\.]+/)iptables\s?
|
||||
conf.iptables
|
||||
|
||||
# lspci
|
||||
(^|[/\w\.]+/)lspci\s?
|
||||
conf.lspci
|
||||
|
||||
# lsblk
|
||||
(^|[/\w\.]+/)lsblk\s?
|
||||
conf.lsblk
|
||||
|
||||
# lsof
|
||||
(^|[/\w\.]+/)lsof\s?
|
||||
conf.lsof
|
||||
|
||||
# blkid
|
||||
(^|[/\w\.]+/)blkid\s?
|
||||
conf.blkid
|
||||
|
||||
# id
|
||||
(^|[/\w\.]+/)id\s?
|
||||
conf.id
|
||||
|
||||
# iostat / sar
|
||||
(^|[/\w\.]+/)(iostat|sar)\s?
|
||||
conf.iostat_sar
|
||||
|
||||
# fdisk
|
||||
(^|[/\w\.]+/)fdisk -l\s?
|
||||
conf.fdisk
|
||||
|
||||
# free
|
||||
(^|[/\w\.]+/)free\s?
|
||||
conf.free
|
||||
|
||||
# findmnt
|
||||
(^|[/\w\.]+/)findmnt\s?
|
||||
conf.findmnt
|
||||
|
||||
------------
|
||||
# docker
|
||||
|
||||
# docker ps
|
||||
(^|[/\w\.]+/)docker(-compose)? ps\s?
|
||||
conf.dockerps
|
||||
|
||||
(^|[/\w\.]+/)docker images\s?
|
||||
conf.dockerimages
|
||||
|
||||
(^|[/\w\.]+/)docker search\s?
|
||||
conf.dockersearch
|
||||
|
||||
#(^|[/\w\.]+/)docker pull\s?
|
||||
#conf.dockerpull
|
||||
|
||||
(^|[/\w\.]+/)docker-machine ls\s?
|
||||
conf.docker-machinels
|
||||
|
||||
(^|[/\w\.]+/)docker network ls\s?
|
||||
conf.dockernetwork
|
||||
|
||||
(^|[/\w\.]+/)docker info\s?
|
||||
conf.dockerinfo
|
||||
|
||||
(^|[/\w\.]+/)docker version\s?
|
||||
conf.dockerversion
|
||||
------------
|
||||
|
||||
# journalctl command
|
||||
(^|[/\w\.]+/)journalctl?\s
|
||||
conf.log
|
||||
|
||||
# systemctl command
|
||||
(^|[/\w\.]+/)systemctl?\s
|
||||
conf.systemctl
|
||||
|
||||
# sysctl command
|
||||
(^|[/\w\.]+/)sysctl?\s
|
||||
conf.sysctl
|
||||
|
||||
# tcpdump command
|
||||
(^|[/\w\.]+/)tcpdump\s?
|
||||
conf.tcpdump
|
||||
|
||||
# tune2fs command
|
||||
(^|[/\w\.]+/)tune2fs\s?
|
||||
conf.tune2fs
|
||||
|
||||
# lsmod
|
||||
(^|[/\w\.]+/)lsmod\s?
|
||||
conf.lsmod
|
||||
|
||||
# lsattr
|
||||
(^|[/\w\.]+/)lsattr\s?
|
||||
conf.lsattr
|
||||
|
||||
# semanage ---------------------------------
|
||||
(^|[/\w\.]+/)semanage boolean\s?
|
||||
conf.semanageboolean
|
||||
(^|[/\w\.]+/)semanage fcontext\s?
|
||||
conf.semanagefcontext
|
||||
(^|[/\w\.]+/)semanage (user|login|port)\s?
|
||||
conf.semanageuser
|
||||
|
||||
# getsebool
|
||||
(^|[/\w\.]+/)getsebool\s?
|
||||
conf.getsebool
|
||||
|
||||
# ulimit
|
||||
(^|[/\w\.]+/)ulimit\s?
|
||||
conf.ulimit
|
||||
|
||||
# vmstat
|
||||
(^|[/\w\.]+/)vmstat\s?
|
||||
conf.vmstat
|
||||
|
||||
# dnf
|
||||
(^|[/\w\.]+/)dnf\s?
|
||||
conf.dnf
|
||||
|
||||
# nmap
|
||||
(^|[/\w\.]+/)nmap\s?
|
||||
conf.nmap
|
||||
|
||||
# uptime | w
|
||||
(^|[/\w\.]+/)(uptime|w)\s?
|
||||
conf.uptime
|
||||
|
||||
# getfacl
|
||||
(^|[/\w\.]+/)getfacl\s?
|
||||
conf.getfacl
|
||||
|
||||
# showmount
|
||||
(^|[/\w\.]+/)showmount\s?
|
||||
conf.showmount
|
||||
|
||||
# apache ant command
|
||||
(^|[/\w\.]+/)ant\s?
|
||||
conf.ant
|
||||
|
||||
# # apache maven command
|
||||
(^|[/\w\.]+/)mvn\s?
|
||||
conf.mvn
|
||||
|
||||
|
|
16
grc.fish
16
grc.fish
|
@ -8,15 +8,19 @@
|
|||
|
||||
set -U grc_plugin_execs cat cvs df diff dig gcc g++ ls ifconfig \
|
||||
make mount mtr netstat ping ps tail traceroute \
|
||||
wdiff blkid du dnf docker docker-machine env id ip iostat \
|
||||
wdiff blkid du dnf docker docker-compose docker-machine env id ip iostat journalctl kubectl \
|
||||
last lsattr lsblk lspci lsmod lsof getfacl getsebool ulimit uptime nmap \
|
||||
fdisk findmnt free semanage sar ss sysctl systemctl stat showmount tune2fs \
|
||||
tcpdump tune2fs \
|
||||
vmstat w who
|
||||
fdisk findmnt free semanage sar ss sysctl systemctl stat showmount \
|
||||
tcpdump tune2fs vmstat w who sockstat
|
||||
|
||||
for executable in $grc_plugin_execs
|
||||
if type -q $executable
|
||||
alias $executable "grc $executable"
|
||||
function $executable --inherit-variable executable --wraps=$executable
|
||||
if isatty 1
|
||||
grc $executable $argv
|
||||
else
|
||||
eval command $executable $argv
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,14 +1,25 @@
|
|||
# aliases for grc(1)
|
||||
|
||||
# this will execute only if there is a line with
|
||||
# GRC_ALIASES=true
|
||||
# in /etc/default/grc or you export GRC_ALIASES=true prior to sourcing this
|
||||
|
||||
[ -f /etc/default/grc ] && . /etc/default/grc
|
||||
|
||||
[ x$GRC_ALIASES = xtrue ] || return 0
|
||||
|
||||
GRC="$(which grc)"
|
||||
if [ "$TERM" != dumb ] && [ -n "$GRC" ]; then
|
||||
alias colourify="$GRC -es --colour=auto"
|
||||
if tty -s && [ -n "$TERM" ] && [ "$TERM" != dumb ] && [ -n "$GRC" ]; then
|
||||
alias colourify="$GRC -es"
|
||||
alias blkid='colourify blkid'
|
||||
alias configure='colourify ./configure'
|
||||
alias df='colourify df'
|
||||
alias diff='colourify diff'
|
||||
alias docker='colourify docker'
|
||||
alias docker-compose='colourify docker-compose'
|
||||
alias docker-machine='colourify docker-machine'
|
||||
alias du='colourify du'
|
||||
alias env='colourify env'
|
||||
# alias env='colourify env'
|
||||
alias free='colourify free'
|
||||
alias fdisk='colourify fdisk'
|
||||
alias findmnt='colourify findmnt'
|
||||
|
@ -20,6 +31,8 @@ if [ "$TERM" != dumb ] && [ -n "$GRC" ]; then
|
|||
alias iptables='colourify iptables'
|
||||
alias as='colourify as'
|
||||
alias gas='colourify gas'
|
||||
alias journalctl='colourify journalctl'
|
||||
alias kubectl='colourify kubectl'
|
||||
alias ld='colourify ld'
|
||||
#alias ls='colourify ls'
|
||||
alias lsof='colourify lsof'
|
||||
|
@ -27,6 +40,7 @@ if [ "$TERM" != dumb ] && [ -n "$GRC" ]; then
|
|||
alias lspci='colourify lspci'
|
||||
alias netstat='colourify netstat'
|
||||
alias ping='colourify ping'
|
||||
alias ss='colourify ss'
|
||||
alias traceroute='colourify traceroute'
|
||||
alias traceroute6='colourify traceroute6'
|
||||
alias head='colourify head'
|
||||
|
@ -36,7 +50,8 @@ if [ "$TERM" != dumb ] && [ -n "$GRC" ]; then
|
|||
alias ps='colourify ps'
|
||||
alias mtr='colourify mtr'
|
||||
alias semanage='colourify semanage'
|
||||
alias getsebool='colourify setsebool'
|
||||
alias getsebool='colourify getsebool'
|
||||
alias ifconfig='colourify ifconfig'
|
||||
alias sockstat='colourify sockstat'
|
||||
fi
|
||||
|
131
grc.zsh
131
grc.zsh
|
@ -1,40 +1,95 @@
|
|||
if [[ "$TERM" != dumb ]] && (( $+commands[grc] )) ; then
|
||||
# Prevent grc aliases from overriding zsh completions.
|
||||
setopt COMPLETE_ALIASES
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
# Supported commands
|
||||
cmds=(
|
||||
cc \
|
||||
configure \
|
||||
cvs \
|
||||
df \
|
||||
diff \
|
||||
dig \
|
||||
gcc \
|
||||
gmake \
|
||||
ifconfig \
|
||||
last \
|
||||
ldap \
|
||||
ls \
|
||||
make \
|
||||
mount \
|
||||
mtr \
|
||||
netstat \
|
||||
ping \
|
||||
ping6 \
|
||||
ps \
|
||||
traceroute \
|
||||
traceroute6 \
|
||||
wdiff \
|
||||
);
|
||||
|
||||
# Set alias for available commands.
|
||||
for cmd in $cmds ; do
|
||||
if (( $+commands[$cmd] )) ; then
|
||||
alias $cmd="grc --colour=auto $cmd"
|
||||
fi
|
||||
done
|
||||
|
||||
# Clean up variables
|
||||
unset cmds cmd
|
||||
if ! tty -s || [ ! -n "$TERM" ] || [ "$TERM" = dumb ] || (( ! $+commands[grc] ))
|
||||
then
|
||||
return
|
||||
fi
|
||||
|
||||
# Supported commands
|
||||
cmds=(
|
||||
as
|
||||
ant
|
||||
blkid
|
||||
cc
|
||||
configure
|
||||
curl
|
||||
cvs
|
||||
df
|
||||
diff
|
||||
dig
|
||||
dnf
|
||||
docker
|
||||
docker-compose
|
||||
docker-machine
|
||||
du
|
||||
env
|
||||
fdisk
|
||||
findmnt
|
||||
free
|
||||
g++
|
||||
gas
|
||||
gcc
|
||||
getfacl
|
||||
getsebool
|
||||
gmake
|
||||
id
|
||||
ifconfig
|
||||
iostat
|
||||
ip
|
||||
iptables
|
||||
iwconfig
|
||||
journalctl
|
||||
kubectl
|
||||
last
|
||||
ldap
|
||||
lolcat
|
||||
ld
|
||||
ls
|
||||
lsattr
|
||||
lsblk
|
||||
lsmod
|
||||
lsof
|
||||
lspci
|
||||
make
|
||||
mount
|
||||
mtr
|
||||
mvn
|
||||
netstat
|
||||
nmap
|
||||
ntpdate
|
||||
php
|
||||
ping
|
||||
ping6
|
||||
proftpd
|
||||
ps
|
||||
sar
|
||||
semanage
|
||||
sensors
|
||||
showmount
|
||||
sockstat
|
||||
ss
|
||||
stat
|
||||
sysctl
|
||||
systemctl
|
||||
tcpdump
|
||||
traceroute
|
||||
traceroute6
|
||||
tune2fs
|
||||
ulimit
|
||||
uptime
|
||||
vmstat
|
||||
wdiff
|
||||
whois
|
||||
)
|
||||
|
||||
# Set alias for available commands.
|
||||
for cmd in $cmds ; do
|
||||
if (( $+commands[$cmd] )) ; then
|
||||
$cmd() {
|
||||
grc --colour=auto ${commands[$0]} "$@"
|
||||
}
|
||||
fi
|
||||
done
|
||||
|
||||
# Clean up variables
|
||||
unset cmds cmd
|
||||
|
|
46
grcat
46
grcat
|
@ -4,6 +4,34 @@ from __future__ import print_function
|
|||
|
||||
import sys, os, string, re, signal, errno
|
||||
|
||||
|
||||
# redefine readline to pass invalidly encoded characters unchanged, if possible
|
||||
if hasattr(sys.stdin, 'reconfigure') and hasattr(sys.stdout, 'reconfigure'):
|
||||
# at least python3.7
|
||||
sys.stdin.reconfigure(errors='surrogateescape')
|
||||
sys.stdout.reconfigure(errors='surrogateescape')
|
||||
myreadline = sys.stdin.readline
|
||||
myprint = print
|
||||
else:
|
||||
if hasattr(sys.stdin, 'buffer'):
|
||||
# python3
|
||||
buffer_reader = sys.stdin.buffer
|
||||
else:
|
||||
buffer_reader = sys.stdin
|
||||
def myreadline():
|
||||
for line in buffer_reader:
|
||||
try:
|
||||
decoded = line.decode('utf-8', errors='surrogateescape')
|
||||
except (UnicodeDecodeError, LookupError):
|
||||
decoded = line.decode('utf-8', errors='ignore')
|
||||
return decoded
|
||||
return ''
|
||||
def myprint(x):
|
||||
try:
|
||||
print(x)
|
||||
except UnicodeEncodeError:
|
||||
print(x.encode('utf-8', errors='replace').decode('utf-8'))
|
||||
|
||||
#some default definitions
|
||||
colours = {
|
||||
'none' : "",
|
||||
|
@ -135,7 +163,7 @@ while not is_last:
|
|||
continue
|
||||
if not l[0] in letters:
|
||||
break
|
||||
fields = split(l[:-1], "=", 1)
|
||||
fields = split(l.rstrip('\r\n'), "=", 1)
|
||||
if len(fields) != 2:
|
||||
sys.stderr.write('Error in configuration, I expect keyword=value line\n')
|
||||
sys.stderr.write('But I got instead:\n')
|
||||
|
@ -175,9 +203,9 @@ while not is_last:
|
|||
prevcolour = colours['default']
|
||||
prevcount = "more"
|
||||
blockflag = 0
|
||||
freadline = sys.stdin.readline
|
||||
|
||||
while 1:
|
||||
line = freadline()
|
||||
line = myreadline()
|
||||
if line == "" :
|
||||
break
|
||||
if line[-1] in '\r\n':
|
||||
|
@ -187,14 +215,15 @@ while 1:
|
|||
for pattern in regexplist:
|
||||
pos = 0
|
||||
currcount = pattern['count']
|
||||
was_replace = 0 # watch replacements, replace regexp only one per line, to avoid infinte loops if the replacement matches the regexp again
|
||||
while 1:
|
||||
m = pattern['regexp'](line, pos)
|
||||
if m:
|
||||
if 'replace' in pattern:
|
||||
if was_replace:
|
||||
break
|
||||
line = re.sub(m.re, pattern['replace'], line)
|
||||
#m = pattern['regexp'](line, pos)
|
||||
#if not m:
|
||||
# break
|
||||
was_replace = 1
|
||||
if 'colours' in pattern:
|
||||
if currcount == "block":
|
||||
blockflag = 1
|
||||
|
@ -235,7 +264,8 @@ while 1:
|
|||
skip = pattern['skip'] in ("yes", "1", "true")
|
||||
if 'colours' not in pattern:
|
||||
break
|
||||
else: break
|
||||
else:
|
||||
break
|
||||
if m and currcount == "stop":
|
||||
prevcount = "stop"
|
||||
break
|
||||
|
@ -273,7 +303,7 @@ while 1:
|
|||
clineprev = cline[i]
|
||||
nline = nline + colours['default']
|
||||
try:
|
||||
print(nline)
|
||||
myprint(nline)
|
||||
except IOError as e:
|
||||
if e.errno == errno.EPIPE:
|
||||
break
|
||||
|
|
|
@ -24,5 +24,11 @@ cp -fv grc.conf $CONFDIR
|
|||
cp -fv grc.zsh $CONFDIR
|
||||
cp -fv grc.fish $CONFDIR
|
||||
mkdir -p $PROFILEDIR
|
||||
cp -fv grc.bashrc $PROFILEDIR
|
||||
cp -fv grc.sh $PROFILEDIR
|
||||
|
||||
# probably we should not install it into site-functions in a debian package...
|
||||
if [ "$PREFIX" = "/usr/local" ]; then
|
||||
mkdir -p $PREFIX/zsh/site-functions
|
||||
cp -fv _grc $PREFIX/zsh/site-functions
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue