bash
bash function for rpm whatprovides
2018/12/31
Sometimes some simple one-liner function can save you a lot of time, like-
Directories with maximum number of files
2018/12/10
Lot of times, I want to find the directories with maximum number of files and so I wrote this quick function to do exactly the same
mv command with progress
2018/03/19
When moving large files/directories, I would like to see the progress. Idea for this is to use rsync with progress and remove source files. But that option does not remove the empty directories left …
Highest disk usage of directory in subdirectories
2018/03/12
I find myself doing this lot of times so thought will share this with you all. Basically, once I want to clear out the directory, I first want to find out the sub-directory using the maximum disk …
send mail using telnet from script
2017/12/25
If you have no other option but to use telnet with authentication to send mail 🙂
search for a port number
2017/09/11
I find myself doing google everytime I want to search for port number mapping. So, here is a short script to do just that 🙂
bash ansi codes to html for html reports from shell script
2017/02/20
How many times you have felt that there was some simple way to convert bash ansi escape sequences ( colors as well in terminal ) to html equivalent so that you can send the same as html report in …
ansible with docker dynamic inventory
2017/01/09
So, I have a few dockers. Every now and then I want to run some command on all of them. Doing ‘docker exec’ is tiresome. I found this neat solution with ansible that I thought I should share with you. …
Trello – backup to your linux machine
2017/01/02
Just in case, you are looking for backing up your trello account boards, you can use the following bash script to do so: #!/bin/bash - …
change the output format for time command
2016/08/16
If you are doing some scripting and using ‘time’ command, then you know sometimes it becomes difficult to capture the output as the output would be something like this: : amit ; time ls real 0m0.002s …
Generate random string for various use case
2016/08/08
Some times I need random string, for example to use as email seperator or to use in some API. One way is to use tools like /dev/[u]random or od and other such. But they seem cubersome after I figured …
Get your local IP address like pro
2016/07/10
In shell scripts if you need to get you local IP address corresponding to your hostname then you can use this command