Most things today can be done by googling. Do you need to generate a random string? Google for a generator. Need to parse a JWT? Google for a parser. The problem with both of those cases is that it can be unsuitable to trust random internet pages. So in many cases it’s better to use CLI-tools as a default. So in this page I will try to collect ways of easily doing things in the CLI, preferrably without installing a lot of junk in your system.

Generating random strings

## Use OpenSSL as a randomizer
openssl rand -hex 32

Reading JWT content

If you have jq installed you can finish off by piping it to that.

jwt=eyJ...
cut -d. -f2  <<<"$jwt" | base64 -d