In my previous post I showed my git and vim configuration. This post will be about random small tools that I use, such as tooling for docker and kubernetes, or just some small utilities to make life a bit easier.

dry

dry is a terminal tool to manage Docker. It shows information about containers, and you can kill/restart them, or see their logs. You can also view your images or volumes. Basically you can do anything with docker using dry, but instead of remembering all the commands you have a nice and fast text based UI in your terminal.

dry

k9s

k9s is a similar tool to dry, but it manages your kubernetes clusters.

k9s

The screenshot above shows the pod in my cluster, but you can use k9s for viewing deployments, secrets, namespaces, and even switch context. You can also filter the list of pods(or on any other screen of k9s), by simply typing / followed by what you want to search for. Basically k9s allows you to do anything you can also do with the kubectl command.

As a bonus tool, check out minikube to run a kubernetes cluster locally. And check out kubectx, it allows you to switch your context for kubectl (so in turn it also switches the context for k9s).

jwt-cli

jwt-cli is a tool to encode and decode JSON Web Tokens (JWTs). I used to use jwt.io to decode/encode JWTs, but when I found this tool I prefer that over pasting JWTs on a website (even though jwt.io does everything locally with JavaScript).

An example:

$ jwt decode eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEyMzQ1Njc4OTAiLCJuYW1lIjoiRGVuaXoiLCJsYXN0bmFtZSI6IlR1cmFuIn0.jyi0QCpbu2ct_855oKhXzJjChWd6wwGSlVo7x3g0ZTo

Token header
------------
{
  "typ": "JWT",
  "alg": "HS256"
}

Token claims
------------
{
  "id": "1234567890",
  "lastname": "Turan",
  "name": "Deniz"
}

jq

jq is a simple lightweight json processor in the terminal. I usually use it to quickly format it properly, such as this:

$ cat input.json
{"foo":"bar"}

$ cat input.json | jq > output.json
$ cat output.json
{
  "foo": "bar"
}

But you can do much more, such as selecting a part of the json. You can see some examples on its website.

autojump

autojump is probably one of my most used tools. It is a tool that indexes the directories you have visited, and allows you to change to those directories in a fast way.

Imagine the following directories for your projects for example:

- ~/projects/messaging-serice
- ~/projects/some-cloud-service
- ~/projects/payment-service
- ~/projects/bank-service
- ~/projects/infra/cloud-deployment

You could then simply use the command j bank and it will go to the bank-service directory. If you used the command j cloud it will either go to some-cloud-service or cloud-deployment, it depends on which one you visit more often. And the best thing is, it doesn’t matter in which directory you are in currently, autojump will work and change your directory.

tldr-pages

tldr-pages as you might have guessed, stands for 'too long didn’t read'. It provides simplified man pages for certain commands, which can be useful for commands you don’t use that often such as tar or curl. Here is an example output for tar:

$ tldr tar

tar

Archiving utility.
Often combined with a compression method, such as gzip or bzip2.
More information: <https://www.gnu.org/software/tar>.

- [c]reate an archive and write it to a [f]ile:
    tar cf target.tar file1 file2 file3

- [c]reate a g[z]ipped archive and write it to a [f]ile:
    tar czf target.tar.gz file1 file2 file3

- [c]reate a g[z]ipped archive from a directory using relative paths:
    tar czf target.tar.gz --directory=path/to/directory .

- E[x]tract a (compressed) archive [f]ile into the current directory [v]erbosely:
    tar xvf source.tar[.gz|.bz2|.xz]

- E[x]tract a (compressed) archive [f]ile into the target directory:
    tar xf source.tar[.gz|.bz2|.xz] --directory=directory

- [c]reate a compressed archive and write it to a [f]ile, using [a]rchive suffix to determine the compression program:
    tar caf target.tar.xz file1 file2 file3

- Lis[t] the contents of a tar [f]ile [v]erbosely:
    tar tvf source.tar

- E[x]tract files matching a pattern from an archive [f]ile:
    tar xf source.tar --wildcards "*.html"

Especially for commands you don’t use very often, such as tar or maybe curl, it is very useful to have a quick manual that shows you how to use it.

The Fuck

The Fuck is a simple tool when you have a typo in your command. Just run the command fuck after your typo, and it will suggest the correct command (or you can cycle through its suggestions until you find the correct one):

thefuck

It’s just a great feeling to type fuck when you make a typo, it let’s out all the frustration 🙂.

Glances

Glances is a system monitor for the terminal. You can install other plugins(dependencies) for it to show other data as well, which is explained on its GitHub page.

glances

You can also use it to quickly kill a certain task, which is what I use it for mainly.

shadow-left