this post was submitted on 01 Jul 2023
106 points (100.0% liked)

Free and Open Source Software

18350 readers
1 users here now

If it's free and open source and it's also software, it can be discussed here. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 2 years ago
MODERATORS
 

Playing around with PeppermintOS on a "new " old laptop, and having fun. Its making me realize that tiny things can really work to impress. (Especially when you're waiting on a ram upgrade, haha!)

Could be terminal based or GUI, I'm just curious---what tiny apps do you use that you think are neat? Things that don't take up much storage or memory.

you are viewing a single comment's thread
view the rest of the comments
[–] StrayCatFrump 30 points 2 years ago (3 children)

jq for parsing/formatting/manipulating JSON, and its yq wrapper for YAML. Holy shit you can do powerful queries with them.

[–] tom42 6 points 2 years ago (1 children)

Or the even faster successor gojq.

[–] sin_free_for_00_days@lemmy.one 4 points 2 years ago (1 children)

Not sure how big the JSON files are you're messing with, but I've never had any noticeable delay using jq.

[–] StrayCatFrump 1 points 2 years ago* (last edited 2 years ago)

When you're dealing with log files that are on the order of 100 MB or 1+ GB in size, jq can, indeed, be a bit slow. Often I use grep as a first-pass filter, which speeds things up tremendously. I'll have to give gojq a try and see if it makes the initial grep unneeded. The downside is that jq is often already installed everywhere I need it (VMs, base docker images, etc.), but gojq definitely is not (yet).

[–] tochee@aussie.zone 3 points 2 years ago

I use jq for decoding base64 😂

pbpaste | jq -R 'split(".") | .[0],.[1] | @base64d | fromjson'

[–] pkulak 1 points 2 years ago (1 children)

Big fan of gron and grep myself. Way easier if you’re not doing anything crazy.

[–] StrayCatFrump 2 points 2 years ago* (last edited 2 years ago)

For sure. Often I use grep as a first pass to find relevant entries in JSON-lines formatted log files, and then pass that through jq (or yq -y if I want YAML output) for further filtering, processing, and formatting.