pax_global_header00006660000000000000000000000064132713513470014520gustar00rootroot0000000000000052 comment=92aac170d07c754a0c720f713cbd426edea421c8 grc-1.11.3/000077500000000000000000000000001327135134700123565ustar00rootroot00000000000000grc-1.11.3/CHANGES000077700000000000000000000000001327135134700164402debian/changelogustar00rootroot00000000000000grc-1.11.3/COPYING000077700000000000000000000000001327135134700165612debian/copyrightustar00rootroot00000000000000grc-1.11.3/CREDITS000066400000000000000000000011531327135134700133760ustar00rootroot00000000000000Credits where credits are due: These people helped me with ideas, support and other things: Piotr Klaban Jason Tackaberry Eivind Tagseth Edward Betts Joey Hess Miguel Gualdron Daniel Kollár Christian Zuckschwerdt Paul Oppenheim Emanuele Aina April Arcus Justin J. Novack Ben Hoskins Nikolay Kolev Juraj Bednar Francisco De Lozanne Duncan Overbruck delphinus Aditya Bhargava Cemil Browne Ruben Barkow Efreak Alexander Kuntashov Isaias Piña Andrew Wong Max Pavel Vishnyakov tomaszn Nicolas Leclercq Dave Wikoff richi235 Ricardo J. Barberis Joe Block iamoverit Oxicode Jonas Minnberg alcik Henry Eklind Justin Lecher grc-1.11.3/INSTALL000066400000000000000000000017741327135134700134200ustar00rootroot00000000000000=================================================================== Generic Colouriser Radovan Garabík http://kassiopeia.juls.savba.sk/~garabik/software/grc.html =================================================================== Requirements: Anything with a python interpreter, with more or less work needed if it is not unix. If you have a debian system with all necessary packages installed, type dpkg-buildpackage (or dpkg-buildpackage -rfakeroot) in the package's directory, then type dpkg -i ../grc*deb else: 1) copy colourfiles/conf.* files into /usr/share/grc/ or /usr/local/share/grc/, creating directories when needed 2) copy grc.conf into /etc/ 3) copy grc and grcat somewhere to your path 4) read the README and manual pages 5) modify /etc/grc.conf if you feel like it There is a small shell script called install.sh provided, which automatically does the above steps. If you're on OS X and using Homebrew, brew install grc grc-1.11.3/README.markdown000066400000000000000000000212411327135134700150570ustar00rootroot00000000000000# Generic Colouriser Radovan Garabík (garabik @ kassiopeia.juls.savba.sk) For the impatient - try following commands: grc netstat grc ping hostname grc tail /var/log/syslog grc ps aux Being overflooded with different logfile colo(u)?ri(s|z)ers, colortails, gccolors, colormakes and similar programs for making text files or outputs of different programs more readable by inserting ansi colour control codes into them, I decided to write my very own colouriser, eventually providing the functions of all those others. Two programs are provided: `grc` and `grcat`. The main is `grcat`, which acts as a filter, i.e. taking standard input, colourising it and writing to standard output. ## Configuration `grcat` takes as a parameter the name of configuration file. Directories `~/.grc/`, `/usr/local/share/grc/`, `/usr/share/grc/` are searched for the file (in this order). If the file is not found, it is assumed to be an absolute path of a configuration file located elsewhere. Configuration file consists of entries, one per regexp, entries are separated with lines with first character non-alphanumeric (except #). Lines beginning with # or empty lines are ignored. Each entry consists of several lines. Each line has form: `keyword=value` where keyword is one of: regexp, colours, command, concat, skip, replace, count Only regexp is mandatory, but it does not have much sense by itself unless you specify at least a colour, skip, replace or command keyword as well. **regexp** is the regular expression to match. **colours** is the list of colours, separated by commas (you can specify only one colour), each colour per one regexp group specified in regexp. if you use special colour name "previous", colour of the previous line of text will be used (actually, if both the first and last character of the previous line are of different colour than the default one, colour of the first one will be used). Another special colour name "unchanged" will leave the colour unchanged, useful if you need some context for matching regular expression and you want to leave the colour of context unchanged. Yet another special name is an arbitrary string enclosed in straight quotes. This string will be inserted directly into the output in front of the matching expression. The string will be eval'ed, so you can use usual python escape sequences. This is useful on a 256-colour enabled xterm, where e.g. `colours="\033[38;5;22m"` will give you a dark green (inspired by Rutger Ovidius). Caveat: the string cannot contain a comma. This is due to my laziness :-) **command** is command to be executed when regexp matches. Its output will be mixed with normal stdout, use redirectors (`>/dev/null`) if you want to suppress it. **concat** is the name of a file which the current line will be appended to when the regexp matches. **skip** can be `skip=yes`, if that case the matched line is skipped (discarded from the output), or `skip=no`, when it is not skipped. Default (if you do not have skip keyword) is of course not skipped. **replace** means the regular expression match will be replaced by the value. All the preceeding regular expressions will be evaluated against the original text, but if they match and the replacement changes the length of the text, the colouring will *stay at the same positions*, which is probably not what you want - therefore put the `replace` rule preferrably at the beginning of config file. all the following regular expressions will be evaluated against the replaced text, not the original. replacement is done by `re.sub()`, therefore you can use anything python supports - in particular, `\1`, `\2` etc... to include text from the original matching groups, e.g: regexp=(\d\d):(\d\d):(\d\d) replace=\1h\2m\3s will change time format from 09:43:59 into 09h43m59s **count** is one of words: once, more, stop, previous, block or unblock - **once** means that if the regexp is matched, its first occurrence is coloured and the program will continue with other regexp's. - **more** means that if there are multiple matches of the regexp in one line, all of them will be coloured. - **stop** means that the regexp will be coloured and program will move to the next line (i.e. ignoring other regexp's) - **previous** means the count will be the same as for the previous line - **block** marks a start of a multiline block of text, coloured with the same colour - **unblock**, obviously, marks the end of such a block example: # this is probably a pathname regexp=/[\w/\.]+ colour=green count=more this will match `/usr/bin`, `/usr/local/bin/`, `/etc/init.d/syslogd` and similar strings and paint it with green. Another example: regexp=^-{1,2}\s{0,1}$ colours=red count=block - regexp=^\s{0,5}$ colours=default count=unblock this will turn all correctly formatted mail signatures red. Regular expressions are evaluated from top to bottom, this allows nested and overlapped expressions. (e.g. you colour everything inside parentheses with one colour, and if a following expression matches the text inside parentheses, it will be also coloured). # Typical usage: grcat conf.log < /var/log/syslog /usr/sbin/traceroute www.linux.org | grcat conf.traceroute grcat conf.esperanto < Fundamento.txt | less -r To facilitate the use, command `grc` acts as frontend for `grcat`, automatically choosing the configuration files, so you can write: grc netstat grc ping hostname grc tail /var/log/syslog etc... `grc` will execute command command with optional parameters piping its stdout into `grcat`. Configuration file for `grcat` is determined by `/etc/grc.conf` or `~/.grc/grc.conf` file. Format of `/etc/grc.conf` or `~/.grc/grc.conf:` each entry consists of 2 lines, between entries there can be any number of empty lines or lines beginning with # (comments). First line is regular expression, second line the name of configuration file for `grcat`. Configuration file after the first regular expression matching the rest of line after `grc` will be passed to grcat as its configuration file For example, if you have # log file \b\w+\b.*log\b conf.log # traceroute command (^|[/\w\.]+/)traceroute\s conf.traceroute in your `/etc/grc.conf`, then typing `grc cat /var/log/syslog` will use `conf.log` to colourise the output, `grc /usr/sbin/traceroute www.linux.org` will use `conf.traceroute`. ## Miscellaneous remarks: You should get yourself familiar with regular expressions. Good reading is at The program is not yet optimized for speed. There are places that can give a big boost if optimized. Regular expressions are handled by python, it means that they may be slightly different from those you know from perl or grep. It's not my fault in that case. Colours are one of: none, default, bold, underline, blink, reverse, concealed, black, green, yellow, blue, magenta, cyan, white, on_black, on_green, on_yellow, on_blue, on_magenta, on_cyan, on_white beep `on_red` means that the background (instead of foreground) is painted with red etc... Additional colours can be: `dark, italic, rapidblink, strikethrough`. These are supported only on some terminals, so if you want to write portable configuration files, avoid uing them (idea by James Rowe). there can be more attributes per line (separated by space), e.g. # this is probably a pathname regexp=/[\w/\.]+ colours=bold blink green count=more will display pathnames in bold blinking green ## Python 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. ## Hints Following commands will display nice coloured log in virtual console 12: If you have GNU tail: tail --follow=name /var/log/syslog | grcat conf.log >/dev/tty12 or, if you have recent BSD tail: tail -F /var/log/syslog | grcat conf.log >/dev/tty12 ## Automatic aliases You can start using grc automatically with supported commands. The following assumes that `grc.` is in `/etc`. The location may differ (i. e. `/usr/local/etc` when installed with homebrew). ### Bash To set aliases for supported commands, append to your `~/.bashrc`: [[ -s "/etc/grc.bashrc" ]] && source /etc/grc.bashrc ### ZSH Or for zsh users, append to `~/.zshrc`: [[ -s "/etc/grc.zsh" ]] && source /etc/grc.zsh ### Fish Add to `~/.config/fish/config.fish` or in a new file in `~/.config/fish/conf.d/`: source /usr/local/etc/grc.fish grc-1.11.3/Regexp.txt000066400000000000000000000260601327135134700143550ustar00rootroot00000000000000 Regular Expression Syntax (taken from python library reference) A regular expression (or RE) specifies a set of strings that matches it; the functions in this module let you check if a particular string matches a given regular expression (or if a given regular expression matches a particular string, which comes down to the same thing). Regular expressions can be concatenated to form new regular expressions; if A and B are both regular expressions, then AB is also an regular expression. If a string p matches A and another string q matches B, the string pq will match AB. Thus, complex expressions can easily be constructed from simpler primitive expressions like the ones described here. For details of the theory and implementation of regular expressions, consult the Friedl book referenced below, or almost any textbook about compiler construction. A brief explanation of the format of regular expressions follows. For further information and a gentler presentation, consult the Regular Expression HOWTO, accessible from http://www.python.org/doc/howto/. Regular expressions can contain both special and ordinary characters. Most ordinary characters, like "A", "a", or "0", are the simplest regular expressions; they simply match themselves. You can concatenate ordinary characters, so last matches the string 'last'. (In the rest of this section, we'll write RE's in this special style, usually without quotes, and strings to be matched 'in single quotes'.) Some characters, like "|" or "(", are special. Special characters either stand for classes of ordinary characters, or affect how the regular expressions around them are interpreted. The special characters are: "." (Dot.) In the default mode, this matches any character except a newline. If the DOTALL flag has been specified, this matches any character including a newline. "^" (Caret.) Matches the start of the string, and in MULTILINE mode also matches immediately after each newline. "$" Matches the end of the string, and in MULTILINE mode also matches before a newline. foo matches both 'foo' and 'foobar', while the regular expression foo$ matches only 'foo'. "*" Causes the resulting RE to match 0 or more repetitions of the preceding RE, as many repetitions as are possible. ab* will match 'a', 'ab', or 'a' followed by any number of 'b's. "+" Causes the resulting RE to match 1 or more repetitions of the preceding RE. ab+ will match 'a' followed by any non-zero number of 'b's; it will not match just 'a'. "?" Causes the resulting RE to match 0 or 1 repetitions of the preceding RE. ab? will match either 'a' or 'ab'. *?, +?, ?? The "*", "+", and "?" qualifiers are all greedy; they match as much text as possible. Sometimes this behaviour isn't desired; if the RE <.*> is matched against '

title

', it will match the entire string, and not just '

'. Adding "?" after the qualifier makes it perform the match in non-greedy or minimal fashion; as few characters as possible will be matched. Using .*? in the previous expression will match only '

