From 7b22db50d354c8bd9dea74eb6086f6b5862cc31b Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 25 Apr 2022 18:50:36 -0700 Subject: [PATCH 01/21] remove single quotes around asciified string --- jc/cli.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jc/cli.py b/jc/cli.py index 976ceabb..aaedfbce 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -90,8 +90,10 @@ def asciify(string): conversions. """ string = string.replace('©', '(c)') - string = ascii(string) - return string.replace(r'\n', '\n') + # the ascii() function adds single quotes around the string + string = ascii(string)[1:-1] + string = string.replace(r'\n', '\n') + return string def set_env_colors(env_colors=None): From 5bb4e2b4b6bdf7ac113527a483d56478306bf7af Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 25 Apr 2022 19:22:18 -0700 Subject: [PATCH 02/21] revert f-string to regular string --- jc/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jc/cli.py b/jc/cli.py index aaedfbce..1657a321 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -37,7 +37,7 @@ class info(): author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' website = 'https://github.com/kellyjonbrazil/jc' - copyright = f'© 2019-2022 Kelly Brazil' + copyright = '© 2019-2022 Kelly Brazil' license = 'MIT License' From e04cd298fb05b3870e9cbae141c222bf64ea55b9 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 25 Apr 2022 19:25:58 -0700 Subject: [PATCH 03/21] version bump --- CHANGELOG | 5 ++++- jc/lib.py | 2 +- setup.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index acc744c5..3710a13e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,12 +1,15 @@ jc changelog +20220425 v1.18.8 +- Fix quotation marks around asciified output with UnicodeEncodeError + 20220425 v1.18.7 - Add git log command parser - Add update-alternatives --query parser - Add update-alternatives --get-selections parser - Fix key/value and ini parsers to allow duplicate keys - Fix yaml file parser for files including timestamp objects -- Fix UnicodeDecodeError on some systems where LANG=C is set and unicode +- Fix UnicodeEncodeError on some systems where LANG=C is set and unicode characters are in the output - Update xrandr parser: add a 'rotation' field - Fix failing tests by moving template files diff --git a/jc/lib.py b/jc/lib.py index 252a1171..7184ffce 100644 --- a/jc/lib.py +++ b/jc/lib.py @@ -6,7 +6,7 @@ import importlib from typing import Dict, List, Iterable, Union, Iterator from jc import appdirs -__version__ = '1.18.7' +__version__ = '1.18.8' parsers = [ 'acpi', diff --git a/setup.py b/setup.py index 2bf6de38..3ab23866 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open('README.md', 'r') as f: setuptools.setup( name='jc', - version='1.18.7', + version='1.18.8', author='Kelly Brazil', author_email='kellyjonbrazil@gmail.com', description='Converts the output of popular command-line tools and file-types to JSON.', From dd231ae293161efe379aa603827f5fca11e9a051 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 26 Apr 2022 09:57:12 -0700 Subject: [PATCH 04/21] for for UnicodeEncodeError exception when printing JSON --- CHANGELOG | 7 ++--- jc/cli.py | 90 +++++++++++++++++++++++++++++++++---------------------- 2 files changed, 58 insertions(+), 39 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3710a13e..97d8dc8a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,8 @@ jc changelog -20220425 v1.18.8 -- Fix quotation marks around asciified output with UnicodeEncodeError +20220426 v1.18.8 +- Fix UnicodeEncodeError on some systems where LANG=C is set and unicode + characters are in the output 20220425 v1.18.7 - Add git log command parser @@ -9,8 +10,6 @@ jc changelog - Add update-alternatives --get-selections parser - Fix key/value and ini parsers to allow duplicate keys - Fix yaml file parser for files including timestamp objects -- Fix UnicodeEncodeError on some systems where LANG=C is set and unicode - characters are in the output - Update xrandr parser: add a 'rotation' field - Fix failing tests by moving template files - Add python interpreter version and path to -v and -a output diff --git a/jc/cli.py b/jc/cli.py index 1657a321..56006a3d 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -274,7 +274,7 @@ def versiontext(): return textwrap.dedent(versiontext_string) -def json_out(data, pretty=False, env_colors=None, mono=False, piped_out=False): +def json_out(data, pretty=False, env_colors=None, mono=False, piped_out=False, ascii_only=False): """ Return a JSON formatted string. String may include color codes or be pretty printed. @@ -291,23 +291,13 @@ def json_out(data, pretty=False, env_colors=None, mono=False, piped_out=False): class JcStyle(Style): styles = set_env_colors(env_colors) - try: - return str(highlight(json.dumps(data, - indent=indent, - separators=separators, - ensure_ascii=False), - JsonLexer(), Terminal256Formatter(style=JcStyle))[0:-1]) - except UnicodeEncodeError: - return str(highlight(json.dumps(data, - indent=indent, - separators=separators, - ensure_ascii=True), - JsonLexer(), Terminal256Formatter(style=JcStyle))[0:-1]) + return str(highlight(json.dumps(data, + indent=indent, + separators=separators, + ensure_ascii=ascii_only), + JsonLexer(), Terminal256Formatter(style=JcStyle))[0:-1]) - try: - return json.dumps(data, indent=indent, separators=separators, ensure_ascii=False) - except UnicodeEncodeError: - return json.dumps(data, indent=indent, separators=separators, ensure_ascii=True) + return json.dumps(data, indent=indent, separators=separators, ensure_ascii=ascii_only) def magic_parser(args): @@ -445,11 +435,19 @@ def main(): mono = True if about: - print(json_out(about_jc(), - pretty=pretty, - env_colors=jc_colors, - mono=mono, - piped_out=piped_output(force_color))) + try: + print(json_out(about_jc(), + pretty=pretty, + env_colors=jc_colors, + mono=mono, + piped_out=piped_output(force_color))) + except UnicodeEncodeError: + print(json_out(about_jc(), + pretty=pretty, + env_colors=jc_colors, + mono=mono, + piped_out=piped_output(force_color), + ascii_only=True)) sys.exit(0) if help_me: @@ -478,7 +476,10 @@ def main(): try: magic_stdout, magic_stderr, magic_exit_code = run_user_command(run_command) if magic_stderr: - print(magic_stderr[:-1], file=sys.stderr) + try: + print(magic_stderr[:-1], file=sys.stderr) + except UnicodeEncodeError: + print(asciify(magic_stderr[:-1], file=sys.stderr)) except OSError as e: if debug: @@ -542,12 +543,21 @@ def main(): quiet=quiet, ignore_exceptions=ignore_exceptions) for line in result: - print(json_out(line, - pretty=pretty, - env_colors=jc_colors, - mono=mono, - piped_out=piped_output(force_color)), - flush=unbuffer) + try: + print(json_out(line, + pretty=pretty, + env_colors=jc_colors, + mono=mono, + piped_out=piped_output(force_color)), + flush=unbuffer) + except UnicodeEncodeError: + print(json_out(line, + pretty=pretty, + env_colors=jc_colors, + mono=mono, + piped_out=piped_output(force_color), + ascii_only=True), + flush=unbuffer) sys.exit(combined_exit_code(magic_exit_code, 0)) @@ -557,12 +567,22 @@ def main(): result = parser.parse(data, raw=raw, quiet=quiet) - print(json_out(result, - pretty=pretty, - env_colors=jc_colors, - mono=mono, - piped_out=piped_output(force_color)), - flush=unbuffer) + + try: + print(json_out(result, + pretty=pretty, + env_colors=jc_colors, + mono=mono, + piped_out=piped_output(force_color)), + flush=unbuffer) + except UnicodeEncodeError: + print(json_out(result, + pretty=pretty, + env_colors=jc_colors, + mono=mono, + piped_out=piped_output(force_color), + ascii_only=True), + flush=unbuffer) sys.exit(combined_exit_code(magic_exit_code, 0)) From 98eedc69ec38c95b59adec806fd21921549df423 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 26 Apr 2022 09:57:50 -0700 Subject: [PATCH 05/21] doc update --- man/jc.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/jc.1 b/man/jc.1 index e0be7db5..ff873a10 100644 --- a/man/jc.1 +++ b/man/jc.1 @@ -1,4 +1,4 @@ -.TH jc 1 2022-04-25 1.18.7 "JSON Convert" +.TH jc 1 2022-04-26 1.18.8 "JSON Convert" .SH NAME jc \- JSONifies the output of many CLI tools and file-types .SH SYNOPSIS From 0b407123c2b8ad3efe233161dbb928a8570cbc2d Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 26 Apr 2022 10:18:49 -0700 Subject: [PATCH 06/21] simplify json_out code --- jc/cli.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/jc/cli.py b/jc/cli.py index 56006a3d..75d7f41e 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -286,18 +286,16 @@ def json_out(data, pretty=False, env_colors=None, mono=False, piped_out=False, a separators = None indent = 2 + j_data = json.dumps(data, indent=indent, separators=separators, ensure_ascii=ascii_only) + if not mono and not piped_out: # set colors class JcStyle(Style): styles = set_env_colors(env_colors) - return str(highlight(json.dumps(data, - indent=indent, - separators=separators, - ensure_ascii=ascii_only), - JsonLexer(), Terminal256Formatter(style=JcStyle))[0:-1]) + return str(highlight(j_data, JsonLexer(), Terminal256Formatter(style=JcStyle))[0:-1]) - return json.dumps(data, indent=indent, separators=separators, ensure_ascii=ascii_only) + return j_data def magic_parser(args): From a4ef52b5334c5e88cba8fcbff8a23312aa62fe33 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 26 Apr 2022 14:25:34 -0700 Subject: [PATCH 07/21] refactor try/except blocks to safe_print function --- jc/cli.py | 26 ++++---------------------- jc/utils.py | 27 +++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/jc/cli.py b/jc/cli.py index 75d7f41e..b8c6e607 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -84,16 +84,7 @@ if PYGMENTS_INSTALLED: } -def asciify(string): - """ - Return a string downgraded from Unicode to ASCII with some simple - conversions. - """ - string = string.replace('©', '(c)') - # the ascii() function adds single quotes around the string - string = ascii(string)[1:-1] - string = string.replace(r'\n', '\n') - return string + def set_env_colors(env_colors=None): @@ -449,17 +440,11 @@ def main(): sys.exit(0) if help_me: - try: - print(help_doc(sys.argv)) - except UnicodeEncodeError: - print(asciify(help_doc(sys.argv))) + utils.safe_print(help_doc(sys.argv)) sys.exit(0) if version_info: - try: - print(versiontext()) - except UnicodeEncodeError: - print(asciify(versiontext())) + utils.safe_print(versiontext()) sys.exit(0) # if magic syntax used, try to run the command and error if it's not found, etc. @@ -474,10 +459,7 @@ def main(): try: magic_stdout, magic_stderr, magic_exit_code = run_user_command(run_command) if magic_stderr: - try: - print(magic_stderr[:-1], file=sys.stderr) - except UnicodeEncodeError: - print(asciify(magic_stderr[:-1], file=sys.stderr)) + utils.safe_print(magic_stderr[:-1], file=sys.stderr) except OSError as e: if debug: diff --git a/jc/utils.py b/jc/utils.py index bb03bff1..493c6207 100644 --- a/jc/utils.py +++ b/jc/utils.py @@ -9,6 +9,25 @@ from functools import lru_cache from typing import List, Iterable, Union, Optional +def asciify(string: str) -> str: + """ + Return a string downgraded from Unicode to ASCII with some simple + conversions. + """ + string = string.replace('©', '(c)') + # the ascii() function adds single quotes around the string + string = ascii(string)[1:-1] + string = string.replace(r'\n', '\n') + return string + + +def safe_print(string: str, sep=' ', end='\n', file=sys.stdout, flush=False) -> None: + try: + print(string, sep=sep, end=end, file=file, flush=flush) + except UnicodeEncodeError: + print(asciify(string), sep=sep, end=end, file=file, flush=flush) + + def warning_message(message_lines: List[str]) -> None: """ Prints warning message for non-fatal issues. The first line is @@ -36,13 +55,13 @@ def warning_message(message_lines: List[str]) -> None: first_line = message_lines.pop(0) first_str = f'jc: Warning - {first_line}' first_str = first_wrapper.fill(first_str) - print(first_str, file=sys.stderr) + safe_print(first_str, file=sys.stderr) for line in message_lines: if line == '': continue message = next_wrapper.fill(line) - print(message, file=sys.stderr) + safe_print(message, file=sys.stderr) def error_message(message_lines: List[str]) -> None: @@ -68,13 +87,13 @@ def error_message(message_lines: List[str]) -> None: first_line = message_lines.pop(0) first_str = f'jc: Error - {first_line}' first_str = first_wrapper.fill(first_str) - print(first_str, file=sys.stderr) + safe_print(first_str, file=sys.stderr) for line in message_lines: if line == '': continue message = next_wrapper.fill(line) - print(message, file=sys.stderr) + safe_print(message, file=sys.stderr) def compatibility(mod_name: str, compatible: List, quiet: bool = False) -> None: From faec16d1f20d4571434bb8ecca489432bfd40b15 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 26 Apr 2022 14:28:18 -0700 Subject: [PATCH 08/21] add line feed --- jc/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jc/cli.py b/jc/cli.py index b8c6e607..a1464492 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -261,7 +261,8 @@ def versiontext(): python path: {sys.executable} {info.website} - {info.copyright}''' + {info.copyright} + ''' return textwrap.dedent(versiontext_string) From 3ef2a0a0650f8e98cbd890e1b311931b9883222b Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 26 Apr 2022 14:29:59 -0700 Subject: [PATCH 09/21] rename j_data to j_string --- jc/cli.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jc/cli.py b/jc/cli.py index a1464492..0b6ff286 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -278,16 +278,16 @@ def json_out(data, pretty=False, env_colors=None, mono=False, piped_out=False, a separators = None indent = 2 - j_data = json.dumps(data, indent=indent, separators=separators, ensure_ascii=ascii_only) + j_string = json.dumps(data, indent=indent, separators=separators, ensure_ascii=ascii_only) if not mono and not piped_out: # set colors class JcStyle(Style): styles = set_env_colors(env_colors) - return str(highlight(j_data, JsonLexer(), Terminal256Formatter(style=JcStyle))[0:-1]) + return str(highlight(j_string, JsonLexer(), Terminal256Formatter(style=JcStyle))[0:-1]) - return j_data + return j_string def magic_parser(args): From 8417f2fe4e6b96dbdadd09c582ce731129e56b90 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 26 Apr 2022 15:01:12 -0700 Subject: [PATCH 10/21] use UTF-8 encoding in subprocess.Popen --- jc/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jc/cli.py b/jc/cli.py index 0b6ff286..ef433d46 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -358,7 +358,8 @@ def run_user_command(command): stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False, # Allows inheriting file descriptors; - universal_newlines=True) # useful for process substitution + universal_newlines=True, # useful for process substitution + encoding='UTF-8') stdout, stderr = proc.communicate() return ( From 621f11e6f917ab59a446f1f4e86b147c4bb9a1c5 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 26 Apr 2022 17:46:16 -0700 Subject: [PATCH 11/21] simplify history code --- docs/parsers/history.md | 2 +- jc/parsers/history.py | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/docs/parsers/history.md b/docs/parsers/history.md index 2151e0ff..636862a0 100644 --- a/docs/parsers/history.md +++ b/docs/parsers/history.md @@ -87,4 +87,4 @@ Returns: ### Parser Information Compatibility: linux, darwin, cygwin, aix, freebsd -Version 1.6 by Kelly Brazil (kellyjonbrazil@gmail.com) +Version 1.7 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/jc/parsers/history.py b/jc/parsers/history.py index adcc7aa9..095f09c1 100644 --- a/jc/parsers/history.py +++ b/jc/parsers/history.py @@ -63,7 +63,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.6' + version = '1.7' description = '`history` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -117,17 +117,14 @@ def parse(data, raw=False, quiet=False): raw_output = {} if jc.utils.has_data(data): + linedata = data.splitlines() - # split lines and clear out any non-ascii chars - linedata = data.encode('ascii', errors='ignore').decode().splitlines() - - # Skip any blank lines for entry in filter(None, linedata): try: - parsed_line = entry.split(maxsplit=1) - raw_output[parsed_line[0]] = parsed_line[1] - except IndexError: - # need to catch indexerror in case there is weird input from prior commands + number, command = entry.split(maxsplit=1) + raw_output[number] = command + except ValueError: + # need to catch ValueError in case there is weird input from prior commands pass if raw: From 5a12d98893f028039da78110d66a1123cf203644 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 26 Apr 2022 17:49:27 -0700 Subject: [PATCH 12/21] update history tests --- tests/fixtures/centos-7.7/history.json | 2 +- tests/fixtures/centos-7.7/history.out | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/fixtures/centos-7.7/history.json b/tests/fixtures/centos-7.7/history.json index 11ce03d6..bf117524 100644 --- a/tests/fixtures/centos-7.7/history.json +++ b/tests/fixtures/centos-7.7/history.json @@ -1 +1 @@ -[{"line": 65, "command": "sudo iptables -w -vL -t filter | jc --iptables -p"}, {"line": 66, "command": "sudo iptables -vnL -t filter | jc --iptables -p"}, {"line": 67, "command": "sudo iptables -vnL -t filter"}, {"line": 68, "command": "rm iptables.py "}, {"line": 69, "command": "vi iptables.py"}, {"line": 70, "command": "sudo iptables -vnL -t filter | jc --iptables -p"}, {"line": 71, "command": "sudo iptables -vL -t filter | jc --iptables -p"}, {"line": 72, "command": "sudo iptables -L -t filter | jc --iptables -p"}, {"line": 73, "command": "sudo iptables -L -t nat | jc --iptables -p"}, {"line": 74, "command": "sudo iptables -vnL -t filter | jc --iptables -p"}, {"line": 75, "command": "sudo iptables -vnL -t filter | jc"}, {"line": 76, "command": "sudo iptables -vnL -t filter | jc --iptables"}, {"line": 77, "command": "sudo iptables -vnL -t raw | jc --iptables"}, {"line": 78, "command": "sudo iptables -vnL -t raw | jc --iptables -p"}, {"line": 79, "command": "jobs"}, {"line": 80, "command": "sleep 100 &"}, {"line": 81, "command": "jobs"}, {"line": 82, "command": "sleep 101 &"}, {"line": 83, "command": "jobs"}, {"line": 84, "command": "sleep 102 &"}, {"line": 85, "command": "jobs"}, {"line": 86, "command": "sleep 103 &"}, {"line": 87, "command": "jobs"}, {"line": 88, "command": "iptable"}, {"line": 89, "command": "sudo iptables -L | jc --iptables"}, {"line": 90, "command": "sudo iptables -L | jc --iptables -p"}, {"line": 91, "command": "sudo iptables -L | jc --iptables | jq ."}, {"line": 92, "command": "pip3 install jq"}, {"line": 93, "command": "pip3 install --user jq"}, {"line": 94, "command": "jq"}, {"line": 95, "command": "yum install jq"}, {"line": 96, "command": "sudo yum install jq"}, {"line": 97, "command": "sudo dnf install jq"}, {"line": 98, "command": "curl https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64"}, {"line": 99, "command": "ls"}, {"line": 100, "command": "ls -al"}, {"line": 101, "command": "cd ~"}, {"line": 102, "command": "curl https://github-production-release-asset-2e65be.s3.amazonaws.com/5101141/6387d980-de1f-11e8-8d3e-4455415aa408?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20191023%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20191023T000342Z&X-Amz-Expires=300&X-Amz-Signature=6d4aad2941c281a57ea469d57115f0a3d877fc24998ded52e1c51cbf7b482705&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Djq-linux64&response-content-type=application%2Foctet-stream"}, {"line": 103, "command": "ls"}, {"line": 104, "command": "curl 'https://github-production-release-asset-2e65be.s3.amazonaws.com/5101141/6387d980-de1f-11e8-8d3e-4455415aa408?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20191023%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20191023T000342Z&X-Amz-Expires=300&X-Amz-Signature=6d4aad2941c281a57ea469d57115f0a3d877fc24998ded52e1c51cbf7b482705&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Djq-linux64&response-content-type=application%2Foctet-stream'"}, {"line": 105, "command": "ifconfig"}, {"line": 106, "command": "ls"}, {"line": 107, "command": "chmod jq-linux64 "}, {"line": 108, "command": "chmod +x jq-linux64 "}, {"line": 109, "command": "./jq-linux64 "}, {"line": 110, "command": "mv jq-linux64 jq"}, {"line": 111, "command": "sudo mv jq /usr/local/bin/"}, {"line": 112, "command": "jq"}, {"line": 113, "command": "iptables -L | jc --iptables | jq ."}, {"line": 114, "command": "sudo iptables -L | jc --iptables | jq ."}, {"line": 115, "command": "sudo iptables -L "}, {"line": 116, "command": "sudo iptables -vL "}, {"line": 117, "command": "sudo iptables -vL | jc --iptables | jq ."}, {"line": 118, "command": "df | jc --df -p"}, {"line": 119, "command": "cd ~"}, {"line": 120, "command": "pip3 uninstall jc"}, {"line": 121, "command": "cd git/"}, {"line": 122, "command": "ls"}, {"line": 123, "command": "rm -rf jc/"}, {"line": 124, "command": "history | grep clone"}, {"line": 125, "command": "git clone https://github.com/kellyjonbrazil/jc.git"}, {"line": 126, "command": "ls"}, {"line": 127, "command": "cd jc/"}, {"line": 128, "command": "./build-package.sh "}, {"line": 129, "command": "./pypi-upload.sh "}, {"line": 130, "command": "cd .."}, {"line": 131, "command": "ls"}, {"line": 132, "command": "pip3 uninstall jc"}, {"line": 133, "command": "rm -rf jc/"}, {"line": 134, "command": "pip3 install --user --upgrade jc"}, {"line": 135, "command": "iptables -L | jc --iptables | jq"}, {"line": 136, "command": "sudo iptables -L | jc --iptables | jq"}, {"line": 137, "command": "mount | jc --mount -p"}, {"line": 138, "command": "uname -a | jc --uname"}, {"line": 139, "command": "uname -a | jc --uname -p"}, {"line": 140, "command": "df | jc --df -p"}, {"line": 141, "command": "free | jc --free -p"}, {"line": 142, "command": "lsblk | jc --lsblk -p"}, {"line": 143, "command": "ls | jc"}, {"line": 144, "command": "env | jc --env -p"}, {"line": 145, "command": "ls | jc"}, {"line": 146, "command": "route | jc --route -p"}, {"line": 147, "command": "iptables -L | jc --iptables | jq ."}, {"line": 148, "command": "sudo iptables -L | jc --iptables | jq ."}, {"line": 149, "command": "ls"}, {"line": 150, "command": "pip3 uninstall jc"}, {"line": 151, "command": "history | grep clone"}, {"line": 152, "command": "git clone --single-branch --branch dev https://github.com/kellyjonbrazil/jc.git"}, {"line": 153, "command": "cd jc/"}, {"line": 154, "command": "pip3 install --user --upgrade -e ."}, {"line": 155, "command": "sudo iptables -L | jc --iptables -p"}, {"line": 156, "command": "sudo iptables -L | jc --iptables"}, {"line": 157, "command": "sudo iptables -L | jc --iptables | jq ."}, {"line": 158, "command": "pip3 list"}, {"line": 159, "command": "cd jc"}, {"line": 160, "command": "ls"}, {"line": 161, "command": "vi jc.py "}, {"line": 162, "command": "jc"}, {"line": 163, "command": "ls | jc"}, {"line": 164, "command": "vi jc.py "}, {"line": 165, "command": "jc"}, {"line": 166, "command": "ls | jc"}, {"line": 167, "command": "cat"}, {"line": 168, "command": "jc"}, {"line": 169, "command": "vi jc.py "}, {"line": 170, "command": "jc"}, {"line": 171, "command": "ls | jc"}, {"line": 172, "command": "vi jc.py "}, {"line": 173, "command": "jc"}, {"line": 174, "command": "vi jc.py "}, {"line": 175, "command": "jc"}, {"line": 176, "command": "ls | jc"}, {"line": 177, "command": "vi jc.py "}, {"line": 178, "command": "jc"}, {"line": 179, "command": "ls | jc"}, {"line": 180, "command": "ls | jc --ls"}, {"line": 181, "command": "jc << ls -l"}, {"line": 182, "command": "jc < ls -l"}, {"line": 183, "command": "jc < ls / -l"}, {"line": 184, "command": "jc < ls -l /"}, {"line": 185, "command": "jc <<< ls -l /"}, {"line": 186, "command": "jc --ls <<< ls -l /"}, {"line": 187, "command": "jc --ls -p <<< ls -l /"}, {"line": 188, "command": "jc --ls -p <<< 'ls -a /'"}, {"line": 189, "command": "cat jc.py "}, {"line": 190, "command": "ls"}, {"line": 191, "command": "rm jc.py "}, {"line": 192, "command": "vi jc.py"}, {"line": 193, "command": "jc"}, {"line": 194, "command": "rm jc.py "}, {"line": 195, "command": "vi jc.py"}, {"line": 196, "command": "jc"}, {"line": 197, "command": "jc --ls"}, {"line": 198, "command": "ls | jc --ls"}, {"line": 199, "command": "ls -al | jc --ls"}, {"line": 200, "command": "ls -al | jc --ls -p"}, {"line": 201, "command": "ls -al | jc --p"}, {"line": 202, "command": "jc"}, {"line": 203, "command": "sudo iptables -L | jc --iptables -p"}, {"line": 204, "command": "mount | jc --mount -p"}, {"line": 205, "command": "jc"}, {"line": 206, "command": "jc --mount"}, {"line": 207, "command": "ps | jc --hello"}, {"line": 208, "command": "jc"}, {"line": 209, "command": "jq"}, {"line": 210, "command": "jq --help"}, {"line": 211, "command": "jc"}, {"line": 212, "command": "ps | jc -p"}, {"line": 213, "command": "ps | jc -p --ps"}, {"line": 214, "command": "jc -p --ps"}, {"line": 215, "command": "ps -ef | jc -p --ps | jq ."}, {"line": 216, "command": "jc"}, {"line": 217, "command": "df | jc --df"}, {"line": 218, "command": "env | jc --env"}, {"line": 219, "command": "free | jc --free"}, {"line": 220, "command": "ifconfig | jc --ifconfig"}, {"line": 221, "command": "jc"}, {"line": 222, "command": "iptables -L | jc --iptables"}, {"line": 223, "command": "sudo iptables -L | jc --iptables"}, {"line": 224, "command": "jc"}, {"line": 225, "command": "ls -l | jc --ls"}, {"line": 226, "command": "lsblk | jc --lsblk"}, {"line": 227, "command": "mount | jc --mount"}, {"line": 228, "command": "jc"}, {"line": 229, "command": "netstat -l | jc --netstat"}, {"line": 230, "command": "ps -ef | jc --ps"}, {"line": 231, "command": "jc"}, {"line": 232, "command": "route | jc --route"}, {"line": 233, "command": "uname -a | jc --uname"}, {"line": 234, "command": "cd parsers/"}, {"line": 235, "command": "rm iptables.py "}, {"line": 236, "command": "vi iptables.py"}, {"line": 237, "command": "sudo iptables -L | jc --iptables"}, {"line": 238, "command": "sudo iptables -L | jc --iptables -p"}, {"line": 239, "command": "lsof"}, {"line": 240, "command": "journalctl "}, {"line": 241, "command": "python3"}, {"line": 242, "command": "ls"}, {"line": 243, "command": "vi jobs.py"}, {"line": 244, "command": "cd .."}, {"line": 245, "command": "ls"}, {"line": 246, "command": "rm jc.py "}, {"line": 247, "command": "vi jc.py"}, {"line": 248, "command": "sleep 500 &"}, {"line": 249, "command": "sleep 501 &"}, {"line": 250, "command": "sleep 502 &"}, {"line": 251, "command": "sleep 503 &"}, {"line": 252, "command": "jobs"}, {"line": 253, "command": "jobs | jc --jobs"}, {"line": 254, "command": "jobs -l | jc --jobs"}, {"line": 255, "command": "jobs -l"}, {"line": 256, "command": "python3"}, {"line": 257, "command": "ls"}, {"line": 258, "command": "cd parsers/"}, {"line": 259, "command": "ls"}, {"line": 260, "command": "rm jobs.py "}, {"line": 261, "command": "vi jobs.py"}, {"line": 262, "command": "jobs | jc --jobs"}, {"line": 263, "command": "jobs"}, {"line": 264, "command": "rm jobs"}, {"line": 265, "command": "rm jobs.py "}, {"line": 266, "command": "vi jobs"}, {"line": 267, "command": "vi jobs.py"}, {"line": 268, "command": "jobs | jc --jobs -p"}, {"line": 269, "command": "jobs -l | jc --jobs -p"}, {"line": 270, "command": "jobs"}, {"line": 271, "command": "sleep 500 &"}, {"line": 272, "command": "sleep 501 &"}, {"line": 273, "command": "sleep 502 &"}, {"line": 274, "command": "sleep 503 &"}, {"line": 275, "command": "jobs -l | jc --jobs -p"}, {"line": 276, "command": "jobs | jc --jobs -p"}, {"line": 277, "command": "rm jobs.py "}, {"line": 278, "command": "vi jobs.py"}, {"line": 279, "command": "jobs | jc --jobs -p"}, {"line": 280, "command": "jobs -l | jc --jobs -p"}, {"line": 281, "command": "jobs"}, {"line": 282, "command": "jobs -l"}, {"line": 283, "command": "rm jobs.py "}, {"line": 284, "command": "vi jobs.py"}, {"line": 285, "command": "jobs -l | jc --jobs -p"}, {"line": 286, "command": "rm jobs.py "}, {"line": 287, "command": "vi jobs.py"}, {"line": 288, "command": "sleep 500 &"}, {"line": 289, "command": "sleep 501 &"}, {"line": 290, "command": "sleep 502 &"}, {"line": 291, "command": "sleep 503 &"}, {"line": 292, "command": "sleep 504 &"}, {"line": 293, "command": "jobs"}, {"line": 294, "command": "jobs -l | jc --jobs -p"}, {"line": 295, "command": "rm jobs.py "}, {"line": 296, "command": "vi jobs.py"}, {"line": 297, "command": "sleep 1000 &"}, {"line": 298, "command": "sleep 1001 &"}, {"line": 299, "command": "sleep 1002 &"}, {"line": 300, "command": "sleep 1003 &"}, {"line": 301, "command": "sleep 1004 &"}, {"line": 302, "command": "jobs | jc --jobs -p"}, {"line": 303, "command": "jobs -l | jc --jobs -p"}, {"line": 304, "command": "python3"}, {"line": 305, "command": "rm jobs.py "}, {"line": 306, "command": "vi jobs.py"}, {"line": 307, "command": "jobs | jc --jobs -p"}, {"line": 308, "command": "rm jobs.py "}, {"line": 309, "command": "vi jobs.py"}, {"line": 310, "command": "jobs | jc --jobs -p"}, {"line": 311, "command": "rm jobs.py "}, {"line": 312, "command": "vi jobs.py"}, {"line": 313, "command": "jobs | jc --jobs -p"}, {"line": 314, "command": "rm jobs.py "}, {"line": 315, "command": "vi jobs.py"}, {"line": 316, "command": "jobs | jc --jobs -p"}, {"line": 317, "command": "jobs -l | jc --jobs -p"}, {"line": 318, "command": "jobs | jc --jobs -p"}, {"line": 319, "command": "rm jobs.py "}, {"line": 320, "command": "vi jobs.py"}, {"line": 321, "command": "jobs | jc --jobs -p"}, {"line": 322, "command": "\"\"\"jc - JSON CLI output utility jobs Parser"}, {"line": 323, "command": "Usage:"}, {"line": 324, "command": "specify --jobs as the first argument if the piped input is coming from jobs"}, {"line": 325, "command": "Examples:"}, {"line": 326, "command": "\"\"\""}, {"line": 327, "command": "import string"}, {"line": 328, "command": "def parse(data):"}, {"line": 329, "command": "output = []"}, {"line": 330, "command": "linedata = data.splitlines()"}, {"line": 331, "command": "# Clear any blank lines"}, {"line": 332, "command": "cleandata = list(filter(None, linedata))"}, {"line": 333, "command": "if cleandata:; for entry in cleandata:; output_line = {}"}, {"line": 334, "command": "job_number = ''"}, {"line": 335, "command": "pid = ''"}, {"line": 336, "command": "job_history = ''"}, {"line": 337, "command": "parsed_line = entry.split(maxsplit=2)"}, {"line": 338, "command": "print(parsed_line)"}, {"line": 339, "command": "# check if -l was used"}, {"line": 340, "command": "if parsed_line[1][0] in string.digits:; pid = parsed_line.pop(1)"}, {"line": 341, "command": "print(parsed_line)"}, {"line": 342, "command": "# check for + or - in first field"}, {"line": 343, "command": "if parsed_line[0].find('+') != -1:"}, {"line": 344, "command": "job_history = 'current'"}, {"line": 345, "command": "job_number = parsed_line[0].rstrip('+')"}, {"line": 346, "command": "if pid:; remainder = parsed_line[1].split(maxsplit=1)"}, {"line": 347, "command": "else:"}, {"line": 348, "command": "remainder = list(parsed_line[1])"}, {"line": 349, "command": "remainder.insert(0, job_number)"}, {"line": 350, "command": "parsed_line = remainder"}, {"line": 351, "command": "if parsed_line[0].find('-') != -1:"}, {"line": 352, "command": "job_history = 'previous'"}, {"line": 353, "command": "job_number = parsed_line[0].rstrip('-')"}, {"line": 354, "command": "if pid:; remainder = parsed_line[1].split(maxsplit=1)"}, {"line": 355, "command": "else:"}, {"line": 356, "command": "remainder = list(parsed_line[1])"}, {"line": 357, "command": "remainder = parsed_line[1].split(maxsplit=1)"}, {"line": 358, "command": "remainder.insert(0, job_number)"}, {"line": 359, "command": "parsed_line = remainder"}, {"line": 360, "command": "# clean up first field"}, {"line": 361, "command": "parsed_line[0] = parsed_line[0].lstrip('[').rstrip(']')"}, {"line": 362, "command": "print(parsed_line)"}, {"line": 363, "command": "# create list of dictionaries"}, {"line": 364, "command": "# output_line['job_number'] = int(parsed_line[0])"}, {"line": 365, "command": "# if pid:"}, {"line": 366, "command": "# output_line['pid'] = int(pid)"}, {"line": 367, "command": "# if job_history:"}, {"line": 368, "command": "# output_line['history'] = job_history"}, {"line": 369, "command": "# output_line['status'] = parsed_line[1]"}, {"line": 370, "command": "# output_line['command'] = parsed_line[2]"}, {"line": 371, "command": "# output.append(output_line)"}, {"line": 372, "command": "# return output"}, {"line": 373, "command": "rm jobs.py "}, {"line": 374, "command": "vi jobs.py"}, {"line": 375, "command": "jobs | jc --jobs -p"}, {"line": 376, "command": "jobs"}, {"line": 377, "command": "sleep"}, {"line": 378, "command": "sleep 1000 &"}, {"line": 379, "command": "sleep 1001 &"}, {"line": 380, "command": "sleep 1002 &"}, {"line": 381, "command": "sleep 1003 &"}, {"line": 382, "command": "sleep 1004 &"}, {"line": 383, "command": "jobs | jc --jobs -p"}, {"line": 384, "command": "jobs -l | jc --jobs -p"}, {"line": 385, "command": "rm jobs.py "}, {"line": 386, "command": "vi jobs.py"}, {"line": 387, "command": "jobs -l | jc --jobs -p"}, {"line": 388, "command": "jobs | jc --jobs -p"}, {"line": 389, "command": "rm jobs.py "}, {"line": 390, "command": "vi jobs.py"}, {"line": 391, "command": "jobs | jc --jobs -p"}, {"line": 392, "command": "jobs -l | jc --jobs -p"}, {"line": 393, "command": "jobs"}, {"line": 394, "command": "rm jobs.py "}, {"line": 395, "command": "vi jobs.py"}, {"line": 396, "command": "sleep 10000 &"}, {"line": 397, "command": "sleep 10001 &"}, {"line": 398, "command": "sleep 10002 &"}, {"line": 399, "command": "sleep 10003 &"}, {"line": 400, "command": "sleep 10004 &"}, {"line": 401, "command": "jobs -l | jc --jobs -p"}, {"line": 402, "command": "jobs | jc --jobs -p"}, {"line": 403, "command": "rm jobs.py "}, {"line": 404, "command": "vi jobs.py"}, {"line": 405, "command": "jobs | jc --jobs -p"}, {"line": 406, "command": "jobs -l| jc --jobs -p"}, {"line": 407, "command": "rm jobs.py "}, {"line": 408, "command": "vi jobs.py"}, {"line": 409, "command": "jobs -l| jc --jobs -p"}, {"line": 410, "command": "jobs | jc --jobs -p"}, {"line": 411, "command": "rm jobs.py "}, {"line": 412, "command": "vi jobs.py"}, {"line": 413, "command": "jobs | jc --jobs -p"}, {"line": 414, "command": "jobs -l | jc --jobs -p"}, {"line": 415, "command": "rm jobs.py "}, {"line": 416, "command": "vi jobs.py"}, {"line": 417, "command": "jobs -l | jc --jobs -p"}, {"line": 418, "command": "jobs| jc --jobs -p"}, {"line": 419, "command": "jc"}, {"line": 420, "command": "lsof"}, {"line": 421, "command": "yum install lsof"}, {"line": 422, "command": "sudo yum install lsof"}, {"line": 423, "command": "lsof"}, {"line": 424, "command": "vi lsof.py"}, {"line": 425, "command": "cd .."}, {"line": 426, "command": "ls"}, {"line": 427, "command": "rm jc.py "}, {"line": 428, "command": "vi jc.py"}, {"line": 429, "command": "lsof | jc --lsof"}, {"line": 430, "command": "cd parsers/"}, {"line": 431, "command": "rm lsof.py "}, {"line": 432, "command": "vi lsof.py"}, {"line": 433, "command": "lsof | jc --lsof -p"}, {"line": 434, "command": "rm lsof.py "}, {"line": 435, "command": "vi lsof.py"}, {"line": 436, "command": "lsof | jc --lsof -p"}, {"line": 437, "command": "rm lsof.py "}, {"line": 438, "command": "vi lsof.py"}, {"line": 439, "command": "lsof | jc --lsof -p"}, {"line": 440, "command": "rm lsof.py "}, {"line": 441, "command": "vi lsof.py"}, {"line": 442, "command": "lsof | jc --lsof -p"}, {"line": 443, "command": "lsof | head"}, {"line": 444, "command": "rm lsof.py "}, {"line": 445, "command": "vi lsof.py"}, {"line": 446, "command": "lsof | jc --lsof "}, {"line": 447, "command": "rm lsof.py "}, {"line": 448, "command": "vi lsof.py"}, {"line": 449, "command": "lsof | jc --lsof "}, {"line": 450, "command": "rm lsof.py "}, {"line": 451, "command": "vi lsof.py"}, {"line": 452, "command": "lsof | jc --lsof "}, {"line": 453, "command": "rm lsof.py "}, {"line": 454, "command": "vi lsof.py"}, {"line": 455, "command": "lsof | jc --lsof "}, {"line": 456, "command": "rm lsof.py "}, {"line": 457, "command": "vi lsof.py"}, {"line": 458, "command": "lsof | jc --lsof "}, {"line": 459, "command": "rm lsof.py "}, {"line": 460, "command": "vi lsof.py"}, {"line": 461, "command": "lsof | jc --lsof "}, {"line": 462, "command": "rm lsof.py "}, {"line": 463, "command": "vi lsof.py"}, {"line": 464, "command": "lsof | jc --lsof "}, {"line": 465, "command": "rm lsof.py "}, {"line": 466, "command": "vi lsof.py"}, {"line": 467, "command": "lsof | jc --lsof "}, {"line": 468, "command": "rm lsof.py "}, {"line": 469, "command": "vi lsof.py"}, {"line": 470, "command": "lsof | jc --lsof "}, {"line": 471, "command": "python3"}, {"line": 472, "command": "rm lsof.py "}, {"line": 473, "command": "vi lsof.py"}, {"line": 474, "command": "lsof | jc --lsof "}, {"line": 475, "command": "lsof"}, {"line": 476, "command": "lsof | head"}, {"line": 477, "command": "rm lsof.py "}, {"line": 478, "command": "vi lsof.py"}, {"line": 479, "command": "lsof | jc --lsof "}, {"line": 480, "command": "lsof | tail"}, {"line": 481, "command": "rm lsof.py "}, {"line": 482, "command": "vi lsof.py"}, {"line": 483, "command": "lsof | jc --lsof "}, {"line": 484, "command": "rm lsof.py "}, {"line": 485, "command": "vi lsof.py"}, {"line": 486, "command": "lsof | jc --lsof "}, {"line": 487, "command": "rm lsof.py "}, {"line": 488, "command": "vi lsof.py"}, {"line": 489, "command": "lsof | jc --lsof "}, {"line": 490, "command": "rm lsof.py "}, {"line": 491, "command": "vi lsof.py"}, {"line": 492, "command": "lsof | jc --lsof "}, {"line": 493, "command": "rm lsof.py "}, {"line": 494, "command": "vi lsof.py"}, {"line": 495, "command": "lsof | jc --lsof "}, {"line": 496, "command": "~/resizeterm.sh "}, {"line": 497, "command": "rm lsof.py "}, {"line": 498, "command": "vi lsof.py"}, {"line": 499, "command": "lsof | jc --lsof "}, {"line": 500, "command": "rm lsof.py "}, {"line": 501, "command": "vi lsof.py"}, {"line": 502, "command": "lsof | jc --lsof "}, {"line": 503, "command": "rm lsof.py "}, {"line": 504, "command": "vi lsof.py"}, {"line": 505, "command": "lsof | jc --lsof "}, {"line": 506, "command": "rm lsof.py "}, {"line": 507, "command": "vi lsof.py"}, {"line": 508, "command": "lsof | jc --lsof "}, {"line": 509, "command": "rm lsof.py "}, {"line": 510, "command": "vi lsof.py"}, {"line": 511, "command": "lsof | jc --lsof "}, {"line": 512, "command": "sudo lsof | jc --lsof "}, {"line": 513, "command": "lsof"}, {"line": 514, "command": "rm lsof.py "}, {"line": 515, "command": "vi lsof.py"}, {"line": 516, "command": "sudo lsof | jc --lsof "}, {"line": 517, "command": "rm lsof.py "}, {"line": 518, "command": "vi lsof.py"}, {"line": 519, "command": "sudo lsof | jc --lsof -p"}, {"line": 520, "command": "sudo lsof | more"}, {"line": 521, "command": "rm lsof.py "}, {"line": 522, "command": "vi lsof.py"}, {"line": 523, "command": "sudo lsof | jc --lsof -p"}, {"line": 524, "command": "lsof | jc --lsof -p"}, {"line": 525, "command": "lsof | jc --lsof"}, {"line": 526, "command": "lsof | jc --lsof | jq ."}, {"line": 527, "command": "jc"}, {"line": 528, "command": "sudo lsof | jc --lsof -p"}, {"line": 529, "command": "man lsof"}, {"line": 530, "command": "~/resizeterm.sh "}, {"line": 531, "command": "sudo lsof | jc --lsof -p"}, {"line": 532, "command": "python3"}, {"line": 533, "command": "lsmod"}, {"line": 534, "command": "~/resizeterm.sh "}, {"line": 535, "command": "lsmod"}, {"line": 536, "command": "cd ~"}, {"line": 537, "command": "pip3 uninstall jc"}, {"line": 538, "command": "cd git/"}, {"line": 539, "command": "rm -rf jc/"}, {"line": 540, "command": "pip3 install --upgrade --user -e ."}, {"line": 541, "command": "history | grep clone"}, {"line": 542, "command": "git clone --single-branch --branch dev https://github.com/kellyjonbrazil/jc.git"}, {"line": 543, "command": "cd jc/"}, {"line": 544, "command": "pip3 install --upgrade --user -e ."}, {"line": 545, "command": "jc"}, {"line": 546, "command": "lsmod | jc --lsmod -p"}, {"line": 547, "command": "cd pypi-upload.sh "}, {"line": 548, "command": "cd jc"}, {"line": 549, "command": "cd parsers/"}, {"line": 550, "command": "ls"}, {"line": 551, "command": "rm lsmod.py "}, {"line": 552, "command": "vi lsmod.py"}, {"line": 553, "command": "lsmod | jc --lsmod -p"}, {"line": 554, "command": "rm lsmod.py "}, {"line": 555, "command": "vi lsmod.py"}, {"line": 556, "command": "lsmod | jc --lsmod -p"}, {"line": 557, "command": "rm lsmod.py "}, {"line": 558, "command": "vi lsmod.py"}, {"line": 559, "command": "lsmod | jc --lsmod -p"}, {"line": 560, "command": "rm lsmod.py "}, {"line": 561, "command": "vi lsmod.py"}, {"line": 562, "command": "lsmod | jc --lsmod -p"}, {"line": 563, "command": "rm lsmod.py "}, {"line": 564, "command": "vi lsmod.py"}, {"line": 565, "command": "lsmod | jc --lsmod -p"}, {"line": 566, "command": "rm lsmod.py "}, {"line": 567, "command": "vi lsmod.py"}, {"line": 568, "command": "lsmod | jc --lsmod -p"}, {"line": 569, "command": "rm lsmod.py "}, {"line": 570, "command": "vi lsmod.py"}, {"line": 571, "command": "lsmod | jc --lsmod -p"}, {"line": 572, "command": "rm lsmod.py "}, {"line": 573, "command": "vi lsmod.py"}, {"line": 574, "command": "lsmod | jc --lsmod -p"}, {"line": 575, "command": "rm lsmod.py "}, {"line": 576, "command": "vi lsmod.py"}, {"line": 577, "command": "lsmod | jc --lsmod -p"}, {"line": 578, "command": "jc"}, {"line": 579, "command": "cd ~"}, {"line": 580, "command": "pip3 uninstall jc"}, {"line": 581, "command": "cd git/"}, {"line": 582, "command": "rm -rf jc/"}, {"line": 583, "command": "history | grep clone"}, {"line": 584, "command": "ls"}, {"line": 585, "command": "git clone https://github.com/kellyjonbrazil/jc.git"}, {"line": 586, "command": "cd jc/"}, {"line": 587, "command": "ls"}, {"line": 588, "command": "./build-package.sh "}, {"line": 589, "command": "ls"}, {"line": 590, "command": "./pypi-upload.sh "}, {"line": 591, "command": "cd .."}, {"line": 592, "command": "ls"}, {"line": 593, "command": "pip3 uninstall jc"}, {"line": 594, "command": "rm -rf jc/"}, {"line": 595, "command": "pip3 install --upgrade --user jc"}, {"line": 596, "command": "pip3 list"}, {"line": 597, "command": "jc"}, {"line": 598, "command": "jc -p"}, {"line": 599, "command": "sudo iptables -L | jc --iptables -p"}, {"line": 600, "command": "jc"}, {"line": 601, "command": "lsmod | jc --lsmod -p"}, {"line": 602, "command": "jc"}, {"line": 603, "command": "jobs"}, {"line": 604, "command": "sleep 500 &"}, {"line": 605, "command": "jobs -l | jc --jobs -p"}, {"line": 606, "command": "jobs | jc --jobs -p"}, {"line": 607, "command": "lsof"}, {"line": 608, "command": "cd ~"}, {"line": 609, "command": "pip3 list"}, {"line": 610, "command": "lsof | jc --lsof > testfile"}, {"line": 611, "command": "cat testfile "}, {"line": 612, "command": "iptables -L | jc --iptables > testfile "}, {"line": 613, "command": "sudo iptables -L | jc --iptables > testfile "}, {"line": 614, "command": "cat testfile "}, {"line": 615, "command": "cat testfile | jq ."}, {"line": 616, "command": "w"}, {"line": 617, "command": "w -h"}, {"line": 618, "command": "w --help"}, {"line": 619, "command": "w -f"}, {"line": 620, "command": "w -i"}, {"line": 621, "command": "w -s"}, {"line": 622, "command": "w -o"}, {"line": 623, "command": "date"}, {"line": 624, "command": "ls | jc --ls"}, {"line": 625, "command": "ls | jc --ls | jq '.select(\"filename\" = \"git)'"}, {"line": 626, "command": "ls | jc --ls | jq '.select(.filename=\"git)'"}, {"line": 627, "command": "ls | jc --ls | jq '.select(.filename=\"git\")'"}, {"line": 628, "command": "ls | jc --ls | jq 'select(.filename == \"git\")'"}, {"line": 629, "command": "ls | jc --ls | jq '.[] | select(.filename == \"git\")'"}, {"line": 630, "command": "ls | jc --ls | jq -r '.[] | select(.filename == \"git\")'"}, {"line": 631, "command": "ls | jc --ls | jq -r '.[] | select(.filename == \"git\") | .filename'"}, {"line": 632, "command": "ifconfig | jc --ifconfig -p"}, {"line": 633, "command": "jc -p"}, {"line": 634, "command": "jc"}, {"line": 635, "command": "ls | jc -p"}, {"line": 636, "command": "ip"}, {"line": 637, "command": "ip address"}, {"line": 638, "command": "ip --help"}, {"line": 639, "command": "ip address --help"}, {"line": 640, "command": "ip address -h"}, {"line": 641, "command": "ip -h address"}, {"line": 642, "command": "ip -b address"}, {"line": 643, "command": "ip -iec address"}, {"line": 644, "command": "ip address"}, {"line": 645, "command": "ip --help"}, {"line": 646, "command": "ip -br address"}, {"line": 647, "command": "ip -d address"}, {"line": 648, "command": "ifconfig"}, {"line": 649, "command": "cat"}, {"line": 650, "command": "jc"}, {"line": 651, "command": "jc | cat"}, {"line": 652, "command": "jc > testing"}, {"line": 653, "command": "cat testing "}, {"line": 654, "command": "rm testing "}, {"line": 655, "command": "jc &2 > testing"}, {"line": 656, "command": "cat testing "}, {"line": 657, "command": "ls"}, {"line": 658, "command": "cat testing "}, {"line": 659, "command": "rm testing "}, {"line": 660, "command": "jc 2>&1 | jc --ls"}, {"line": 661, "command": "jc 2>&1 | jc --ls -p"}, {"line": 662, "command": "jc 2>&1 | jc --route -p"}, {"line": 663, "command": "jc 2>&1 | jc --ps -p"}, {"line": 664, "command": "jc 2>&1 | jc --iptables -p"}, {"line": 665, "command": "jc 2>&1 | jc --lsof -p"}, {"line": 666, "command": "jc 2>&1 | jc --ls -p"}, {"line": 667, "command": "jc 2>&1 | jc --env -p"}, {"line": 668, "command": "jc 2>&1 | jc --netstat -p"}, {"line": 669, "command": "jc 2>&1 | jc --uname -p"}, {"line": 670, "command": "jc"}, {"line": 671, "command": "journalctl "}, {"line": 672, "command": "man journalctl"}, {"line": 673, "command": "man journalctl -o=json"}, {"line": 674, "command": "journalctl -o=json"}, {"line": 675, "command": "journalctl -o json"}, {"line": 676, "command": "journalctl -o json >journaljson"}, {"line": 677, "command": "cat journaljson "}, {"line": 678, "command": "dig"}, {"line": 679, "command": "uptime"}, {"line": 680, "command": "uptime --help"}, {"line": 681, "command": "uptime -p"}, {"line": 682, "command": "uptime -s"}, {"line": 683, "command": "uptime "}, {"line": 684, "command": "date"}, {"line": 685, "command": "uptime"}, {"line": 686, "command": "history"}, {"line": 687, "command": "pip3 uninstall jc"}, {"line": 688, "command": "cd git/"}, {"line": 689, "command": "ls"}, {"line": 690, "command": "history | grep clone"}, {"line": 691, "command": "git clone --single-branch --branch dev https://github.com/kellyjonbrazil/jc.git"}, {"line": 692, "command": "cd jc"}, {"line": 693, "command": "pip3 install --upgrade --user -e ."}, {"line": 694, "command": "jc"}, {"line": 695, "command": "w | jc --w -p"}, {"line": 696, "command": "history | jc --history"}, {"line": 697, "command": "history"}, {"line": 698, "command": "history | jc --history -p"}, {"line": 699, "command": "history | head"}, {"line": 700, "command": "cd jc/parsers/"}, {"line": 701, "command": "vi history.py "}, {"line": 702, "command": "history | jc --history -p"}, {"line": 703, "command": "vi history.py "}, {"line": 704, "command": "history | jc --history -p"}, {"line": 705, "command": "echo \"hello\""}, {"line": 706, "command": "history | jc --history -p"}, {"line": 707, "command": "cat history.py "}, {"line": 708, "command": "rm history.py "}, {"line": 709, "command": "vi history.py"}, {"line": 710, "command": "history | jc --history -p"}, {"line": 711, "command": "history | jc --history"}, {"line": 712, "command": "history | jc --history -p"}, {"line": 713, "command": "history | jc --history -p | jq .1700"}, {"line": 714, "command": "history | jc --history -p | jq .1709"}, {"line": 715, "command": "history | jc --history | jq .1709"}, {"line": 716, "command": "history | jc --history | jq ."}, {"line": 717, "command": "history | jc --history | jq .\"1713\""}, {"line": 718, "command": "history | jc --history | jq .[1713]"}, {"line": 719, "command": "history | jc --history | jq .[\"1713\"]"}, {"line": 720, "command": "history | jc --history | jq '.1713'"}, {"line": 721, "command": "history | jc --history | jq '.[1713]'"}, {"line": 722, "command": "history | jc --history | jq '.[\"1713\"]'"}, {"line": 723, "command": "rm history.py "}, {"line": 724, "command": "vi history.py"}, {"line": 725, "command": "history | jc --history -p"}, {"line": 726, "command": "history | jc --history -p | jq .n1723"}, {"line": 727, "command": "cd ~"}, {"line": 728, "command": "pip3 uninstall jc"}, {"line": 729, "command": "cd git/"}, {"line": 730, "command": "rm -rf jc/"}, {"line": 731, "command": "history | grep clone"}, {"line": 732, "command": "git clone --single-branch --branch dev https://github.com/kellyjonbrazil/jc.git"}, {"line": 733, "command": "cd jc/"}, {"line": 734, "command": "pip3 install --upgrade --user -e ."}, {"line": 735, "command": "jc"}, {"line": 736, "command": "history | jc --history -p"}, {"line": 737, "command": "jc"}, {"line": 738, "command": "w | jc --w -p"}, {"line": 739, "command": "uptime | jc --uptime -p"}, {"line": 740, "command": "ls"}, {"line": 741, "command": "stat build-package.sh "}, {"line": 742, "command": "ls"}, {"line": 743, "command": "stat jc.egg-info/"}, {"line": 744, "command": "stat README.md "}, {"line": 745, "command": "lstat"}, {"line": 746, "command": "cd /proc/"}, {"line": 747, "command": "ls"}, {"line": 748, "command": "cd 1"}, {"line": 749, "command": "ls"}, {"line": 750, "command": "ls -al"}, {"line": 751, "command": "cd attr/"}, {"line": 752, "command": "ls"}, {"line": 753, "command": "ls -al"}, {"line": 754, "command": "cat current "}, {"line": 755, "command": "cat exec "}, {"line": 756, "command": "cat prev "}, {"line": 757, "command": "dig"}, {"line": 758, "command": "sudo yum install dig"}, {"line": 759, "command": "sudo yum install bind-utils"}, {"line": 760, "command": "dig"}, {"line": 761, "command": "dig www.google.com"}, {"line": 762, "command": "dig www.cnn.com"}, {"line": 763, "command": "man dig"}, {"line": 764, "command": "dig www.cnn.com www.google.com"}, {"line": 765, "command": "pip3 list"}, {"line": 766, "command": "cd ~/git/jc/jc/parsers/"}, {"line": 767, "command": "rm history.py "}, {"line": 768, "command": "vi history.py"}, {"line": 769, "command": "history | jc --history"}, {"line": 770, "command": "history | jc --history -p"}, {"line": 771, "command": "ifconfig | jc --ifconfig -p"}, {"line": 772, "command": "rm iptables.py "}, {"line": 773, "command": "vi iptables.py"}, {"line": 774, "command": "iptables -L | jc --iptables -p"}, {"line": 775, "command": "sudo iptables -L | jc --iptables -p"}, {"line": 776, "command": "lsblk | jc --lsblk -p"}, {"line": 777, "command": "rm lsblk.py "}, {"line": 778, "command": "vi lsblk.py"}, {"line": 779, "command": "lsblk | jc --lsblk -p"}, {"line": 780, "command": "rm lsmod.py "}, {"line": 781, "command": "vi lsmod.py"}, {"line": 782, "command": "lsmod"}, {"line": 783, "command": "lsmod | jc --lsmod -p"}, {"line": 784, "command": "rm lsof.py "}, {"line": 785, "command": "vi lsof.py"}, {"line": 786, "command": "lsof | jc --lsof -p"}, {"line": 787, "command": "sudo lsof | jc --lsof -p"}, {"line": 788, "command": "sudo lsof | jc --lsof | jq ."}, {"line": 789, "command": "ps | jc --ps -p"}, {"line": 790, "command": "clear"}, {"line": 791, "command": "rm ps.py "}, {"line": 792, "command": "vi ps.py"}, {"line": 793, "command": "ps | jc --ps -p"}, {"line": 794, "command": "ps axu | jc --ps -p"}, {"line": 795, "command": "rm ps.py "}, {"line": 796, "command": "vi ps.py"}, {"line": 797, "command": "ps | jc --ps -p"}, {"line": 798, "command": "ps axu | jc --ps -p"}, {"line": 799, "command": "ps -ef | jc --ps -p"}, {"line": 800, "command": "ps -ef | jc --ps -p | jq ."}, {"line": 801, "command": "ps axu | jc --ps -p | jq ."}, {"line": 802, "command": "ps -ef | jc --ps -p"}, {"line": 803, "command": "ls"}, {"line": 804, "command": "rm route.py "}, {"line": 805, "command": "vi route.py"}, {"line": 806, "command": "route | jc --route -p"}, {"line": 807, "command": "w | jc --w -p"}, {"line": 808, "command": "rm w.py "}, {"line": 809, "command": "vi w.py"}, {"line": 810, "command": "w | jc --w -p"}, {"line": 811, "command": "rm ls.py "}, {"line": 812, "command": "vi ls.py"}, {"line": 813, "command": "ls -lh | jc --ps -p"}, {"line": 814, "command": "ls | jc --ls -p"}, {"line": 815, "command": "ls -alh | jc --ls -p"}, {"line": 816, "command": "ls -lh | jc --ls -p"}, {"line": 817, "command": "ls -l /usr/bin | jc --ls | jq '.[] | select(.bytes|tonumber > 50000000)'"}, {"line": 818, "command": "ls -l /usr/bin | jc --ls | jq '.[] | select(.size|tonumber > 50000000)'"}, {"line": 819, "command": "ls -l /usr/bin | jc --ls | jq '.[] | select(.size|tonumber > 5000000)'"}, {"line": 820, "command": "$ ls -l /bin | jc --ls -p"}, {"line": 821, "command": "ls -l /bin | jc --ls -p"}, {"line": 822, "command": "python3"}, {"line": 823, "command": "rm jobs.py "}, {"line": 824, "command": "vi jobs.py"}, {"line": 825, "command": "sleep 1000 &"}, {"line": 826, "command": "sleep 1001 &"}, {"line": 827, "command": "sleep 1002 &"}, {"line": 828, "command": "sleep 1003 &"}, {"line": 829, "command": "jobs | jc --jobs -p"}, {"line": 830, "command": "jobs -l | jc --jobs -p"}, {"line": 831, "command": "rm ls.py "}, {"line": 832, "command": "vi ls.py"}, {"line": 833, "command": "ls -al | jc --ls -p"}, {"line": 834, "command": "ls -alh | jc --ls -p"}, {"line": 835, "command": "ls -al /usr/bin | jc --ls -p"}, {"line": 836, "command": "ls /usr/bin | jc --ls -p"}, {"line": 837, "command": "rm netstat.py "}, {"line": 838, "command": "vi netstat.py"}, {"line": 839, "command": "history | grep netstat"}, {"line": 840, "command": "netstat -l | jc --netstat -p"}, {"line": 841, "command": "netstat -lv | jc --netstat -p"}, {"line": 842, "command": "netstat -ln | jc --netstat -p"}, {"line": 843, "command": "sudo netstat -lpn | jc --netstat -p"}, {"line": 844, "command": "sudo systemctl restart"}, {"line": 845, "command": "reboot"}, {"line": 846, "command": "jc"}, {"line": 847, "command": "w | jc --w -p"}, {"line": 848, "command": "uptime | jc --uptime -p"}, {"line": 849, "command": "uptime"}, {"line": 850, "command": "cd git/jc/jc/parsers/"}, {"line": 851, "command": "rm uptime.py "}, {"line": 852, "command": "vi uptime.py"}, {"line": 853, "command": "uptime | jc --uptime -p"}, {"line": 854, "command": "~/resizeterm.sh "}, {"line": 855, "command": "rm uptime.py "}, {"line": 856, "command": "vi uptime.py"}, {"line": 857, "command": "uptime | jc --uptime -p"}, {"line": 858, "command": "w | jc --w -p"}, {"line": 859, "command": "uptime | jc --uptime -p"}, {"line": 860, "command": "cd .."}, {"line": 861, "command": "ls"}, {"line": 862, "command": "rm jc.py "}, {"line": 863, "command": "vi jc.py"}, {"line": 864, "command": "lsof | jc --lsof -p"}, {"line": 865, "command": "cat jc.py "}, {"line": 866, "command": "uptime | jc --uptime -p"}, {"line": 867, "command": "vi jc.py "}, {"line": 868, "command": "rm jc.py "}, {"line": 869, "command": "vi jc.py"}, {"line": 870, "command": "jc"}, {"line": 871, "command": "lsof | jc --lsof -p"}, {"line": 872, "command": "uptime | jc --uptime -p"}, {"line": 873, "command": "lsof | jc --lsof -p"}, {"line": 874, "command": "sudo lsof | jc --lsof -p"}, {"line": 875, "command": "uptime | jc --uptime -p"}, {"line": 876, "command": "ls"}, {"line": 877, "command": "cd .."}, {"line": 878, "command": "ls"}, {"line": 879, "command": "pip3 uninstall jc"}, {"line": 880, "command": "rm -rf jc/"}, {"line": 881, "command": "history | grep clone"}, {"line": 882, "command": "git clone --single-branch --branch dev https://github.com/kellyjonbrazil/jc.git"}, {"line": 883, "command": "cd jc/"}, {"line": 884, "command": "pip3 install --upgrade --user -e ."}, {"line": 885, "command": "jc"}, {"line": 886, "command": "uptime | jc --uptime -p"}, {"line": 887, "command": "uptime | jc --uptime"}, {"line": 888, "command": "lsof | jc --lsof -p"}, {"line": 889, "command": "ls"}, {"line": 890, "command": "cat changelog.txt "}, {"line": 891, "command": "env | jc -env -p"}, {"line": 892, "command": "env | jc --env -p"}, {"line": 893, "command": "history | jc --history -p"}, {"line": 894, "command": "history | jc --history | jq 'select(\"vi\")'"}, {"line": 895, "command": "history | jc --history | jq 'select(.value=\"ls\")'"}, {"line": 896, "command": "history | jc --history | jq 'select(.value==\"ls\")'"}, {"line": 897, "command": "history | jc --history | jq 'select(.value==\"jc\")'"}, {"line": 898, "command": "history | jc --history | jq 'select(.value == jc)'"}, {"line": 899, "command": "history | jc --history -p"}, {"line": 900, "command": "uptime | jc --uptime -p"}, {"line": 901, "command": "pip3 list"}, {"line": 902, "command": "pip3 install --upgrade pip"}, {"line": 903, "command": "pip3 install --upgrade --user pip"}, {"line": 904, "command": "pip3 list"}, {"line": 905, "command": "jc"}, {"line": 906, "command": "df | jc --df -p"}, {"line": 907, "command": "jc"}, {"line": 908, "command": "env | jc --env -p"}, {"line": 909, "command": "env | jc --env"}, {"line": 910, "command": "env | jc --env | jq '. paths'"}, {"line": 911, "command": "env | jc --env | jq 'paths()'"}, {"line": 912, "command": "env | jc --env | jq '[paths(\"ls\")]'"}, {"line": 913, "command": "env"}, {"line": 914, "command": "env | jc --env | jq '[paths(\"kbrazil\")]'"}, {"line": 915, "command": "uptime | jc --uptime -p"}, {"line": 916, "command": "jc"}, {"line": 917, "command": "free | jc --free -p"}, {"line": 918, "command": "history | jc --history"}, {"line": 919, "command": "jc"}, {"line": 920, "command": "ifconfig | jc --ifconfig -p"}, {"line": 921, "command": "jc"}, {"line": 922, "command": "sudo iptables -vnL | jc --iptables -p"}, {"line": 923, "command": "jc"}, {"line": 924, "command": "sudo iptables -vnL | jc --iptables -p"}, {"line": 925, "command": "ls"}, {"line": 926, "command": "jc"}, {"line": 927, "command": "jobs | jc --jobs -p"}, {"line": 928, "command": "jobs -p| jc --jobs -p"}, {"line": 929, "command": "jobs -a| jc --jobs -p"}, {"line": 930, "command": "jobs -l| jc --jobs -p"}, {"line": 931, "command": "sleep 100 &"}, {"line": 932, "command": "jobs -l| jc --jobs -p"}, {"line": 933, "command": "jc"}, {"line": 934, "command": "ls -alh | jc --ls -p"}, {"line": 935, "command": "jc"}, {"line": 936, "command": "lsblk | jc --lsblk -p"}, {"line": 937, "command": "uptime | jc --uptime -p"}, {"line": 938, "command": "jc"}, {"line": 939, "command": "lsmod | jc --lsmod -p"}, {"line": 940, "command": "jc"}, {"line": 941, "command": "lsof | jc --lsof -p"}, {"line": 942, "command": "sudo lsof | jc --lsof -p"}, {"line": 943, "command": "uptime | jc --uptime -p"}, {"line": 944, "command": "uptime | jc --uptime | jq ."}, {"line": 945, "command": "uptime"}, {"line": 946, "command": "uptime | jc --uptime | jq ."}, {"line": 947, "command": "uptime | jc --uptime -p"}, {"line": 948, "command": "cd jc/parsers/"}, {"line": 949, "command": "rm uptime.py "}, {"line": 950, "command": "vi uptime.py"}, {"line": 951, "command": "uptime | jc --uptime -p"}, {"line": 952, "command": "rm uptime.py "}, {"line": 953, "command": "vi uptime.py"}, {"line": 954, "command": "rm uptime.py "}, {"line": 955, "command": "vi uptime.py"}, {"line": 956, "command": "uptime | jc --uptime -p"}, {"line": 957, "command": "uptime"}, {"line": 958, "command": "rm uptime.py "}, {"line": 959, "command": "vi uptime.py"}, {"line": 960, "command": "uptime | jc --uptime -p"}, {"line": 961, "command": "rm uptime.py "}, {"line": 962, "command": "vi uptime.py"}, {"line": 963, "command": "uptime | jc --uptime -p"}, {"line": 964, "command": "rm uptime.py "}, {"line": 965, "command": "vi uptime.py"}, {"line": 966, "command": "uptime | jc --uptime -p"}, {"line": 967, "command": "rm uptime.py "}, {"line": 968, "command": "vi uptime.py"}, {"line": 969, "command": "uptime | jc --uptime -p"}, {"line": 970, "command": "reboot"}, {"line": 971, "command": "uptime"}, {"line": 972, "command": "uptime | jc --uptime -p"}, {"line": 973, "command": "python3"}, {"line": 974, "command": "uptime | sed -E 's/.*(up.*), [[:digit:]]+ user.*/\\1/'"}, {"line": 975, "command": "echo '22:19 up 54 days, 1 min, 4 users, load averages: 2.08 2.06 2.27' | sed -E 's/.*(up.*), [[:digit:]]+ user.*/\\1/'"}, {"line": 976, "command": "~/resizeterm.sh "}, {"line": 977, "command": "echo '22:19 up 54 days, 1 min, 4 users, load averages: 2.08 2.06 2.27' | sed -E 's/.*(up.*), [[:digit:]]+ user.*/\\1/'"}, {"line": 978, "command": "uptime | jc --uptime -p"}, {"line": 979, "command": "cd git/jc/jc/parsers/"}, {"line": 980, "command": "rm uptime.py "}, {"line": 981, "command": "vi uptime.py"}, {"line": 982, "command": "uptime | jc --uptime -p"}, {"line": 983, "command": "rm uptime.py "}, {"line": 984, "command": "vi uptime.py"}, {"line": 985, "command": "uptime | jc --uptime -p"}, {"line": 986, "command": "python3"}, {"line": 987, "command": "uptime | jc --uptime -p"}, {"line": 988, "command": "rm uptime.py "}, {"line": 989, "command": "vi uptime.py"}, {"line": 990, "command": "uptime | jc --uptime -p"}, {"line": 991, "command": "rm uptime.py "}, {"line": 992, "command": "vi uptime.py"}, {"line": 993, "command": "uptime | jc --uptime -p"}, {"line": 994, "command": "reboot"}, {"line": 995, "command": "ls"}, {"line": 996, "command": "w"}, {"line": 997, "command": "mkdir testfiles"}, {"line": 998, "command": "ls"}, {"line": 999, "command": "cat testfile"}, {"line": 1000, "command": "rm testfile"}, {"line": 1001, "command": "ls"}, {"line": 1002, "command": "cd testfiles/"}, {"line": 1003, "command": "vi tests.sh"}, {"line": 1004, "command": "chmod +x tests.sh "}, {"line": 1005, "command": "ls"}, {"line": 1006, "command": "./tests.sh "}, {"line": 1007, "command": "ls"}, {"line": 1008, "command": "cat jobs.out "}, {"line": 1009, "command": "cat w.out "}, {"line": 1010, "command": "cat uname-a.out "}, {"line": 1011, "command": "jc"}, {"line": 1012, "command": "rm tests.sh "}, {"line": 1013, "command": "vi tests.sh"}, {"line": 1014, "command": "chmod +x tests.sh "}, {"line": 1015, "command": "./tests.sh "}, {"line": 1016, "command": "uptime "}, {"line": 1017, "command": "rm tests.sh "}, {"line": 1018, "command": "vi tests.sh"}, {"line": 1019, "command": "chmod +x tests.sh "}, {"line": 1020, "command": "./tests.sh "}, {"line": 1021, "command": "ls"}, {"line": 1022, "command": "cat uptime.out "}, {"line": 1023, "command": "cat uptime.out | jc --uptime -p"}, {"line": 1024, "command": "route -n > route-n.out"}, {"line": 1025, "command": "cat route-n.out "}, {"line": 1026, "command": "route -vn"}, {"line": 1027, "command": "rm route-n.out "}, {"line": 1028, "command": "ls"}, {"line": 1029, "command": "cat iptables-filter-nv.out "}, {"line": 1030, "command": "cat iptables-filter-nv.out | jc --iptables -p"}, {"line": 1031, "command": "ls"}, {"line": 1032, "command": "cat iptables-mangle.out "}, {"line": 1033, "command": "rm tests.sh "}, {"line": 1034, "command": "vi tests.sh"}, {"line": 1035, "command": "chmod +x tests.sh "}, {"line": 1036, "command": "./tests.sh "}, {"line": 1037, "command": "ls"}, {"line": 1038, "command": "ls -al"}, {"line": 1039, "command": "cat history.out "}, {"line": 1040, "command": "history"}, {"line": 1041, "command": "history > kbhistory.out"}, {"line": 1042, "command": "cat kbhistory.out "}, {"line": 1043, "command": "rm kbhistory.out "}, {"line": 1044, "command": "ls"}, {"line": 1045, "command": "ls -al"}, {"line": 1046, "command": "rm tests.sh "}, {"line": 1047, "command": "vi tests.sh"}, {"line": 1048, "command": "chmod +x tests.sh "}, {"line": 1049, "command": "./tests.sh "}, {"line": 1050, "command": "ls -al"}, {"line": 1051, "command": "vi iptables-filter.out "}, {"line": 1052, "command": "uname -a"}, {"line": 1053, "command": "cd /"}, {"line": 1054, "command": "ls"}, {"line": 1055, "command": "cd etc/"}, {"line": 1056, "command": "ls"}, {"line": 1057, "command": "cat environment "}, {"line": 1058, "command": "cat centos-release"}, {"line": 1059, "command": "lsb_release -a"}, {"line": 1060, "command": "ifconfig"}, {"line": 1061, "command": "cd ~"}, {"line": 1062, "command": "ls"}, {"line": 1063, "command": "cd testfiles/"}, {"line": 1064, "command": "history > history.out "}] +[{"line":65,"command":"sudo iptables -w -vL -t filter | jc --iptables -p"},{"line":66,"command":"sudo iptables -vnL -t filter | jc --iptables -p"},{"line":67,"command":"sudo iptables -vnL -t filter"},{"line":68,"command":"rm iptables.py "},{"line":69,"command":"vi iptables.py"},{"line":70,"command":"sudo iptables -vnL -t filter | jc --iptables -p"},{"line":71,"command":"sudo iptables -vL -t filter | jc --iptables -p"},{"line":72,"command":"sudo iptables -L -t filter | jc --iptables -p"},{"line":73,"command":"sudo iptables -L -t nat | jc --iptables -p"},{"line":74,"command":"sudo iptables -vnL -t filter | jc --iptables -p"},{"line":75,"command":"sudo iptables -vnL -t filter | jc"},{"line":76,"command":"sudo iptables -vnL -t filter | jc --iptables"},{"line":77,"command":"sudo iptables -vnL -t raw | jc --iptables"},{"line":78,"command":"sudo iptables -vnL -t raw | jc --iptables -p"},{"line":79,"command":"jobs"},{"line":80,"command":"sleep 100 &"},{"line":81,"command":"jobs"},{"line":82,"command":"sleep 101 &"},{"line":83,"command":"jobs"},{"line":84,"command":"sleep 102 &"},{"line":85,"command":"jobs"},{"line":86,"command":"sleep 103 &"},{"line":87,"command":"jobs"},{"line":88,"command":"iptable"},{"line":89,"command":"sudo iptables -L | jc --iptables"},{"line":90,"command":"sudo iptables -L | jc --iptables -p"},{"line":91,"command":"sudo iptables -L | jc --iptables | jq ."},{"line":92,"command":"pip3 install jq"},{"line":93,"command":"pip3 install --user jq"},{"line":94,"command":"jq"},{"line":95,"command":"yum install jq"},{"line":96,"command":"sudo yum install jq"},{"line":97,"command":"sudo dnf install jq"},{"line":98,"command":"curl https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64"},{"line":99,"command":"ls"},{"line":100,"command":"ls -al"},{"line":101,"command":"cd ~"},{"line":102,"command":"curl https://github-production-release-asset-2e65be.s3.amazonaws.com/5101141/6387d980-de1f-11e8-8d3e-4455415aa408?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20191023%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20191023T000342Z&X-Amz-Expires=300&X-Amz-Signature=6d4aad2941c281a57ea469d57115f0a3d877fc24998ded52e1c51cbf7b482705&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Djq-linux64&response-content-type=application%2Foctet-stream"},{"line":103,"command":"ls"},{"line":104,"command":"curl 'https://github-production-release-asset-2e65be.s3.amazonaws.com/5101141/6387d980-de1f-11e8-8d3e-4455415aa408?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20191023%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20191023T000342Z&X-Amz-Expires=300&X-Amz-Signature=6d4aad2941c281a57ea469d57115f0a3d877fc24998ded52e1c51cbf7b482705&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Djq-linux64&response-content-type=application%2Foctet-stream'"},{"line":105,"command":"ifconfig"},{"line":106,"command":"ls"},{"line":107,"command":"chmod jq-linux64 "},{"line":108,"command":"chmod +x jq-linux64 "},{"line":109,"command":"./jq-linux64 "},{"line":110,"command":"mv jq-linux64 jq"},{"line":111,"command":"sudo mv jq /usr/local/bin/"},{"line":112,"command":"jq"},{"line":113,"command":"iptables -L | jc --iptables | jq ."},{"line":114,"command":"sudo iptables -L | jc --iptables | jq ."},{"line":115,"command":"sudo iptables -L "},{"line":116,"command":"sudo iptables -vL "},{"line":117,"command":"sudo iptables -vL | jc --iptables | jq ."},{"line":118,"command":"df | jc --df -p"},{"line":119,"command":"cd ~"},{"line":120,"command":"pip3 uninstall jc"},{"line":121,"command":"cd git/"},{"line":122,"command":"ls"},{"line":123,"command":"rm -rf jc/"},{"line":124,"command":"history | grep clone"},{"line":125,"command":"git clone https://github.com/kellyjonbrazil/jc.git"},{"line":126,"command":"ls"},{"line":127,"command":"cd jc/"},{"line":128,"command":"./build-package.sh "},{"line":129,"command":"./pypi-upload.sh "},{"line":130,"command":"cd .."},{"line":131,"command":"ls"},{"line":132,"command":"pip3 uninstall jc"},{"line":133,"command":"rm -rf jc/"},{"line":134,"command":"pip3 install --user --upgrade jc"},{"line":135,"command":"iptables -L | jc --iptables | jq"},{"line":136,"command":"sudo iptables -L | jc --iptables | jq"},{"line":137,"command":"mount | jc --mount -p"},{"line":138,"command":"uname -a | jc --uname"},{"line":139,"command":"uname -a | jc --uname -p"},{"line":140,"command":"df | jc --df -p"},{"line":141,"command":"free | jc --free -p"},{"line":142,"command":"lsblk | jc --lsblk -p"},{"line":143,"command":"ls | jc"},{"line":144,"command":"env | jc --env -p"},{"line":145,"command":"ls | jc"},{"line":146,"command":"route | jc --route -p"},{"line":147,"command":"iptables -L | jc --iptables | jq ."},{"line":148,"command":"sudo iptables -L | jc --iptables | jq ."},{"line":149,"command":"ls"},{"line":150,"command":"pip3 uninstall jc"},{"line":151,"command":"history | grep clone"},{"line":152,"command":"git clone --single-branch --branch dev https://github.com/kellyjonbrazil/jc.git"},{"line":153,"command":"cd jc/"},{"line":154,"command":"pip3 install --user --upgrade -e ."},{"line":155,"command":"sudo iptables -L | jc --iptables -p"},{"line":156,"command":"sudo iptables -L | jc --iptables"},{"line":157,"command":"sudo iptables -L | jc --iptables | jq ."},{"line":158,"command":"pip3 list"},{"line":159,"command":"cd jc"},{"line":160,"command":"ls"},{"line":161,"command":"vi jc.py "},{"line":162,"command":"jc"},{"line":163,"command":"ls | jc"},{"line":164,"command":"vi jc.py "},{"line":165,"command":"jc"},{"line":166,"command":"ls | jc"},{"line":167,"command":"cat"},{"line":168,"command":"jc"},{"line":169,"command":"vi jc.py "},{"line":170,"command":"jc"},{"line":171,"command":"ls | jc"},{"line":172,"command":"vi jc.py "},{"line":173,"command":"jc"},{"line":174,"command":"vi jc.py "},{"line":175,"command":"jc"},{"line":176,"command":"ls | jc"},{"line":177,"command":"vi jc.py "},{"line":178,"command":"jc"},{"line":179,"command":"ls | jc"},{"line":180,"command":"ls | jc --ls"},{"line":181,"command":"jc << ls -l"},{"line":182,"command":"jc < ls -l"},{"line":183,"command":"jc < ls / -l"},{"line":184,"command":"jc < ls -l /"},{"line":185,"command":"jc <<< ls -l /"},{"line":186,"command":"jc --ls <<< ls -l /"},{"line":187,"command":"jc --ls -p <<< ls -l /"},{"line":188,"command":"jc --ls -p <<< 'ls -a /'"},{"line":189,"command":"cat jc.py "},{"line":190,"command":"ls"},{"line":191,"command":"rm jc.py "},{"line":192,"command":"vi jc.py"},{"line":193,"command":"jc"},{"line":194,"command":"rm jc.py "},{"line":195,"command":"vi jc.py"},{"line":196,"command":"jc"},{"line":197,"command":"jc --ls"},{"line":198,"command":"ls | jc --ls"},{"line":199,"command":"ls -al | jc --ls"},{"line":200,"command":"ls -al | jc --ls -p"},{"line":201,"command":"ls -al | jc --p"},{"line":202,"command":"jc"},{"line":203,"command":"sudo iptables -L | jc --iptables -p"},{"line":204,"command":"mount | jc --mount -p"},{"line":205,"command":"jc"},{"line":206,"command":"jc --mount"},{"line":207,"command":"ps | jc --hello"},{"line":208,"command":"jc"},{"line":209,"command":"jq"},{"line":210,"command":"jq --help"},{"line":211,"command":"jc"},{"line":212,"command":"ps | jc -p"},{"line":213,"command":"ps | jc -p --ps"},{"line":214,"command":"jc -p --ps"},{"line":215,"command":"ps -ef | jc -p --ps | jq ."},{"line":216,"command":"jc"},{"line":217,"command":"df | jc --df"},{"line":218,"command":"env | jc --env"},{"line":219,"command":"free | jc --free"},{"line":220,"command":"ifconfig | jc --ifconfig"},{"line":221,"command":"jc"},{"line":222,"command":"iptables -L | jc --iptables"},{"line":223,"command":"sudo iptables -L | jc --iptables"},{"line":224,"command":"jc"},{"line":225,"command":"ls -l | jc --ls"},{"line":226,"command":"lsblk | jc --lsblk"},{"line":227,"command":"mount | jc --mount"},{"line":228,"command":"jc"},{"line":229,"command":"netstat -l | jc --netstat"},{"line":230,"command":"ps -ef | jc --ps"},{"line":231,"command":"jc"},{"line":232,"command":"route | jc --route"},{"line":233,"command":"uname -a | jc --uname"},{"line":234,"command":"cd parsers/"},{"line":235,"command":"rm iptables.py "},{"line":236,"command":"vi iptables.py"},{"line":237,"command":"sudo iptables -L | jc --iptables"},{"line":238,"command":"sudo iptables -L | jc --iptables -p"},{"line":239,"command":"lsof"},{"line":240,"command":"journalctl "},{"line":241,"command":"python3"},{"line":242,"command":"ls"},{"line":243,"command":"vi jobs.py"},{"line":244,"command":"cd .."},{"line":245,"command":"ls"},{"line":246,"command":"rm jc.py "},{"line":247,"command":"vi jc.py"},{"line":248,"command":"sleep 500 &"},{"line":249,"command":"sleep 501 &"},{"line":250,"command":"sleep 502 &"},{"line":251,"command":"sleep 503 &"},{"line":252,"command":"jobs"},{"line":253,"command":"jobs | jc --jobs"},{"line":254,"command":"jobs -l | jc --jobs"},{"line":255,"command":"jobs -l"},{"line":256,"command":"python3"},{"line":257,"command":"ls"},{"line":258,"command":"cd parsers/"},{"line":259,"command":"ls"},{"line":260,"command":"rm jobs.py "},{"line":261,"command":"vi jobs.py"},{"line":262,"command":"jobs | jc --jobs"},{"line":263,"command":"jobs"},{"line":264,"command":"rm jobs"},{"line":265,"command":"rm jobs.py "},{"line":266,"command":"vi jobs"},{"line":267,"command":"vi jobs.py"},{"line":268,"command":"jobs | jc --jobs -p"},{"line":269,"command":"jobs -l | jc --jobs -p"},{"line":270,"command":"jobs"},{"line":271,"command":"sleep 500 &"},{"line":272,"command":"sleep 501 &"},{"line":273,"command":"sleep 502 &"},{"line":274,"command":"sleep 503 &"},{"line":275,"command":"jobs -l | jc --jobs -p"},{"line":276,"command":"jobs | jc --jobs -p"},{"line":277,"command":"rm jobs.py "},{"line":278,"command":"vi jobs.py"},{"line":279,"command":"jobs | jc --jobs -p"},{"line":280,"command":"jobs -l | jc --jobs -p"},{"line":281,"command":"jobs"},{"line":282,"command":"jobs -l"},{"line":283,"command":"rm jobs.py "},{"line":284,"command":"vi jobs.py"},{"line":285,"command":"jobs -l | jc --jobs -p"},{"line":286,"command":"rm jobs.py "},{"line":287,"command":"vi jobs.py"},{"line":288,"command":"sleep 500 &"},{"line":289,"command":"sleep 501 &"},{"line":290,"command":"sleep 502 &"},{"line":291,"command":"sleep 503 &"},{"line":292,"command":"sleep 504 &"},{"line":293,"command":"jobs"},{"line":294,"command":"jobs -l | jc --jobs -p"},{"line":295,"command":"rm jobs.py "},{"line":296,"command":"vi jobs.py"},{"line":297,"command":"sleep 1000 &"},{"line":298,"command":"sleep 1001 &"},{"line":299,"command":"sleep 1002 &"},{"line":300,"command":"sleep 1003 &"},{"line":301,"command":"sleep 1004 &"},{"line":302,"command":"jobs | jc --jobs -p"},{"line":303,"command":"jobs -l | jc --jobs -p"},{"line":304,"command":"python3"},{"line":305,"command":"rm jobs.py "},{"line":306,"command":"vi jobs.py"},{"line":307,"command":"jobs | jc --jobs -p"},{"line":308,"command":"rm jobs.py "},{"line":309,"command":"vi jobs.py"},{"line":310,"command":"jobs | jc --jobs -p"},{"line":311,"command":"rm jobs.py "},{"line":312,"command":"vi jobs.py"},{"line":313,"command":"jobs | jc --jobs -p"},{"line":314,"command":"rm jobs.py "},{"line":315,"command":"vi jobs.py"},{"line":316,"command":"jobs | jc --jobs -p"},{"line":317,"command":"jobs -l | jc --jobs -p"},{"line":318,"command":"jobs | jc --jobs -p"},{"line":319,"command":"rm jobs.py "},{"line":320,"command":"vi jobs.py"},{"line":321,"command":"jobs | jc --jobs -p"},{"line":322,"command":"\"\"\"jc - JSON CLI output utility jobs Parser"},{"line":323,"command":"Usage:"},{"line":324,"command":"specify --jobs as the first argument if the piped input is coming from jobs"},{"line":325,"command":"Examples:"},{"line":326,"command":"\"\"\""},{"line":327,"command":"import string"},{"line":328,"command":"def parse(data):"},{"line":329,"command":"output = []"},{"line":330,"command":"linedata = data.splitlines()"},{"line":331,"command":"# Clear any blank lines"},{"line":332,"command":"cleandata = list(filter(None, linedata))"},{"line":333,"command":"if cleandata:; for entry in cleandata:; output_line = {}"},{"line":334,"command":"job_number = ''"},{"line":335,"command":"pid = ''"},{"line":336,"command":"job_history = ''"},{"line":337,"command":"parsed_line = entry.split(maxsplit=2)"},{"line":338,"command":"print(parsed_line)"},{"line":339,"command":"# check if -l was used"},{"line":340,"command":"if parsed_line[1][0] in string.digits:; pid = parsed_line.pop(1)"},{"line":341,"command":"print(parsed_line)"},{"line":342,"command":"# check for + or - in first field"},{"line":343,"command":"if parsed_line[0].find('+') != -1:"},{"line":344,"command":"job_history = 'current'"},{"line":345,"command":"job_number = parsed_line[0].rstrip('+')"},{"line":346,"command":"if pid:; remainder = parsed_line[1].split(maxsplit=1)"},{"line":347,"command":"else:"},{"line":348,"command":"remainder = list(parsed_line[1])"},{"line":349,"command":"remainder.insert(0, job_number)"},{"line":350,"command":"parsed_line = remainder"},{"line":351,"command":"if parsed_line[0].find('-') != -1:"},{"line":352,"command":"job_history = 'previous'"},{"line":353,"command":"job_number = parsed_line[0].rstrip('-')"},{"line":354,"command":"if pid:; remainder = parsed_line[1].split(maxsplit=1)"},{"line":355,"command":"else:"},{"line":356,"command":"remainder = list(parsed_line[1])"},{"line":357,"command":"remainder = parsed_line[1].split(maxsplit=1)"},{"line":358,"command":"remainder.insert(0, job_number)"},{"line":359,"command":"parsed_line = remainder"},{"line":360,"command":"# clean up first field"},{"line":361,"command":"parsed_line[0] = parsed_line[0].lstrip('[').rstrip(']')"},{"line":362,"command":"print(parsed_line)"},{"line":363,"command":"# create list of dictionaries"},{"line":364,"command":"# output_line['job_number'] = int(parsed_line[0])"},{"line":365,"command":"# if pid:"},{"line":366,"command":"# output_line['pid'] = int(pid)"},{"line":367,"command":"# if job_history:"},{"line":368,"command":"# output_line['history'] = job_history"},{"line":369,"command":"# output_line['status'] = parsed_line[1]"},{"line":370,"command":"# output_line['command'] = parsed_line[2]"},{"line":371,"command":"# output.append(output_line)"},{"line":372,"command":"# return output"},{"line":373,"command":"rm jobs.py "},{"line":374,"command":"vi jobs.py"},{"line":375,"command":"jobs | jc --jobs -p"},{"line":376,"command":"jobs"},{"line":377,"command":"sleep"},{"line":378,"command":"sleep 1000 &"},{"line":379,"command":"sleep 1001 &"},{"line":380,"command":"sleep 1002 &"},{"line":381,"command":"sleep 1003 &"},{"line":382,"command":"sleep 1004 &"},{"line":383,"command":"jobs | jc --jobs -p"},{"line":384,"command":"jobs -l | jc --jobs -p"},{"line":385,"command":"rm jobs.py "},{"line":386,"command":"vi jobs.py"},{"line":387,"command":"jobs -l | jc --jobs -p"},{"line":388,"command":"jobs | jc --jobs -p"},{"line":389,"command":"rm jobs.py "},{"line":390,"command":"vi jobs.py"},{"line":391,"command":"jobs | jc --jobs -p"},{"line":392,"command":"jobs -l | jc --jobs -p"},{"line":393,"command":"jobs"},{"line":394,"command":"rm jobs.py "},{"line":395,"command":"vi jobs.py"},{"line":396,"command":"sleep 10000 &"},{"line":397,"command":"sleep 10001 &"},{"line":398,"command":"sleep 10002 &"},{"line":399,"command":"sleep 10003 &"},{"line":400,"command":"sleep 10004 &"},{"line":401,"command":"jobs -l | jc --jobs -p"},{"line":402,"command":"jobs | jc --jobs -p"},{"line":403,"command":"rm jobs.py "},{"line":404,"command":"vi jobs.py"},{"line":405,"command":"jobs | jc --jobs -p"},{"line":406,"command":"jobs -l| jc --jobs -p"},{"line":407,"command":"rm jobs.py "},{"line":408,"command":"vi jobs.py"},{"line":409,"command":"jobs -l| jc --jobs -p"},{"line":410,"command":"jobs | jc --jobs -p"},{"line":411,"command":"rm jobs.py "},{"line":412,"command":"vi jobs.py"},{"line":413,"command":"jobs | jc --jobs -p"},{"line":414,"command":"jobs -l | jc --jobs -p"},{"line":415,"command":"rm jobs.py "},{"line":416,"command":"vi jobs.py"},{"line":417,"command":"jobs -l | jc --jobs -p"},{"line":418,"command":"jobs| jc --jobs -p"},{"line":419,"command":"jc"},{"line":420,"command":"lsof"},{"line":421,"command":"yum install lsof"},{"line":422,"command":"sudo yum install lsof"},{"line":423,"command":"lsof"},{"line":424,"command":"vi lsof.py"},{"line":425,"command":"cd .."},{"line":426,"command":"ls"},{"line":427,"command":"rm jc.py "},{"line":428,"command":"vi jc.py"},{"line":429,"command":"lsof | jc --lsof"},{"line":430,"command":"cd parsers/"},{"line":431,"command":"rm lsof.py "},{"line":432,"command":"vi lsof.py"},{"line":433,"command":"lsof | jc --lsof -p"},{"line":434,"command":"rm lsof.py "},{"line":435,"command":"vi lsof.py"},{"line":436,"command":"lsof | jc --lsof -p"},{"line":437,"command":"rm lsof.py "},{"line":438,"command":"vi lsof.py"},{"line":439,"command":"lsof | jc --lsof -p"},{"line":440,"command":"rm lsof.py "},{"line":441,"command":"vi lsof.py"},{"line":442,"command":"lsof | jc --lsof -p"},{"line":443,"command":"lsof | head"},{"line":444,"command":"rm lsof.py "},{"line":445,"command":"vi lsof.py"},{"line":446,"command":"lsof | jc --lsof "},{"line":447,"command":"rm lsof.py "},{"line":448,"command":"vi lsof.py"},{"line":449,"command":"lsof | jc --lsof "},{"line":450,"command":"rm lsof.py "},{"line":451,"command":"vi lsof.py"},{"line":452,"command":"lsof | jc --lsof "},{"line":453,"command":"rm lsof.py "},{"line":454,"command":"vi lsof.py"},{"line":455,"command":"lsof | jc --lsof "},{"line":456,"command":"rm lsof.py "},{"line":457,"command":"vi lsof.py"},{"line":458,"command":"lsof | jc --lsof "},{"line":459,"command":"rm lsof.py "},{"line":460,"command":"vi lsof.py"},{"line":461,"command":"lsof | jc --lsof "},{"line":462,"command":"rm lsof.py "},{"line":463,"command":"vi lsof.py"},{"line":464,"command":"lsof | jc --lsof "},{"line":465,"command":"rm lsof.py "},{"line":466,"command":"vi lsof.py"},{"line":467,"command":"lsof | jc --lsof "},{"line":468,"command":"rm lsof.py "},{"line":469,"command":"vi lsof.py"},{"line":470,"command":"lsof | jc --lsof "},{"line":471,"command":"python3"},{"line":472,"command":"rm lsof.py "},{"line":473,"command":"vi lsof.py"},{"line":474,"command":"lsof | jc --lsof "},{"line":475,"command":"lsof"},{"line":476,"command":"lsof | head"},{"line":477,"command":"rm lsof.py "},{"line":478,"command":"vi lsof.py"},{"line":479,"command":"lsof | jc --lsof "},{"line":480,"command":"lsof | tail"},{"line":481,"command":"rm lsof.py "},{"line":482,"command":"vi lsof.py"},{"line":483,"command":"lsof | jc --lsof "},{"line":484,"command":"rm lsof.py "},{"line":485,"command":"vi lsof.py"},{"line":486,"command":"lsof | jc --lsof "},{"line":487,"command":"rm lsof.py "},{"line":488,"command":"vi lsof.py"},{"line":489,"command":"lsof | jc --lsof "},{"line":490,"command":"rm lsof.py "},{"line":491,"command":"vi lsof.py"},{"line":492,"command":"lsof | jc --lsof "},{"line":493,"command":"rm lsof.py "},{"line":494,"command":"vi lsof.py"},{"line":495,"command":"lsof | jc --lsof "},{"line":496,"command":"~/resizeterm.sh "},{"line":497,"command":"rm lsof.py "},{"line":498,"command":"vi lsof.py"},{"line":499,"command":"lsof | jc --lsof "},{"line":500,"command":"rm lsof.py "},{"line":501,"command":"vi lsof.py"},{"line":502,"command":"lsof | jc --lsof "},{"line":503,"command":"rm lsof.py "},{"line":504,"command":"vi lsof.py"},{"line":505,"command":"lsof | jc --lsof "},{"line":506,"command":"rm lsof.py "},{"line":507,"command":"vi lsof.py"},{"line":508,"command":"lsof | jc --lsof "},{"line":509,"command":"rm lsof.py "},{"line":510,"command":"vi lsof.py"},{"line":511,"command":"lsof | jc --lsof "},{"line":512,"command":"sudo lsof | jc --lsof "},{"line":513,"command":"lsof"},{"line":514,"command":"rm lsof.py "},{"line":515,"command":"vi lsof.py"},{"line":516,"command":"sudo lsof | jc --lsof "},{"line":517,"command":"rm lsof.py "},{"line":518,"command":"vi lsof.py"},{"line":519,"command":"sudo lsof | jc --lsof -p"},{"line":520,"command":"sudo lsof | more"},{"line":521,"command":"rm lsof.py "},{"line":522,"command":"vi lsof.py"},{"line":523,"command":"sudo lsof | jc --lsof -p"},{"line":524,"command":"lsof | jc --lsof -p"},{"line":525,"command":"lsof | jc --lsof"},{"line":526,"command":"lsof | jc --lsof | jq ."},{"line":527,"command":"jc"},{"line":528,"command":"sudo lsof | jc --lsof -p"},{"line":529,"command":"man lsof"},{"line":530,"command":"~/resizeterm.sh "},{"line":531,"command":"sudo lsof | jc --lsof -p"},{"line":532,"command":"python3"},{"line":533,"command":"lsmod"},{"line":534,"command":"~/resizeterm.sh "},{"line":535,"command":"lsmod"},{"line":536,"command":"cd ~"},{"line":537,"command":"pip3 uninstall jc"},{"line":538,"command":"cd git/"},{"line":539,"command":"rm -rf jc/"},{"line":540,"command":"pip3 install --upgrade --user -e ."},{"line":541,"command":"history | grep clone"},{"line":542,"command":"git clone --single-branch --branch dev https://github.com/kellyjonbrazil/jc.git"},{"line":543,"command":"cd jc/"},{"line":544,"command":"pip3 install --upgrade --user -e ."},{"line":545,"command":"jc"},{"line":546,"command":"lsmod | jc --lsmod -p"},{"line":547,"command":"cd pypi-upload.sh "},{"line":548,"command":"cd jc"},{"line":549,"command":"cd parsers/"},{"line":550,"command":"ls"},{"line":551,"command":"rm lsmod.py "},{"line":552,"command":"vi lsmod.py"},{"line":553,"command":"lsmod | jc --lsmod -p"},{"line":554,"command":"rm lsmod.py "},{"line":555,"command":"vi lsmod.py"},{"line":556,"command":"lsmod | jc --lsmod -p"},{"line":557,"command":"rm lsmod.py "},{"line":558,"command":"vi lsmod.py"},{"line":559,"command":"lsmod | jc --lsmod -p"},{"line":560,"command":"rm lsmod.py "},{"line":561,"command":"vi lsmod.py"},{"line":562,"command":"lsmod | jc --lsmod -p"},{"line":563,"command":"rm lsmod.py "},{"line":564,"command":"vi lsmod.py"},{"line":565,"command":"lsmod | jc --lsmod -p"},{"line":566,"command":"rm lsmod.py "},{"line":567,"command":"vi lsmod.py"},{"line":568,"command":"lsmod | jc --lsmod -p"},{"line":569,"command":"rm lsmod.py "},{"line":570,"command":"vi lsmod.py"},{"line":571,"command":"lsmod | jc --lsmod -p"},{"line":572,"command":"rm lsmod.py "},{"line":573,"command":"vi lsmod.py"},{"line":574,"command":"lsmod | jc --lsmod -p"},{"line":575,"command":"rm lsmod.py "},{"line":576,"command":"vi lsmod.py"},{"line":577,"command":"lsmod | jc --lsmod -p"},{"line":578,"command":"jc"},{"line":579,"command":"cd ~"},{"line":580,"command":"pip3 uninstall jc"},{"line":581,"command":"cd git/"},{"line":582,"command":"rm -rf jc/"},{"line":583,"command":"history | grep clone"},{"line":584,"command":"ls"},{"line":585,"command":"git clone https://github.com/kellyjonbrazil/jc.git"},{"line":586,"command":"cd jc/"},{"line":587,"command":"ls"},{"line":588,"command":"./build-package.sh "},{"line":589,"command":"ls"},{"line":590,"command":"./pypi-upload.sh "},{"line":591,"command":"cd .."},{"line":592,"command":"ls"},{"line":593,"command":"pip3 uninstall jc"},{"line":594,"command":"rm -rf jc/"},{"line":595,"command":"pip3 install --upgrade --user jc"},{"line":596,"command":"pip3 list"},{"line":597,"command":"jc"},{"line":598,"command":"jc -p"},{"line":599,"command":"sudo iptables -L | jc --iptables -p"},{"line":600,"command":"jc"},{"line":601,"command":"lsmod | jc --lsmod -p"},{"line":602,"command":"jc"},{"line":603,"command":"jobs"},{"line":604,"command":"sleep 500 &"},{"line":605,"command":"jobs -l | jc --jobs -p"},{"line":606,"command":"jobs | jc --jobs -p"},{"line":607,"command":"lsof"},{"line":608,"command":"cd ~"},{"line":609,"command":"pip3 list"},{"line":610,"command":"lsof | jc --lsof > testfile"},{"line":611,"command":"cat testfile "},{"line":612,"command":"iptables -L | jc --iptables > testfile "},{"line":613,"command":"sudo iptables -L | jc --iptables > testfile "},{"line":614,"command":"cat testfile "},{"line":615,"command":"cat testfile | jq ."},{"line":616,"command":"w"},{"line":617,"command":"w -h"},{"line":618,"command":"w --help"},{"line":619,"command":"w -f"},{"line":620,"command":"w -i"},{"line":621,"command":"w -s"},{"line":622,"command":"w -o"},{"line":623,"command":"date"},{"line":624,"command":"ls | jc --ls"},{"line":625,"command":"ls | jc --ls | jq '.select(\"filename\" = \"git)'"},{"line":626,"command":"ls | jc --ls | jq '.select(.filename=\"git)'"},{"line":627,"command":"ls | jc --ls | jq '.select(.filename=\"git\")'"},{"line":628,"command":"ls | jc --ls | jq 'select(.filename == \"git\")'"},{"line":629,"command":"ls | jc --ls | jq '.[] | select(.filename == \"git\")'"},{"line":630,"command":"ls | jc --ls | jq -r '.[] | select(.filename == \"git\")'"},{"line":631,"command":"ls | jc --ls | jq -r '.[] | select(.filename == \"git\") | .filename'"},{"line":632,"command":"ifconfig | jc --ifconfig -p"},{"line":633,"command":"jc -p"},{"line":634,"command":"jc"},{"line":635,"command":"ls | jc -p"},{"line":636,"command":"ip"},{"line":637,"command":"ip address"},{"line":638,"command":"ip --help"},{"line":639,"command":"ip address --help"},{"line":640,"command":"ip address -h"},{"line":641,"command":"ip -h address"},{"line":642,"command":"ip -b address"},{"line":643,"command":"ip -iec address"},{"line":644,"command":"ip address"},{"line":645,"command":"ip --help"},{"line":646,"command":"ip -br address"},{"line":647,"command":"ip -d address"},{"line":648,"command":"ifconfig"},{"line":649,"command":"cat"},{"line":650,"command":"jc"},{"line":651,"command":"jc | cat"},{"line":652,"command":"jc > testing"},{"line":653,"command":"cat testing "},{"line":654,"command":"rm testing "},{"line":655,"command":"jc &2 > testing"},{"line":656,"command":"cat testing "},{"line":657,"command":"ls"},{"line":658,"command":"cat testing "},{"line":659,"command":"rm testing "},{"line":660,"command":"jc 2>&1 | jc --ls"},{"line":661,"command":"jc 2>&1 | jc --ls -p"},{"line":662,"command":"jc 2>&1 | jc --route -p"},{"line":663,"command":"jc 2>&1 | jc --ps -p"},{"line":664,"command":"jc 2>&1 | jc --iptables -p"},{"line":665,"command":"jc 2>&1 | jc --lsof -p"},{"line":666,"command":"jc 2>&1 | jc --ls -p"},{"line":667,"command":"jc 2>&1 | jc --env -p"},{"line":668,"command":"jc 2>&1 | jc --netstat -p"},{"line":669,"command":"jc 2>&1 | jc --uname -p"},{"line":670,"command":"jc"},{"line":671,"command":"journalctl "},{"line":672,"command":"man journalctl"},{"line":673,"command":"man journalctl -o=json"},{"line":674,"command":"journalctl -o=json"},{"line":675,"command":"journalctl -o json"},{"line":676,"command":"journalctl -o json >journaljson"},{"line":677,"command":"cat journaljson "},{"line":678,"command":"dig"},{"line":679,"command":"uptime"},{"line":680,"command":"uptime --help"},{"line":681,"command":"uptime -p"},{"line":682,"command":"uptime -s"},{"line":683,"command":"uptime "},{"line":684,"command":"date"},{"line":685,"command":"uptime"},{"line":686,"command":"history"},{"line":687,"command":"pip3 uninstall jc"},{"line":688,"command":"cd git/"},{"line":689,"command":"ls"},{"line":690,"command":"history | grep clone"},{"line":691,"command":"git clone --single-branch --branch dev https://github.com/kellyjonbrazil/jc.git"},{"line":692,"command":"cd jc"},{"line":693,"command":"pip3 install --upgrade --user -e ."},{"line":694,"command":"jc"},{"line":695,"command":"w | jc --w -p"},{"line":696,"command":"history | jc --history"},{"line":697,"command":"history"},{"line":698,"command":"history | jc --history -p"},{"line":699,"command":"history | head"},{"line":700,"command":"cd jc/parsers/"},{"line":701,"command":"vi history.py "},{"line":702,"command":"history | jc --history -p"},{"line":703,"command":"vi history.py "},{"line":704,"command":"history | jc --history -p"},{"line":705,"command":"echo \"hello\""},{"line":706,"command":"history | jc --history -p"},{"line":707,"command":"cat history.py "},{"line":708,"command":"rm history.py "},{"line":709,"command":"vi history.py"},{"line":710,"command":"history | jc --history -p"},{"line":711,"command":"history | jc --history"},{"line":712,"command":"history | jc --history -p"},{"line":713,"command":"history | jc --history -p | jq .1700"},{"line":714,"command":"history | jc --history -p | jq .1709"},{"line":715,"command":"history | jc --history | jq .1709"},{"line":716,"command":"history | jc --history | jq ."},{"line":717,"command":"history | jc --history | jq .\"1713\""},{"line":718,"command":"history | jc --history | jq .[1713]"},{"line":719,"command":"history | jc --history | jq .[\"1713\"]"},{"line":720,"command":"history | jc --history | jq '.1713'"},{"line":721,"command":"history | jc --history | jq '.[1713]'"},{"line":722,"command":"history | jc --history | jq '.[\"1713\"]'"},{"line":723,"command":"rm history.py "},{"line":724,"command":"vi history.py"},{"line":725,"command":"history | jc --history -p"},{"line":726,"command":"history | jc --history -p | jq .n1723"},{"line":727,"command":"cd ~"},{"line":728,"command":"pip3 uninstall jc"},{"line":729,"command":"cd git/"},{"line":730,"command":"rm -rf jc/"},{"line":731,"command":"history | grep clone"},{"line":732,"command":"git clone --single-branch --branch dev https://github.com/kellyjonbrazil/jc.git"},{"line":733,"command":"cd jc/"},{"line":734,"command":"pip3 install --upgrade --user -e ."},{"line":735,"command":"jc"},{"line":736,"command":"history | jc --history -p"},{"line":737,"command":"jc"},{"line":738,"command":"w | jc --w -p"},{"line":739,"command":"uptime | jc --uptime -p"},{"line":740,"command":"ls"},{"line":741,"command":"stat build-package.sh "},{"line":742,"command":"ls"},{"line":743,"command":"stat jc.egg-info/"},{"line":744,"command":"stat README.md "},{"line":745,"command":"lstat"},{"line":746,"command":"cd /proc/"},{"line":747,"command":"ls"},{"line":748,"command":"cd 1"},{"line":749,"command":"ls"},{"line":750,"command":"ls -al"},{"line":751,"command":"cd attr/"},{"line":752,"command":"ls"},{"line":753,"command":"ls -al"},{"line":754,"command":"cat current "},{"line":755,"command":"cat exec "},{"line":756,"command":"cat prev "},{"line":757,"command":"dig"},{"line":758,"command":"sudo yum install dig"},{"line":759,"command":"sudo yum install bind-utils"},{"line":760,"command":"dig"},{"line":761,"command":"dig www.google.com"},{"line":762,"command":"dig www.cnn.com"},{"line":763,"command":"man dig"},{"line":764,"command":"dig www.cnn.com www.google.com"},{"line":765,"command":"pip3 list"},{"line":766,"command":"cd ~/git/jc/jc/parsers/"},{"line":767,"command":"rm history.py "},{"line":768,"command":"vi history.py"},{"line":769,"command":"history | jc --history"},{"line":770,"command":"history | jc --history -p"},{"line":771,"command":"ifconfig | jc --ifconfig -p"},{"line":772,"command":"rm iptables.py "},{"line":773,"command":"vi iptables.py"},{"line":774,"command":"iptables -L | jc --iptables -p"},{"line":775,"command":"sudo iptables -L | jc --iptables -p"},{"line":776,"command":"lsblk | jc --lsblk -p"},{"line":777,"command":"rm lsblk.py "},{"line":778,"command":"vi lsblk.py"},{"line":779,"command":"lsblk | jc --lsblk -p"},{"line":780,"command":"rm lsmod.py "},{"line":781,"command":"vi lsmod.py"},{"line":782,"command":"lsmod"},{"line":783,"command":"lsmod | jc --lsmod -p"},{"line":784,"command":"rm lsof.py "},{"line":785,"command":"vi lsof.py"},{"line":786,"command":"lsof | jc --lsof -p"},{"line":787,"command":"sudo lsof | jc --lsof -p"},{"line":788,"command":"sudo lsof | jc --lsof | jq ."},{"line":789,"command":"ps | jc --ps -p"},{"line":790,"command":"clear"},{"line":791,"command":"rm ps.py "},{"line":792,"command":"vi ps.py"},{"line":793,"command":"ps | jc --ps -p"},{"line":794,"command":"ps axu | jc --ps -p"},{"line":795,"command":"rm ps.py "},{"line":796,"command":"vi ps.py"},{"line":797,"command":"ps | jc --ps -p"},{"line":798,"command":"ps axu | jc --ps -p"},{"line":799,"command":"ps -ef | jc --ps -p"},{"line":800,"command":"ps -ef | jc --ps -p | jq ."},{"line":801,"command":"ps axu | jc --ps -p | jq ."},{"line":802,"command":"ps -ef | jc --ps -p"},{"line":803,"command":"ls"},{"line":804,"command":"rm route.py "},{"line":805,"command":"vi route.py"},{"line":806,"command":"route | jc --route -p"},{"line":807,"command":"w | jc --w -p"},{"line":808,"command":"rm w.py "},{"line":809,"command":"vi w.py"},{"line":810,"command":"w | jc --w -p"},{"line":811,"command":"rm ls.py "},{"line":812,"command":"vi ls.py"},{"line":813,"command":"ls -lh | jc --ps -p"},{"line":814,"command":"ls | jc --ls -p"},{"line":815,"command":"ls -alh | jc --ls -p"},{"line":816,"command":"ls -lh | jc --ls -p"},{"line":817,"command":"ls -l /usr/bin | jc --ls | jq '.[] | select(.bytes|tonumber > 50000000)'"},{"line":818,"command":"ls -l /usr/bin | jc --ls | jq '.[] | select(.size|tonumber > 50000000)'"},{"line":819,"command":"ls -l /usr/bin | jc --ls | jq '.[] | select(.size|tonumber > 5000000)'"},{"line":820,"command":"$ ls -l /bin | jc --ls -p"},{"line":821,"command":"ls -l /bin | jc --ls -p"},{"line":822,"command":"python3"},{"line":823,"command":"rm jobs.py "},{"line":824,"command":"vi jobs.py"},{"line":825,"command":"sleep 1000 &"},{"line":826,"command":"sleep 1001 &"},{"line":827,"command":"sleep 1002 &"},{"line":828,"command":"sleep 1003 &"},{"line":829,"command":"jobs | jc --jobs -p"},{"line":830,"command":"jobs -l | jc --jobs -p"},{"line":831,"command":"rm ls.py "},{"line":832,"command":"vi ls.py"},{"line":833,"command":"ls -al | jc --ls -p"},{"line":834,"command":"ls -alh | jc --ls -p"},{"line":835,"command":"ls -al /usr/bin | jc --ls -p"},{"line":836,"command":"ls /usr/bin | jc --ls -p"},{"line":837,"command":"rm netstat.py "},{"line":838,"command":"vi netstat.py"},{"line":839,"command":"history | grep netstat"},{"line":840,"command":"netstat -l | jc --netstat -p"},{"line":841,"command":"netstat -lv | jc --netstat -p"},{"line":842,"command":"netstat -ln | jc --netstat -p"},{"line":843,"command":"sudo netstat -lpn | jc --netstat -p"},{"line":844,"command":"sudo systemctl restart"},{"line":845,"command":"reboot"},{"line":846,"command":"jc"},{"line":847,"command":"w | jc --w -p"},{"line":848,"command":"uptime | jc --uptime -p"},{"line":849,"command":"uptime"},{"line":850,"command":"cd git/jc/jc/parsers/"},{"line":851,"command":"rm uptime.py "},{"line":852,"command":"vi uptime.py"},{"line":853,"command":"uptime | jc --uptime -p"},{"line":854,"command":"~/resizeterm.sh "},{"line":855,"command":"rm uptime.py "},{"line":856,"command":"vi uptime.py"},{"line":857,"command":"uptime | jc --uptime -p"},{"line":858,"command":"w | jc --w -p"},{"line":859,"command":"uptime | jc --uptime -p"},{"line":860,"command":"cd .."},{"line":861,"command":"ls"},{"line":862,"command":"rm jc.py "},{"line":863,"command":"vi jc.py"},{"line":864,"command":"lsof | jc --lsof -p"},{"line":865,"command":"cat jc.py "},{"line":866,"command":"uptime | jc --uptime -p"},{"line":867,"command":"vi jc.py "},{"line":868,"command":"rm jc.py "},{"line":869,"command":"vi jc.py"},{"line":870,"command":"jc"},{"line":871,"command":"lsof | jc --lsof -p"},{"line":872,"command":"uptime | jc --uptime -p"},{"line":873,"command":"lsof | jc --lsof -p"},{"line":874,"command":"sudo lsof | jc --lsof -p"},{"line":875,"command":"uptime | jc --uptime -p"},{"line":876,"command":"ls"},{"line":877,"command":"cd .."},{"line":878,"command":"ls"},{"line":879,"command":"pip3 uninstall jc"},{"line":880,"command":"rm -rf jc/"},{"line":881,"command":"history | grep clone"},{"line":882,"command":"git clone --single-branch --branch dev https://github.com/kellyjonbrazil/jc.git"},{"line":883,"command":"cd jc/"},{"line":884,"command":"pip3 install --upgrade --user -e ."},{"line":885,"command":"jc"},{"line":886,"command":"uptime | jc --uptime -p"},{"line":887,"command":"uptime | jc --uptime"},{"line":888,"command":"lsof | jc --lsof -p"},{"line":889,"command":"ls"},{"line":890,"command":"cat changelog.txt "},{"line":891,"command":"env | jc -env -p"},{"line":892,"command":"env | jc --env -p"},{"line":893,"command":"history | jc --history -p"},{"line":894,"command":"history | jc --history | jq 'select(\"vi\")'"},{"line":895,"command":"history | jc --history | jq 'select(.value=\"ls\")'"},{"line":896,"command":"history | jc --history | jq 'select(.value==\"ls\")'"},{"line":897,"command":"history | jc --history | jq 'select(.value==\"jc\")'"},{"line":898,"command":"history | jc --history | jq 'select(.value == jc)'"},{"line":899,"command":"history | jc --history -p"},{"line":900,"command":"uptime | jc --uptime -p"},{"line":901,"command":"pip3 list"},{"line":902,"command":"pip3 install --upgrade pip"},{"line":903,"command":"pip3 install --upgrade --user pip"},{"line":904,"command":"pip3 list"},{"line":905,"command":"jc"},{"line":906,"command":"df | jc --df -p"},{"line":907,"command":"jc"},{"line":908,"command":"env | jc --env -p"},{"line":909,"command":"env | jc --env"},{"line":910,"command":"env | jc --env | jq '. paths'"},{"line":911,"command":"env | jc --env | jq 'paths()'"},{"line":912,"command":"env | jc --env | jq '[paths(\"ls\")]'"},{"line":913,"command":"env"},{"line":914,"command":"env | jc --env | jq '[paths(\"kbrazil\")]'"},{"line":915,"command":"uptime | jc --uptime -p"},{"line":916,"command":"jc"},{"line":917,"command":"free | jc --free -p"},{"line":918,"command":"history | jc --history"},{"line":919,"command":"jc"},{"line":920,"command":"ifconfig | jc --ifconfig -p"},{"line":921,"command":"jc"},{"line":922,"command":"sudo iptables -vnL | jc --iptables -p"},{"line":923,"command":"jc"},{"line":924,"command":"sudo iptables -vnL | jc --iptables -p"},{"line":925,"command":"ls"},{"line":926,"command":"jc"},{"line":927,"command":"jobs | jc --jobs -p"},{"line":928,"command":"jobs -p| jc --jobs -p"},{"line":929,"command":"jobs -a| jc --jobs -p"},{"line":930,"command":"jobs -l| jc --jobs -p"},{"line":931,"command":"sleep 100 &"},{"line":932,"command":"jobs -l| jc --jobs -p"},{"line":933,"command":"jc"},{"line":934,"command":"ls -alh | jc --ls -p"},{"line":935,"command":"jc"},{"line":936,"command":"lsblk | jc --lsblk -p"},{"line":937,"command":"uptime | jc --uptime -p"},{"line":938,"command":"jc"},{"line":939,"command":"lsmod | jc --lsmod -p"},{"line":940,"command":"jc"},{"line":941,"command":"lsof | jc --lsof -p"},{"line":942,"command":"sudo lsof | jc --lsof -p"},{"line":943,"command":"uptime | jc --uptime -p"},{"line":944,"command":"uptime | jc --uptime | jq ."},{"line":945,"command":"uptime"},{"line":946,"command":"uptime | jc --uptime | jq ."},{"line":947,"command":"uptime | jc --uptime -p"},{"line":948,"command":"cd jc/parsers/"},{"line":949,"command":"rm uptime.py "},{"line":950,"command":"vi uptime.py"},{"line":951,"command":"uptime | jc --uptime -p"},{"line":952,"command":"rm uptime.py "},{"line":953,"command":"vi uptime.py"},{"line":954,"command":"rm uptime.py "},{"line":955,"command":"vi uptime.py"},{"line":956,"command":"uptime | jc --uptime -p"},{"line":957,"command":"uptime"},{"line":958,"command":"rm uptime.py "},{"line":959,"command":"vi uptime.py"},{"line":960,"command":"uptime | jc --uptime -p"},{"line":961,"command":"rm uptime.py "},{"line":962,"command":"vi uptime.py"},{"line":963,"command":"uptime | jc --uptime -p"},{"line":964,"command":"rm uptime.py "},{"line":965,"command":"vi uptime.py"},{"line":966,"command":"uptime | jc --uptime -p"},{"line":967,"command":"rm uptime.py "},{"line":968,"command":"vi uptime.py"},{"line":969,"command":"uptime | jc --uptime -p"},{"line":970,"command":"reboot"},{"line":971,"command":"uptime"},{"line":972,"command":"uptime | jc --uptime -p"},{"line":973,"command":"python3"},{"line":974,"command":"uptime | sed -E 's/.*(up.*), [[:digit:]]+ user.*/\\1/'"},{"line":975,"command":"echo '22:19 up 54 days, 1 min, 4 users, load averages: 2.08 2.06 2.27' | sed -E 's/.*(up.*), [[:digit:]]+ user.*/\\1/'"},{"line":976,"command":"~/resizeterm.sh "},{"line":977,"command":"echo '22:19 up 54 days, 1 min, 4 users, load averages: 2.08 2.06 2.27' | sed -E 's/.*(up.*), [[:digit:]]+ user.*/\\1/'"},{"line":978,"command":"uptime | jc --uptime -p"},{"line":979,"command":"cd git/jc/jc/parsers/"},{"line":980,"command":"rm uptime.py "},{"line":981,"command":"vi uptime.py"},{"line":982,"command":"uptime | jc --uptime -p"},{"line":983,"command":"rm uptime.py "},{"line":984,"command":"vi uptime.py"},{"line":985,"command":"uptime | jc --uptime -p"},{"line":986,"command":"python3"},{"line":987,"command":"uptime | jc --uptime -p"},{"line":988,"command":"rm uptime.py "},{"line":989,"command":"vi uptime.py"},{"line":990,"command":"uptime | jc --uptime -p"},{"line":991,"command":"rm uptime.py "},{"line":992,"command":"vi uptime.py"},{"line":993,"command":"uptime | jc --uptime -p"},{"line":994,"command":"reboot"},{"line":995,"command":"ls"},{"line":996,"command":"w"},{"line":997,"command":"mkdir testfiles"},{"line":998,"command":"ls"},{"line":999,"command":"cat testfile"},{"line":1000,"command":"rm testfile"},{"line":1001,"command":"ls"},{"line":1002,"command":"cd testfiles/"},{"line":1003,"command":"vi tests.sh"},{"line":1004,"command":"chmod +x tests.sh "},{"line":1005,"command":"ls"},{"line":1006,"command":"./tests.sh "},{"line":1007,"command":"ls"},{"line":1008,"command":"cat jobs.out "},{"line":1009,"command":"cat w.out "},{"line":1010,"command":"cat uname-a.out "},{"line":1011,"command":"jc"},{"line":1012,"command":"rm tests.sh "},{"line":1013,"command":"vi tests.sh"},{"line":1014,"command":"chmod +x tests.sh "},{"line":1015,"command":"./tests.sh "},{"line":1016,"command":"uptime "},{"line":1017,"command":"rm tests.sh "},{"line":1018,"command":"vi tests.sh"},{"line":1019,"command":"chmod +x tests.sh "},{"line":1020,"command":"./tests.sh "},{"line":1021,"command":"ls"},{"line":1022,"command":"cat uptime.out "},{"line":1023,"command":"cat uptime.out | jc --uptime -p"},{"line":1024,"command":"route -n > route-n.out"},{"line":1025,"command":"cat route-n.out "},{"line":1026,"command":"route -vn"},{"line":1027,"command":"rm route-n.out "},{"line":1028,"command":"ls"},{"line":1029,"command":"cat iptables-filter-nv.out "},{"line":1030,"command":"cat iptables-filter-nv.out | jc --iptables -p"},{"line":1031,"command":"ls"},{"line":1032,"command":"cat iptables-mangle.out "},{"line":1033,"command":"rm tests.sh "},{"line":1034,"command":"vi tests.sh"},{"line":1035,"command":"chmod +x tests.sh "},{"line":1036,"command":"./tests.sh "},{"line":1037,"command":"ls"},{"line":1038,"command":"ls -al"},{"line":1039,"command":"cat history.out "},{"line":1040,"command":"history"},{"line":1041,"command":"history > kbhistory.out"},{"line":1042,"command":"cat kbhistory.out "},{"line":1043,"command":"rm kbhistory.out "},{"line":1044,"command":"ls"},{"line":1045,"command":"ls -al"},{"line":1046,"command":"rm tests.sh "},{"line":1047,"command":"vi tests.sh"},{"line":1048,"command":"chmod +x tests.sh "},{"line":1049,"command":"./tests.sh "},{"line":1050,"command":"ls -al"},{"line":1051,"command":"vi iptables-filter.out "},{"line":1052,"command":"uname -a"},{"line":1053,"command":"cd /"},{"line":1054,"command":"ls"},{"line":1055,"command":"cd etc/"},{"line":1056,"command":"ls"},{"line":1057,"command":"cat environment "},{"line":1058,"command":"cat centos-release"},{"line":1059,"command":"lsb_release -a"},{"line":1060,"command":"ifconfig"},{"line":1061,"command":"cd ~"},{"line":1062,"command":"ls"},{"line":1063,"command":"cd testfiles/"},{"line":1064,"command":"history > history.out "},{"line":1065,"command":"export MYTEST=©2019-2022"}] diff --git a/tests/fixtures/centos-7.7/history.out b/tests/fixtures/centos-7.7/history.out index 6ee81165..b440c4a6 100644 --- a/tests/fixtures/centos-7.7/history.out +++ b/tests/fixtures/centos-7.7/history.out @@ -998,3 +998,4 @@ 1062 ls 1063 cd testfiles/ 1064 history > history.out + 1065 export MYTEST=©2019-2022 From 78d2b239c853236c082a9cddc4027ade5ba49de5 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 26 Apr 2022 17:51:30 -0700 Subject: [PATCH 13/21] doc update --- CHANGELOG | 3 +++ README.md | 3 +++ docs/utils.md | 12 ++++++++++++ man/jc.1 | 2 ++ templates/manpage_template | 2 ++ templates/readme_template | 3 +++ 6 files changed, 25 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 97d8dc8a..e57c6938 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,9 @@ jc changelog 20220426 v1.18.8 - Fix UnicodeEncodeError on some systems where LANG=C is set and unicode characters are in the output +- Update history parser: do not drop non-ASCII characters if the system + is configured for UTF-8 encoding +- Enhance "magic syntax" to always use UTF-8 encoding 20220425 v1.18.7 - Add git log command parser diff --git a/README.md b/README.md index 5b3ecf61..2a061f56 100644 --- a/README.md +++ b/README.md @@ -425,6 +425,9 @@ or by exporting to the environment before running commands: $ export LANG=C ``` +On some older systems UTF-8 output will be downgraded to ASCII with `\\u` +escape sequences if the `C` locale does not support UTF-8 encoding. + #### Timezones Some parsers have calculated epoch timestamp fields added to the output. Unless diff --git a/docs/utils.md b/docs/utils.md index b400bcbd..5677d42e 100644 --- a/docs/utils.md +++ b/docs/utils.md @@ -1,6 +1,7 @@ # Table of Contents * [jc.utils](#jc.utils) + * [asciify](#jc.utils.asciify) * [warning\_message](#jc.utils.warning_message) * [error\_message](#jc.utils.error_message) * [compatibility](#jc.utils.compatibility) @@ -18,6 +19,17 @@ jc - JSON Convert utils + + +### asciify + +```python +def asciify(string: str) -> str +``` + +Return a string downgraded from Unicode to ASCII with some simple +conversions. + ### warning\_message diff --git a/man/jc.1 b/man/jc.1 index ff873a10..e408b763 100644 --- a/man/jc.1 +++ b/man/jc.1 @@ -686,6 +686,8 @@ or by exporting to the environment before running commands: $ export LANG=C .RE +On some older systems UTF-8 output will be downgraded to ASCII with `\\u` escape sequences if the \fBC\fP locale does not support UTF-8 encoding. + \fBTimezones:\fP Some parsers have calculated epoch timestamp fields added to the output. Unless a timestamp field name has a \fB_utc\fP suffix it is considered naive. (i.e. based on the local timezone of the system the \fBjc\fP parser was run on). If a UTC timezone can be detected in the text of the command output, the timestamp will be timezone aware and have a \fB_utc\fP suffix on the key name. (e.g. \fBepoch_utc\fP) No other timezones are supported for aware timestamps. diff --git a/templates/manpage_template b/templates/manpage_template index 43c6b585..c61ad7e1 100644 --- a/templates/manpage_template +++ b/templates/manpage_template @@ -201,6 +201,8 @@ or by exporting to the environment before running commands: $ export LANG=C .RE +On some older systems UTF-8 output will be downgraded to ASCII with `\\u` escape sequences if the \fBC\fP locale does not support UTF-8 encoding. + \fBTimezones:\fP Some parsers have calculated epoch timestamp fields added to the output. Unless a timestamp field name has a \fB_utc\fP suffix it is considered naive. (i.e. based on the local timezone of the system the \fBjc\fP parser was run on). If a UTC timezone can be detected in the text of the command output, the timestamp will be timezone aware and have a \fB_utc\fP suffix on the key name. (e.g. \fBepoch_utc\fP) No other timezones are supported for aware timestamps. diff --git a/templates/readme_template b/templates/readme_template index a5df7a6d..3176712e 100644 --- a/templates/readme_template +++ b/templates/readme_template @@ -328,6 +328,9 @@ or by exporting to the environment before running commands: $ export LANG=C ``` +On some older systems UTF-8 output will be downgraded to ASCII with `\\u` +escape sequences if the `C` locale does not support UTF-8 encoding. + #### Timezones Some parsers have calculated epoch timestamp fields added to the output. Unless From d9c0b8f8ad892d1328cd27381cb1d5385bb1f316 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 27 Apr 2022 07:37:31 -0700 Subject: [PATCH 14/21] make _safe_print and _asciify private --- jc/cli.py | 9 +++------ jc/utils.py | 15 ++++++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/jc/cli.py b/jc/cli.py index ef433d46..36d4fcbe 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -84,9 +84,6 @@ if PYGMENTS_INSTALLED: } - - - def set_env_colors(env_colors=None): """ Return a dictionary to be used in Pygments custom style class. @@ -442,11 +439,11 @@ def main(): sys.exit(0) if help_me: - utils.safe_print(help_doc(sys.argv)) + utils._safe_print(help_doc(sys.argv)) sys.exit(0) if version_info: - utils.safe_print(versiontext()) + utils._safe_print(versiontext()) sys.exit(0) # if magic syntax used, try to run the command and error if it's not found, etc. @@ -461,7 +458,7 @@ def main(): try: magic_stdout, magic_stderr, magic_exit_code = run_user_command(run_command) if magic_stderr: - utils.safe_print(magic_stderr[:-1], file=sys.stderr) + utils._safe_print(magic_stderr[:-1], file=sys.stderr) except OSError as e: if debug: diff --git a/jc/utils.py b/jc/utils.py index 493c6207..625e67bb 100644 --- a/jc/utils.py +++ b/jc/utils.py @@ -9,7 +9,7 @@ from functools import lru_cache from typing import List, Iterable, Union, Optional -def asciify(string: str) -> str: +def _asciify(string: str) -> str: """ Return a string downgraded from Unicode to ASCII with some simple conversions. @@ -21,11 +21,12 @@ def asciify(string: str) -> str: return string -def safe_print(string: str, sep=' ', end='\n', file=sys.stdout, flush=False) -> None: +def _safe_print(string: str, sep=' ', end='\n', file=sys.stdout, flush=False) -> None: + """Output for both UTF-8 and ASCII encoding systems""" try: print(string, sep=sep, end=end, file=file, flush=flush) except UnicodeEncodeError: - print(asciify(string), sep=sep, end=end, file=file, flush=flush) + print(_asciify(string), sep=sep, end=end, file=file, flush=flush) def warning_message(message_lines: List[str]) -> None: @@ -55,13 +56,13 @@ def warning_message(message_lines: List[str]) -> None: first_line = message_lines.pop(0) first_str = f'jc: Warning - {first_line}' first_str = first_wrapper.fill(first_str) - safe_print(first_str, file=sys.stderr) + _safe_print(first_str, file=sys.stderr) for line in message_lines: if line == '': continue message = next_wrapper.fill(line) - safe_print(message, file=sys.stderr) + _safe_print(message, file=sys.stderr) def error_message(message_lines: List[str]) -> None: @@ -87,13 +88,13 @@ def error_message(message_lines: List[str]) -> None: first_line = message_lines.pop(0) first_str = f'jc: Error - {first_line}' first_str = first_wrapper.fill(first_str) - safe_print(first_str, file=sys.stderr) + _safe_print(first_str, file=sys.stderr) for line in message_lines: if line == '': continue message = next_wrapper.fill(line) - safe_print(message, file=sys.stderr) + _safe_print(message, file=sys.stderr) def compatibility(mod_name: str, compatible: List, quiet: bool = False) -> None: From b876645fc5046765cacbae62ac15014de2ad7a8c Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 27 Apr 2022 07:38:17 -0700 Subject: [PATCH 15/21] doc update --- docs/utils.md | 12 ------------ man/jc.1 | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/docs/utils.md b/docs/utils.md index 5677d42e..b400bcbd 100644 --- a/docs/utils.md +++ b/docs/utils.md @@ -1,7 +1,6 @@ # Table of Contents * [jc.utils](#jc.utils) - * [asciify](#jc.utils.asciify) * [warning\_message](#jc.utils.warning_message) * [error\_message](#jc.utils.error_message) * [compatibility](#jc.utils.compatibility) @@ -19,17 +18,6 @@ jc - JSON Convert utils - - -### asciify - -```python -def asciify(string: str) -> str -``` - -Return a string downgraded from Unicode to ASCII with some simple -conversions. - ### warning\_message diff --git a/man/jc.1 b/man/jc.1 index e408b763..0054dccd 100644 --- a/man/jc.1 +++ b/man/jc.1 @@ -1,4 +1,4 @@ -.TH jc 1 2022-04-26 1.18.8 "JSON Convert" +.TH jc 1 2022-04-27 1.18.8 "JSON Convert" .SH NAME jc \- JSONifies the output of many CLI tools and file-types .SH SYNOPSIS From 9b1fe0d9a4ccf74f893895fec205e11945549b35 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 27 Apr 2022 08:24:54 -0700 Subject: [PATCH 16/21] create safe_print_json function --- jc/cli.py | 80 +++++++++++++++++++++++++------------------------------ 1 file changed, 37 insertions(+), 43 deletions(-) diff --git a/jc/cli.py b/jc/cli.py index 36d4fcbe..937bff64 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -84,6 +84,26 @@ if PYGMENTS_INSTALLED: } +def safe_print_json(string, pretty=None, env_colors=None, mono=None, + piped_out=None, flush=None): + """Safely prints JSON output in both UTF-8 and ASCII systems""" + try: + print(json_out(string, + pretty=pretty, + env_colors=env_colors, + mono=mono, + piped_out=piped_out), + flush=flush) + except UnicodeEncodeError: + print(json_out(string, + pretty=pretty, + env_colors=env_colors, + mono=mono, + piped_out=piped_out, + ascii_only=True), + flush=flush) + + def set_env_colors(env_colors=None): """ Return a dictionary to be used in Pygments custom style class. @@ -423,19 +443,11 @@ def main(): mono = True if about: - try: - print(json_out(about_jc(), - pretty=pretty, - env_colors=jc_colors, - mono=mono, - piped_out=piped_output(force_color))) - except UnicodeEncodeError: - print(json_out(about_jc(), - pretty=pretty, - env_colors=jc_colors, - mono=mono, - piped_out=piped_output(force_color), - ascii_only=True)) + safe_print_json(about_jc(), + pretty=pretty, + env_colors=jc_colors, + mono=mono, + piped_out=piped_output(force_color)) sys.exit(0) if help_me: @@ -522,21 +534,12 @@ def main(): quiet=quiet, ignore_exceptions=ignore_exceptions) for line in result: - try: - print(json_out(line, - pretty=pretty, - env_colors=jc_colors, - mono=mono, - piped_out=piped_output(force_color)), - flush=unbuffer) - except UnicodeEncodeError: - print(json_out(line, - pretty=pretty, - env_colors=jc_colors, - mono=mono, - piped_out=piped_output(force_color), - ascii_only=True), - flush=unbuffer) + safe_print_json(line, + pretty=pretty, + env_colors=jc_colors, + mono=mono, + piped_out=piped_output(force_color), + flush=unbuffer) sys.exit(combined_exit_code(magic_exit_code, 0)) @@ -547,21 +550,12 @@ def main(): raw=raw, quiet=quiet) - try: - print(json_out(result, - pretty=pretty, - env_colors=jc_colors, - mono=mono, - piped_out=piped_output(force_color)), - flush=unbuffer) - except UnicodeEncodeError: - print(json_out(result, - pretty=pretty, - env_colors=jc_colors, - mono=mono, - piped_out=piped_output(force_color), - ascii_only=True), - flush=unbuffer) + safe_print_json(result, + pretty=pretty, + env_colors=jc_colors, + mono=mono, + piped_out=piped_output(force_color), + flush=unbuffer) sys.exit(combined_exit_code(magic_exit_code, 0)) From f7b64a57624c1669c221ccc592902018d8795f80 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 27 Apr 2022 08:26:12 -0700 Subject: [PATCH 17/21] formatting --- jc/cli.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/jc/cli.py b/jc/cli.py index 937bff64..f9730e71 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -89,18 +89,18 @@ def safe_print_json(string, pretty=None, env_colors=None, mono=None, """Safely prints JSON output in both UTF-8 and ASCII systems""" try: print(json_out(string, - pretty=pretty, - env_colors=env_colors, - mono=mono, - piped_out=piped_out), + pretty=pretty, + env_colors=env_colors, + mono=mono, + piped_out=piped_out), flush=flush) except UnicodeEncodeError: print(json_out(string, - pretty=pretty, - env_colors=env_colors, - mono=mono, - piped_out=piped_out, - ascii_only=True), + pretty=pretty, + env_colors=env_colors, + mono=mono, + piped_out=piped_out, + ascii_only=True), flush=flush) From a53aa1d0b8e75e41eb345ec39f1e015b0faa61b6 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 27 Apr 2022 09:02:30 -0700 Subject: [PATCH 18/21] fix bug when no slaves are present --- jc/parsers/update_alt_q.py | 8 +++++--- .../generic/update-alternatives-query2.json | 1 + .../generic/update-alternatives-query2.out | 14 ++++++++++++++ tests/test_update_alt_q.py | 13 +++++++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 tests/fixtures/generic/update-alternatives-query2.json create mode 100644 tests/fixtures/generic/update-alternatives-query2.out diff --git a/jc/parsers/update_alt_q.py b/jc/parsers/update_alt_q.py index 625e15dd..41ac78a7 100644 --- a/jc/parsers/update_alt_q.py +++ b/jc/parsers/update_alt_q.py @@ -241,10 +241,12 @@ def parse( if not 'alternatives' in raw_output: raw_output['alternatives'] = [] - if slaves: - alt_obj['slaves'] = slaves + if alt_obj: + if slaves: + alt_obj['slaves'] = slaves + slaves = [] + raw_output['alternatives'].append(alt_obj) - slaves = [] alt_obj = {"alternative": line_list[1]} continue diff --git a/tests/fixtures/generic/update-alternatives-query2.json b/tests/fixtures/generic/update-alternatives-query2.json new file mode 100644 index 00000000..395fde29 --- /dev/null +++ b/tests/fixtures/generic/update-alternatives-query2.json @@ -0,0 +1 @@ +{"name":"php-fpm.sock","link":"/run/php/php-fpm.sock","status":"auto","best":"/run/php/php8.1-fpm.sock","value":"/run/php/php8.1-fpm.sock","alternatives":[{"alternative":"/run/php/php7.4-fpm.sock","priority":74},{"alternative":"/run/php/php8.0-fpm.sock","priority":80},{"alternative":"/run/php/php8.1-fpm.sock","priority":81}]} diff --git a/tests/fixtures/generic/update-alternatives-query2.out b/tests/fixtures/generic/update-alternatives-query2.out new file mode 100644 index 00000000..7c0c9212 --- /dev/null +++ b/tests/fixtures/generic/update-alternatives-query2.out @@ -0,0 +1,14 @@ +Name: php-fpm.sock +Link: /run/php/php-fpm.sock +Status: auto +Best: /run/php/php8.1-fpm.sock +Value: /run/php/php8.1-fpm.sock + +Alternative: /run/php/php7.4-fpm.sock +Priority: 74 + +Alternative: /run/php/php8.0-fpm.sock +Priority: 80 + +Alternative: /run/php/php8.1-fpm.sock +Priority: 81 diff --git a/tests/test_update_alt_q.py b/tests/test_update_alt_q.py index 932cd45f..7957f675 100644 --- a/tests/test_update_alt_q.py +++ b/tests/test_update_alt_q.py @@ -13,10 +13,17 @@ class MyTests(unittest.TestCase): with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/update-alternatives-query.out'), 'r', encoding='utf-8') as f: self.update_alternatives_query = f.read() + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/update-alternatives-query2.out'), 'r', encoding='utf-8') as f: + self.update_alternatives_query2 = f.read() + # output with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/update-alternatives-query.json'), 'r', encoding='utf-8') as f: self.update_alternatives_query_json = json.loads(f.read()) + with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/update-alternatives-query2.json'), 'r', encoding='utf-8') as f: + self.update_alternatives_query2_json = json.loads(f.read()) + + def test_update_alt_q_nodata(self): """ @@ -30,6 +37,12 @@ class MyTests(unittest.TestCase): """ self.assertEqual(jc.parsers.update_alt_q.parse(self.update_alternatives_query, quiet=True), self.update_alternatives_query_json) + def test_update_alt_q_no_slaves(self): + """ + Test 'update-alternatives --query' with no slaves in output + """ + self.assertEqual(jc.parsers.update_alt_q.parse(self.update_alternatives_query2, quiet=True), self.update_alternatives_query2_json) + if __name__ == '__main__': unittest.main() From 37489dd4e1bb4d93c0917923bfca6db08cfcbd6b Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 27 Apr 2022 09:10:38 -0700 Subject: [PATCH 19/21] doc update --- CHANGELOG | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index e57c6938..0645513f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ jc changelog -20220426 v1.18.8 +20220427 v1.18.8 +- Fix update-alternatives --query parser for cases where `slaves` are not present - Fix UnicodeEncodeError on some systems where LANG=C is set and unicode characters are in the output - Update history parser: do not drop non-ASCII characters if the system From 4f8c1a2ca2cb4c81938973f54c08bb4fa5f146c1 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 27 Apr 2022 09:43:55 -0700 Subject: [PATCH 20/21] version bump --- docs/parsers/update_alt_q.md | 2 +- jc/parsers/update_alt_q.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/parsers/update_alt_q.md b/docs/parsers/update_alt_q.md index 90f29a82..2a07d5e1 100644 --- a/docs/parsers/update_alt_q.md +++ b/docs/parsers/update_alt_q.md @@ -154,4 +154,4 @@ Returns: ### Parser Information Compatibility: linux -Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com) +Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/jc/parsers/update_alt_q.py b/jc/parsers/update_alt_q.py index 41ac78a7..7833fc3e 100644 --- a/jc/parsers/update_alt_q.py +++ b/jc/parsers/update_alt_q.py @@ -132,7 +132,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.0' + version = '1.1' description = '`update-alternatives --query` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' From 7608823ea7bf1a444b6e6d85c58bc733d969bb9d Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 27 Apr 2022 11:31:35 -0700 Subject: [PATCH 21/21] add git-log --- EXAMPLES.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/EXAMPLES.md b/EXAMPLES.md index d17b1c58..3eb2f057 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -1059,6 +1059,53 @@ cat /etc/fstab | jc --fstab -p } ] ``` +### git log +```bash +git log --stat | jc --git-log -p or: jc -p git log --stat +``` +```json +[ + { + "commit": "728d882ed007b3c8b785018874a0eb06e1143b66", + "author": "Kelly Brazil", + "author_email": "kellyjonbrazil@gmail.com", + "date": "Wed Apr 20 09:50:19 2022 -0400", + "stats": { + "files_changed": 2, + "insertions": 90, + "deletions": 12, + "files": [ + "docs/parsers/git_log.md", + "jc/parsers/git_log.py" + ] + }, + "message": "add timestamp docs and examples", + "epoch": 1650462619, + "epoch_utc": null + }, + { + "commit": "b53e42aca623181aa9bc72194e6eeef1e9a3a237", + "author": "Kelly Brazil", + "author_email": "kellyjonbrazil@gmail.com", + "date": "Wed Apr 20 09:44:42 2022 -0400", + "stats": { + "files_changed": 5, + "insertions": 29, + "deletions": 6, + "files": [ + "docs/parsers/git_log.md", + "docs/utils.md", + "jc/parsers/git_log.py", + "jc/utils.py", + "man/jc.1" + ] + }, + "message": "add calculated timestamp", + "epoch": 1650462282, + "epoch_utc": null + } +] +``` ### /etc/group file ```bash cat /etc/group | jc --group -p