Ignore case when completing file names in bash

2021-12-11 1 min read Learning bash
Sometimes you don’t want to have the bash completion work with case completion. There could be several reasons like one I dont like is the default xdg folders starting with capital letters. So, if you know that bash uses readline for a lot of configuration then there is a very easy solution, you can just run this command and start a new bash shell :) 1 echo 'set completion-ignore-case on' >> ~/. Continue reading

Warn when battery is low

2020-08-30 2 min read Learning bash scripting
I am very lazy to look at battery status and want to be warned when the battery is low. This means that even if I am away from the laptop, I can be warned that laptop is about to poweroff due to battery low. So, what kind of alerts I can have, many - zenity message box email sms with twillio Telegram message and possibility is endless. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 LOW=35 ## This si the lowest percentage at which I want the alerts. Continue reading

Some good find alias.

2020-08-23 1 min read Learning bash
Here are some interesting alias’s that you may want to add to your bashrc file or where-ever else you add your aliase’s. Very useful if you use find commonly. There are four aliases defined here and have a comment explaining what it does. but these are so simple and useful that you probably dont even need the comments. 1 2 3 4 5 6 7 8 9 10 11 # ff: to find a file under the current directory ff () { find . Continue reading

Books menu with bash

2020-08-16 1 min read Learning bash
If you have a folder full of ebooks in various formats and not necessarily one sigle format and you want to have a quick menu to browse though your collection without requiring to open a File Manager then you are going to love this script. The scripts works by allowing you to browse to the requied folder of your choice and once you select the file, then using xdg-open to open the file with your default viewer. Continue reading

List all the tags for a image on docker hub

2020-03-16 1 min read Learning Vurtualization
Something that you may want to know sometimes and docker cli does not show by default is all the tags for the image on docker hub. Here is example to list all tags fro the centos image curl https://registry.hub.docker.com/v2/repositories/library/centos/tags |jq '."results"[]["name"]' The example is for a v2 registry. The output for v1 is different than v2 registry. For a v1 registry, you can use command like below curl https://registry.hub.docker.com/v1/repositories/centos/tags |jq '. Continue reading
Older posts Newer posts