'. {m,n} Causes the resulting RE to match from m to n repetitions of the preceding RE, attempting to match as many repetitions as possible. For example, a{3,5} will match from 3 to 5 "a" characters. Omitting n specifies an infinite upper bound; you can't omit m. {m,n}? Causes the resulting RE to match from m to n repetitions of the preceding RE, attempting to match as few repetitions as possible. This is the non-greedy version of the previous qualifier. For example, on the 6-character string 'aaaaaa', a{3,5} will match 5 "a" characters, while a{3,5}? will only match 3 characters. "\" Either escapes special characters (permitting you to match characters like "*", "?", and so forth), or signals a special sequence; special sequences are discussed below. If you're not using a raw string to express the pattern, remember that Python also uses the backslash as an escape sequence in string literals; if the escape sequence isn't recognized by Python's parser, the backslash and subsequent character are included in the resulting string. However, if Python would recognize the resulting sequence, the backslash should be repeated twice. This is complicated and hard to understand, so it's highly recommended that you use raw strings for all but the simplest expressions. [] Used to indicate a set of characters. Characters can be listed individually, or a range of characters can be indicated by giving two characters and separating them by a "-". Special characters are not active inside sets. For example, [akm$] will match any of the characters "a", "k", "m", or "$"; [a-z] will match any lowercase letter, and [a-zA-Z0-9] matches any letter or digit. Character classes such as \w or \S(defined below) are also acceptable inside a range. If you want to include a "]" or a "-" inside a set, precede it with a backslash, or place it as the first character. The pattern []] will match ']', for example. You can match the characters not within a range by complementing the set. This is indicated by including a "^" as the first character of the set; "^" elsewhere will simply match the "^" character. For example, [^5] will match any character except "5". "|" A|B, where A and B can be arbitrary REs, creates a regular expression that will match either A or B. This can be used inside groups (see below) as well. To match a literal "|", use \|, or enclose it inside a character class, as in [|]. (...) Matches whatever regular expression is inside the parentheses, and indicates the start and end of a group; the contents of a group can be retrieved after a match has been performed, and can be matched later in the string with the \number special sequence, described below. To match the literals "(" or "')", use \( or \), or enclose them inside a character class: [(] [)]. (?...) This is an extension notation (a "?" following a "(" is not meaningful otherwise). The first character after the "?" determines what the meaning and further syntax of the construct is. Extensions usually do not create a new group; (?P...) is the only exception to this rule. Following are the currently supported extensions. (?iLmsx) (One or more letters from the set "i", "L", "m", "s", "x".) The group matches the empty string; the letters set the corresponding flags (re.I, re.L, re.M, re.S, re.X) for the entire regular expression. This is useful if you wish to include the flags as part of the regular expression, instead of passing a flag argument to the compile() function. (?:...) A non-grouping version of regular parentheses. Matches whatever regular expression is inside the parentheses, but the substring matched by the group cannot be retrieved after performing a match or referenced later in the pattern. (?P...) Similar to regular parentheses, but the substring matched by the group is accessible via the symbolic group name name. Group names must be valid Python identifiers. A symbolic group is also a numbered group, just as if the group were not named. So the group named 'id' in the example above can also be referenced as the numbered group 1. For example, if the pattern is (?P[a-zA-Z_]\w*), the group can be referenced by its name in arguments to methods of match objects, such as m.group('id')or m.end('id'), and also by name in pattern text (e.g. (?P=id)) and replacement text (e.g. \g). (?P=name) Matches whatever text was matched by the earlier group named name. (?#...) A comment; the contents of the parentheses are simply ignored. (?=...) Matches if ... matches next, but doesn't consume any of the string. This is called a lookahead assertion. For example, Isaac (?=Asimov) will match 'Isaac ' only if it's followed by 'Asimov'. (?!...) Matches if ... doesn't match next. This is a negative lookahead assertion. For example, Isaac (?!Asimov) will match 'Isaac ' only if it's not followed by 'Asimov'. The special sequences consist of "\" and a character from the list below. If the ordinary character is not on the list, then the resulting RE will match the second character. For example, \$ matches the character "$". \number Matches the contents of the group of the same number. Groups are numbered starting from 1. For example, (.+) \1 matches 'the the' or '55 55', but not 'the end' (note the space after the group). This special sequence can only be used to match one of the first 99 groups. If the first digit of number is 0, or number is 3 octal digits long, it will not be interpreted as a group match, but as the character with octal value number. Inside the "[" and "]" of a character class, all numeric escapes are treated as characters. \A Matches only at the start of the string. \b Matches the empty string, but only at the beginning or end of a word. A word is defined as a sequence of alphanumeric characters, so the end of a word is indicated by whitespace or a non-alphanumeric character. Inside a character range, \b represents the backspace character, for compatibility with Python's string literals. \B Matches the empty string, but only when it is not at the beginning or end of a word. \d Matches any decimal digit; this is equivalent to the set [0-9]. \D Matches any non-digit character; this is equivalent to the set [^0-9]. \s Matches any whitespace character; this is equivalent to the set [ \t\n\r\f\v]. \S Matches any non-whitespace character; this is equivalent to the set [^ \t\n\r\f\v]. \w When the LOCALE flag is not specified, matches any alphanumeric character; this is equivalent to the set [a-zA-Z0-9_]. With LOCALE, it will match the set [0-9_] plus whatever characters are defined as letters for the current locale. \W When the LOCALE flag is not specified, matches any non-alphanumeric character; this is equivalent to the set [^a-zA-Z0-9_]. With LOCALE, it will match any character not in the set [0-9_], and not defined as a letter for the current locale. \Z Matches only at the end of the string. \\ Matches a literal backslash. grc-1.11.3/TODO000066400000000000000000000001121327135134700130400ustar00rootroot00000000000000optimize for speed handle ^C intelligently - almost done (multiline mode) grc-1.11.3/_grc000066400000000000000000000013051327135134700132120ustar00rootroot00000000000000#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 --config=)'{-c+,--config=-}'[use as configuration file for grcat]:file:_files' '--color=-[colo?urize output]:color:(on off auto)' '(-h --help)'{-h,--help}'[display help message and exit]' '--pty[run command in pseudotermnial (experimental)]' '*::arguments:{ _normal }' ) _arguments -s $args grc-1.11.3/colourfiles/000077500000000000000000000000001327135134700147045ustar00rootroot00000000000000grc-1.11.3/colourfiles/conf.ant000066400000000000000000000013361327135134700163400ustar00rootroot00000000000000# ant grc colorizer configuration # BUILD FAILED regexp=BUILD FAILED colours=bold red count=more ============== # BUILD SUCCESSFUL regexp=^BUILD SUCCESSFUL colours=bold green count=more ============== # Total time regexp=^(Total time: )([\d]+.*)$ colours=yellow,bold magenta count=more =============== # some error regexp=[\d]+ error[s]? colours=red count=more ============== # some warning regexp=[\d]+ warning[s]? colours=yellow count=more =============== # some error regexp=[Ee]rror: colours=red count=more ============== # some warning regexp=[Ww]arning: colours=yellow count=more ============== # project name regexp=^[^:\s]+:$ colours=green count=more ============== # products regexp=[^/]+\.[ewrj]ar$ colours=blue count=more grc-1.11.3/colourfiles/conf.blkid000066400000000000000000000010551327135134700166410ustar00rootroot00000000000000# Blk regexp=^(/dev/)(.+):\s colours=default,green,bright_green ====== # Blk mapper regexp=^/dev/(mapper/)(.+):\s colours=unchanged,underline green,bright_green ====== # UUID regexp=\sUUID="([^"]+) colours=bold yellow,blue ====== #UUID_SUB regexp=\sUUID_SUB="([^"]+) colours=green,bright_green ====== # TYPE regexp=TYPE="([^"]+) colours=bold cyan,cyan ====== # LABEL regexp=\sLABEL="([^"]+) colours=bold bright_cyan,bright_cyan ====== # PARTLABEL regexp=\sPARTLABEL="([^"]+) colours=bold green,red # PARTUUID regexp=PARTUUID="([^"]+) colours=green,magenta grc-1.11.3/colourfiles/conf.configure000066400000000000000000000010351327135134700175330ustar00rootroot00000000000000# cache functions regexp=\b(loading|updating|creating) cache\b colours=yellow bold ......... # checking regexp=\bchecking\s*(for|if|whether|command|how|that)?(\s*to)?\b colours=bold blue ......... # result is complex regexp=\.\.\. .*$ colours=bold yellow ......... # check succeeded regexp=\.\.\.( \(cached\))? yes$ colours=bold cyan ......... # check did not succeed regexp=\.\.\.( \(cached\))? no$ colours=bold red ......... # ... should be normal regexp=\.\.\. colours=default ......... # creating stuff regexp=\bcreating\b colours=green grc-1.11.3/colourfiles/conf.cvs000066400000000000000000000004271327135134700163510ustar00rootroot00000000000000# conflict regexp=^C .*$ colours=bold red count=more ====== # modified regexp=^M .*$ colours=bold blue count=more ====== # added regexp=^A .*$ colours=cyan count=more ====== # removed regexp=^R .*$ colours=cyan count=more ====== # unlisted regexp=^\? .*$ colours=bold count=more grc-1.11.3/colourfiles/conf.df000066400000000000000000000012221327135134700161410ustar00rootroot00000000000000# FS #regexp=^.*?\s regexp=^(?!Filesystem)(\/[-\w\d.]+)+\s colours=blue,bold blue ====== # Size 'K' regexp=\s\d*[.,]?\dKi?\s colours=green ====== # Size 'M' regexp=\s\d*[.,]?\dMi?\s colours=yellow ====== # Size 'G' regexp=\s\d*[.,]?\dGi?\s colours=red ====== # Size 'T' regexp=\s\d*[.,]?\dTi?\s colours=bold red ====== # Mounted on regexp=\/$|(\/[-\w\d. ]+)+$ colours=green,bold green ====== # Use 0-60% regexp=[\b1-6][0-9]?%|0% colours=green ====== # Use 70-90% regexp=[7-9][0-9]% colours=yellow ====== # Use 90-97 regexp=9[0-7]% colours=red ====== # Use 98-100 regexp=9[8-9]%|100% colours=bold red ====== # tmpfs lines regexp=^tmpfs.* colours=bright_black grc-1.11.3/colourfiles/conf.diff000066400000000000000000000006361327135134700164700ustar00rootroot00000000000000# new lines and filenames (unified diff) regexp=^\+(.*$) colours=bold green count=more ======= # removed lines and filenames (unified diff) regexp=^\-(--.+$|[^\-].*$|$) colours=bold red count=more ======== # new lines regexp=^\>([^\>].*|$) colours=bold green count=more ======= # removed lines regexp=^\<([^\<].*|$) colours=bold red count=more ======= # lines affected regexp=^@@ .* @@$ colours=magenta count=more grc-1.11.3/colourfiles/conf.dig000066400000000000000000000007471327135134700163260ustar00rootroot00000000000000#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=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} colours=green ======= #comments regexp=^;;\s\w*\s*\w* colours=yellow ======= #Title regexp=; <<>> DiG (\d+\.\d+\.\d+).*<<>>\s(\S+)$ colours=default,green,bold magenta grc-1.11.3/colourfiles/conf.dnf000066400000000000000000000002121327135134700163150ustar00rootroot00000000000000# Install regexp=^Installing: colour=bold green - # Main regexp=^Upgrading: colour=bold yellow - # Main regexp=^Removing: colour=bold red grc-1.11.3/colourfiles/conf.docker-machinels000066400000000000000000000006531327135134700207670ustar00rootroot00000000000000# IMAGE regexp=^(?!NAME|error)(\S+)\s+(\S+)\s+(\S+) colours=default,bold yellow,bold black,cyan ====== # Running regexp=\sRunning\s colours=bold green ====== # Stopped regexp=\sStopped\s colours=bold red ====== # Error regexp=\sError\s colours=red ====== # PORTS regexp=((?:\d{1,3}\.){3}\d{1,3}):(\d+) colours=default,blue,bold blue ====== # Error Line regexp=^error\s(?:\w+\s)+([a-z\-_0-9]+):(.*)$ colours=red,yellow,bold red grc-1.11.3/colourfiles/conf.dockerimages000066400000000000000000000025141327135134700202120ustar00rootroot00000000000000# 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=dark cyan ===== # REPOSITORY (Image name) regexp=^(?:(\S+)\/)*(\S+)\s colours=default,yellow,bright_white ===== # images without name regexp=^.*$ colours=bold red ===== # images without tag regexp=\s+()\s+ colours=unchanged,bold red ===== # Size 'K' regexp=(?<=\s)\d+[.,]?\d*\s?(KB?|B) colours=green ====== # Size 'M', 2 digits regexp=(?<=\s)\d{1,2}[.,]?\d*\s?MB? colours=green ====== # Size 'M' 3+ digits regexp=(?<=\s)\d{3,4}[.,]?\d*\s?MB? colours=yellow ====== # Size 'G' 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 ====== # 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 grc-1.11.3/colourfiles/conf.dockerinfo000066400000000000000000000005621327135134700177010ustar00rootroot00000000000000# Main Nodes regexp=^(\S[^:]+):\s?(.*)?$ colours=default,cyan ====== # Sub Nodes regexp=^\s([^:]+):\s?(.*)?$ colours=default,magenta ====== # Warning regexp=WARNING:\s(.+)$ colours=bold yellow, yellow ====== # devicemapper regexp=devicemapper$ colours=bright_red - # loop-lvm regexp=: (/var/lib/docker/devicemapper/devicemapper/(?:meta)?data) colours=default,bright_red grc-1.11.3/colourfiles/conf.dockernetwork000066400000000000000000000007231327135134700204360ustar00rootroot00000000000000# HEADERS regexp=(?:\s|^)(NETWORK ID|NAME|DRIVER|SCOPE)(?:\s|$) colours=default,underline - # Line regexp=^(?!NETWORK)(\S+)\s+(\S+) colours=unchanged,bright_black,bright_blue - # Driver BRIDGE regexp=^\S+\s+\S+\s+(bridge) colours=unchanged,bright_cyan - # Driver HOST regexp=^\S+\s+\S+\s+(host) colours=unchanged,cyan - # Driver OVERLAY regexp=^\S+\s+\S+\s+(overlay) colours=unchanged,magenta - # Driver NULL regexp=^\S+\s+\S+\s+(null) colours=unchanged,on_red white grc-1.11.3/colourfiles/conf.dockerps000066400000000000000000000021531327135134700173660ustar00rootroot00000000000000# HEADERS regexp=(?:\s|^)(CONTAINER ID|IMAGE|COMMAND|CREATED|STATUS|PORTS|NAMES)(?:\s|$) colours=default,underline ====== # 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,(,)]+)+)? colours=bold green ====== # 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 / Ports regexp=(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(\:)?(\d{1,5}))?(?:->)?(\d{1,5}(\/)\w+) colours=default,blue,default,bright_green,bright_blue,default ====== # NAMES regexp=(?:([a-z\-_0-9]+)\/)*([a-z\-_0-9]+)$ colours=default,yellow,on_blue white grc-1.11.3/colourfiles/conf.dockerpull000066400000000000000000000013221327135134700177150ustar00rootroot00000000000000# Header regexp=Using default tag: (\w+) colours=default,bold yellow ====== # Image regexp=Pulling from ([^\s]+) colours=default,bold green ====== # HASH regexp=^\w{12}: colours=default ====== # 1_Pulling fs layer regexp=Pulling fs layer colours=yellow ====== # 2_Waiting regexp=Waiting colours=bright_yellow ====== # 3_Verifying Checksum regexp=Verifying Checksum colours=bold yellow ====== # 4_Download complete regexp=Download complete colours=green ====== # 5_Pull Complete regexp=Pull complete colours=bold green ====== # Already exists regexp=Already exists colours=blue ====== # Status Updated regexp=Image is up to date colours=bold green ====== # Status Downloaded regexp=Downloaded newer image colours=bold blue grc-1.11.3/colourfiles/conf.dockersearch000066400000000000000000000006261327135134700202140ustar00rootroot00000000000000# NAMES regexp=^(?:([a-z\-_0-9]+)\/)*(\S+)\s(?!DESCRIPTION) colours=default,yellow,bold yellow - # Title regexp=^NAME.* colours=default - # Oficial regexp=\[OK\](?!$) colours=bold green - # Automated regexp=\[OK\]$ colours=magenta - # 1 digit Star regexp=\s{3,}(\d)\s{3,} colours=red - # 2 digits Stars regexp=\s{3,}(\d{2})\s{3,} colours=yellow - # 3 digits Stars regexp=\s{3,}(\d{3,})\s{3,} colours=green grc-1.11.3/colourfiles/conf.dockerversion000066400000000000000000000002571327135134700204340ustar00rootroot00000000000000# Values regexp=^\s([^:]+):(.+)$ colours=default,cyan ====== # Client regexp=^(Client): colours=default,bold cyan ====== # Server regexp=^(Server): colours=default,bold green grc-1.11.3/colourfiles/conf.du000066400000000000000000000006651327135134700161720ustar00rootroot00000000000000# Cannot read STDERR, not working regexp=^du.* colours=red ====== # Path regexp=\s+[\.\/]+([\w\s\-\_\.]+)(\/.*)?$ colours=default,bold blue,blue ====== # Size 'K' regexp=^\d*[.,]?\dKi?\s colours=green ====== # Size 'M' regexp=^\d*[.,]?\dMi?\s colours=yellow ====== # Size 'G' regexp=^\d*[.,]?\dGi?\s colours=red ====== # Size 'T' regexp=^\d*[.,]?\dTi?\s colours=bold red ====== # Total regexp=(.*)\s+(total)$ colours=bold yellow on_blue grc-1.11.3/colourfiles/conf.env000066400000000000000000000001011327135134700163330ustar00rootroot00000000000000# Main regexp=^([^=]+)(=)(.*)$ colours=default,cyan,white,yellow grc-1.11.3/colourfiles/conf.esperanto000066400000000000000000000014161327135134700175550ustar00rootroot00000000000000# cxi tia dosiero estas treege nekompleta kaj nur mallonga ekzemplo # kial skribi regulojn por kolorigo de tekstoj # # substantivoj regexp=(?i)\b\w+(?=(o|oj|on|ojn)\b) colours=green %%%%%%% # sufiksoj de substantivoj regexp=(?i)o(|j|n|jn)\b colours=yellow %%%%%%% # verboj regexp=\b\w+(?=(?i)i|as|is|os|u)\b colours=magenta %%%%%%% # sufiksoj de verboj regexp=(?i)(i|as|is|os|u)\b colours=yellow %%%%%%% # adverboj regexp=(?i)\b\w+(?=e\b) colours=bold magenta %%%%%%% # sufiksoj de adverboj regexp=(?i)(e|aux)\b colours=yellow %%%%%%% # adjektivoj regexp=(?i)\b\w+(?=(a|aj|an|ajn)\b) colours=blue %%%%%%% # sufiksoj de adjektivoj regexp=(?i)a(j|n|jn)\b colours=yellow %%%%%%% # kelkaj kurtaj vortoj regexp=(?i)\b(de|en|kun|sen|la|pli|plej|plu)\b colours=bold yellow grc-1.11.3/colourfiles/conf.fdisk000066400000000000000000000010451327135134700166530ustar00rootroot00000000000000# Error regexp=fdisk: cannot open ([^:]+).*$ colours=red, bold red - # Disk regexp=^(Disk) (?:\/([^\/: ]+))+ colours=yellow,on_yellow black,bold yellow - # Boot? regexp=\*\s\s\s colours=on_red bold white - # Partitions regexp=^(?:\/([^\/: ]+))+ colours=green,bold green - # Type regexp=type: (.*)$ colours=unchanged,bold cyan - # ID regexp=identifier: (.*)$ colours=unchanged, cyan - # Size 'K' regexp=\s\d*[.,]?\d*\s?Ki?B? colours=green - # Size 'M' regexp=\s\d*[.,]?\d*\s?Mi?B? colours=yellow - # Size 'G' regexp=\s\d+[.,]?\d*\s?Gi?B? colours=red grc-1.11.3/colourfiles/conf.findmnt000066400000000000000000000007001327135134700172070ustar00rootroot00000000000000# Devices regexp=\s\/dev(?:\/([^\/ ]+))+ colours=green, bold green - # Mount Path regexp=(?<=─|-)(?:\/([^\/ ]+))+ colours=unchanged,bold yellow - # RW regexp=(?:\s)rw colours=bold red - # RO regexp=(?:\s)ro colours=bold green - # Like comment, leave at end always regexp=^.*(?=cgroup|tmpfs).*$ colours=bright_black - # Common Types regexp=\b(ext\d|xfs|btrfs|nfs)\b colours=cyan - # MS Types regexp=\b(fat|vfat|ntfs|msdos)\b colours=on_cyan white grc-1.11.3/colourfiles/conf.free000066400000000000000000000005431327135134700164760ustar00rootroot00000000000000# Size 'K' regexp=\s\d*[.,]?\dKi? colours=green ====== # Size 'M' regexp=\s\d*[.,]?\dMi? colours=yellow ====== # Size 'G' regexp=\s\d*[.,]?\dGi? colours=red ====== # Size 'T' regexp=\s\d*[.,]?\dTi? colours=bold red ====== # Mem regexp=^Mem colours=bold cyan ====== # Swap regexp=^Swap colours=bold magenta ====== # Zero regexp=\s+0\w?(\s|$) colours=green grc-1.11.3/colourfiles/conf.gcc000066400000000000000000000014451327135134700163130ustar00rootroot00000000000000# regexp=\b(g?cc|[gc]\+\+|g?as|ld)\b colours=white bold count=once ......... # regexp=^[^:\s]*?:\d+: colours=bold magenta ......... regexp=^[^:\s]*?: colours=cyan count=once ......... # regexp=\`[A-Za-z0-9_():&*]+( const)?\' colours=magenta ......... # compilation method modifiers regexp=\s\-(O\d?|f\S+|pthread|g\S*|c|W\S,\S+)\b colours=yellow ......... # -O regexp=\-O\d colours=green ......... # -o regexp=\-o\s[^\s]+ colours=yellow ......... # warning and error won't work, unless you redirect also # stderr to grcat # # warning regexp=[Ww]arning[:\b] colours=white ......... regexp=warning: colours=bold yellow count=once ......... # error regexp=[Ee]rror[:\b] colours=bold white ......... regexp=error: colours=bold white on_red count=once ......... #note regexp=note: colours=bold cyan count=once grc-1.11.3/colourfiles/conf.getfacl000066400000000000000000000011121327135134700171530ustar00rootroot00000000000000# Header file regexp=^\#\sfile:\s(\S+) colours=cyan,bold - # Header owner regexp=^\#\sowner:\s(\S+) colours=cyan,bold green - # Header group regexp=^\#\sgroup:\s(\S+) colours=cyan,bold yellow - # user regexp=(?:^|:)user:([^:]+)?:(\S+) colours=green,on_green black,bright_green - # group regexp=(?:^|:)group:([^:]+)?:(\S+) colours=yellow,on_yellow black,bright_yellow - # other regexp=(?:^|:)other:([^:]+)?:(\S+) colours=red,on_red black,bright_red - # mask regexp=(?:^|:)mask:([^:]+)?:(\S+) colours=blue,on_blue black,bright_blue - # default: regexp=^default colours=on_blue bold white grc-1.11.3/colourfiles/conf.getsebool000066400000000000000000000002601327135134700175340ustar00rootroot00000000000000# Name regexp=^\S+ colours=default - # State regexp=--> colours=yellow - # State regexp=\s(off) colours=default,bright_red - # State regexp=\s(on) colours=default,bright_green grc-1.11.3/colourfiles/conf.id000066400000000000000000000003551327135134700161520ustar00rootroot00000000000000# Groups regexp=(\d+)\((\w+)\) colours=unchanged,yellow,bold yellow - # User regexp=uid.(\d+)\((\w+)\) colours=unchanged,green,bold green - # SELinux regexp=(\w+_u):(\w+_r):(\w+_t):([\w\-.:]+) colours=unchanged,green,yellow,cyan,magenta grc-1.11.3/colourfiles/conf.ifconfig000066400000000000000000000014651327135134700173450ustar00rootroot00000000000000 # 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 ======= #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 grc-1.11.3/colourfiles/conf.iostat_sar000066400000000000000000000010561327135134700177250ustar00rootroot00000000000000# Devices regexp=^[\w\d-]+\s{2,}(?!%) colours=bright_green - # Averages Title regexp=\s+(%user)\s+(%nice)\s+(%system)\s+(%iowait)\s+(%steal)\s+(%idle) colours=default,blue,cyan,magenta,bright_magenta,red,green - # Averages Numbers regexp=\s+(\d+\.\d+)\s+(\d+\.\d+)\s+(\d+\.\d+)\s+(\d+\.\d+)\s+(\d+\.\d+)\s+(\d+\.\d+) colours=default,blue,cyan,magenta,bright_magenta,red,green - # Averages last line regexp=^Average:.*$ colours=reverse - # High rates (4 digits) regexp=\s\d{4}\.\d+ colours=red - # High rates (5+ digits) regexp=\s\d{5,}\.\d+ colours=bold red grc-1.11.3/colourfiles/conf.ip000066400000000000000000000007641327135134700161720ustar00rootroot00000000000000# IP4 regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} colours=bold yellow - # IP6 regexp=[0-9a-fA-F]{0,4}(\:\:?[0-9a-fA-F]{0,4})+?(\/\d{1,3}) colours=yellow - # MAC regexp=(\d|[a-f]){2}(\:(\d|[a-f]){2}){5} colours=magenta - # parenthesis regexp=\(|\) colours=yellow - # dev wlan0 etc regexp=dev \w+ colours=yellow - # "default" regexp=default colours=on_blue - # ip range size regexp=/\d{1,2} colours=red - # "linkdown" regexp=linkdown colours=bold red - # "src" regexp=src \S+ colours=on_magenta grc-1.11.3/colourfiles/conf.ipaddr000066400000000000000000000016741327135134700170260ustar00rootroot00000000000000# IP4 regexp=inet\s([^\/]+)\/(\d+) colours=default,bold yellow,bold magenta ===== # broadcast regexp=brd\s([^}s]+) colours=default,dark ===== # IP6 regexp=inet6\s([^\/]+)\/(\d+) colours=default,yellow,magenta ===== # MAC regexp=link\/ether\s(\S+)\s colours=default,magenta ===== # State UP regexp=(\d+):\s(\S+):.+state (UP) colours=default,bright_white,bold green,bold green ===== # State DOWN regexp=(\d+):\s(\S+):.+state (DOWN) colours=default,bright_white,bold red,bold red ===== # State UNKNOWN regexp=(\d+):\s(\S+):.+state (UNKNOWN) colours=default,bright_white,bold cyan,cyan ===== # State DORMANT regexp=(\d+):\s(\S+):.+state (DORMANT) colours=default,bright_white,bold cyan,cyan ===== # < > regexp=\s<([^>]+)> colours=default,cyan ===== # Master dev regexp=\smaster\s(\S+)\s colours=default,on_blue white ===== # on regexp=\son\s colours=green ===== # off regexp=\soff\s colours=dark red ===== # link/none regexp=link\/(none) colours=unchanged,red grc-1.11.3/colourfiles/conf.ipneighbor000066400000000000000000000006031327135134700177000ustar00rootroot00000000000000# STATUS - STALE regexp=^(\S+)\s.*(STALE)$ colours=default,bright_red,bold red - # STATUS - FAILED regexp=^(\S+)\s.*(FAILED)$ colours=default,bright_magenta,bold magenta - # Status - REACHABLE regexp=^(\S+)\s.*(REACHABLE)$ colours=default,bright_green,green - # Status - DELAY regexp=^(\S+)\s.*(DELAY)$ colours=default,bright_yellow,yellow - # DEV regexp=dev\s(\S+) colours=default,cyan grc-1.11.3/colourfiles/conf.iproute000066400000000000000000000007351327135134700172470ustar00rootroot00000000000000# DEV regexp=dev\s(\S+) colours=default,cyan ===== # Gateway regexp=(via)\s(\S+)\s colours=default,yellow,bold yellow ===== # Network regexp=^(default|[^ \/]+(\/(\d+))?) colours=green,bright_green,default,green ===== # Network DEFAULT regexp=^default colours=on_green bold white ===== # Local regexp=(src)\s(\S+)\s? colours=default,magenta,bold magenta ===== # proto regexp=(proto)\s(\S+)\s colours=default,default,dark yellow ===== # linkdown regexp=linkdown colours=bold red grc-1.11.3/colourfiles/conf.iptables000066400000000000000000000027531327135134700173650ustar00rootroot00000000000000# Chains Custom name regexp=^Chain\s(\S+)\s\(.*$ colours=white, bold bright_blue - # Chains FILTER table regexp=^Chain\s(INPUT|OUTPUT|FORWARD)\s colours=unchanged, bold yellow - # Chains NAT|MANGLE table regexp=^Chain\s(PREROUTING|POSTROUTING|INPUT|OUTPUT)\s colours=unchanged, bold yellow - # 2row Title regexp=(pkts|target|num).* colours=bold black - # JUMP Destiny ---------------------------------------------------------------- regexp=ACCEPT colours=bright_green - regexp=DROP colours=bright_red - regexp=REJECT colours=red - regexp=QUEUE colours=on_red white - regexp=RETURN colours=on_green white - regexp=MASQUERADE colours=bright_magenta - regexp=(LOG|ULOG) colours=bright_cyan - regexp=DNAT colours=magenta - regexp=SNAT colours=dark magenta # ------------------------------------------------------------------------------ - # tcp regexp=\stcp\s colours=bold cyan - # udp regexp=\sudp\s colours=bold magenta - # icmp regexp=\sicmp\s colours=cyan - # all regexp=\sall\s colours=red - # dpt regexp=\sdpts?:([^\s]*)(\s|$) colours=default,bold yellow - # Goto regexp=\s(\[goto\]) colours=default,on_blue bold white - # masq ports regexp=\smasq ports:\s(\d+)-?(\d+)? colours=default,bold yellow,bold yellow - # ctstate regexp=ctstate\s(\S+) colours=default,blue - # IP regexp=(!)?((?:\d{1,3}\.){3}(?:\d{1,3}))(?:\/|:)?(\d+)? colours=default,red,bright_white,magenta - # anywhere regexp=\s(anywhere|0.0.0.0/0)\s colours=bright_black - # (Num references) regexp=\((\d+) references\) colours=default,bright_green grc-1.11.3/colourfiles/conf.irclog000066400000000000000000000007141327135134700170340ustar00rootroot00000000000000# ip number regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} colours=magenta ======= # *** regexp=\*\*\* colours=bold green ======= # +++ regexp=\+\+\+ colours=green ======= # mail address regexp=\S+\@[\w\-\.]+ colours=bold yellow ======= # Signoff regexp=Signoff colours=bold red ======= # Signon regexp=Signon colours=bold green ======= # everything in parentheses regexp=\(.+?\) colours=green count=more ======= # channel name regexp=\#[\w\-\.]+ colours=bold blue grc-1.11.3/colourfiles/conf.iwconfig000066400000000000000000000021551327135134700173630ustar00rootroot00000000000000# 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 ======= #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 grc-1.11.3/colourfiles/conf.jobs000066400000000000000000000002211327135134700165030ustar00rootroot00000000000000# BASH regexp=\[(\d+)\](.) +(\d+)?\s? colour=unchanged, cyan, yellow, magenta - regexp=Running.* colour=bold green - regexp=Stopped.* colour=red grc-1.11.3/colourfiles/conf.last000066400000000000000000000015721327135134700165230ustar00rootroot00000000000000# DateTime regexp=\s(\w{3})\s(\w{3})\s+(\d{1,2})\s(\d+:\d+)\s colours=default,default,default,default,cyan ===== # DateTime end regexp=\s-\s(\d+:\d+) colours=default,magenta ===== # DateTime - down regexp=\s-\s(down) colours=default, red ===== # DateTime - crash regexp=\s-\s(crash) colours=default, on_red white ===== # still logged in regexp=still logged in colours=on_cyan bold white ===== # still running regexp=still running colours=bright_green ===== # Time regexp=\((\d+\+)?(\d+):(\d+)\) colours=default,bright_red,yellow,green ===== # pts regexp=\s(pts[\S]+) colours=default,green ===== # tty regexp=\s(tty\d) colours=default,blue ===== # reboot regexp=^reboot\s+system boot colours=red ===== # Third column IP regexp=(?:\s|\()(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?:\s|\)) colours=default,bold red ===== # Third column local regexp=(?:\s|\()(\:0)(?:\s|\)) colours=default,dark cyan grc-1.11.3/colourfiles/conf.ldap000066400000000000000000000003521327135134700164730ustar00rootroot00000000000000# Intended for colouring LDIF output (from ldap tools) # comments regexp=^#.* colours=green count=stop - # meta regexp=^(version|search|result): colours=red count=stop - # "attribute: value" pairs regexp=^.*?: colours=blue count=stop grc-1.11.3/colourfiles/conf.log000066400000000000000000000017401327135134700163360ustar00rootroot00000000000000# this configuration file is suitable for displaying kernel log files # example of text substitution #regexp=\bda?emon #replace=angel #colours=red #====== # example of text substitution #regexp=(\d\d):(\d\d):(\d\d) #replace=\1h\2m\3s #====== # display this line in yellow and stop further processing 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) colours=green, green, red count=once ====== # everything in parentheses regexp=\(.+?\) colours=green count=more ====== # everything in `' regexp=\`.+?\' colours=bold yellow count=more ====== # this is probably a pathname regexp=/[\w/\.]+ colours=bold green count=more ====== # name of process and pid 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 count=more ====== # connect requires special attention regexp=connect colours=on_red count=more grc-1.11.3/colourfiles/conf.lolcat000066400000000000000000000001541327135134700170310ustar00rootroot00000000000000#Message regexp=([^\w\d]+) colours=unchanged ====== regexp=([a-zA-Z0-9]+) colours=default,green,yellow,red grc-1.11.3/colourfiles/conf.ls000066400000000000000000000047431327135134700162010ustar00rootroot00000000000000# The following matches file sizes as produced by ls -l or ls -lh # The output produced by ls -s is probably not specific # enough to be reliably matched, especially considering ls -s(k|m|g|G). # # 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+)?[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) colours=yellow ======= # size: 100M <= size < 1G 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) colours=bold red ======= # device major minor numbers regexp=\s(\d+),\s+(\d+)\s colours=default,bright_yellow ,yellow ======= # 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 ======= # root regexp=\s(root|wheel)(?=\s|$) colours=unchanged,bold white on_red ======= # SELinux regexp=(\w+_u):(\w+_r):(\w+_t):(\w\d) colours=default,green,yellow,cyan,magenta - # -rwxrwxrwx ============================ # File Type regexp=(-|([bcCdDlMnpPs?]))(?=[-r][-w][-xsStT][-r][-w][-xsStT][-r][-w][-xsStT]) colours=unchanged,unchanged,bold white - # owner rwx regexp=(?<=[-bcCdDlMnpPs?])(-|(r))(-|(w))(-|([xsStT]))(?=[-r][-w][-xsStT][-r][-w][-xsStT]) colours=unchanged,unchanged,bright_green,unchanged,bright_green,unchanged,bright_green - # group rwx regexp=(?<=[-bcCdDlMnpPs?][-r][-w][-xsStT])(-|(r))(-|(w))(-|([xsStT]))(?=[-r][-w][-xsStT]) colours=unchanged,unchanged,yellow,unchanged,yellow,unchanged,yellow - # other rwx regexp=(?<=[-bcCdDlMnpPs?][-r][-w][-xsStT][-r][-w][-xsStT])(-|(r))(-|(w))(-|([xsStT])) colours=unchanged,unchanged,bright_red,unchanged,bright_red,unchanged,bright_red - # sStT all regexp=(?<=[-bcCdDlMnpPs?])[-r][-w]([sStT])[-r][-w]([sStT])[-r][-w]([sStT]) colours=unchanged,bold green,bold yellow, bold red - # ACL regexp=^\S{10}(\+) colours=unchanged,on_cyan bold white grc-1.11.3/colourfiles/conf.lsattr000066400000000000000000000004561327135134700170710ustar00rootroot00000000000000# Normal regexp=[aAcCdDeijsStTu] colours=cyan - # User Namespace regexp=[iadA] colours=bright_green - # Read Only regexp=[EhINXZ] colours=bold red - # Separators regexp=[\-] colours=dark - # Error regexp=(lsattr:) \w.* colours=default, bold red - # Filename regexp=(\/[-\w\d. ]+)+$ colours=yellow,bold grc-1.11.3/colourfiles/conf.lsblk000066400000000000000000000017351327135134700166700ustar00rootroot00000000000000# Main HD regexp=^[a-z]+\d?\s colours=bold white ====== # Partition regexp=([├└─│]+|[\|\`\-]+)(\S+) colours=bright_green ====== # Partition - LVM regexp=\s+([├└─│]+|[\|\`\-]+)(\S+) colours=default,default,bright_cyan ====== # Type crypt regexp=(?<=\s)crypt\b colours=on_magenta white ====== # Type disk regexp=(?<=\s)disk\b colours=magenta ====== # Type lvm regexp=(?<=\s)lvm\b colours=bold cyan ====== # Type part regexp=(?<=\s)part\b colours=cyan ====== # Type loop regexp=(?<=\s)loop\b colours=bright_red ====== # Size 'K' regexp=\s\d*[.,]?\dKi?\s colours=green ====== # Size 'M' regexp=\s\d*[.,]?\dMi?\s colours=yellow ====== # Size 'G' regexp=\s\d*[.,]?\dGi?\s colours=red ====== # Size 'T' regexp=\s\d*[.,]?\dTi?\s colours=bold red ====== # 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 grc-1.11.3/colourfiles/conf.lsmod000066400000000000000000000001151327135134700166660ustar00rootroot00000000000000# Main regexp=(\S+)\s+(\d+)\s+(\d+) colours=default,bright_green,cyan,yellow grc-1.11.3/colourfiles/conf.lsof000066400000000000000000000004301327135134700165130ustar00rootroot00000000000000# device major minor numbers regexp=\s(\d+),(\d+)\s colours=unchanged,bright_yellow ,yellow - # root regexp=\broot\b colours=bold white on_red - # PID regexp=^(\S+)\s+(\d+)\s colours=unchanged,bold cyan,cyan - # PATH regexp=\s\/.*\/(\S+)($| \(.*\)) colours=green,bright_green,red grc-1.11.3/colourfiles/conf.lspci000066400000000000000000000004431327135134700166660ustar00rootroot00000000000000# Address regexp=^(..):(..).(.) colours=default,bright_green,bright_yellow,red - # Ethernet regexp=(Ethernet controller|Network controller) colours=cyan - # Wireless regexp=Wireless colours=bright_cyan - # SATA regexp=SATA controller colours=green - # Audio regexp=Audio device colours=blue grc-1.11.3/colourfiles/conf.mount000066400000000000000000000007201327135134700167140ustar00rootroot00000000000000# Intended for colouring 'mount' output # written by Emanuele Aina regexp=^(.*) on (.*) type (.*) \((.*)\) colours=default,green,yellow,blue,magenta - # 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 grc-1.11.3/colourfiles/conf.mtr000066400000000000000000000006501327135134700163560ustar00rootroot00000000000000#ip address regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} colours=green ======= # 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=\?\?\? colours=red ======= # Packets/Pings regexp=(Packets|Pings) colours=bold green grc-1.11.3/colourfiles/conf.mvn000066400000000000000000000033241327135134700163550ustar00rootroot00000000000000# mvn grc colorizer configuration # [INFO] regexp=^\[INFO\] colours=bold count=more ============== # [WARNING] regexp=^\[WARNING\] colours=bold yellow count=more ============== # [ERROR] regexp=^\[ERROR\] colours=bold red count=more ============== # BUILD FAILURE regexp=BUILD FAILURE colours=bold red count=more ============== # [debug] regexp=^\[debug\] colours=magenta count=more ============== # lines [INFO] ---- regexp=\s[-]{6,} colours=red count=more ============== # lines ^---- regexp=^[-]{6,} colours=yellow count=more ============== # lines T E S T S regexp=^ T E S T S colours=yellow count=more ============== # lines ^Tests run: regexp=^Tests run: ([\d]+) colours=yellow,green count=more ============== # lines ^Tests run: Failures/Errors/Skipped regexp=(Failures|Errors|Skipped):\s([\d]+) colours=none,yellow,bold red count=more ============== # lines ^Tests run: Failures/Errors/Skipped regexp=(Failures|Errors|Skipped):\s(0)\D? colours=none,yellow,green count=more ============== # summary regexp=\s(Total time: )(.*)$ colours=none,none,bold yellow count=more ============== # summary regexp=\s(Finished at: )(.*)$ colours=none,none,bold yellow count=more ============== # BUILD SUCCESSFUL regexp=\s(BUILD SUCCESSFUL) colours=none,green bold count=more ============== # Building projectName regexp=^(\[INFO\])( Building )(.*)$ colours=none,bold,none,white bold count=more ============== # reactor summary regexp=([.]{3,} )(SUCCESS)( \[)([^\]]*)(]) colours=none,none,green,none,yellow,none count=more ============== # reactor summary regexp=([.]{3,} )(FAILURE)( \[)([^\]]*)(]) colours=none,none,red,none,red,none count=more ============== # reactor summary regexp=([.]{3,} )(SKIPPED) colours=none,none,yellow bold,none count=more grc-1.11.3/colourfiles/conf.netstat000066400000000000000000000022341327135134700172360ustar00rootroot00000000000000# ip number regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} colours=magenta ======= # 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, blue, bold yellow ======= # ipx hostname regexp=^IPX.*[\dABCDEF]+:[\dABCDEF]+ colours=green ======= # protocols regexp=(^tcp6?|^udp6?|^unix|^IPX|STREAM|DGRAM) colours=bold blue ======= # 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=UNKNOWN colours=blink bold red ======= # status regexp=\[.*\] colours=green ======= # path regexp=(\@)[\dabcdef]+ colours=green, bold green grc-1.11.3/colourfiles/conf.nmap000066400000000000000000000013211327135134700165030ustar00rootroot00000000000000# Scan Title regexp=Nmap scan report for (\S+)\s\(([^\)]+)\) colours=default,bold green, bold magenta - # up regexp=Host is (up) colours=default, bold green - # Failed to resolve regexp=Failed\sto\sresolve\s\"(\S+)\" colours=red,bold red - # Closed ports regexp=Not shown: (\d+)\s(closed|filtered)\sports colours=default,bright_red,red - # Titles regexp=^PORT.*$|^HOP.* colours=bold - # Ports regexp=^(\d+)\/(\w+)\s+(\w+)\s+(\S+) colours=default,bold green,magenta,cyan,bold yellow - # Ports Details regexp=^\|_?(.*) colours=bold green,default - # Trace regexp=^\d+\s+(\d+\.\d+\sms)[^0-9]*(\d+\.\d+\.\d+\.\d+) colours=default,green,magenta - # Network Distance: regexp=Network Distance:\s(\d+) colours=default,bold green grc-1.11.3/colourfiles/conf.ntpdate000066400000000000000000000002331327135134700172100ustar00rootroot00000000000000# time offset regexp=offset\s([0-9\.,\-]+\ssec) colours=unchanged,bold green ====== # server ip regexp=server\s([0-9a-fA-F\.:]+) colours=unchanged,yellow grc-1.11.3/colourfiles/conf.php000066400000000000000000000024341327135134700163450ustar00rootroot00000000000000# this configuration file is suitable for displaying php error log files regexp=\] PHP [^\s]+ error: colours=on_red count=once ====== regexp=\] PHP Notice: colours=on_yellow black count=once ====== regexp=\] PHP Warning: colours=on_cyan count=once ====== regexp=(PHP )?Stack trace: colours=on_green count=once ====== regexp=] PHP [ \d]{2}\d\. colours=on_green count=once ====== # display this line in yellow and stop further processing 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) colours=green, green, red count=once ====== # everything in parentheses regexp=\(.+?\) colours=green count=more ====== # everything in `' regexp=\`.+?\' colours=bold yellow count=more ====== # this is probably a pathname regexp=/[\w/\.]+ colours=bold green count=more ====== # name of process and pid 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 count=more ====== # connect requires special attention regexp=connect colours=on_red count=more ====== regexp=not found or unable to stat colours=black count=block ====== regexp=File does not exist colours=italic black count=block ====== regexp=^\[ colours=default count=unblock grc-1.11.3/colourfiles/conf.ping000066400000000000000000000021421327135134700165070ustar00rootroot00000000000000# 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 ======= # 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=green,bold green ======= # DUP regexp=DUP\! colours=red ======= # OK regexp=0% packet loss colours=green ======= # Errors regexp=(Destination Host Unreachable|100% packet loss) colours=red ======= # unknown host regexp=.+unknown\shost\s(.+) colours=red,bold red - # statistics header regexp=--- (\S+) ping statistics --- colours=bold, bold blue - # last line 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\.]+)\/([0-9\.]+)\/([0-9\.]+)\/([0-9\.]+) colours=default,bright_yellow,bright_blue,bright_red,bright_magenta - # these are good for nping regexp=SENT|RCVD colours=red - # nping regexp=unreachable colours=red grc-1.11.3/colourfiles/conf.ping2000066400000000000000000000010121327135134700165640ustar00rootroot00000000000000# ip number regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} colours=magenta ======= # ipv6 number regexp=(([0-9a-fA-F]{1,4})?\:\:?[0-9a-fA-F]{1,4})+ colours=magenta ======= # time regexp=\d+\.\d+\sms colours=green ======= # time regexp=\d+\sms colours=green ====== # time regexp=time= colours=yellow ======= # DUP regexp=DUP\! colours=red ======= # (,) regexp=\(|\) colours=yellow ======= # unknown host regexp=.+unknown\shost\s(.+) colours=red,bold red ======= regexp=.*icmp_seq=(\d+) timeout replace=TIMEOUT \1 colours=red grc-1.11.3/colourfiles/conf.proftpd000066400000000000000000000011001327135134700172210ustar00rootroot00000000000000# this configuration file is suitable for displaying proftpd log files # submitted by Pavol Domin # everything in brakets regexp=\[.+?\] colours=cyan count=more ====== # everything in "" regexp=\".+?\" colours=green count=more ====== # ip number regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} colours=bold magenta count=more ====== # STOR regexp=STOR colours=bold red on_white count=more ====== # RETR regexp=RETR colours=black on_white count=more == # first tree fields separated by space regexp=^([\w\.]+?\s)([\w\.]+?\s)([\w\.]+?\s) colours=bold blue, bold yellow, bold magenta grc-1.11.3/colourfiles/conf.ps000066400000000000000000000031051327135134700161740ustar00rootroot00000000000000# /full/path regexp=(\s|^)/[-\w\d.]+/[-\w\d./]+ colours=bold white ======= # CAPS LINE regexp=^[A-Z\s%]*([A-Z]{3})[A-Z\s%]*$ colours=underline ======= # Capd Line regexp=^([A-Z][-a-z0-9]+(\s+|$)){3,}$ colours=underline ======= # VMSTAT regexp=(\s|^)\d+([.,]\d+)?(?=[\s,]|$) colours=bright_green ======= # PID regexp=^[a-zA-Z]+\w+\s+(\d+)|^\d\s+\w\s+(?:\w+\s+)?(\d+)|^\s*(\d+) colours=unchanged,bold magenta,bold magenta,bold magenta ======= # n.n.n regexp=(\s|^)\d+\.\d+\.\d+(?=[\s,]|$) colours=bold cyan ======= # text: regexp=^([-a-z0-9]+):\s colours=unchanged,yellow ======= # -options regexp=(?<=\s)-[\w\d]+(?=\s|$) colours=yellow ======= # --long-option= # legacy: regexp=(?<=\s)--[-\w\d]+[\w\d](?==|\s|$)(=?) regexp=(?<=\s)--[-\w\d]+[\w\d](?==|\s|$)(=|\s)?(?!--)([^\s]*) colours=cyan,white,underline cyan ======= # [text] regexp=\[[-\w\d:/]+\] colours=cyan ======= # root regexp=root|wheel(?=\s|$) colours=bold red ======= # pts regexp=(\s|^)pts/\d+(?=[^\w\d]|$) colours=bright_yellow ======= # tty regexp=(\s|^)tty\d+(?=[^\w\d]|$) colours=bright_cyan ======= # Negative NICE (works only in -l) regexp=^\d\s+\w\s+\w+\s+\d+\s+\d+\s+\d\s+\d+\s+(-\d+) colours=unchanged,on_red bold white ======= # Neutral NICE (works only in -l) regexp=^\d\s+\w\s+\w+\s+\d+\s+\d+\s+\d\s+\d+\s+(\d+) colours=unchanged,cyan ======= # Positive NICE (works only in -l) regexp=^\d\s+\w\s+\w+\s+\d+\s+\d+\s+\d\s+\d+\s+(1\d) colours=unchanged,on_cyan bold white ======= # Process ZOMBIE regexp=^\d\s+([zZ])\s colours=unchanged,on_red bold white ======= # Process RS regexp=^\d\s+([sSrR])\s colours=unchanged,on_magenta black grc-1.11.3/colourfiles/conf.pv000066400000000000000000000001741327135134700162020ustar00rootroot00000000000000# size regexp=(\s|^)\d+([.,]\d+)?\s?([kKMG][bB]|[bB]|[kKMG])(?=[\s,]|$) colours=yellow ======= # regexp=<=> colours=yellow grc-1.11.3/colourfiles/conf.semanageboolean000066400000000000000000000003751327135134700207000ustar00rootroot00000000000000# Name regexp=^\S+ colours=white - # State regexp=\s\((off) colours=default,bright_red - # State regexp=\s\((on) colours=default,bright_green - # State regexp=\,\s+(off)\) colours=default,dark red - # State regexp=\,\s+(on)\) colours=default,dark green grc-1.11.3/colourfiles/conf.semanagefcontext000066400000000000000000000003501327135134700211040ustar00rootroot00000000000000# SELinux regexp=(\w+_u):(\w+_r):(\w+_t):(\w\d) colours=default,green,yellow,cyan,magenta - # Path regexp=\/\S+(\/\S+)\( colours=green,bright_green - # Almost universal regex regexp=\.\*|\[\^\/\]\*|\(\/\.\*\)\?|\?|\\\. colours=blue grc-1.11.3/colourfiles/conf.semanageuser000066400000000000000000000003311327135134700202270ustar00rootroot00000000000000# r regexp=\S+_r colours=yellow - # u regexp=\S+_u colours=green - # t regexp=\S+_t colours=cyan - # s regexp=s\d+ colours=magenta - # tcp for ports regexp=tcp colours=blue - # udp for ports regexp=udp colours=yellow grc-1.11.3/colourfiles/conf.sensors000066400000000000000000000003511327135134700172460ustar00rootroot00000000000000# Adapetr regexp=Adapter:\s(.*) colours=default, green ====== # High temperature regexp=.+:\s+(\+[67][0-9][^0-9]) colours=default, red ====== # Very high temperature regexp=.+:\s+(\+[89][0-9][0-9]?) colours=default, blink red ====== grc-1.11.3/colourfiles/conf.showmount000066400000000000000000000005271327135134700176220ustar00rootroot00000000000000# Path regexp=^(\/\S+) colours=green - # Path Last part regexp=\/(\w+)\s colours=unchanged,bright_green - # IP regexp=(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(\/\d+)?) colours=default,yellow,magenta - # ALL regexp=\* colours=bold red - # Options regexp=\(([\w,]+)\) colours=default,cyan - # Server regexp=for\s([^:]+):$ colours=default,bold yellow grc-1.11.3/colourfiles/conf.sql000066400000000000000000000120521327135134700163520ustar00rootroot00000000000000# this configuration file is for displaying sql scripts very nice to use with sqlformat aka sqlparser regexp=\w colours="\033[38;5;140m" count=more ====== regexp=\b(MIN|MAX|CASE|IF|ELSE|SUBDATE|NOW|ABORT|ABS|ABSOLUTE|ACCESS|ADA|ADD|ADMIN|AFTER|AGGREGATE|ALIAS|ALL|ALLOCATE|ANALYSE|ANALYZE|ANY|ARE|ASC|ASENSITIVE|ASSERTION|ASSIGNMENT|ASYMMETRIC|AT|ATOMIC|AUTHORIZATION|AVG|BACKWARD|BEFORE|BEGIN|BETWEEN|BITVAR|BIT_LENGTH|BOTH|BREADTH|CACHE|CALL|CALLED|CARDINALITY|CASCADE|CASCADED|CAST|CATALOG|CATALOG_NAME|CHAIN|CHARACTERISTICS|CHARACTER_LENGTH|CHARACTER_SET_CATALOG|CHARACTER_SET_NAME|CHARACTER_SET_SCHEMA|CHAR_LENGTH|CHECK|CHECKED|CHECKPOINT|CLASS|CLASS_ORIGIN|CLOB|CLOSE|CLUSTER|COALESCE|COBOL|COLLATE|COLLATION|COLLATION_CATALOG|COLLATION_NAME|COLLATION_SCHEMA|COLLECT|COLUMN|COLUMN_NAME|COMMAND_FUNCTION|COMMAND_FUNCTION_CODE|COMMENT|COMMIT|COMMITTED|COMPLETION|CONDITION_NUMBER|CONNECT|CONNECTION|CONNECTION_NAME|CONSTRAINT|CONSTRAINTS|CONSTRAINT_CATALOG|CONSTRAINT_NAME|CONSTRAINT_SCHEMA|CONSTRUCTOR|CONTAINS|CONTINUE|CONVERSION|CONVERT|COPY|CORRESPONTING|COUNT|CREATEDB|CREATEUSER|CROSS|CUBE|CURRENT|CURRENT_DATE|CURRENT_PATH|CURRENT_ROLE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|CURSOR_NAME|CYCLE|DATA|DATABASE|DATETIME_INTERVAL_CODE|DATETIME_INTERVAL_PRECISION|DAY|DEALLOCATE|DECLARE|DEFAULT|DEFAULTS|DEFERRABLE|DEFERRED|DEFINED|DEFINER|DELIMITER|DELIMITERS|DEREF|DESC|DESCRIBE|DESCRIPTOR|DESTROY|DESTRUCTOR|DETERMINISTIC|DIAGNOSTICS|DICTIONARY|DISCONNECT|DISPATCH|DO|DOMAIN|DYNAMIC|DYNAMIC_FUNCTION|DYNAMIC_FUNCTION_CODE|EACH|ENCODING|ENCRYPTED|END-EXEC|EQUALS|ESCAPE|EVERY|EXCEPT|EXCEPTION|EXCLUDING|EXCLUSIVE|EXEC|EXECUTE|EXISTING|EXISTS|EXTERNAL|EXTRACT|FALSE|FETCH|FINAL|FIRST|FORCE|FOREACH|FOREIGN|FORTRAN|FORWARD|FOUND|FREE|FREEZE|FULL|FUNCTION| 'G|GENERAL|GENERATED|GET|GLOBAL|GO|GOTO|GRANT|GRANTED|GROUPING|HANDLER|HAVING|HIERARCHY|HOLD|HOST|IDENTITY|IGNORE|ILIKE|IMMEDIATE|IMMUTABLE|IMPLEMENTATION|IMPLICIT|INCLUDING|INCREMENT|INDEX|INDITCATOR|INFIX|INHERITS|INITIALIZE|INITIALLY|INOUT|INPUT|INSENSITIVE|INSTANTIABLE|INSTEAD|INTERSECT|INTO|INVOKER|IS|ISNULL|ISOLATION|ITERATE|KEY|KEY_MEMBER|KEY_TYPE|LANCOMPILER|LANGUAGE|LARGE|LAST|LATERAL|LEADING|LENGTH|LESS|LEVEL|LIMIT|LISTEN|LOAD|LOCAL|LOCALTIME|LOCALTIMESTAMP|LOCATION|LOCATOR|LOCK|LOWER|MAP|MATCH|MAXVALUE|MESSAGE_LENGTH|MESSAGE_OCTET_LENGTH|MESSAGE_TEXT|METHOD|MINUTE|MINVALUE|MOD|MODE|MODIFIES|MODIFY|MONTH|MORE|MOVE|MUMPS|NAMES|NATIONAL|NATURAL|NCHAR|NCLOB|NEW|NEXT|NO|NOCREATEDB|NOCREATEUSER|NONE|NOT|NOTHING|NOTIFY|NOTNULL|NULL|NULLABLE|IFNULL|NULLIF|OBJECT|OCTET_LENGTH|OF|OFF|OFFSET|OIDS|OLD|ONLY|OPEN|OPERATION|OPERATOR|OPTION|OPTIONS|ORDINALITY|OUT|OUTPUT|OVERLAPS|OVERLAY|OVERRIDING|OWNER|PAD|PARAMETER|PARAMETERS|PARAMETER_MODE|PARAMATER_NAME|PARAMATER_ORDINAL_POSITION|PARAMETER_SPECIFIC_CATALOG|PARAMETER_SPECIFIC_NAME|PARAMATER_SPECIFIC_SCHEMA|PARTIAL|PASCAL|PENDANT|PLACING|PLI|POSITION|POSTFIX|PRECISION|PREFIX|PREORDER|PREPARE|PRESERVE|PRIMARY|PRIOR|PRIVILEGES|PROCEDURAL|PROCEDURE|PUBLIC|RAISE|READ|READS|RECHECK|RECURSIVE|REF|REFERENCES|REFERENCING|REINDEX|RELATIVE|RENAME|REPEATABLE|RESET|RESTART|RESTRICT|RESULT|RETURN|RETURNED_LENGTH|RETURNED_OCTET_LENGTH|RETURNED_SQLSTATE|RETURNS|REVOKE|RIGHT|ROLE|ROLLBACK|ROLLUP|ROUTINE|ROUTINE_CATALOG|ROUTINE_NAME|ROUTINE_SCHEMA|ROW|ROWS|ROW_COUNT|RULE|SAVE_POINT|SCALE|SCHEMA|SCHEMA_NAME|SCOPE|SCROLL|SEARCH|SECOND|SECURITY|SELF|SENSITIVE|SEQUENCE|SERIALIZABLE|SERVER_NAME|SESSION|SESSION_USER|SETOF|SETS|SHARE|SHOW|SIMILAR|SIMPLE|SIZE|SOME|SOURCE|SPACE|SPECIFIC|SPECIFICTYPE|SPECIFIC_NAME|SQL|SQLCODE|SQLERROR|SQLEXCEPTION|SQLSTATE|SQLWARNING|STABLE|START|STATE|STATEMENT|STATIC|STATISTICS|STDIN|STDOUT|STORAGE|STRICT|STRUCTURE|STYPE|SUBCLASS_ORIGIN|SUBLIST|SUBSTRING|SUM|SYMMETRIC|SYSID|SYSTEM|SYSTEM_USER|TABLE|TABLE_NAME|TEMP|TEMPLATE|TEMPORARY|TERMINATE|THAN|TIMESTAMP|TIMEZONE_HOUR|TIMEZONE_MINUTE|TO|TOAST|TRAILING|TRANSATION|TRANSACTIONS_COMMITTED|TRANSACTIONS_ROLLED_BACK|TRANSATION_ACTIVE|TRANSFORM|TRANSFORMS|TRANSLATE|TRANSLATION|TREAT|TRIGGER|TRIGGER_CATALOG|TRIGGER_NAME|TRIGGER_SCHEMA|TRIM|TRUE|TRUNCATE|TRUSTED|TYPE|UNCOMMITTED|UNDER|UNENCRYPTED|UNION|UNIQUE|UNKNOWN|UNLISTEN|UNNAMED|UNNEST|UNTIL|UPPER|USAGE|USE|USER|USER_DEFINED_TYPE_CATALOG|USER_DEFINED_TYPE_NAME|USER_DEFINED_TYPE_SCHEMA|USING|VACUUM|VALID|VALIDATOR|VALUES|VARIABLE|VERBOSE|VERSION|VIEW|VOLATILE|WHENEVER|WITH|WITHOUT|WORK|WRITE|YEAR|ZONE)\b colours="\033[38;5;11m" count=more ====== regexp=\b(ARRAY|BIGINT|BINARY|BIT|BLOB|BOOLEAN|CHAR|CHARACTER|DATE|DEC|DECIMAL|FLOAT|INT|INT8|INTEGER|LONG|NUMBER|NUMERIC|REAL|SERIAL|SERIAL8|SIGNED|SMALLINT|TEXT|TINYINT|UNSIGNED|VARCHAR|VARCHAR2|VARYING)\b colours=bright_white count=more ====== regexp=\b(HOUR|MINUTE|SECOND|INTERVAL|SELECT|INSERT|DELETE|UPDATE|REPLACE|MERGE|DROP|CREATE|ALTER|WHERE|FROM|INNER|JOIN|STRAIGHT_JOIN|AND|OR|LIKE|ON|IN|SET|BY|GROUP|ORDER|LEFT|OUTER|FULL|END|THEN|LOOP|AS|FOR|WHILE|WHEN|DISTINCT)\b colours="\033[38;5;172m" count=more ====== regexp=\, colours="\033[38;5;172m" count=more ====== regexp=\b(\d)\b colours="\033[38;5;73m" count=more ====== regexp=[=!><] colours="\033[38;5;73m" count=more ====== regexp=\/\*.*?\*\/ colours="\033[38;5;244m" count=more grc-1.11.3/colourfiles/conf.ss000066400000000000000000000024001327135134700161740ustar00rootroot00000000000000# 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 ======= # ipx hostname regexp=^IPX.*[\dABCDEF]+:[\dABCDEF]+ colours=green ======= # protocols regexp=(^tcp|^udp|^unix|^IPX|STREAM|DGRAM) colours=magenta ======= # protocols UDP regexp=^udp colours=yellow ======= # protocols TCP regexp=^tcp colours=blue ======= # status UNCONN regexp=UNCONN colours=dark 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=UNKNOWN colours=blink bold red ======= # status regexp=\[.*\] colours=green ======= # path regexp=(\@)[\dabcdef]+ colours=green, bold green ======= # timer regexp=\d+sec colours=yellow ======= #Skip header regexp=(Netid|State).*$ colours=default grc-1.11.3/colourfiles/conf.stat000066400000000000000000000023701327135134700165300ustar00rootroot00000000000000# Fields regexp=(?:IO\s)?\S+:\s colours=cyan - # Filename regexp=File: ‘(\S+)’ colours=unchanged, bold - # File Type regexp=IO\sBlock:\s\d+\s+(.*)$ colours=unchanged, bold green - # SELinux from conf.ls regexp=(\w+_u):(\w+_r):(\w+_t):(\w\d) colours=default,green,yellow,cyan,magenta - # Permission Numbers regexp=\((\d)(\d)(\d)(\d)\/ colours=default,bold white,bright_green,yellow,bright_red - # -rwxrwxrwx ============================ from conf.ls # File Type regexp=(-|([bcCdDlMnpPs?]))(?=[-r][-w][-xsStT][-r][-w][-xsStT][-r][-w][-xsStT]) colours=unchanged,unchanged,bold white - # owner rwx regexp=(?<=[-bcCdDlMnpPs?])(-|(r))(-|(w))(-|([xsStT]))(?=[-r][-w][-xsStT][-r][-w][-xsStT]) colours=unchanged,unchanged,bright_green,unchanged,bright_green,unchanged,bright_green - # group rwx regexp=(?<=[-bcCdDlMnpPs?][-r][-w][-xsStT])(-|(r))(-|(w))(-|([xsStT]))(?=[-r][-w][-xsStT]) colours=unchanged,unchanged,yellow,unchanged,yellow,unchanged,yellow - # other rwx regexp=(?<=[-bcCdDlMnpPs?][-r][-w][-xsStT][-r][-w][-xsStT])(-|(r))(-|(w))(-|([xsStT])) colours=unchanged,unchanged,bright_red,unchanged,bright_red,unchanged,bright_red - # sStT all regexp=(?<=[-bcCdDlMnpPs?])[-r][-w]([sStT])[-r][-w]([sStT])[-r][-w]([sStT]) colours=unchanged,bold green,bold yellow, bold red grc-1.11.3/colourfiles/conf.sysctl000066400000000000000000000003511327135134700170730ustar00rootroot00000000000000# Main & Last key regexp=(\w+)\.(\S+) = ?(.+)?$ colours=default,green,cyan,yellow - # subcategories regexp=\w+\.(\S+(?=\.))\. colours=unchanged,magenta - # error regexp=sysctl: permission denied on key '([^']+)' colours=red,bold red grc-1.11.3/colourfiles/conf.systemctl000066400000000000000000000007401327135134700176030ustar00rootroot00000000000000# Name regexp=\.service\s colours=bright_white - regexp=\.mount\s colours=magenta - regexp=\.device\s colours=blue - regexp=\.socket\s colours=cyan - regexp=\.slice\s colours=dark red - regexp=\.path\s colours=green - regexp=\.target\s colours=dark magenta - regexp=\.timer\s colours=dark cyan - regexp=\.swap\s colours=bright_magenta - regexp=\sloaded\s colours=cyan - regexp=\sactive\s colours=green - # exited regexp=exited colours=red - # running regexp=running colours=green grc-1.11.3/colourfiles/conf.tcpdump000066400000000000000000000005601327135134700172300ustar00rootroot00000000000000# Title regexp=on ([^,]+), link-type (\S+) colours=unchanged, bold green, green - # Basic Line (-nS) regexp=^(\d+):(\d+):(\d+\.\d+) (\S+) (\S+) (>) (\S+): colours=unchanged,bold white,bright_white,dark white,cyan, bright_green, bold red, bright_blue - # IP regexp=(?:\d{1,3}\.){3}(?:\d{1,3}) colours=bold - # Summary regexp=^(\d+) packets colours=unchanged,bold green grc-1.11.3/colourfiles/conf.traceroute000066400000000000000000000011151327135134700177260ustar00rootroot00000000000000# hostname regexp=\s\w+[\w\-\.]+\w+ colours=bold white count=once - # ip number regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} colours=magenta - # ipv6 number regexp=(([0-9a-fA-F]{1,4})?\:\:?[0-9a-fA-F]{1,4})+ colours=magenta - # time regexp=\d+\.?\d*(?=\sms) colours=green - # ms regexp=\bms\b colours=yellow - # DUP regexp=\bDUP colours=red - # !S, !A, !H (host unreachable), etc. regexp=\b\![AFGNPSTU] colours=red # just an example: #command=echo 'Network is down'| mail root - # ttl=...! regexp=ttl=\d+\! colours=cyan - # * regexp=\* colours=red - # parenthesis regexp=\(|\) colours=yellow grc-1.11.3/colourfiles/conf.tune2fs000066400000000000000000000000641327135134700171410ustar00rootroot00000000000000# Values regexp=^([^:]+):(.+)$ colours=default,cyan grc-1.11.3/colourfiles/conf.ulimit000066400000000000000000000002361327135134700170570ustar00rootroot00000000000000# ( ) regexp=\((?:([^,)]+),\s)?(-\w)\) colours=default,magenta,cyan - # unlimited regexp=\sunlimited colours=bold red - # number regexp=\s\d+ colours=yellow grc-1.11.3/colourfiles/conf.uptime000066400000000000000000000005051327135134700170560ustar00rootroot00000000000000# Time regexp=\sup(?:\s(\d+ days?),)?\s+(\d+ min|\d+:\d+), colours=default,yellow,green - # users regexp=\s+(\d+)\susers colours=yellow,bold yellow - # load average regexp=load average: (\d+\.\d+),\s(\d+\.\d+),\s(\d+\.\d+) colours=default,bright_cyan,cyan,dark cyan - # W Command section # Title regexp=^USER.*$ colours=bold grc-1.11.3/colourfiles/conf.vmstat000066400000000000000000000016251327135134700170750ustar00rootroot00000000000000# Title regexp=(procs)\s(-+memory-+)\s(-+swap-+)\s(-+io-+)\s(-+system-+)\s(-+cpu-+) colours=default,bold,bold cyan,bold magenta,bold blue, bold green, bold red - # rows regexp=^(\s*\w+\s+\w+)\s+(\w+\s+\w+\s+\w+\s+\w+)\s+(\w+\s+\w+)\s+(\w+\s+\w+)\s+(\w+\s+\w+)\s+(\w+\s+\w+\s+\w+\s+\w+\s+\w+) colours=default,default,bright_cyan,bright_magenta,bright_blue,bright_green,bright_red - # ============================ DISK MODE ================================= # Title disk mode regexp=^(disk-)\s(-+reads-+)\s(-+writes-+)\s(-+IO-+) colours=default,bold,bold green,bold magenta,bold blue - # Title disk mode regexp=(\s+)(total\s+merged\s+sectors\s+ms)\s+(total\s+merged\s+sectors\s+ms)\s+(cur\s+sec) colours=default,bold,bold green,bold magenta,bold blue - # rows disk mode regexp=^(\S+)\s+(\d+\s+\d+\s+\d+\s+\d+)\s+(\d+\s+\d+\s+\d+\s+\d+)\s+(\d+\s+\d+) colours=default,bright_white,bright_green,bright_magenta,bright_blue grc-1.11.3/colourfiles/conf.wdiff000066400000000000000000000002041327135134700166460ustar00rootroot00000000000000# new words regexp=\{\+.+\+\} colours=bold green count=more ======= # deleted words regexp=\[\-.+\-\] colours=bold green count=more grc-1.11.3/colourfiles/conf.whois000066400000000000000000000026271327135134700167130ustar00rootroot00000000000000# 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 grc-1.11.3/contrib/000077500000000000000000000000001327135134700140165ustar00rootroot00000000000000grc-1.11.3/contrib/conf.efingerd000066400000000000000000000007711327135134700164550ustar00rootroot00000000000000# contributed by Daniel Kollár # @host regexp=@\w+[\w\-\.]+\w+ colours=magenta count=once ====== # who fingers regexp=(\s\w+[\w\-\.]+)(?=@) colours=bold magenta count=once ====== # user null fingers regexp=\(null\) colours=green count=once ====== # who's fingered regexp=(\s\d\d\d\d\s)(\w+[\w\-\.]+\s(?=fingered)) colours=bold yellow count=once ====== # date and time regexp=^(...)(\s...\s.\d \d\d:\d\d:\d\d)(\s...\s\d\d\d\d\s) colours=green, green, bold green, green count=once grc-1.11.3/contrib/mrsmith/000077500000000000000000000000001327135134700155015ustar00rootroot00000000000000grc-1.11.3/contrib/mrsmith/README.md000066400000000000000000000001131327135134700167530ustar00rootroot00000000000000alternative configuration files for some commands, contributed by mrsmith grc-1.11.3/contrib/mrsmith/conf.dig000066400000000000000000000010411327135134700171070ustar00rootroot00000000000000#comments regexp=;\s\w*\s*\w*.* colours=yellow ======= #comments 2 regexp=;;\s\w*\s*\w*.* colours=white ======= #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=\s(A|AAAA|NS|PTR|MX|CNAME|TXT|COA)(\s|$) colours=cyan ======= #in regexp=\s(IN|CH)\s colours=yellow ======= #domain regexp=@?([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}\.? colours=magenta ======= #ip address regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} colours=green #======= grc-1.11.3/contrib/mrsmith/conf.ifconfig000066400000000000000000000016241327135134700201370ustar00rootroot00000000000000# ip regexp=\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b colours=bold green ======= # ipv6 regexp=(([0-9a-fA-F]{1,4})?\:\:?[0-9a-fA-F]{1,4})+ colours=bold green ======= # hwaddr regexp=([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F]) colours=yellow ======= # size regexp=\d+(\.\d+)?\s((T|G|M|K)i)?B colours=yellow ======= # interface regexp=(([0-9a-z]{3,8}\d)|lo): colours=bold green ======= #ip disc regexp=(inet6?|netmask|broadcast) colours=cyan ======= #flags regexp=(?<=[,<])[^,]*(?=[,>]) colours=blue ======= # mtu regexp=mtu\s\d+ colours=green ======= # unspec regexp=(unspec|UNSPEC) colours=bold red ======= #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 grc-1.11.3/contrib/mrsmith/conf.mtr000066400000000000000000000007311327135134700171530ustar00rootroot00000000000000#ip address regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} colours=green ======= # % 0.0 - 10.9 % loss regexp=[^\d][0-9]{1}.\d% colours=green ======= # % 11.0 - 30.9 % loss regexp=[123]{1}[0-9]{1}.\d% colours=yellow ======= # % 30.0 - 80.9% loss regexp=[3-8]{1}[0-9]{1}.\d% colours=bold yellow ======= # % 80.0 - 95.9% loss regexp=[8-9]{1}[0-9]{1}.\d% colours=red ======= # unknow host regexp=\?\?\? colours=red ======= # Packets/Pings regexp=(Packets|Pings) colours=bold green grc-1.11.3/contrib/mrsmith/conf.netstat000066400000000000000000000022621327135134700200340ustar00rootroot00000000000000# hostname:service regexp=(\S*):(\d{1,5}|\S*)\s colours=yellow, bold green, bold yellow ======= # ipx hostname regexp=^IPX.*[\dABCDEF]+:[\dABCDEF]+ colours=green ======= # protocols TCP regexp=tcp6? colours=bold blue ======= # protocols UDP regexp=udp6? colours=bold cyan ======= # protocols other regexp=(^unix|^IPX|STREAM|DGRAM|SEQPACKET) colours=bold green ======= # 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=UNKNOWN colours=blink bold red ======= # path regexp=(\@)[\dabcdef]+ colours=green, bold green ======= # timewait regexp=timewait\s\((.*\)) colours=green, red ======= # timewait off regexp=off.* colours=bold red ======= # process name regexp=\s(\d*)/(\S*)\s colours=yellow,bold cyan, bold green grc-1.11.3/contrib/mrsmith/conf.ps000066400000000000000000000021301327135134700167660ustar00rootroot00000000000000# CAPS LINE regexp=^[A-Z\s%]*([A-Z]{3})[A-Z\s%]*$ colours=underline ======= # /full/path regexp=(\s|^)/[-\w\d.]+/[-\w\d./]+ colours=white ======= # Capd Line regexp=^([A-Z][-a-z0-9]+(\s+|$)){3,}$ colours=underline ======= # VMSTAT regexp=(\s|^)\d+([.,]\d+)?(?=[\s,]|$) colours=bold green ======= # n.n.n regexp=(\s|^)\d+\.\d+\.\d+(?=[\s,]|$) colours=bold cyan ======= # text: regexp=^([-a-z0-9]+):\s colours=unchanged,yellow ======= # -options regexp=(?<=\s)-[\w\d]+(?=\s|$) colours=yellow ======= # --long-option= regexp=(?<=\s)--[-\w\d]+[\w\d](?==|\s|$)(=?) colours=cyan,white ======= # [text] regexp=\[[-\w\d:/]+\] colours=cyan ======= # root user regexp=root|wheel(?=\s|$) colours=red ======= # pts regexp=(\s|^)pts/\d+(?=[^\w\d]|$) colours=bold yellow ======= # tty regexp=(\s|^)tty\d+(?=[^\w\d]|$) colours=bold cyan ======= # time regexp=(\d*:)?\d*:\d{2} colours=bold white ======= # time 00:00:00 regexp=00:00:00 colours=bold black ====== # time 0:00 regexp=\s0:00\s colours=bold black ====== # ? regexp=\s\?\s colours=red ======= # Process state regexp=\s([DRSTEXZ])([NLsl+<]*)\s colours=cyan, bold blue grc-1.11.3/contrib/nmh-in-color/000077500000000000000000000000001327135134700163205ustar00rootroot00000000000000grc-1.11.3/contrib/nmh-in-color/README000066400000000000000000000061461327135134700172070ustar00rootroot00000000000000-------------- COLORIZING nmh -------------- I've been using nmh on Linux for a few years now, it is a powerful mail handling system maintained by a team of volunteers. The latest version can be found at: http://www.mhost.com/nmh/ A few months ago I discovered grc, a very cool "generic colouriser", written by Radovan Garabik http://melkor.dnp.fmph.uniba.sk/~garabik/grc.html Since I'm hooked on nmh, I decided to use grc with it. Here's a list of the files needed: The latest version of these files can be found at: http://users.anet.com/~mig/nmh-in-color/nmh-in-color.tar.gz configs/ bashrc-entries Example alias entries for a ~/.bashrc file. conf.flists grc config for flists command. conf.inc grc config for inc command. conf.mail grc config for show command. conf.scan grc config for scan command. grc.conf-entries sample entries for use in grc.conf mh_profile-entries sample entries for use in ~/.mh_profile mhl.body sample format file for MIME message body mhl.format sample format file for show command mhl.headers sample format file for MIME message headers rxvt-resources rxvt settings from ~/.Xdefaults used for the screenshots scripts/ viewmail Script for viewing colorized e-mail. vimail Script to call vim in mail-syntax mode. ------------ INSTALLATION ------------ Grab nmh-1.0.x.tar.gz, and grc_0.x.tar.gz from the websites above. Read the documentation included with the packages and install them. Grc requires a Python interpreter. I tested with grc_0.81 and Python-1.5.1. Copy the conf.* files to /usr/share/grc/ or /usr/local/share/grc/, depending on how grc was installed. Copy viewmail and vimail somewhere in your path, like ~/bin/. Note vimail does not use grc, but makes use of vim-5.x syntax-highlighting. You may have to modify the path to the syntax description files given in the script to match your system. If you only want to colorize email-viewing, or you don't use vim to compose messages, don't install vimail. Add the contents of bashrc-entries to your ~/.bashrc, and the contents of mh_profile-entries to your ~/.mh_profile (look these over first, some of these profile entries are just my personal preference). Also, add grc.conf-entries to /etc/grc.conf. I recommend the use of rxvt (http://www.rxvt.org). I've included the settings from my .Xdefaults file in rxvt-resources (don't forget to do a xrdb -load .Xdefaults after you put these in place). -------- COMMENTS -------- The color-scheme I've used in the conf.* files is optimized for light text on a dark background. Please feel free to make modifications. Enjoy! Miguel Gualdron (August 2000) mig@anet.com http://users.anet.com/~mig/nmh-in-color #--------------------------------------------------------------------------- # README file for nmh-in-color.tar.gz # $Id: README,v 1.7 2001/01/19 03:32:30 mig Exp mig $ #--------------------------------------------------------------------------- grc-1.11.3/contrib/nmh-in-color/configs/000077500000000000000000000000001327135134700177505ustar00rootroot00000000000000grc-1.11.3/contrib/nmh-in-color/configs/bashrc-entries000066400000000000000000000024571327135134700226140ustar00rootroot00000000000000#---------------------------------------------------------------------- # This alias shows all my mail folders, highlighting (in yellow) # those which have new mail in them. #---------------------------------------------------------------------- alias flists="grc flists" #---------------------------------------------------------------------- # I use Procmail to sort my incoming mail into nmh folders, this alias # shows me only the folders that have new mail in them: #---------------------------------------------------------------------- alias fl="flists -seq unseen -noshowzero -recurse" #---------------------------------------------------------------------- # Since I use procmail(1), I don't use inc(1) much... #---------------------------------------------------------------------- alias inc="grc inc" #---------------------------------------------------------------------- # I like to have a header on the the scan(1) output so I know where I am. # Feel free to change any of the colors in the conf-* files... #---------------------------------------------------------------------- alias scan="grc scan -header" #---------------------------------------------------------------------- # Just a shortcut for the inbox: #---------------------------------------------------------------------- alias si="scan +inbox" grc-1.11.3/contrib/nmh-in-color/configs/conf.flists000066400000000000000000000007571327135134700221340ustar00rootroot00000000000000#--------------------------------------------------------------------------- # $Id: conf.flists,v 1.5 2001/01/19 03:04:38 mig Exp mig $ #--------------------------------------------------------------------------- # GRC config file for use with nmh(1) command flists(1). #--------------------------------------------------------------------------- # Unread messages: regexp=.*has\s+([0-9]+[0-9]|[1-9])\sin.* colours=yellow count=more - # Current folder: regexp=.*\+\s+.* colours=green count=once grc-1.11.3/contrib/nmh-in-color/configs/conf.inc000066400000000000000000000007311327135134700213710ustar00rootroot00000000000000#--------------------------------------------------------------------------- # $Id: conf.inc,v 1.5 2001/01/20 00:00:57 mig Exp mig $ #--------------------------------------------------------------------------- # GRC config file for use with nmh(1) command inc(1). #--------------------------------------------------------------------------- # Replies... regexp=\s+R[Ee]:\s+.* colours=blue count=more - # Current message: regexp=^\s{0,3}\d{1,5}\+.* colours=green count=once grc-1.11.3/contrib/nmh-in-color/configs/conf.mail000066400000000000000000000077311327135134700215510ustar00rootroot00000000000000#--------------------------------------------------------------------------- # $Id: conf.mail,v 3.3 2001/01/19 03:10:13 mig Exp mig $ #------------------------------------------------------------------------- # This configuration file is suitable for displaying mail files. # Such as when mail is read with mh(1) or nmh(1). # # This version makes more use of the block count to avoid listing all of # the possible header lines... #------------------------------------------------------------------------- # The Date, will be green. #------------------------------------------------------------------------- regexp=^\s*(Date|Sent):.* colours=green count=stop - #------------------------------------------------------------------------- # The To, CC, BCC, and From, etc. lines will be green. #------------------------------------------------------------------------- regexp=^\s*((In-)?([Rr]eply-)?[Tt]o|From|Author|[BbFf]?[Cc][Cc]): colours=green count=more - #------------------------------------------------------------------------- # The Subject line will be red. #------------------------------------------------------------------------- regexp=^\s*Subject:.*$ colours=bold red count=stop - #------------------------------------------------------------------------- # Long lines: #------------------------------------------------------------------------- regexp=^\s{5}\*\*\*.*$ colours=previous count=previous - #------------------------------------------------------------------------- # Header lines added by nmh: #------------------------------------------------------------------------- regexp=^\s*Replied:.*$ colours=cyan count=more - #------------------------------------------------------------------------- # Other mail header lines will be yellow. #------------------------------------------------------------------------- regexp=^(([Xx]-{0,1}.*\S)|((Return-)?Path)|(MIME-{0,1}.*\S)):.*$ colours=yellow count=block - #------------------------------------------------------------------------- # Multi-line signatures: #------------------------------------------------------------------------- regexp=^-{1,3}\s{0,1}$ colours=red count=block - regexp=^={1,5}\s{0,1}$ colours=red count=block - regexp=^-=-\s{0,1}$ colours=red count=block - #------------------------------------------------------------------------- # This unblock applies to all of the block lines above: #------------------------------------------------------------------------- regexp=^\s{0,5}$ colours=default count=unblock - #--------------------------------------------------------------------------- # This will make most separating lines blue: #--------------------------------------------------------------------------- regexp=^.*([-=_!#$*<=>.:/|\\~`] *){7}.*$ colours=blue count=more - #------------------------------------------------------------------------- # Any quoted messages will show up in blue if quoted an odd number of times, # cyan if quoted an even number of times. The main message text will remain # unchanged. # # (I grabbed these regexp's from the vim-5.x mail.vim file.) #------------------------------------------------------------------------- regexp=^[ \t]*([A-Za-z]+>|[\]|}>#:]).*$ colours=blue count=more - regexp=^[ \t]*(([A-Za-z]+>|[\]|}>#:])[ \t]*){2}.*$ colours=cyan count=more - regexp=^[ \t]*(([A-Za-z]+>|[\]|}>#:])[ \t]*){3}.*$ colours=blue count=more - regexp=^[ \t]*(([A-Za-z]+>|[\]|}>#:])[ \t]*){4}.*$ colours=cyan count=more - regexp=^[ \t]*(([A-Za-z]+>|[\]|}>#:])[ \t]*){5}.*$ colours=blue count=more - regexp=^[ \t]*(([A-Za-z]+>|[\]|}>#:])[ \t]*){6}.*$ colours=cyan count=more - #------------------------------------------------------------------------- # Highlight URLs in magenta and email addresses in green: #------------------------------------------------------------------------- regexp=\b\S+@\S+\b colours=green count=more - regexp=mailto:\S+@\S+\b colours=green count=more - regexp=https?:\/\/\S+\b colours=magenta count=more - regexp=ftp:\/\/\S+\b colours=magenta count=more - regexp=file:\/\/\S+\b colours=magenta count=more grc-1.11.3/contrib/nmh-in-color/configs/conf.scan000066400000000000000000000014071327135134700215450ustar00rootroot00000000000000#--------------------------------------------------------------------------- # $Id: conf.scan,v 1.6 2001/01/20 00:01:32 mig Exp mig $ #--------------------------------------------------------------------------- # GRC config file for use with nmh(1) command scan(1). # # This file works well with the scan.unseen file provided with nmh(1). #--------------------------------------------------------------------------- # The header line: regexp=^FOLDER.* colours=green count=once - # Messages replied-to by me: regexp=^\s{0,3}\d{1,5}\s+-.* colours=cyan count=more - # Replies... regexp=\s+R[Ee]:\s+.* colours=blue count=more - # Unread messages: regexp=^\s{0,3}\d{1,5}\sU\s.{23} colours=yellow count=more - # Current message: regexp=^\s{0,3}\d{1,5}\+.* colours=green count=once grc-1.11.3/contrib/nmh-in-color/configs/grc.conf-entries000066400000000000000000000004171327135134700230430ustar00rootroot00000000000000# # Add these entries to the /etc/grc.conf file, so grc does the right thing # when the scan, flists, and inc commands are used. # # scan command (^|[/\w\.]+/)scan\b conf.scan # flists command (^|[/\w\.]+/)flists\b conf.flists # inc command (^|[/\w\.]+/)inc\b conf.inc grc-1.11.3/contrib/nmh-in-color/configs/mh_profile-entries000066400000000000000000000006111327135134700234640ustar00rootroot00000000000000#: #: The .mh_profile entries listed below may be useful when using #: nmh with grc/grcat. #: moreproc: viewmail Unseen-Sequence: unseen scan: -form scan.unseen comp: -editor vimail repl: -annotate -nocc all -fcc sent-mail -filter reply.filter -editor vimail forw: -editor forwedit -format forwedit: -editor vimail flists: -recurse mhshow-show-text/html: lynx -dump -force_html '%f' |viewmail grc-1.11.3/contrib/nmh-in-color/configs/mhl.body000066400000000000000000000001141327135134700214030ustar00rootroot00000000000000body:nocomponent,width=79,overflowtext="*** ",overflowoffset=5,noleftadjust grc-1.11.3/contrib/nmh-in-color/configs/mhl.format000066400000000000000000000012401327135134700217370ustar00rootroot00000000000000; mhl.format ; ; This is a slighly modified version of the default mhl.format file included ; with nmh-1.0.x. I've added "width=79,overflowtext='*** '" to the "body" ; line at the bottom. I've also made the the overflowtext string "*** " ; instead of the default "***" to improve readability. ; ; Miguel Gualdron (July 2000). ; : overflowtext="*** ",overflowoffset=5 leftadjust,compwidth=9 ignores=msgid,message-id,received,content-type,content-transfer-encoding,content-id Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>" To: cc: From:decode Subject:decode : extras:nocomponent : body:nocomponent,width=79,overflowtext="*** ",overflowoffset=5,noleftadjust grc-1.11.3/contrib/nmh-in-color/configs/mhl.headers000066400000000000000000000010551327135134700220660ustar00rootroot00000000000000; mhl.headers ; ; Slighly modified version of the default mhl.headers file included with ; nmh-1.0.x. See the comments at the top of mhl.format for more details. ; ; Format file for displaying headers in ; MIME messages. mhn calls the mhlproc with this ; filter to display message header. ; overflowtext="*** ",overflowoffset=5 leftadjust,compwidth=9 ignores=msgid,message-id,received,content-type,content-transfer-encoding,content-id Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>" To: cc: From:decode Subject:decode : extras:nocomponent : grc-1.11.3/contrib/nmh-in-color/configs/rxvt-resources000066400000000000000000000015411327135134700227070ustar00rootroot00000000000000!-------------------------------------------------------------- ! These are the resource settings I use with rxvt(1), ! they were in place when the screenshots were generated. ! ! If you prefer your terminal windows with dark text on ! a light background, you'll have to tweak the colors here, as ! well as in the grc conf-* files. !----------------- ! Rxvt settings !----------------- Rxvt*background: black Rxvt*foreground: gray70 Rxvt*color4: #1e90ff Rxvt*color12: #63b8ff Rxvt*colorBD: #63b8ff Rxvt*colorUL: #00ffff ! !-------------------------------------------------------------- ! The following settings have a similar effect on ! xterm(1). !----------------- ! Xterm settings !----------------- XTerm*background: black XTerm*foreground: gray70 XTerm*colorBDMode: on XTerm*color4: #1e90ff XTerm*color12: #63b8ff XTerm*colorBD: #63b8ff XTerm*colorUL: #00ffff grc-1.11.3/contrib/nmh-in-color/scripts/000077500000000000000000000000001327135134700200075ustar00rootroot00000000000000grc-1.11.3/contrib/nmh-in-color/scripts/viewmail000077500000000000000000000020101327135134700215430ustar00rootroot00000000000000#!/bin/sh # #--------------------------------------------------------------------------- # $Id: viewmail,v 1.4 2000/08/19 00:23:32 mig Exp mig $ #---------------------------------------------------------------------- # Script Name: viewmail # Purpose: Short script to page through and colorize email. # #---------------------------------------------------------------------- #--------------------------------------------------------------------------- # If we're sending output to a terminal, then colorize it, # otherwise, just cat it (...in case we're piping to lpr, etc.). # # Assume the input comes from STDIN. If we get command-line arguments, # then we assume they're filenames, and cat them each in turn. #--------------------------------------------------------------------------- if [ -t 1 ]; then if [ $# -eq 0 ]; then grcat conf.mail | less -r else for _arg in $* do grcat conf.mail < $_arg | less -r done fi else if [ $# -eq 0 ]; then cat else for _arg in $* do cat $_arg done fi fi grc-1.11.3/contrib/nmh-in-color/scripts/vimail000077500000000000000000000010571327135134700212210ustar00rootroot00000000000000#!/bin/sh # #--------------------------------------------------------------------------- # $Id: vimail,v 1.3 2000/08/19 00:25:17 mig Exp mig $ #--------------------------------------------------------------------------- # Script Name: vimail # Purpose: Short script to edit mail from nmh(1) # This script makes use if vim-5.x syntax highlighting. # #--------------------------------------------------------------------------- if [ $# = 0 ]; then vi +'so $VIM/syntax/mail.vim' - else vi +'so $VIM/syntax/mail.vim' $* fi grc-1.11.3/contrib/wrap-ccache000077500000000000000000000007771327135134700161340ustar00rootroot00000000000000#!/bin/sh # by Alexey Galakhov wd="`dirname $0`" ccache="`which ccache`" grc="`which grc`" grconf="conf.gcc" if [ "`basename $1`" = "configure" ]; then ccache="" grconf="conf.configure" fi gropts="" if perl -e 'use POSIX "isatty"; exit !isatty(1);'; then gropts="$gropts --stdout" fi if perl -e 'use POSIX "isatty"; exit !isatty(2);'; then gropts="$gropts --stderr" fi if [ ! -z "$grc" -a ! -z "$gropts" ]; then grc="$grc -s -e -c $wd/$grconf" else grc="" fi exec $grc $ccache "$@" grc-1.11.3/debian/000077500000000000000000000000001327135134700136005ustar00rootroot00000000000000grc-1.11.3/debian/changelog000066400000000000000000000224721327135134700154610ustar00rootroot00000000000000grc (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 Sun, 29 Apr 2018 16:12:14 +0200 grc (1.11.2-1) unstable; urgency=low * add ntpdate configuration command -- Radovan Garabík 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 Wed, 07 Jun 2017 15:01:11 +0200 grc (1.11.1-1) unstable; urgency=low * fixed python2 compatibility errors -- Radovan Garabík Sun, 21 May 2017 16:01:51 +0200 grc (1.11-1) unstable; urgency=low * clean up directories * improve some configuration files -- Radovan Garabík Fri, 21 Apr 2017 11:06:13 +0200 grc (1.10.1-1) unstable; urgency=low * make aliases more compatible with zsh anc MacOSX -- Radovan Garabík Sat, 04 Mar 2017 10:04:12 +0100 grc (1.10-1) unstable; urgency=low * many configuration files added * python3 compatible -- Radovan Garabík Sat, 28 Jan 2017 15:48:58 +0100 grc (1.9-1) unstable; urgency=low * add `colors' as a synonym of `colours' (and the singulars, too) -- Radovan Garabík Tue, 31 Mar 2015 17:44:11 +0200 grc (1.8-1) unstable; urgency=low * added support for Ki, Gi, Ti for df (thanks to Juraj Bednár) * added example aliases for bash (thanks to Juraj Bednár) * fix infinite loop if regexp matches but does not consume anything -- Radovan Garabík Mon, 16 Mar 2015 14:38:42 +0100 grc (1.7-1) unstable; urgency=low * added `replace' keyword to replace arbitrary text (idea by Ben Hoskins) * added config.php to display php error log (thanks to Ben Hoskins) * added aixterm bright colour codes (thanks to April Arcus) * minor cleanups * switch to non-native Debian package -- Radovan Garabík Fri, 27 Feb 2015 11:09:48 +0100 grc (1.6) unstable; urgency=low * add several configuration files (thanks to Mrs. Smith) -- Radovan Garabík Wed, 30 Oct 2013 15:15:20 +0100 grc (1.5) unstable; urgency=low * added configuration file for the 'mount' command (thanks to Emanuele Aina) * catch SIGPIPE in grcat (closes: #689705), thanks to Дмитрий Кацубо for pointing this out * add several configuration files (thanks to Dark Wizard) * preliminary python3 support (thanks to Dark Wizard and Andreas Niederl), as a consequence, grc requires at least python2.6 -- Radovan Garabík Sat, 10 Aug 2013 14:23:01 +0200 grc (1.4) unstable; urgency=low * fix grcat argument search path, thanks to Andrzej Polis and Алексей Галахов * added conf.configure, thanks to Алексей Галахов * IPv6 support for ping6 and traceroute6 -- Radovan Garabík Sat, 14 May 2011 14:39:43 +0200 grc (1.3) unstable; urgency=low * propagate CTRL+C properly to the command being executed (for i in range(100): print "I'll never use wildcard 'except:' again") * if grcat argument starts with ./, search in current working directory * fix unified diff configuration to include also single '-', thanks to Markus Klinik for noticing -- Radovan Garabík Wed, 8 Jul 2009 20:29:06 +0200 grc (1.2) unstable; urgency=low * properly redirect stderr, thanks to Алексей Галахов * fix several minor pylint warnings -- Radovan Garabík Thu, 14 May 2009 19:21:00 +0200 grc (1.1) unstable; urgency=low * added several non-standard escape attributes (thanks to James Rowe) -- Radovan Garabík Sat, 31 Mar 2007 21:25:02 +0200 grc (1.0.9) unstable; urgency=low * added configuration file for the cvs command (thanks to Andreas Niederl) * modify diff configuration file to colour the filenames as well (thanks to Andreas Niederl) -- Radovan Garabík Thu, 4 Jan 2007 20:45:12 +0100 grc (1.0.8) unstable; urgency=low * add the possibility to include arbitrary string as the colourifying sequence -- Radovan Garabík Mon, 11 Sep 2006 09:58:54 +0200 grc (1.0.7) unstable; urgency=low * do not use sys.maxint, it caused problems * improve ping conffile, thanks to Michael Kebe (closes: #378981) -- Radovan Garabík Sat, 22 Jul 2006 08:56:56 +0200 grc (1.0.6) unstable; urgency=low * applied patch that causes grcat to complain and exits when grcat can't find the config file (thanks to Tripp Lilley ) -- Radovan Garabík Tue, 4 Mar 2003 13:42:47 +0100 grc (1.0.5) unstable; urgency=low * add "unchanged" colour (thanks to Jehan Bing ) -- Radovan Garabik Tue, 4 Feb 2003 14:29:55 +0100 grc (1.0.4) unstable; urgency=low * do not require $HOME to be set (closes: #158316) -- Radovan Garabik Wed, 4 Sep 2002 13:44:41 +0200 grc (1.0.3) unstable; urgency=low * added configuration file for colourising diff outputs (thanks to Dr. Rafael Sepúlveda ) -- Radovan Garabik Sun, 18 Aug 2002 19:35:34 +0200 grc (1.0.2) unstable; urgency=low * package updated for new python version in debian * if grc is run without any arguments, display helpful message (closes: #108675) * do not include INSTALL in debian documentation (closes: #94053) -- Radovan Garabik Sun, 21 Oct 2001 14:43:11 +0200 grc (1.0.1) unstable; urgency=low * included rpm spec file, conf.ldap, modified grc.conf - all thanks to Christian Zuckschwerdt -- Radovan Garabik Wed, 28 Feb 2001 21:56:02 +0100 grc (1.0) unstable; urgency=low * moved Build-Depends where it belongs * OK, this seems pretty stable already.... first stable version :-) -- Radovan Garabik Fri, 23 Feb 2001 21:27:55 +0100 grc (0.999) unstable; urgency=low * grc terminates with the exit status of subprogram * my e-mail added to README file :-) * license changed -- Radovan Garabik Mon, 12 Feb 2001 18:01:24 +0100 grc (0.99) unstable; urgency=low * candidate for stable version * corrected two stupid bugs when using skip option (closes: #84007) * upgraded nmh-in-color, by Miguel Gualdron -- Radovan Garabik Tue, 30 Jan 2001 15:06:57 +0100 grc (0.9) unstable; urgency=low * grc catches ctrl C and propagates to subprocess (Closes: #81137) * added skip keyword to skip lines in output containing certain patterns -- Radovan Garabik Thu, 18 Jan 2001 10:12:38 +0100 grc (0.8.1) unstable; urgency=low * typo in manpages fixed, closes: #70498 -- Radovan Garabik Tue, 29 Aug 2000 14:20:14 +0200 grc (0.8) unstable; urgency=low * added patches from Miguel Gualdron for colourising multiline blocks of text and making current colour dependent on previous line -- Radovan Garabik Sun, 27 Aug 2000 09:47:17 +0200 grc (0.7) unstable; urgency=low * redirecting both stdout and stderr works I do not know what was the error, but I made it differently and it works :-) -- Radovan Garabik Tue, 23 May 2000 21:35:46 +0200 grc (0.6) unstable; urgency=low * rewritten grc to use fork() and exec() * introduce --colour= option, to colourise depending on stdout being a tty (closes #62365) -- Radovan Garabik Sun, 7 May 2000 19:42:30 +0200 grc (0.5) unstable; urgency=low * a bit of speed optimization * added a few (2) more configuration files * added debhelper to Build-Depends * upgraded Standards-Version -- Radovan Garabik Mon, 14 Feb 2000 12:23:29 +0100 grc (0.4) unstable; urgency=low * change of configuration file format * added use of different colours per different regexp groups * added execution of external commands if regexp matches -- Radovan Garabik Mon, 22 Nov 1999 19:13:05 +0100 grc (0.3) unstable; urgency=low * enable nested and overlaped regular expressions - this fixes a few display glitches -- Radovan Garabik Wed, 27 Oct 1999 22:32:58 +0200 grc (0.2) unstable; urgency=low * grc can redirect stderr as well * background and other attributes (blink, bold) can be changed too * documentation update -- Radovan Garabik Tue, 26 Oct 1999 18:02:28 +0200 grc (0.1) unstable; urgency=low * Initial Release. -- Radovan Garabik Thu, 14 Oct 1999 19:24:25 +0200 Local variables: mode: debian-changelog End: grc-1.11.3/debian/compat000066400000000000000000000000021327135134700147760ustar00rootroot000000000000009 grc-1.11.3/debian/control000066400000000000000000000006571327135134700152130ustar00rootroot00000000000000Source: grc Section: text Priority: optional Maintainer: Radovan Garabík Standards-Version: 3.9.6 Build-Depends: debhelper (>=9), python3, dh-python Package: grc Architecture: all Depends: ${python3:Depends}, ${misc:Depends} Description: generic colouriser for everything generic colouriser, can be used to colourise logfiles, output of commands, arbitrary text.... configured via regexp's. grc-1.11.3/debian/copyright000066400000000000000000000021561327135134700155370ustar00rootroot00000000000000This is grc, written and maintained by Radovan Garabík on Thu, 14 Oct 1999 19:24:25 +0200. Upstream Author: Radovan Garabík Copyright: Copyright © 2014 Radovan Garabík The original source can be found at: http://kassiopeia.juls.savba.sk/~garabik/software/grc.html It is released under GPL v2 or any later version, under Debian systems see /usr/share/common-licenses/GPL-2, with following additional condition: 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 this program at me and at least one of these conditions is met: - the resulting license fulfills Debian free software guidelines (http://www.debian.org/social_contract#guidelines) - Richard Stallman has nothing against the new license, neither against running grc with any version of python available at the time of adding the clause - the resulting license brings peace and happiness to the world grc-1.11.3/debian/dirs000066400000000000000000000000261327135134700144620ustar00rootroot00000000000000usr/bin usr/share/grc grc-1.11.3/debian/docs000066400000000000000000000000611327135134700144500ustar00rootroot00000000000000TODO README.markdown Regexp.txt CREDITS contrib/ grc-1.11.3/debian/rules000077500000000000000000000025351327135134700146650ustar00rootroot00000000000000#!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 clean: dh_testdir dh_testroot rm -f build-stamp dh_clean install: dh_testdir dh_testroot dh_prep dh_installdirs # 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 build-indep: build-stamp build-stamp: # nothing to do # Build architecture-dependent files here. binary-arch: install # nothing to do # Build architecture-independent files here. binary-indep: build install # dh_testversion dh_testdir dh_testroot # dh_installdebconf dh_installdocs dh_installexamples dh_installmenu # dh_installemacsen # dh_installpam # dh_installinit dh_installcron dh_installman grc.1 grcat.1 dh_installinfo # dh_undocumented dh_installchangelogs dh_link dh_strip dh_compress dh_fixperms # You may want to make some executables suid here. # dh_suidregister # dh_makeshlibs dh_installdeb # dh_perl dh_python3 dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install grc-1.11.3/debian/source/000077500000000000000000000000001327135134700151005ustar00rootroot00000000000000grc-1.11.3/debian/source/format000066400000000000000000000000141327135134700163060ustar00rootroot000000000000003.0 (quilt) grc-1.11.3/grc000077500000000000000000000122231327135134700130570ustar00rootroot00000000000000#! /usr/bin/env python3 from __future__ import print_function import os, re, string, sys, getopt, signal def version(): print ("Generic Colouriser 1.11.3") sys.exit() def help(): print("""Generic Colouriser 1.11.3 grc [options] command [args] Options: -e --stderr redirect stderr. If this option is selected, do not automatically redirect stdout -s --stdout redirect stdout, even if -e is selected -c name --config=name use name as configuration file for grcat --colour=word word is one of: on, off, auto --pty run command in pseudoterminal (experimental) """) sys.exit() 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 pass try: optlist, args = getopt.getopt(sys.argv[1:], "sec:", ["stdout", "stderr", "config=", "colour=", "pty"] ) except: help() if not args: help() stdoutf = 0 stderrf = 0 # configure file for grcat cfile = "" colour = sys.stdout.isatty() use_pty = 0 for i in optlist: if i[0] in ["--stderr", "-e"]: # redirect stderr stderrf = 1 elif i[0] in ["--stdout", "-s"]: # redirect stdout stdoutf = 1 elif i[0] in ["--config", "-c"]: cfile = i[1] elif i[0] == "--colour": if i[1] == "on": colour = 1 elif i[1] == "off": colour = 0 elif i[1] == "auto": colour = sys.stdout.isatty() else: help() elif i[0] == '--pty': use_pty = 1 stdoutff = 1 stderrff = 0 if stderrf == 1: stdoutff = 0 stderrff = 1 if stdoutf == 1: stdoutff = 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 = [] 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 signal.signal(signal.SIGINT, catch_signal) if cfile != "" and colour: if stdoutff: choo, chio = os.pipe() if stderrff: choe, chie = os.pipe() if use_pty: pidp, pty_fd = pty.fork() else: pidp = os.fork() if pidp == 0: # child, command to run if stdoutff: # connect child (this) stdout to pipe write end if not use_pty: os.dup2(chio, 1) os.close(choo) os.close(chio) if stderrff: os.dup2(chie, 2) os.close(choe) os.close(chie) try: os.execvp(args[0], args) except OSError as e: sys.stderr.write('grc: %s: %s\n' % (args[0], e.strerror)) sys.exit(1) if stdoutff: pido = os.fork() if pido == 0: # child, grcat # connect grcat's stdin to pipe read end, or pty master if use_pty: os.dup2(pty_fd, 0) else: os.dup2(choo, 0) os.close(choo) os.close(chio) if stderrff: os.close(choe) os.close(chie) os.execvp("grcat", ["grcat", cfile]) if stderrff: pide = os.fork() if pide == 0: # child os.dup2(choe, 0) os.dup2(2, 1) os.close(choe) os.close(chie) if stdoutff: os.close(choo) os.close(chio) os.execvp("grcat", ["grcat", cfile]) try: status = os.waitpid(pidp, 0)[1] except OSError: # interrupted system call status = None pass # this is probably not correct # except KeyboardInterrupt: # catching SIGINT does not work when using pty... # status = None # os.kill(pidp, signal.SIGINT) # pass if stderrff: os.close(chie) os.waitpid(pide, 0) os.close(choe) if stdoutff: os.close(chio) os.waitpid(pido, 0) os.close(choo) sys.exit(status and os.WEXITSTATUS(status)) else: pidp = os.fork() if pidp == 0: try: os.execvp(args[0], args) except OSError as e: sys.stderr.write('grc: %s: %s\n' % (args[0], e.strerror)) sys.exit(1) try: status = os.wait()[1] except OSError: # interrupted system call status = None pass # this is probably not correct sys.exit(status and os.WEXITSTATUS(status)) grc-1.11.3/grc.1000066400000000000000000000027061327135134700132200ustar00rootroot00000000000000.TH GRC 1 .SH NAME grc \- frontend for generic colouriser .BR grcat "(1) .SH SYNOPSIS .B grc .I [options] "command [args]" .SH DESCRIPTION .BR grc will execute command .I "command" with optional parameters .I "[args]" piping its stdout or stderr into .BR grcat ", with apropriate configuration file. Configuration file for .BR grc is determined by /etc/grc.conf file. Format of /etc/grc.conf: each entry consists of 2 lines, between entries there can be any number of empty lines or lines beginning with # (comments) First line is regular expression, second line the name of configuration file for .BR grcat ". Configuration file after the first regular expression matching .I "command [args]" will be passed to .BR grcat as its configuration file .SH OPTIONS .TP .B \-\-help Show summary of options. .TP .B \-\-version Display version. .TP .B \-e \-\-stderr Redirect error output. Unless .B -s is selected as well, this cancels redirection of standard output via .BR grcat .TP .B \-s \-\-stdout Redirect standard output. Used to redirect standard output together with .B \-\-stderr option. .TP .B \-\-colour=x x is one of .I on .I off .I auto .B \-\-colour=on will colourise (default) .B \-\-colour=off will just execute .I command without colourising. .B \-\-colour=auto will test if standard output is a tty, and colourise only when it is. .SH SEE ALSO .BR grcat "(1) .SH AUTHOR Written by Radovan Garab\('ik grc-1.11.3/grc.bashrc000066400000000000000000000025351327135134700143220ustar00rootroot00000000000000GRC="$(which grc)" if [ "$TERM" != dumb ] && [ -n "$GRC" ]; then alias colourify="$GRC -es --colour=auto" alias blkid='colourify blkid' alias configure='colourify ./configure' alias df='colourify df' alias diff='colourify diff' alias docker='colourify docker' alias docker-machine='colourify docker-machine' alias du='colourify du' alias env='colourify env' alias free='colourify free' alias fdisk='colourify fdisk' alias findmnt='colourify findmnt' alias make='colourify make' alias gcc='colourify gcc' alias g++='colourify g++' alias id='colourify id' alias ip='colourify ip' alias iptables='colourify iptables' alias as='colourify as' alias gas='colourify gas' alias ld='colourify ld' #alias ls='colourify ls' alias lsof='colourify lsof' alias lsblk='colourify lsblk' alias lspci='colourify lspci' alias netstat='colourify netstat' alias ping='colourify ping' alias traceroute='colourify traceroute' alias traceroute6='colourify traceroute6' alias head='colourify head' alias tail='colourify tail' alias dig='colourify dig' alias mount='colourify mount' alias ps='colourify ps' alias mtr='colourify mtr' alias semanage='colourify semanage' alias getsebool='colourify getsebool' alias ifconfig='colourify ifconfig' fi grc-1.11.3/grc.conf000066400000000000000000000072611327135134700140060ustar00rootroot00000000000000# anything to do with irc \b\w+\b.*irc.* conf.irclog # log file \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\.]+/)(lastb?|who|lastlog)\b 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)\b conf.uptime # getfacl (^|[/\w\.]+/)getfacl\s? conf.getfacl # ntpdate (^|[/\w\.]+/)ntpdate\s? conf.ntpdate # showmount (^|[/\w\.]+/)showmount\s? conf.showmount # apache ant command (^|[/\w\.]+/)ant\s? conf.ant # # apache maven command (^|[/\w\.]+/)mvn\s? conf.mvn # iwconfig command (^|[/\w\.]+/)iwconfig\s? conf.iwconfig # lolcat command (^|[/\w\.]+/)lolcat\s? conf.lolcat # whois (^|[/\w\.]+/)whois\s? conf.whois grc-1.11.3/grc.fish000066400000000000000000000016351327135134700140110ustar00rootroot00000000000000#!/usr/bin/env fish # # To load in ~/.config/fish/fish.conf or a new file in # ~/.config/fish/conf.d add: # source /etc/grc.fish (path may depend on install method) # # See also the plugin at https://github.com/oh-my-fish/plugin-grc 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 \ last lsattr lsblk lspci lsmod lsof getfacl getsebool ulimit uptime nmap \ fdisk findmnt free semanage sar ss sysctl systemctl stat showmount \ tcpdump tune2fs vmstat w who for executable in $grc_plugin_execs if type -q $executable function $executable --inherit-variable executable --wraps=$executable if isatty 1 grc $executable $argv else eval command $executable $argv end end end end grc-1.11.3/grc.spec000066400000000000000000000027121327135134700140070ustar00rootroot00000000000000# Note that this is NOT a relocatable package %define ver 1.0.8 %define rel 1 %define prefix /usr %define confdir /etc Summary: Generic Colouriser Name: grc Version: %ver Release: %rel License: GPL Group: Development/Tools Source: grc-%{PACKAGE_VERSION}.tar.gz URL: http://melkor.dnp.fmph.uniba.sk/~garabik/grc.html BuildRoot: %{_tmppath}/grc-%{PACKAGE_VERSION}-root Packager: Valerij Klein BuildArchitectures: noarch %description Generic Colouriser is yet another colouriser for beautifying your logfiles or output of commands. Authors: -------- Radovan Garabik %prep %setup %install rm -rf $RPM_BUILD_ROOT install -d -m 755 $RPM_BUILD_ROOT%{prefix}/bin install -m 755 grc $RPM_BUILD_ROOT%{prefix}/bin install -m 755 grcat $RPM_BUILD_ROOT%{prefix}/bin install -d -m 755 $RPM_BUILD_ROOT%{prefix}/share/grc install -m 644 colorfiles/conf.* $RPM_BUILD_ROOT%{prefix}/share/grc install -d -m 755 $RPM_BUILD_ROOT%{confdir} install -m 644 grc.conf $RPM_BUILD_ROOT%{confdir} install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1 install -m 644 *.1 $RPM_BUILD_ROOT%{_mandir}/man1 %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-, root, root) %doc CHANGES CREDITS README TODO Regexp.txt %{prefix}/bin/* %{prefix}/share/grc/* %doc %{_mandir}/man1/* %config(noreplace) /etc/grc.conf %changelog * Fri Sep 01 2006 Valerij Klein 1.0.7-1 - Minor changes in SPEC grc-1.11.3/grc.spec.old000066400000000000000000000024511327135134700145640ustar00rootroot00000000000000# Note that this is NOT a relocatable package %define ver 1.0 %define rel 1 %define prefix /usr %define confdir /etc Summary: Generic Colouriser Name: grc Version: %ver Release: %rel Copyright: GPL Group: Console/Utilities Source: grc_%{PACKAGE_VERSION}.tar.gz URL: http://melkor.dnp.fmph.uniba.sk/~garabik/grc.html BuildRoot: %{_tmppath}/grc-%{PACKAGE_VERSION}-root Packager: Christian Zuckschwerdt %description Generic Colouriser is yet another colouriser for beautifying your logfiles or output of commands. Authors: -------- Radovan Garabik %prep %setup %install rm -rf $RPM_BUILD_ROOT install -d -m 755 $RPM_BUILD_ROOT%{prefix}/bin install -m 755 grc $RPM_BUILD_ROOT%{prefix}/bin install -m 755 grcat $RPM_BUILD_ROOT%{prefix}/bin install -d -m 755 $RPM_BUILD_ROOT%{prefix}/share/grc install -m 644 conf.* $RPM_BUILD_ROOT%{prefix}/share/grc install -d -m 755 $RPM_BUILD_ROOT%{confdir} install -m 755 grc.conf $RPM_BUILD_ROOT%{confdir} install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1 install -m 644 *.1 $RPM_BUILD_ROOT%{_mandir}/man1 %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-, root, root) %doc CHANGES CREDITS README TODO Regexp.txt %{prefix}/bin/* %{prefix}/share/grc/* %doc %{_mandir}/man1/* %config /etc/* grc-1.11.3/grc.zsh000066400000000000000000000011171327135134700136570ustar00rootroot00000000000000if [[ "$TERM" != dumb ]] && (( $+commands[grc] )) ; then # 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 \ whois \ iwconfig \ ); # Set alias for available commands. for cmd in $cmds ; do if (( $+commands[$cmd] )) ; then alias $cmd="grc --colour=auto $(whence $cmd)" fi done # Clean up variables unset cmds cmd fi grc-1.11.3/grcat000077500000000000000000000230451327135134700134100ustar00rootroot00000000000000#! /usr/bin/env python3 from __future__ import print_function import sys, os, string, re, signal, errno #some default definitions colours = { 'none' : "", 'default' : "\033[0m", 'bold' : "\033[1m", 'underline' : "\033[4m", 'blink' : "\033[5m", 'reverse' : "\033[7m", 'concealed' : "\033[8m", 'black' : "\033[30m", 'red' : "\033[31m", 'green' : "\033[32m", 'yellow' : "\033[33m", 'blue' : "\033[34m", 'magenta' : "\033[35m", 'cyan' : "\033[36m", 'white' : "\033[37m", 'on_black' : "\033[40m", 'on_red' : "\033[41m", 'on_green' : "\033[42m", 'on_yellow' : "\033[43m", 'on_blue' : "\033[44m", 'on_magenta' : "\033[45m", 'on_cyan' : "\033[46m", 'on_white' : "\033[47m", 'beep' : "\007", 'previous' : "prev", 'unchanged' : "unchanged", # non-standard attributes, supported by some terminals 'dark' : "\033[2m", 'italic' : "\033[3m", 'rapidblink' : "\033[6m", 'strikethrough': "\033[9m", # aixterm bright color codes # prefixed with standard ANSI codes for graceful failure 'bright_black' : "\033[30;90m", 'bright_red' : "\033[31;91m", 'bright_green' : "\033[32;92m", 'bright_yellow' : "\033[33;93m", 'bright_blue' : "\033[34;94m", 'bright_magenta' : "\033[35;95m", 'bright_cyan' : "\033[36;96m", 'bright_white' : "\033[37;97m", 'on_bright_black' : "\033[40;100m", 'on_bright_red' : "\033[41;101m", 'on_bright_green' : "\033[42;102m", 'on_bright_yellow' : "\033[43;103m", 'on_bright_blue' : "\033[44;104m", 'on_bright_magenta' : "\033[45;105m", 'on_bright_cyan' : "\033[46;106m", 'on_bright_white' : "\033[47;107m", } # ignore ctrl C - this is not ideal for standalone grcat, but # enables propagating SIGINT to the other subprocess in grc signal.signal(signal.SIGINT, signal.SIG_IGN) def add2list(clist, m, patterncolour): for group in range(0, len(m.groups()) +1): if group < len(patterncolour): clist.append((m.start(group), m.end(group), patterncolour[group])) else: clist.append((m.start(group), m.end(group), patterncolour[0])) def get_colour(x): if x in colours: return colours[x] elif len(x)>=2 and x[0]=='"' and x[-1]=='"': return eval(x) else: raise ValueError('Bad colour specified: '+x) home = [] conffile = None xdg_config = os.environ.get('XDG_CONFIG_HOME') xdg_data = os.environ.get('XDG_DATA_HOME') home = os.environ.get('HOME') if home and not xdg_config: xdg_config = home + '/.config' if home and not xdg_data: xdg_data = home + '/.local/share' conffilepath = [""] if xdg_data: conffilepath += [xdg_data + '/grc/'] if xdg_config: conffilepath += [xdg_config + '/grc/'] if home: conffilepath += [home + '/.grc/'] conffilepath += ['/usr/local/share/grc/', '/usr/share/grc/'] if len(sys.argv) != 2: sys.stderr.write("You are not supposed to call grcat directly, but the usage is: grcat conffile\n") sys.exit(1) conffile_arg = sys.argv[1] # tentative conffile for i in conffilepath: # test if conffile exists, it can be also a pipe if os.path.exists(i+conffile_arg) and not os.path.isdir(i+conffile_arg): conffile = i+conffile_arg break if not conffile: sys.stderr.write("config file [%s] not found\n" % sys.argv[1]) sys.exit(1) regexplist = [] f = open(conffile, "r") is_last = 0 split = str.split lower = str.lower letters = string.ascii_letters while not is_last: ll = {'count':"more"} while 1: l = f.readline() if l == "": is_last = 1 break if l[0] == "#" or l[0] == '\012': continue if not l[0] in letters: break 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') sys.stderr.write(repr(l)) sys.stderr.write('\n') sys.exit(1) keyword, value = fields keyword = lower(keyword) if keyword in ('colors', 'colour', 'color'): keyword = 'colours' if not keyword in ["regexp", "colours", "count", "command", "skip", "replace", "concat"]: raise ValueError("Invalid keyword") ll[keyword] = value # Split string into one string per regex group # e.g. split "brown bold, red" into "brown bold" and # "red" #colstrings = [] #for colgroup in split(ll['colours'], ','): # colourlist = split(colgroup) # c = "" # for i in colourlist : # c = c + colours[i] # colstrings.append(c) # do not try to understand the optimized form below :-) if 'colours' in ll: colstrings = list( [''.join([get_colour(x) for x in split(colgroup)]) for colgroup in split(ll['colours'], ',')] ) ll['colours'] = colstrings cs = ll['count'] if 'regexp' in ll: ll['regexp'] = re.compile(ll['regexp']).search regexplist.append(ll) prevcolour = colours['default'] prevcount = "more" blockflag = 0 freadline = sys.stdin.readline while 1: line = freadline() if line == "" : break if line[-1] in '\r\n': line = line[:-1] clist = [] skip = 0 for pattern in regexplist: pos = 0 currcount = pattern['count'] while 1: m = pattern['regexp'](line, pos) if m: if 'replace' in pattern: line = re.sub(m.re, pattern['replace'], line) #m = pattern['regexp'](line, pos) #if not m: # break if 'colours' in pattern: if currcount == "block": blockflag = 1 blockcolour = pattern['colours'][0] currcount = "stop" break elif currcount == "unblock": blockflag = 0 blockcolour = colours['default'] currcount = "stop" add2list(clist, m, pattern['colours']) if currcount == "previous": currcount = prevcount if currcount == "stop": break if currcount == "more": prevcount = "more" newpos = m.end(0) # special case, if the regexp matched but did not consume anything, # advance the position by 1 to escape endless loop if newpos == pos: pos += 1 else: pos = newpos else: prevcount = "once" pos = len(line) if 'concat' in pattern: with open(pattern['concat'], 'a') as f : f.write(line + '\n') if 'colours' not in pattern: break if 'command' in pattern: os.system(pattern['command']) if 'colours' not in pattern: break if 'skip' in pattern: skip = pattern['skip'] in ("yes", "1", "true") if 'colours' not in pattern: break else: break if m and currcount == "stop": prevcount = "stop" break if len(clist) == 0: prevcolour = colours['default'] first_char = 0 last_char = 0 length_line = len(line) if blockflag == 0: cline = (length_line+1)*[colours['default']] for i in clist: # each position in the string has its own colour if i[2] == "prev": cline[i[0]:i[1]] = [colours['default']+prevcolour]*(i[1]-i[0]) elif i[2] != "unchanged": cline[i[0]:i[1]] = [colours['default']+i[2]]*(i[1]-i[0]) if i[0] == 0: first_char = 1 if i[2] != "prev": prevcolour = i[2] if i[1] == length_line: last_char = 1 if first_char == 0 or last_char == 0: prevcolour = colours['default'] else: cline = (length_line+1)*[blockcolour] nline = "" clineprev = "" if not skip: for i in range(len(line)): if cline[i] == clineprev: nline = nline + line[i] else: nline = nline + cline[i] + line[i] clineprev = cline[i] nline = nline + colours['default'] try: print(nline) except IOError as e: if e.errno == errno.EPIPE: break else: raise grc-1.11.3/grcat.1000066400000000000000000000046741327135134700135530ustar00rootroot00000000000000.TH GRCAT 1 .SH NAME grcat \- read from standard input, colourise it and write to standard output .SH SYNOPSIS .B grcat .I "configuration" .SH DESCRIPTION .I "configuration" is a name of a configuration file. Directories ~/.grc/, /usr/local/share/grc/, /usr/share/grc/ are searched for the file (in this order). If the file is not found, it is assumed to be an absolute path of a configuration file located elsewhere. Configuration file consists of entries, one per regexp, entries are separated with lines with first character non-alphanumeric (except #). Lines beginning with # or empty lines are ignored. Each entry consists of several lines. Each line has form: .I keyword=value where keyword is one of: .BR regexp ", .BR colours ", .BR command ", .BR concat ", .BR skip ", .BR count ". Only .BR regexp is mandatory, but it does not have much sense by itself unless you specify at least a .BR colour or .BR command keyword as well. .I regexp is the regular expression to match .I colours is the list of colours, separated by commas (you can specify only one colour), each colour per one regexp group specified in regexp. .I command is command to be executed when regexp matches. Its output will be mixed with normal stdout, use redirectors ( >/dev/null) if you want to supress it. .I replace means the regular expression match will be replaced by the value, all the preceeding regular expressions will be evaluated against the original text, all the following regular expressions will be evaluated against the replaced text .I skip can be either .BR yes ", or .BR no ", if yes, the matched line will be skipped and not displayed in output. Default is no. .I count is one of words: .BR once ", .BR more ", or .BR stop ". .BR once means that if the regexp is matched, its first occurrence is coloured and the program will continue with other regexp's. .BR more means that if there are multiple matches of the regexp in one line, all of them will be coloured. .BR stop means that the regexp will be coloured and program will move to the next line (i.e. ignoring other regexp's) Regular expressions are evaluated from top to bottom, this allows nested and overlapped expressions. (e.g. you colour everything inside parentheses with one colour, and if a following expression matches the text inside parentheses, it will be also coloured) .SH OPTIONS None so far. .SH SEE ALSO .BR grc "(1) .SH AUTHOR Written by Radovan Garab\('ik grc-1.11.3/install.sh000077500000000000000000000013061327135134700143630ustar00rootroot00000000000000#!/bin/sh set -e PREFIX=${1:-/usr/local} ETCPREFIX=$2 BINDIR=$PREFIX/bin LIBDIR=$PREFIX/share/grc MANDIR=$PREFIX/share/man CONFDIR=$ETCPREFIX/etc PROFILEDIR=$CONFDIR/profile.d mkdir -p $BINDIR || true cp -fv grc grcat $BINDIR mkdir -p $LIBDIR || true cp -fv colourfiles/conf.* $LIBDIR mkdir -p $MANDIR/man1 cp -fv grc.1 $MANDIR/man1 cp -fv grcat.1 $MANDIR/man1 mkdir -p $CONFDIR cp -fv grc.conf $CONFDIR cp -fv grc.zsh $CONFDIR cp -fv grc.fish $CONFDIR mkdir -p $PROFILEDIR cp -fv grc.bashrc $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