From cbb92c1a9517234806f1c54398a69645b6f43669 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 3 Feb 2020 21:38:08 -0800 Subject: [PATCH] add ini and yaml --- README.md | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/README.md b/README.md index 7b989d4f..59a86ae2 100755 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ jc PARSER [OPTIONS] - `--history` enables the `history` parser - `--hosts` enables the `/etc/hosts` file parser - `--ifconfig` enables the `ifconfig` parser +- `--ini` enables the `ini` file parser - `--iptables` enables the `iptables` parser - `--jobs` enables the `jobs` parser - `--ls` enables the `ls` parser @@ -96,6 +97,7 @@ jc PARSER [OPTIONS] - `--uname` enables the `uname -a` parser - `--uptime` enables the `uptime` parser - `--w` enables the `w` parser +- `--yaml` enables the `YAML` file parser ### Options - `-a` about `jc`. Prints information about `jc` and the parsers (in JSON, of course!) @@ -662,6 +664,40 @@ $ ifconfig | jc --ifconfig -p } ] ``` +### ini +``` +$ cat example.ini +[DEFAULT] +ServerAliveInterval = 45 +Compression = yes +CompressionLevel = 9 +ForwardX11 = yes + +[bitbucket.org] +User = hg + +[topsecret.server.com] +Port = 50022 +ForwardX11 = no + +$ cat example.ini | jc --ini -p +{ + "bitbucket.org": { + "serveraliveinterval": "45", + "compression": "yes", + "compressionlevel": "9", + "forwardx11": "yes", + "user": "hg" + }, + "topsecret.server.com": { + "serveraliveinterval": "45", + "compression": "yes", + "compressionlevel": "9", + "forwardx11": "no", + "port": "50022" + } +} +``` ### iptables ``` $ sudo iptables --line-numbers -v -L -t nat | jc --iptables -p @@ -1599,6 +1635,64 @@ $ w | jc --w -p } ] ``` +### YAML +``` +$ cat istio-mtls-permissive.yaml +apiVersion: "authentication.istio.io/v1alpha1" +kind: "Policy" +metadata: + name: "default" + namespace: "default" +spec: + peers: + - mtls: {} +--- +apiVersion: "networking.istio.io/v1alpha3" +kind: "DestinationRule" +metadata: + name: "default" + namespace: "default" +spec: + host: "*.default.svc.cluster.local" + trafficPolicy: + tls: + mode: ISTIO_MUTUAL + +$ cat istio-mtls-permissive.yaml | jc --yaml -p +[ + { + "apiVersion": "authentication.istio.io/v1alpha1", + "kind": "Policy", + "metadata": { + "name": "default", + "namespace": "default" + }, + "spec": { + "peers": [ + { + "mtls": {} + } + ] + } + }, + { + "apiVersion": "networking.istio.io/v1alpha3", + "kind": "DestinationRule", + "metadata": { + "name": "default", + "namespace": "default" + }, + "spec": { + "host": "*.default.svc.cluster.local", + "trafficPolicy": { + "tls": { + "mode": "ISTIO_MUTUAL" + } + } + } + } +] +``` ## TODO Future parsers: - /proc files