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

Podman repositories on ubuntu like distros

2020-08-01 2 min read Learning Virtualization

Recently I installed podman on ubuntu based dervative. I like podman a lot but to my distress I found that after installation, I was not able to search or run any containers. Found out that the repositories were not configured. So, if you run into such issues, then here is what you need to do. You need to create a file /etc/containers/registries.conf. And the contents of the file for just one docker hub registries would be -

Continue reading

Pygmentize Styles

2020-07-26 1 min read Learning

I have recently started using pygmentize for looking at my code in terminal. A very good and native way to do this is to use pygmentize. If you do not know about pygmentize then

Highlight the input file and write the result to . If no input file is given, use stdin, if -o is not given, use stdout.

So, you can simply pass the script or source code through pygmentize and get a lovely color output with code highlighting in the terminal and this can be very useful.

Continue reading

Blog Updates

2020-07-19 1 min read Uncategorized

Quick update on the blog. I have made some pretty good changes and now this blog should be loading pretty fast. Hope you have a much better experience now :)

scripting – performance improvement with file open

2020-04-20 2 min read Bash Learning Linux

Sometimes just one line of code can make all the difference. I will show you with example.

 

Here is script with 2 functions. Both are writing some lines of text to a file. First function, “a” I have used the redirection to write to file. Function “b”, I have opened a file descriptor with “>” before going into the loop and use that reference for writing to the file. (This concept remains same for any scripting or programming language).

Continue reading
Older posts Newer posts