mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-15 01:24:29 +02:00
doc update
This commit is contained in:
189
EXAMPLES.md
189
EXAMPLES.md
@ -922,6 +922,18 @@ du /usr | jc --du -p # or: jc -p du /usr
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
### Email Address string
|
||||||
|
```bash
|
||||||
|
echo 'joe.user@gmail.com' | jc --email-address -p
|
||||||
|
```
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"username": "joe.user",
|
||||||
|
"domain": "gmail.com",
|
||||||
|
"local": "joe.user",
|
||||||
|
"local_plus_suffix": null
|
||||||
|
}
|
||||||
|
```
|
||||||
### env
|
### env
|
||||||
```bash
|
```bash
|
||||||
env | jc --env -p # or: jc -p env
|
env | jc --env -p # or: jc -p env
|
||||||
@ -1715,6 +1727,31 @@ iptables --line-numbers -v -L -t nat | jc --iptables -p # or: jc -p ip
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
### ISO Datetime string
|
||||||
|
```bash
|
||||||
|
echo "2022-07-20T14:52:45Z" | jc --iso-datetime -p
|
||||||
|
```
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"year": 2022,
|
||||||
|
"month": "Jul",
|
||||||
|
"month_num": 7,
|
||||||
|
"day": 20,
|
||||||
|
"weekday": "Wed",
|
||||||
|
"weekday_num": 3,
|
||||||
|
"hour": 2,
|
||||||
|
"hour_24": 14,
|
||||||
|
"minute": 52,
|
||||||
|
"second": 45,
|
||||||
|
"microsecond": 0,
|
||||||
|
"period": "PM",
|
||||||
|
"utc_offset": "+0000",
|
||||||
|
"day_of_year": 201,
|
||||||
|
"week_of_year": 29,
|
||||||
|
"iso": "2022-07-20T14:52:45+00:00",
|
||||||
|
"timestamp": 1658328765
|
||||||
|
}
|
||||||
|
```
|
||||||
### iw dev `device` scan
|
### iw dev `device` scan
|
||||||
```bash
|
```bash
|
||||||
iw dev wlan0 scan | jc --iw-scan -p # or: jc -p iw dev wlan0 scan
|
iw dev wlan0 scan | jc --iw-scan -p # or: jc -p iw dev wlan0 scan
|
||||||
@ -1861,6 +1898,24 @@ jobs -l | jc --jobs -p
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
### JWT string
|
||||||
|
```bash
|
||||||
|
echo 'eyJhbGciOiJIUzI1N...' | jc --jwt -p
|
||||||
|
```
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"header": {
|
||||||
|
"alg": "HS256",
|
||||||
|
"typ": "JWT"
|
||||||
|
},
|
||||||
|
"payload": {
|
||||||
|
"sub": "1234567890",
|
||||||
|
"name": "John Doe",
|
||||||
|
"iat": 1516239022
|
||||||
|
},
|
||||||
|
"signature": "49:f9:4a:c7:04:49:48:c7:8a:28:5d:90:4f:87:f0:a4:c7..."
|
||||||
|
}
|
||||||
|
```
|
||||||
### Key/Value files
|
### Key/Value files
|
||||||
```bash
|
```bash
|
||||||
cat keyvalue.txt
|
cat keyvalue.txt
|
||||||
@ -2197,7 +2252,7 @@ lsusb -v | jc --lsusb -p # or: jc -p lsusb -v
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
### M3U and M3U8
|
### M3U and M3U8 files
|
||||||
```bash
|
```bash
|
||||||
cat playlist.m3u | jc --m3u -p
|
cat playlist.m3u | jc --m3u -p
|
||||||
```
|
```
|
||||||
@ -2527,40 +2582,40 @@ nmcli connection show ens33 | jc --nmcli -p # or jc -p nmcli connection
|
|||||||
```
|
```
|
||||||
```json
|
```json
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"connection_id": "ens33",
|
"connection_id": "ens33",
|
||||||
"connection_uuid": "d92ece08-9e02-47d5-b2d2-92c80e155744",
|
"connection_uuid": "d92ece08-9e02-47d5-b2d2-92c80e155744",
|
||||||
"connection_stable_id": null,
|
"connection_stable_id": null,
|
||||||
"connection_type": "802-3-ethernet",
|
"connection_type": "802-3-ethernet",
|
||||||
"connection_interface_name": "ens33",
|
"connection_interface_name": "ens33",
|
||||||
"connection_autoconnect": "yes",
|
"connection_autoconnect": "yes",
|
||||||
"ip4_address_1": "192.168.71.180/24",
|
"ip4_address_1": "192.168.71.180/24",
|
||||||
"ip4_gateway": "192.168.71.2",
|
"ip4_gateway": "192.168.71.2",
|
||||||
"ip4_route_1": {
|
"ip4_route_1": {
|
||||||
"dst": "0.0.0.0/0",
|
"dst": "0.0.0.0/0",
|
||||||
"nh": "192.168.71.2",
|
"nh": "192.168.71.2",
|
||||||
"mt": 100
|
"mt": 100
|
||||||
},
|
},
|
||||||
"ip4_route_2": {
|
"ip4_route_2": {
|
||||||
"dst": "192.168.71.0/24",
|
"dst": "192.168.71.0/24",
|
||||||
"nh": "0.0.0.0",
|
"nh": "0.0.0.0",
|
||||||
"mt": 100
|
"mt": 100
|
||||||
},
|
},
|
||||||
"ip4_dns_1": "192.168.71.2",
|
"ip4_dns_1": "192.168.71.2",
|
||||||
"ip4_domain_1": "localdomain",
|
"ip4_domain_1": "localdomain",
|
||||||
"dhcp4_option_1": {
|
"dhcp4_option_1": {
|
||||||
"name": "broadcast_address",
|
"name": "broadcast_address",
|
||||||
"value": "192.168.71.255"
|
"value": "192.168.71.255"
|
||||||
},
|
},
|
||||||
"ip6_address_1": "fe80::c1cb:715d:bc3e:b8a0/64",
|
"ip6_address_1": "fe80::c1cb:715d:bc3e:b8a0/64",
|
||||||
"ip6_gateway": null,
|
"ip6_gateway": null,
|
||||||
"ip6_route_1": {
|
"ip6_route_1": {
|
||||||
"dst": "fe80::/64",
|
"dst": "fe80::/64",
|
||||||
"nh": "::",
|
"nh": "::",
|
||||||
"mt": 100
|
"mt": 100
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
### ntpq
|
### ntpq
|
||||||
```bash
|
```bash
|
||||||
@ -4032,6 +4087,70 @@ uptime | jc --uptime -p # or: jc -p uptime
|
|||||||
"uptime_total_seconds": 273780
|
"uptime_total_seconds": 273780
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
### URL string
|
||||||
|
```bash
|
||||||
|
echo "http://example.com/test/path?q1=foo&q1=bar&q2=baz#frag" \\
|
||||||
|
| jc --url -p
|
||||||
|
```
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"url": "http://example.com/test/path?q1=foo&q1=bar&q2=baz#frag",
|
||||||
|
"scheme": "http",
|
||||||
|
"netloc": "example.com",
|
||||||
|
"path": "/test/path",
|
||||||
|
"path_list": [
|
||||||
|
"test",
|
||||||
|
"path"
|
||||||
|
],
|
||||||
|
"query": "q1=foo&q1=bar&q2=baz",
|
||||||
|
"query_obj": {
|
||||||
|
"q1": [
|
||||||
|
"foo",
|
||||||
|
"bar"
|
||||||
|
],
|
||||||
|
"q2": [
|
||||||
|
"baz"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"fragment": "frag",
|
||||||
|
"username": null,
|
||||||
|
"password": null,
|
||||||
|
"hostname": "example.com",
|
||||||
|
"port": null,
|
||||||
|
"encoded": {
|
||||||
|
"url": "http://example.com/test/path?q1=foo&q1=bar&q2=baz#frag",
|
||||||
|
"scheme": "http",
|
||||||
|
"netloc": "example.com",
|
||||||
|
"path": "/test/path",
|
||||||
|
"path_list": [
|
||||||
|
"test",
|
||||||
|
"path"
|
||||||
|
],
|
||||||
|
"query": "q1=foo&q1=bar&q2=baz",
|
||||||
|
"fragment": "frag",
|
||||||
|
"username": null,
|
||||||
|
"password": null,
|
||||||
|
"hostname": "example.com",
|
||||||
|
"port": null
|
||||||
|
},
|
||||||
|
"decoded": {
|
||||||
|
"url": "http://example.com/test/path?q1=foo&q1=bar&q2=baz#frag",
|
||||||
|
"scheme": "http",
|
||||||
|
"netloc": "example.com",
|
||||||
|
"path": "/test/path",
|
||||||
|
"path_list": [
|
||||||
|
"test",
|
||||||
|
"path"
|
||||||
|
],
|
||||||
|
"query": "q1=foo&q1=bar&q2=baz",
|
||||||
|
"fragment": "frag",
|
||||||
|
"username": null,
|
||||||
|
"password": null,
|
||||||
|
"hostname": "example.com",
|
||||||
|
"port": null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
### w
|
### w
|
||||||
```bash
|
```bash
|
||||||
w | jc --w -p # or: jc -p w
|
w | jc --w -p # or: jc -p w
|
||||||
|
@ -89,7 +89,7 @@ Schema:
|
|||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
% echo "http://example.com/test/path?q1=foo&q1=bar&q2=baz#frag" \\
|
$ echo "http://example.com/test/path?q1=foo&q1=bar&q2=baz#frag" \\
|
||||||
| jc --url -p
|
| jc --url -p
|
||||||
{
|
{
|
||||||
"url": "http://example.com/test/path?q1=foo&q1=bar&q2=baz#frag",
|
"url": "http://example.com/test/path?q1=foo&q1=bar&q2=baz#frag",
|
||||||
|
@ -84,7 +84,7 @@ Schema:
|
|||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
% echo "http://example.com/test/path?q1=foo&q1=bar&q2=baz#frag" \\
|
$ echo "http://example.com/test/path?q1=foo&q1=bar&q2=baz#frag" \\
|
||||||
| jc --url -p
|
| jc --url -p
|
||||||
{
|
{
|
||||||
"url": "http://example.com/test/path?q1=foo&q1=bar&q2=baz#frag",
|
"url": "http://example.com/test/path?q1=foo&q1=bar&q2=baz#frag",
|
||||||
|
Reference in New Issue
Block a user