From bac03020d51449f84daff630c9c57135cd81a283 Mon Sep 17 00:00:00 2001 From: Dave Wikoff Date: Mon, 28 Mar 2016 00:56:13 -0400 Subject: [PATCH 01/49] Docker-ps: Fixing some edge cases and generalizing --- conf.dockerps | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/conf.dockerps b/conf.dockerps index 2f94398..04a3753 100644 --- a/conf.dockerps +++ b/conf.dockerps @@ -1,19 +1,28 @@ -# IMAGE -regexp=^(?!CONTAINER)(\w+)\s+([^\s]+)\s+(".*")\s+(.*(?=(?:Up|Exited))) -colours=default,bold black,bold white,bold black,cyan +# HEADERS +regexp=(?:\s|^)(CONTAINER ID|IMAGE|COMMAND|CREATED|STATUS|PORTS|NAMES)(?:\s|$) +colours=default,underline ====== -# Up -regexp=\sUp\s(\d+|\w+)\s\w+(?:\s\w+)? +# Commands +regexp=(?:\s\")(.*)(?:\") +colours=magenta +====== +# https://github.com/docker/docker/blob/e5a3f86e447dd659da3c2e759f3c088a0bfcfe3d/container/state.go#L40 +# Statuses - Up / Restarting +regexp=\sUp(.*)\s colours=bold green ====== -# Exited -regexp=\sExited\s.(\d+).\s.+ago -colours=bold red,red -# PORTS +# Statuses - Exited +regexp=\sExited(?:\s\(\d\)?)(.*)\s +colours=concealed red ====== -regexp=(?:\d{1,3}\.){3}\d{1,3}[^\s]* -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,bold blue,default,bold blue,default ====== # NAMES -regexp=(?:([a-z\-_0-9]+)/)*([a-z\-_0-9]+)$ -colours=default,yellow,bold yellow +regexp=\s([a-z-_0-9]+)$ +colours=default,bold yellow +====== +# CONTAINER ID +regexp=^([a-z-_0-9]+)\s +colours=default,cyan From 5c32ef19df459abbc123352f810dd40f11ffaccc Mon Sep 17 00:00:00 2001 From: Dave Wikoff Date: Fri, 1 Apr 2016 03:42:31 -0400 Subject: [PATCH 02/49] Fix Dockerimages --- conf.dockerimages | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/conf.dockerimages b/conf.dockerimages index 875ef32..36c9ec3 100644 --- a/conf.dockerimages +++ b/conf.dockerimages @@ -1,5 +1,5 @@ # REPO, TAG -regexp=^([a-z]+\/?[^\s]+)\s+([^\s]+)\s+(\w+) +regexp=^([a-z]+\/?[^\s]+)\s+([^\s]+) colours=default,bold white,cyan,bold black ===== # images without name @@ -7,13 +7,17 @@ regexp=^.*$ colours=bold red ===== # Size 'K' -regexp=\s\d*[.,]?\d\sKB? +regexp=\s\d*[\.,]?\d*\sKB? colours=green ====== -# Size 'M' -regexp=\s\d*[.,]?\d\sMB? +# Size 'M', 2 digits +regexp=\s\d{1,2}[\.,]?\d*\sMB? +colours=green +====== +# Size 'M', 3 digits +regexp=\s\d{3,4}[\.,]?\d*\sMB? colours=yellow ====== # Size 'G' -regexp=\s\d*[.,]?\d\sGB? +regexp=\s\d*[.,]?\d*\GB? colours=red From 6f6ef83a9092b907016c8ff8de1730e50ee62469 Mon Sep 17 00:00:00 2001 From: Dave Wikoff Date: Fri, 1 Apr 2016 03:46:08 -0400 Subject: [PATCH 03/49] Dockerimages - Headers --- conf.dockerimages | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/conf.dockerimages b/conf.dockerimages index 36c9ec3..b2bc7aa 100644 --- a/conf.dockerimages +++ b/conf.dockerimages @@ -1,3 +1,7 @@ +# HEADERS +regexp=(?:\s|^)(REPOSITORY|TAG|IMAGE ID|CREATED|SIZE)(?:\s|$) +colours=default,underline +===== # REPO, TAG regexp=^([a-z]+\/?[^\s]+)\s+([^\s]+) colours=default,bold white,cyan,bold black @@ -14,10 +18,10 @@ colours=green regexp=\s\d{1,2}[\.,]?\d*\sMB? colours=green ====== -# Size 'M', 3 digits +# Size 'M' 3+ digits regexp=\s\d{3,4}[\.,]?\d*\sMB? colours=yellow ====== # Size 'G' -regexp=\s\d*[.,]?\d*\GB? +regexp=\s\d*[\.,]?\d*\sGB? colours=red From 4a4cefb98111f0aa73eedc239985908298f51a0b Mon Sep 17 00:00:00 2001 From: Richard Sailer Date: Tue, 10 May 2016 20:15:19 +0200 Subject: [PATCH 04/49] Add conf.ip for "ip" command --- conf.ip | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 conf.ip diff --git a/conf.ip b/conf.ip new file mode 100644 index 0000000..56355df --- /dev/null +++ b/conf.ip @@ -0,0 +1,33 @@ +# ip number +regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} +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 + From 7a4aa1e4489ad486b2aef3fcacb4282ce69c5363 Mon Sep 17 00:00:00 2001 From: "Ricardo J. Barberis" Date: Wed, 18 May 2016 19:55:20 -0300 Subject: [PATCH 05/49] Add traceroute6 Add traceroute6 to the aliases list --- grc.bashrc | 1 + 1 file changed, 1 insertion(+) diff --git a/grc.bashrc b/grc.bashrc index e9eba08..289b415 100644 --- a/grc.bashrc +++ b/grc.bashrc @@ -13,6 +13,7 @@ then alias netstat='colourify netstat' alias ping='colourify ping' alias traceroute='colourify /usr/sbin/traceroute' + alias traceroute6='colourify traceroute6' alias head='colourify head' alias tail='colourify tail' alias dig='colourify dig' From d494aa2d72228b9f75d7a241d840083a2feed0b9 Mon Sep 17 00:00:00 2001 From: "Ricardo J. Barberis" Date: Wed, 18 May 2016 19:56:17 -0300 Subject: [PATCH 06/49] Add ifconfig Add ifconfig to the aliases file --- grc.bashrc | 1 + 1 file changed, 1 insertion(+) diff --git a/grc.bashrc b/grc.bashrc index 289b415..af813ac 100644 --- a/grc.bashrc +++ b/grc.bashrc @@ -20,5 +20,6 @@ then alias mount='colourify mount' alias ps='colourify ps' alias mtr='colourify mtr' + alias ifconfig='colourify ifconfig' alias df='colourify df' fi From 5bce6188fdb5bf3acf3e8372d333f847569da111 Mon Sep 17 00:00:00 2001 From: "Ricardo J. Barberis" Date: Wed, 18 May 2016 19:57:11 -0300 Subject: [PATCH 07/49] Relativize traceroute Remove absolute path from traceroute command (on Slackware, traceroute is in /usr/bin) --- grc.bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grc.bashrc b/grc.bashrc index af813ac..62a9781 100644 --- a/grc.bashrc +++ b/grc.bashrc @@ -12,7 +12,7 @@ then alias ld='colourify ld' alias netstat='colourify netstat' alias ping='colourify ping' - alias traceroute='colourify /usr/sbin/traceroute' + alias traceroute='colourify traceroute' alias traceroute6='colourify traceroute6' alias head='colourify head' alias tail='colourify tail' From 53e5f28ec4fb5110a05e6078e4b8e0e0fd2a206e Mon Sep 17 00:00:00 2001 From: Joe Block Date: Thu, 16 Jun 2016 18:44:10 -0700 Subject: [PATCH 08/49] Add homebrew install instructions & fix typo --- INSTALL | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/INSTALL b/INSTALL index a4667c3..b4a1466 100644 --- a/INSTALL +++ b/INSTALL @@ -5,13 +5,13 @@ Radovan Garabík http://kassiopeia.juls.savba.sk/~garabik/software/grc.html =================================================================== -Requirenments: -anything with python interpreter, with more or less work needed +Requirements: +Anything with a python interpreter, with more or less work needed if it is not unix. -If you have debian system with all necessary packages installed, type - dpkg-buildpackage (or dpkg-buildpackage -rfakeroot) in the package's - directory, then type +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: @@ -26,7 +26,10 @@ else: 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 does - automatically do the above. + + 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 From 0d85e0876736c04c837510713c7cb466ec9f1afe Mon Sep 17 00:00:00 2001 From: Ilya Filisteev Date: Wed, 22 Jun 2016 23:04:27 +0300 Subject: [PATCH 09/49] added config for SQL queries --- conf.sql | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 conf.sql diff --git a/conf.sql b/conf.sql new file mode 100644 index 0000000..ca1abce --- /dev/null +++ b/conf.sql @@ -0,0 +1,32 @@ +# 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 From 29ccd7fa312a45ed309cb06ecb1b420450099931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Wed, 20 Jul 2016 19:52:30 +0200 Subject: [PATCH 10/49] oping --- grc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grc.conf b/grc.conf index e30814f..f446ddf 100644 --- a/grc.conf +++ b/grc.conf @@ -11,7 +11,7 @@ conf.log conf.configure # ping command -(^|[/\w\.]+/)ping6?\s +(^|[/\w\.]+/)o?ping6?\s conf.ping # traceroute command From 6b15eede1b9fb68c93278334095bea6d59ec3a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Sun, 31 Jul 2016 15:34:41 +0200 Subject: [PATCH 11/49] testing pseudoterminal --- grc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/grc b/grc index e0ee182..fce1a52 100755 --- a/grc +++ b/grc @@ -1,6 +1,6 @@ #! /usr/bin/env python -import os, re, string, sys, getopt, signal +import os, re, string, sys, getopt, signal, pty def version(): print ("Generic Colouriser 1.9.1rc1") @@ -46,8 +46,10 @@ colour = 1 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] @@ -106,6 +108,7 @@ if cfile != "" and colour: pidp = os.fork() if pidp == 0: # child if stdoutff: + # connect child (this) stdout to pipe write end os.dup2(chio, 1) os.close(choo) os.close(chio) @@ -113,12 +116,14 @@ if cfile != "" and colour: os.dup2(chie, 2) os.close(choe) os.close(chie) - os.execvp(args[0], args) - + #os.execvp(args[0], args) + pty.spawn(args) + sys.exit(0) if stdoutff: pido = os.fork() - if pido == 0: # child + if pido == 0: # child (grcat) + # connect grcat's stdin to pipe read end os.dup2(choo, 0) os.close(choo) os.close(chio) @@ -155,7 +160,7 @@ if cfile != "" and colour: sys.exit(status and os.WEXITSTATUS(status)) else: - pidp = os.fork() + pidp = os.fork() if pidp == 0: os.execvp(args[0], args) try: From 8edae13481c8fade2b19b2a3b5463998ce432cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Sun, 31 Jul 2016 15:34:52 +0200 Subject: [PATCH 12/49] alternate ping --- conf.ping2 | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 conf.ping2 diff --git a/conf.ping2 b/conf.ping2 new file mode 100644 index 0000000..01bef7f --- /dev/null +++ b/conf.ping2 @@ -0,0 +1,38 @@ +# 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 + + + From 5345174719d924f913ce4c61657eacf5af5593e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Sun, 31 Jul 2016 15:35:15 +0200 Subject: [PATCH 13/49] testing pseudoterminal --- grc-ptytest | 179 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100755 grc-ptytest diff --git a/grc-ptytest b/grc-ptytest new file mode 100755 index 0000000..f8230e6 --- /dev/null +++ b/grc-ptytest @@ -0,0 +1,179 @@ +#! /usr/bin/env python3 + +import os, re, string, sys, getopt, signal + +use_pty = 1 + +if use_pty: + import pty + +def version(): + print ("Generic Colouriser 1.9") + sys.exit() + +def help(): + print("""Generic Colouriser 1.9 +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 +""") + sys.exit() + + +def catch_signal(signum, frame): + "catch signal sent to grc and forward it to the original application" + global pidp + 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="] ) +except: + help() + +if not args: + help() + +stdoutf = 0 +stderrf = 0 + +# configure file for grcat +cfile = "" + +colour = 1 + +for i in optlist: + if i[0] in ["--stderr", "-e"]: + stderrf = 1 + elif i[0] in ["--stdout", "-s"]: + 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() + +stdoutff = 1 +stderrff = 0 +if stderrf == 1: + stdoutff = 0 + stderrff = 1 +if stdoutf == 1: + stdoutff = 1 + +conffile = None +if cfile == "": + home = [] + if 'HOME' in os.environ: + home = [os.environ['HOME']+"/.grc/grc.conf"] + conffilenames = home + ["/etc/grc.conf"] + for i in conffilenames: + if os.path.isfile(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 + if stdoutff: + 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) + os.execvp(args[0], args) + + + if stdoutff: + pido = os.fork() + if pido == 0: # child + 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 + 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: + os.execvp(args[0], args) + 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)) + From 7a641145e67a6644bbda5c661b934c300c8ec0c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Sun, 28 Aug 2016 19:17:53 +0200 Subject: [PATCH 14/49] test pty --- grc | 44 ++++++++----- grc-ptytest | 179 ---------------------------------------------------- 2 files changed, 27 insertions(+), 196 deletions(-) delete mode 100755 grc-ptytest diff --git a/grc b/grc index fce1a52..843ca40 100755 --- a/grc +++ b/grc @@ -1,13 +1,18 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 -import os, re, string, sys, getopt, signal, pty +import os, re, string, sys, getopt, signal + +use_pty = 1 + +if use_pty: + import pty def version(): - print ("Generic Colouriser 1.9.1rc1") + print ("Generic Colouriser 1.9.1test") sys.exit() def help(): - print("""Generic Colouriser 1.9.1rc1 + print("""Generic Colouriser 1.9.1test grc [options] command [args] Options:") -e --stderr redirect stderr. If this option is selected, @@ -104,27 +109,32 @@ if cfile != "" and colour: choo, chio = os.pipe() if stderrff: choe, chie = os.pipe() - - pidp = os.fork() + if use_pty: + pidp, pty_fd = pty.fork() + else: + pidp = os.fork() if pidp == 0: # child if stdoutff: # connect child (this) stdout to pipe write end - os.dup2(chio, 1) - os.close(choo) - os.close(chio) + 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) - #os.execvp(args[0], args) - pty.spawn(args) - sys.exit(0) + os.dup2(chie, 2) + os.close(choe) + os.close(chie) + os.execvp(args[0], args) + if stdoutff: pido = os.fork() - if pido == 0: # child (grcat) + if pido == 0: # child # connect grcat's stdin to pipe read end - os.dup2(choo, 0) + if use_pty: + os.dup2(pty_fd, 0) + else: + os.dup2(choo, 0) os.close(choo) os.close(chio) if stderrff: diff --git a/grc-ptytest b/grc-ptytest deleted file mode 100755 index f8230e6..0000000 --- a/grc-ptytest +++ /dev/null @@ -1,179 +0,0 @@ -#! /usr/bin/env python3 - -import os, re, string, sys, getopt, signal - -use_pty = 1 - -if use_pty: - import pty - -def version(): - print ("Generic Colouriser 1.9") - sys.exit() - -def help(): - print("""Generic Colouriser 1.9 -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 -""") - sys.exit() - - -def catch_signal(signum, frame): - "catch signal sent to grc and forward it to the original application" - global pidp - 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="] ) -except: - help() - -if not args: - help() - -stdoutf = 0 -stderrf = 0 - -# configure file for grcat -cfile = "" - -colour = 1 - -for i in optlist: - if i[0] in ["--stderr", "-e"]: - stderrf = 1 - elif i[0] in ["--stdout", "-s"]: - 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() - -stdoutff = 1 -stderrff = 0 -if stderrf == 1: - stdoutff = 0 - stderrff = 1 -if stdoutf == 1: - stdoutff = 1 - -conffile = None -if cfile == "": - home = [] - if 'HOME' in os.environ: - home = [os.environ['HOME']+"/.grc/grc.conf"] - conffilenames = home + ["/etc/grc.conf"] - for i in conffilenames: - if os.path.isfile(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 - if stdoutff: - 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) - os.execvp(args[0], args) - - - if stdoutff: - pido = os.fork() - if pido == 0: # child - 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 - 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: - os.execvp(args[0], args) - 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)) - From 448c5f064dd06ed606df4fb23214b23ea2a0f8e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Sun, 28 Aug 2016 19:20:46 +0200 Subject: [PATCH 15/49] pty option --- grc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/grc b/grc index 843ca40..b9ff841 100755 --- a/grc +++ b/grc @@ -2,10 +2,6 @@ import os, re, string, sys, getopt, signal -use_pty = 1 - -if use_pty: - import pty def version(): print ("Generic Colouriser 1.9.1test") @@ -20,6 +16,7 @@ Options:") -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() @@ -34,7 +31,7 @@ def catch_signal(signum, frame): try: - optlist, args = getopt.getopt(sys.argv[1:], "sec:", ["stdout", "stderr", "config=", "colour="] ) + optlist, args = getopt.getopt(sys.argv[1:], "sec:", ["stdout", "stderr", "config=", "colour=", "pty"] ) except: help() @@ -48,6 +45,7 @@ stderrf = 0 cfile = "" colour = 1 +use_pty = 0 for i in optlist: if i[0] in ["--stderr", "-e"]: @@ -67,6 +65,8 @@ for i in optlist: colour = sys.stdout.isatty() else: help() + elif i[0] == '--pty': + use_pty = 1 stdoutff = 1 stderrff = 0 @@ -76,6 +76,9 @@ if stderrf == 1: if stdoutf == 1: stdoutff = 1 +if use_pty: + import pty + conffile = None if cfile == "": home = [] From 9f5781460bf846791098361f7d37d096cb85d8d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Sun, 28 Aug 2016 20:51:20 +0200 Subject: [PATCH 16/49] comments --- grc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/grc b/grc index b9ff841..f0e56e5 100755 --- a/grc +++ b/grc @@ -29,7 +29,6 @@ def catch_signal(signum, frame): except OSError: # if the subprocess already died pass - try: optlist, args = getopt.getopt(sys.argv[1:], "sec:", ["stdout", "stderr", "config=", "colour=", "pty"] ) except: @@ -116,7 +115,7 @@ if cfile != "" and colour: pidp, pty_fd = pty.fork() else: pidp = os.fork() - if pidp == 0: # child + if pidp == 0: # child, command to run if stdoutff: # connect child (this) stdout to pipe write end if not use_pty: @@ -132,8 +131,8 @@ if cfile != "" and colour: if stdoutff: pido = os.fork() - if pido == 0: # child - # connect grcat's stdin to pipe read end + 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: From 0928d0b936c670b345bf6e66b10516de480df4b1 Mon Sep 17 00:00:00 2001 From: Leonardo Brondani Schenkel Date: Sat, 24 Sep 2016 16:15:36 +0200 Subject: [PATCH 17/49] Support the XDG Base Directory Specification --- grc | 15 +++++++++++---- grcat | 19 ++++++++++++++++--- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/grc b/grc index e0ee182..0091ff3 100755 --- a/grc +++ b/grc @@ -71,10 +71,17 @@ if stdoutf == 1: conffile = None if cfile == "": - home = [] - if 'HOME' in os.environ: - home = [os.environ['HOME']+"/.grc/grc.conf"] - conffilenames = home + ["/etc/grc.conf"] + 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: if os.path.isfile(i): conffile = i diff --git a/grcat b/grcat index 4187142..5aed820 100755 --- a/grcat +++ b/grcat @@ -84,9 +84,22 @@ def get_colour(x): home = [] conffile = None -if 'HOME' in os.environ: - home = [os.environ['HOME']+"/.grc/"] -conffilepath = [""] + home + ["/usr/local/share/grc/", "/usr/share/grc/"] +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) From fabdbcaf081e76af31bbcac267828939dfa6face Mon Sep 17 00:00:00 2001 From: Jonas Minnberg Date: Wed, 28 Sep 2016 11:48:08 +0200 Subject: [PATCH 18/49] Added 'concat' option for appending matches to a file --- README.markdown | 4 +++- grcat | 7 ++++++- grcat.1 | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index 9ed041c..0f92fd9 100644 --- a/README.markdown +++ b/README.markdown @@ -26,7 +26,7 @@ Each entry consists of several lines. Each line has form: `keyword=value` -where keyword is one of: regexp, colours, command, skip, replace, count +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. @@ -44,6 +44,8 @@ This is useful on a 256-colour enabled xterm, where e.g. `colours="\033[38;5;22 **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. diff --git a/grcat b/grcat index 4187142..d7ec1b9 100755 --- a/grcat +++ b/grcat @@ -130,7 +130,7 @@ while not is_last: keyword = lower(keyword) if keyword in ('colors', 'colour', 'color'): keyword = 'colours' - if not keyword in ["regexp", "colours", "count", "command", "skip", "replace"]: + if not keyword in ["regexp", "colours", "count", "command", "skip", "replace", "concat"]: raise ValueError("Invalid keyword") ll[keyword] = value @@ -210,6 +210,11 @@ while 1: 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: diff --git a/grcat.1 b/grcat.1 index d084fbb..80c2a0d 100644 --- a/grcat.1 +++ b/grcat.1 @@ -25,6 +25,7 @@ where keyword is one of: .BR regexp ", .BR colours ", .BR command ", +.BR concat ", .BR skip ", .BR count ". Only From 0eb46ed91227ba5a58da5024cabb103ba0c5f87b Mon Sep 17 00:00:00 2001 From: Dave Wikoff Date: Sat, 8 Oct 2016 02:27:29 -0400 Subject: [PATCH 19/49] Fix headers for docker-compose --- conf.dockerps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.dockerps b/conf.dockerps index 04a3753..0445510 100644 --- a/conf.dockerps +++ b/conf.dockerps @@ -1,5 +1,5 @@ # HEADERS -regexp=(?:\s|^)(CONTAINER ID|IMAGE|COMMAND|CREATED|STATUS|PORTS|NAMES)(?:\s|$) +regexp=(?:\s|^)(CONTAINER ID|IMAGE|COMMAND|CREATED|STATUS|PORTS|NAMES|Name|Command|State|Ports)(?:\s|$) colours=default,underline ====== # Commands From 9b81a22581245c68a7cc5021cd9af7e22cc8953e Mon Sep 17 00:00:00 2001 From: Dave Wikoff Date: Sat, 8 Oct 2016 02:28:02 -0400 Subject: [PATCH 20/49] Fix docker ps for docker-compose --- grc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grc.conf b/grc.conf index def4c44..2c56e3e 100644 --- a/grc.conf +++ b/grc.conf @@ -83,7 +83,7 @@ conf.mount conf.df # docker ps -(^|[/\w\.]+/)docker ps\s? +(^|[/\w\.]+/)docker(-compose)? ps\s? conf.dockerps # docker images From c66f3b7363a554e01be7e31c0c22ca2d8e356df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Mon, 17 Oct 2016 20:47:57 +0200 Subject: [PATCH 21/49] some debugs --- grc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grc b/grc index f0e56e5..db0dd12 100755 --- a/grc +++ b/grc @@ -24,6 +24,7 @@ Options:") def catch_signal(signum, frame): "catch signal sent to grc and forward it to the original application" global pidp +# print('signal') try: os.kill(pidp, signum) except OSError: # if the subprocess already died @@ -155,12 +156,15 @@ if cfile != "" and colour: 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) From cc15ffed57c4d8e4150dc30204d1ce16d587f267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Mon, 17 Oct 2016 21:13:35 +0200 Subject: [PATCH 22/49] add ipv6 and hwaddr to 'ip' config --- conf.ip | 11 +++++++++++ grc.conf | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/conf.ip b/conf.ip index 56355df..999714d 100644 --- a/conf.ip +++ b/conf.ip @@ -2,6 +2,17 @@ regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} colours=magenta - + +# ipv6 number +regexp=[0-9a-fA-F]{0,4}(\:\:?[0-9a-fA-F]{0,4})+?(\/\d{1,3}) +colours=magenta +- + +# hwaddr +regexp=(\d|[a-f]){2}(\:(\d|[a-f]){2}){5} +colours=yellow +- + # parenthesis regexp=\(|\) colours=yellow diff --git a/grc.conf b/grc.conf index 2c56e3e..c2bc598 100644 --- a/grc.conf +++ b/grc.conf @@ -101,3 +101,8 @@ conf.dockerinfo # journalctl command (^|[/\w\.]+/)journalctl?\s conf.log + +# ip command +(^|[/\w\.]+/)ip?\s +conf.ip + From 8b5313fb3a909f79f128d156768cfbb4bf04dc5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Mon, 17 Oct 2016 21:56:21 +0200 Subject: [PATCH 23/49] unify colours for ip --- conf.ip | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/conf.ip b/conf.ip index 999714d..e248789 100644 --- a/conf.ip +++ b/conf.ip @@ -1,16 +1,16 @@ -# ip number +# IP4 regexp=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} -colours=magenta +colours=bold yellow - -# ipv6 number +# IP6 regexp=[0-9a-fA-F]{0,4}(\:\:?[0-9a-fA-F]{0,4})+?(\/\d{1,3}) -colours=magenta +colours=yellow - -# hwaddr +# MAC regexp=(\d|[a-f]){2}(\:(\d|[a-f]){2}){5} -colours=yellow +colours=magenta - # parenthesis From 0a658d90f13f4fcdb87149e08ded3e407ff26f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Wed, 26 Oct 2016 13:09:10 +0200 Subject: [PATCH 24/49] add ioping --- grc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grc.conf b/grc.conf index ffd3cea..7026eef 100644 --- a/grc.conf +++ b/grc.conf @@ -11,7 +11,7 @@ conf.log conf.configure # ping command -(^|[/\w\.]+/)o?ping6?\s +(^|[/\w\.]+/)(io|o)?ping6?\s conf.ping # traceroute command From 18d69b24bf3ba289d76880ec30721ddc855f9cff Mon Sep 17 00:00:00 2001 From: Dave Wikoff Date: Sun, 20 Nov 2016 17:13:28 -0500 Subject: [PATCH 25/49] Update docker ps and docker-compose ps regex. --- conf.dockerimages | 20 ++++++++++++++++---- conf.dockerps | 43 +++++++++++++++++++++++++++++-------------- grc.conf | 2 +- 3 files changed, 46 insertions(+), 19 deletions(-) diff --git a/conf.dockerimages b/conf.dockerimages index 875ef32..a1561b7 100644 --- a/conf.dockerimages +++ b/conf.dockerimages @@ -1,3 +1,7 @@ +# HEADERS +regexp=(?:\s|^)(REPOSITORY|TAG|IMAGE ID|CREATED|SIZE)(?:\s|$) +colours=default,underline +===== # REPO, TAG regexp=^([a-z]+\/?[^\s]+)\s+([^\s]+)\s+(\w+) colours=default,bold white,cyan,bold black @@ -7,13 +11,21 @@ regexp=^.*$ colours=bold red ===== # Size 'K' -regexp=\s\d*[.,]?\d\sKB? +regexp=\s\d*[\.,]?\d*\sKB? colours=green ====== -# Size 'M' -regexp=\s\d*[.,]?\d\sMB? +# Size 'M', 2 digits +regexp=\s\d{1,2}[\.,]?\d*\sMB? +colours=green +====== +# Size 'M' 3+ digits +regexp=\s\d{3,4}[\.,]?\d*\sMB? colours=yellow ====== # Size 'G' -regexp=\s\d*[.,]?\d\sGB? +regexp=\s\d*[\.,]?\d*\sGB? colours=red +====== +# Date Ago +regexp=(?:\s{2}|^)(?:\w+\s)+ago +colours=cyan diff --git a/conf.dockerps b/conf.dockerps index 2f94398..1940484 100644 --- a/conf.dockerps +++ b/conf.dockerps @@ -1,19 +1,34 @@ -# IMAGE -regexp=^(?!CONTAINER)(\w+)\s+([^\s]+)\s+(".*")\s+(.*(?=(?:Up|Exited))) -colours=default,bold black,bold white,bold black,cyan +# This is for docker ps and docker-compose ps +# Headers +regexp=(?:\s{2}|^)(CONTAINER ID|IMAGE|COMMAND|CREATED|STATUS|PORTS|NAMES|Name|Command|State|Ports)(?:\s|$) +colours=default,underline ====== +# Commands (docker ps) +regexp=(?:\s{2}|^)(?:\s\")(.*)(?:\")(?:\s{2}|$) +colours=magenta +======= +# Date Ago (docker ps) +regexp=(?:\s{2}|^)(?:\w+\s)+ago +colours=cyan +====== +# Statuses +# https://github.com/docker/docker/blob/e5a3f86e447dd659da3c2e759f3c088a0bfcfe3d/container/state.go#L40 # Up -regexp=\sUp\s(\d+|\w+)\s\w+(?:\s\w+)? +regexp=(?:\s{2}|^)(?:Up|Restarting)(?:(?:\s[\w,\d,(,)]+)+)? colours=bold green ====== # Exited -regexp=\sExited\s.(\d+).\s.+ago -colours=bold red,red -# PORTS -====== -regexp=(?:\d{1,3}\.){3}\d{1,3}[^\s]* -colours=bold blue -====== -# NAMES -regexp=(?:([a-z\-_0-9]+)/)*([a-z\-_0-9]+)$ -colours=default,yellow,bold yellow +regexp=(?:\s{2}|^)(?:Exited|Exit|Dead|Removal In Progress)(?:(?:\s[\w,\d,(,)]+)+)? +colours=bold red +======= +# Ip Addresses / Ports +regexp=(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(\:)?(\d{1,5}))?(->)?(\d{1,5})(\/)(\w+) +colours=blue,default,bright_green,default,bright_green,default,bright_blue +======= +# Name and command in docker-compose ps. +regexp=(?:\s{2}|^)(?:[a-z\-_0-9]+)(?:\s{2}|$)(?:\s+(.+?)\s{2,})? +colours=bold yellow,magenta +======= +# Container ID / Image ID and Image. Need to be together to override the "name" regex. +regexp=(?:\s{2}|^)([a-z0-9]+)\s{2,}((?:(?:[a-z\-_0-9\.]+)+(\/|:)?)+) +colours=default,cyan,default diff --git a/grc.conf b/grc.conf index fa221d5..15b3487 100644 --- a/grc.conf +++ b/grc.conf @@ -83,7 +83,7 @@ conf.mount conf.df # docker ps -(^|[/\w\.]+/)docker ps\s? +(^|[/\w\.]+/)docker(-compose)? ps\s? conf.dockerps # docker images From 5e0bc0235cfe4c91e35a5a815488be292b2b9c49 Mon Sep 17 00:00:00 2001 From: alcik <4lcik9@gmail.com> Date: Fri, 25 Nov 2016 13:10:44 +0100 Subject: [PATCH 26/49] configuratoion for ant and maven Configuration for Apache Ant and Apache Maven building systems --- conf.ant | 46 ++++++++++++++++++++++++++++ conf.mvn | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ grc.conf | 8 +++++ 3 files changed, 146 insertions(+) create mode 100644 conf.ant create mode 100644 conf.mvn diff --git a/conf.ant b/conf.ant new file mode 100644 index 0000000..ab8cc72 --- /dev/null +++ b/conf.ant @@ -0,0 +1,46 @@ +# 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 + diff --git a/conf.mvn b/conf.mvn new file mode 100644 index 0000000..b62a538 --- /dev/null +++ b/conf.mvn @@ -0,0 +1,92 @@ +# 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 +============== +# linijki [INFO] ---- +regexp=\s[-]{6,} +colours=red +count=more +============== +# linijki ^---- +regexp=^[-]{6,} +colours=yellow +count=more +============== +# linijki T E S T S +regexp=^ T E S T S +colours=yellow +count=more +============== +# linijki ^Tests run: +regexp=^Tests run: ([\d]+) +colours=yellow,green +count=more +============== +# linijki ^Tests run: Failures/Errors/Skipped +regexp=(Failures|Errors|Skipped):\s([\d]+) +colours=none,yellow,bold red +count=more +============== +# linijki ^Tests run: Failures/Errors/Skipped +regexp=(Failures|Errors|Skipped):\s(0)\D? +colours=none,yellow,green +count=more +============== +# podsumowanie +regexp=\s(Total time: )(.*)$ +colours=none,none,bold yellow +count=more +============== +# podsumowanie +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 + + diff --git a/grc.conf b/grc.conf index 7026eef..ffc345b 100644 --- a/grc.conf +++ b/grc.conf @@ -238,3 +238,11 @@ conf.getfacl (^|[/\w\.]+/)showmount\s? conf.showmount +# apache ant command +(^|[/\w\.]+/)ant\s? +conf.ant + +# # apache maven command +(^|[/\w\.]+/)mvn\s? +conf.mvn + From 759e35a1dcbf49cf58bb52ef461fdb7aefb13b6e Mon Sep 17 00:00:00 2001 From: alcik <4lcik9@gmail.com> Date: Tue, 29 Nov 2016 01:45:49 +0100 Subject: [PATCH 27/49] repair comments --- conf.mvn | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/conf.mvn b/conf.mvn index b62a538..71bf543 100644 --- a/conf.mvn +++ b/conf.mvn @@ -24,42 +24,42 @@ regexp=^\[debug\] colours=magenta count=more ============== -# linijki [INFO] ---- +# lines [INFO] ---- regexp=\s[-]{6,} colours=red count=more ============== -# linijki ^---- +# lines ^---- regexp=^[-]{6,} colours=yellow count=more ============== -# linijki T E S T S +# lines T E S T S regexp=^ T E S T S colours=yellow count=more ============== -# linijki ^Tests run: +# lines ^Tests run: regexp=^Tests run: ([\d]+) colours=yellow,green count=more ============== -# linijki ^Tests run: Failures/Errors/Skipped +# lines ^Tests run: Failures/Errors/Skipped regexp=(Failures|Errors|Skipped):\s([\d]+) colours=none,yellow,bold red count=more ============== -# linijki ^Tests run: Failures/Errors/Skipped +# lines ^Tests run: Failures/Errors/Skipped regexp=(Failures|Errors|Skipped):\s(0)\D? colours=none,yellow,green count=more ============== -# podsumowanie +# summary regexp=\s(Total time: )(.*)$ colours=none,none,bold yellow count=more ============== -# podsumowanie +# summary regexp=\s(Finished at: )(.*)$ colours=none,none,bold yellow count=more From 82ca58087cae842282651f15984f9c1134560d01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Wed, 14 Dec 2016 14:53:36 +0100 Subject: [PATCH 28/49] conffile can be a pipe --- grc | 3 ++- grcat | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/grc b/grc index 4e09528..406dbfd 100755 --- a/grc +++ b/grc @@ -93,7 +93,8 @@ if cfile == "": conffilenames += [home + '/.grc/grc.conf'] conffilenames += ['/usr/local/etc/grc.conf', '/etc/grc.conf'] for i in conffilenames: - if os.path.isfile(i): + # 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 = [] diff --git a/grcat b/grcat index ccd4a14..7cd693a 100755 --- a/grcat +++ b/grcat @@ -106,7 +106,8 @@ if len(sys.argv) != 2: conffile_arg = sys.argv[1] # tentative conffile for i in conffilepath: - if os.path.isfile(i+conffile_arg): + # 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 From f377998feb1669546499346c23e45e5d949e9847 Mon Sep 17 00:00:00 2001 From: Justin Lecher Date: Tue, 27 Dec 2016 11:37:31 +0000 Subject: [PATCH 29/49] Support matching for IPv6 versions of tcp & udp Signed-off-by: Justin Lecher --- conf.netstat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.netstat b/conf.netstat index 2dd96e3..38ed848 100644 --- a/conf.netstat +++ b/conf.netstat @@ -19,7 +19,7 @@ regexp=^IPX.*[\dABCDEF]+:[\dABCDEF]+ colours=green ======= # protocols -regexp=(^tcp|^udp|^unix|^IPX|STREAM|DGRAM) +regexp=(^tcp6?|^udp6?|^unix|^IPX|STREAM|DGRAM) colours=bold blue ======= # status From 38d8cd75fe16b887789eb0c18eae574928926cd5 Mon Sep 17 00:00:00 2001 From: Justin Lecher Date: Tue, 27 Dec 2016 12:27:29 +0000 Subject: [PATCH 30/49] Support more coloring around gcc Signed-off-by: Justin Lecher --- conf.gcc | 14 +++++++++----- grc.conf | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/conf.gcc b/conf.gcc index 839a803..9523a4f 100644 --- a/conf.gcc +++ b/conf.gcc @@ -1,7 +1,7 @@ # -regexp=\bgcc\b -colours=yellow -count=more +regexp=\b(g?cc|[gc]\+\+|g?as|ld)\b +colours=white bold +count=once ......... # regexp=^[^:\s]*?:\d+: @@ -15,6 +15,10 @@ 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 @@ -27,7 +31,7 @@ colours=yellow # stderr to grcat # # warning -regexp=warning:.* +regexp=[Ww]arning[:\b] colours=white ......... regexp=warning: @@ -35,7 +39,7 @@ colours=bold yellow count=once ......... # error -regexp=error:.* +regexp=[Ee]rror[:\b] colours=bold white ......... regexp=error: diff --git a/grc.conf b/grc.conf index fa221d5..10eaf62 100644 --- a/grc.conf +++ b/grc.conf @@ -19,7 +19,7 @@ conf.ping conf.traceroute # gcc command -(^|[/\w\.]+/)g?cc\s +(^|[/\w\.]+/)(g?cc|[gc]\+\+)\s conf.gcc # make command From 1d4f9e1ca5a27426da4dcbd3caee1e38b5d272aa Mon Sep 17 00:00:00 2001 From: Justin Lecher Date: Tue, 27 Dec 2016 13:17:27 +0000 Subject: [PATCH 31/49] Use bash internal functionalities for grc detection which is an external tool, where as type is a bash internal funciton and always available Signed-off-by: Justin Lecher --- grc.bashrc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/grc.bashrc b/grc.bashrc index e9eba08..54e570d 100644 --- a/grc.bashrc +++ b/grc.bashrc @@ -1,6 +1,5 @@ -GRC=`which grc` -if [ "$TERM" != dumb ] && [ -n "$GRC" ] -then +GRC="$(type -p grc)" +if [ "$TERM" != dumb ] && [ -n "$GRC" ]; then alias colourify="$GRC -es --colour=auto" alias configure='colourify ./configure' alias diff='colourify diff' From 6d7ab5f6486c6d30a685605aa5b0ecfda0434e86 Mon Sep 17 00:00:00 2001 From: Justin Lecher Date: Tue, 27 Dec 2016 17:32:48 +0000 Subject: [PATCH 32/49] More advanced regex for configure colouring Signed-off-by: Justin Lecher --- conf.configure | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/conf.configure b/conf.configure index ac88ec7..e7b5d89 100644 --- a/conf.configure +++ b/conf.configure @@ -1,14 +1,27 @@ -regexp=^checking +# 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 ......... -regexp=\.\.\. yes$ +# check succeeded +regexp=\.\.\.( \(cached\))? yes$ colours=bold cyan ......... -regexp=\.\.\. no$ +# check did not succeed +regexp=\.\.\.( \(cached\))? no$ colours=bold red ......... -regexp=\.\.\.[ ] +# ... should be normal +regexp=\.\.\. colours=default +......... +# creating stuff +regexp=\bcreating\b +colours=green From 638a6f94e6f0e6c4dcce1011b120528377b44716 Mon Sep 17 00:00:00 2001 From: Justin Lecher Date: Tue, 27 Dec 2016 12:30:44 +0000 Subject: [PATCH 33/49] Convert for py3 compatibility Signed-off-by: Justin Lecher --- grc | 2 ++ grcat | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/grc b/grc index e0ee182..eae9fc6 100755 --- a/grc +++ b/grc @@ -1,5 +1,7 @@ #! /usr/bin/env python +from __future__ import print_function + import os, re, string, sys, getopt, signal def version(): diff --git a/grcat b/grcat index 4187142..a5ec03c 100755 --- a/grcat +++ b/grcat @@ -1,5 +1,7 @@ #! /usr/bin/env python +from __future__ import print_function + import sys, os, string, re, signal, errno #some default definitions @@ -147,16 +149,12 @@ while not is_last: # do not try to understand the optimized form below :-) if 'colours' in ll: colstrings = list( - map( - lambda colgroup: - ''.join(map(lambda x: get_colour(x), split(colgroup))), - split(ll['colours'], ',') - ) + [''.join([get_colour(x) for x in split(colgroup)]) for colgroup in split(ll['colours'], ',')] ) ll['colours'] = colstrings cs = ll['count'] - if ll.has_key('regexp'): + if 'regexp' in ll: ll['regexp'] = re.compile(ll['regexp']).search regexplist.append(ll) From 94a46c60f811e5f8d8a712d4d6e7bf0488485912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Thu, 5 Jan 2017 16:47:47 +0100 Subject: [PATCH 34/49] python3 --- grcat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grcat b/grcat index 3ff0c07..dc48a59 100755 --- a/grcat +++ b/grcat @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 from __future__ import print_function From f1e635ee6be3c8ff8979b52386cd206ef96ae1e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Thu, 5 Jan 2017 16:50:42 +0100 Subject: [PATCH 35/49] new version --- debian/changelog | 7 +++++++ grc | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d46eb8c..38ae84f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grc (1.10-1) unstable; urgency=low + + * many configuration files added + * python3 compatible + + -- Radovan Garabík Thu, 05 Jan 2017 16:48:58 +0100 + grc (1.9-1) unstable; urgency=low * add `colors' as a synonym of `colours' (and the singulars, too) diff --git a/grc b/grc index 8e7467d..c3536d7 100755 --- a/grc +++ b/grc @@ -6,11 +6,11 @@ import os, re, string, sys, getopt, signal def version(): - print ("Generic Colouriser 1.9.1test") + print ("Generic Colouriser 1.10test") sys.exit() def help(): - print("""Generic Colouriser 1.9.1test + print("""Generic Colouriser 1.10test grc [options] command [args] Options:") -e --stderr redirect stderr. If this option is selected, From 85b3425a97b15aa1990d8f6c8c4a87224288c9ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Thu, 19 Jan 2017 10:52:48 +0100 Subject: [PATCH 36/49] delete stray link --- default | 1 - 1 file changed, 1 deletion(-) delete mode 120000 default diff --git a/default b/default deleted file mode 120000 index 22aef37..0000000 --- a/default +++ /dev/null @@ -1 +0,0 @@ -/usr/share/grc/ \ No newline at end of file From 0fb534c2ac28808a9bac0e87691da076af3f2b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Thu, 19 Jan 2017 10:55:56 +0100 Subject: [PATCH 37/49] remove symlink --- conf.mount | 12 +++++++++++- conf.mount2 | 11 ----------- 2 files changed, 11 insertions(+), 12 deletions(-) mode change 120000 => 100644 conf.mount delete mode 100644 conf.mount2 diff --git a/conf.mount b/conf.mount deleted file mode 120000 index 2522d37..0000000 --- a/conf.mount +++ /dev/null @@ -1 +0,0 @@ -conf.mount2 \ No newline at end of file diff --git a/conf.mount b/conf.mount new file mode 100644 index 0000000..c44cdb5 --- /dev/null +++ b/conf.mount @@ -0,0 +1,11 @@ +# Intended for colouring 'mount' output +# written by Emanuele Aina + +regexp=^(.*) on (.*) type (.*) \((.*)\) +colours=default,green,yellow,blue,magenta +===== +regexp=^cgroup.* +colours=bright_black +===== +regexp=^tmpfs.* +colours=bright_black diff --git a/conf.mount2 b/conf.mount2 deleted file mode 100644 index c44cdb5..0000000 --- a/conf.mount2 +++ /dev/null @@ -1,11 +0,0 @@ -# Intended for colouring 'mount' output -# written by Emanuele Aina - -regexp=^(.*) on (.*) type (.*) \((.*)\) -colours=default,green,yellow,blue,magenta -===== -regexp=^cgroup.* -colours=bright_black -===== -regexp=^tmpfs.* -colours=bright_black From 6dd1ff8b95a7aa72e12f88e2d57ab391427c0c85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Thu, 19 Jan 2017 11:05:18 +0100 Subject: [PATCH 38/49] debian python dependency --- debian/control | 2 +- debian/rules | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 8cb98a4..930972e 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Build-Depends: debhelper (>=9) Package: grc Architecture: all -Depends: python, ${misc:Depends} +Depends: ${python:Depends}, ${misc:Depends} Description: generic colouriser for everything generic colouriser, can be used to colourise logfiles, output of commands, arbitrary text.... diff --git a/debian/rules b/debian/rules index 4fdda70..235fe8c 100755 --- a/debian/rules +++ b/debian/rules @@ -47,7 +47,7 @@ binary-indep: build install dh_installman grc.1 grcat.1 dh_installinfo # dh_undocumented - dh_installchangelogs + dh_installchangelogs dh_link dh_strip dh_compress @@ -57,6 +57,7 @@ binary-indep: build install # dh_makeshlibs dh_installdeb # dh_perl + dh_python2 dh_shlibdeps dh_gencontrol dh_md5sums From 2aa2f36139d5fae3cdfd34505afb42ee8edf88b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Thu, 19 Jan 2017 11:06:46 +0100 Subject: [PATCH 39/49] debian python-dev dependency --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 930972e..36fec57 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: text Priority: optional Maintainer: Radovan Garabík Standards-Version: 3.9.6 -Build-Depends: debhelper (>=9) +Build-Depends: debhelper (>=9), python-dev Package: grc Architecture: all From ea5e50953aa34d01a610699015b2d5a87861d65c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Thu, 19 Jan 2017 11:09:36 +0100 Subject: [PATCH 40/49] debian python build dependency --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 36fec57..a83e134 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: text Priority: optional Maintainer: Radovan Garabík Standards-Version: 3.9.6 -Build-Depends: debhelper (>=9), python-dev +Build-Depends: debhelper (>=9), python Package: grc Architecture: all From 3125d93c3dfaf76e92392c7cf6e654a1cf92db77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Fri, 27 Jan 2017 16:29:44 +0100 Subject: [PATCH 41/49] python3 debian package dependency --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index a83e134..0c1b330 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Build-Depends: debhelper (>=9), python Package: grc Architecture: all -Depends: ${python:Depends}, ${misc:Depends} +Depends: ${python3:Depends}, ${misc:Depends} Description: generic colouriser for everything generic colouriser, can be used to colourise logfiles, output of commands, arbitrary text.... From cab7d78d5587396a1b7283c0fa7c4fdc8f219b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Fri, 27 Jan 2017 16:30:31 +0100 Subject: [PATCH 42/49] python3 in debian/rules --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 235fe8c..7931293 100755 --- a/debian/rules +++ b/debian/rules @@ -57,7 +57,7 @@ binary-indep: build install # dh_makeshlibs dh_installdeb # dh_perl - dh_python2 + dh_python3 dh_shlibdeps dh_gencontrol dh_md5sums From 8c99f756784f454c4cc681a1f5bf78289234fb7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Fri, 27 Jan 2017 16:31:15 +0100 Subject: [PATCH 43/49] python3 build dependency --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 0c1b330..b91aa12 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: text Priority: optional Maintainer: Radovan Garabík Standards-Version: 3.9.6 -Build-Depends: debhelper (>=9), python +Build-Depends: debhelper (>=9), python3:any Package: grc Architecture: all From 826b7d062b70844d75f193c35bc59deab2899264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Fri, 27 Jan 2017 16:34:55 +0100 Subject: [PATCH 44/49] spam-protect e-mails --- CREDITS | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CREDITS b/CREDITS index 5553962..c302835 100644 --- a/CREDITS +++ b/CREDITS @@ -1,11 +1,11 @@ Credits 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 Kollar -Christian Zuckschwerdt +Piotr Klaban +Jason Tackaberry +Eivind Tagseth +Edward Betts +Joey Hess +Miguel Gualdron +Daniel Kollar +Christian Zuckschwerdt From 5bc310369a96a936c785e9ff024891ff5e019bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Fri, 27 Jan 2017 16:53:52 +0100 Subject: [PATCH 45/49] update credits, remove e-mails --- CREDITS | 49 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/CREDITS b/CREDITS index c302835..7eb2721 100644 --- a/CREDITS +++ b/CREDITS @@ -1,11 +1,44 @@ Credits 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 Kollar -Christian Zuckschwerdt +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 + + From 8baa92d61616ba1dcf61a6cbebb7786a096e8194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Fri, 27 Jan 2017 16:57:43 +0100 Subject: [PATCH 46/49] do not install bash profile in debian --- debian/rules | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 7931293..968d0b8 100755 --- a/debian/rules +++ b/debian/rules @@ -19,7 +19,8 @@ install: # Add here commands to install the package into debian/tmp. ./install.sh `pwd`/debian/grc/usr `pwd`/debian/grc - + # this is too invasive, would be incluided in a next major version + rm `pwd`/debian/grc/etc/profile.d/grc.bashrc build: build-arch build-indep build-arch: build-stamp From 69ecfd408b497689260c66f54f549929af576e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Fri, 27 Jan 2017 16:59:24 +0100 Subject: [PATCH 47/49] release version --- grc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grc b/grc index c3536d7..2910411 100755 --- a/grc +++ b/grc @@ -6,11 +6,11 @@ import os, re, string, sys, getopt, signal def version(): - print ("Generic Colouriser 1.10test") + print ("Generic Colouriser 1.10") sys.exit() def help(): - print("""Generic Colouriser 1.10test + print("""Generic Colouriser 1.10 grc [options] command [args] Options:") -e --stderr redirect stderr. If this option is selected, From d6b256fc12361f75bacc858a9e7de582b0effb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Sat, 28 Jan 2017 15:44:37 +0100 Subject: [PATCH 48/49] build dependency --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index b91aa12..1aee572 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: text Priority: optional Maintainer: Radovan Garabík Standards-Version: 3.9.6 -Build-Depends: debhelper (>=9), python3:any +Build-Depends: debhelper (>=9), python3 Package: grc Architecture: all From bd94adda6ce7028564c977fd983eb55adc0a5034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Garab=C3=ADk?= Date: Sat, 28 Jan 2017 15:50:31 +0100 Subject: [PATCH 49/49] debian package date --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 38ae84f..d67d396 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,7 +3,7 @@ grc (1.10-1) unstable; urgency=low * many configuration files added * python3 compatible - -- Radovan Garabík Thu, 05 Jan 2017 16:48:58 +0100 + -- Radovan Garabík Sat, 28 Jan 2017 15:48:58 +0100 grc (1.9-1) unstable; urgency=low