Posts

Showing posts from October, 2021

How to : Docker mount current working directory as volume

Hello Everyone, If you have a docker container and you would like to mount one of your current folder in the host machine as volume inside your container, then you can use below command docker run --rm -it -v $(pwd):/usr/src/project gcc:4.9   use cases: - If you local folder have your source code and you like to execute inside your container environment manually. 

How To - Ansiable Playbook Output - JSON Format

How To - Ansiable Playbook Output - JSON Format Hello Everyone, In this blog post lets see how to execute ansible-playbook with custom output format like JSON Lets say you have a playbook like below --- - hosts : 127.0.0.1 gather_facts : false tasks : - name : execute uptime command command : uptimer register : result - debug : var=result.stdout And if you execute the playbook with below command ansible-playbook playbook.yaml You will get normal ansible standard output format like below ▶ ansible-playbook ansible_uptime.yaml [ WARNING ] : No inventory was parsed, only implicit localhost is available [ WARNING ] : provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' _______________________________ < TASK [ execute uptime command ] > ------------------------------- changed: [ 127.0.0.1 ] ok: [ 127.0.0.1 ] = > { "result

Motivation for everyone for everyday in real life or work life, Read this everyday before starting your day

Image
When something is fun,like playing cricket, watching a suspense thriller or Sci-Fi movie, you dont need extra motivation, you will do that anyway because you are loving it. When something isn't fun, you dont like it and if you still have to do it, then you can follow below ideas. Dont just go with problem -> solution approach, if you have 10 problems, if you have solved 3 already then you still see them as 7 more PROBLEMS and our brain hate problems, wont it ?, so its no more fun, so it (you) started doing procrastination automatically and soon or later you reach deadlines and you started feeling guilty for wasting that much time and you will hurry up with your work and finally your work from making a spider in 10 minutes to making a spider to 1 minute  Image credit : https://jim.blacksweb.com  So look at them like with explorer mindset. You remember in explorer games you have to do lot of exploring for gems, points etc. So adopt same satisfying or happy mindset when you started

Linux: How to remove directory / folder background color in terminal ?

Image
Hello Everyone, I moved to Ubuntu Linux recently from Arch Linux. I observed that my battery ( Lenovo Thinkpad E Series 3rd Gen) health getting low by using Arch Linux and there were some posts on that issue. Though Arch Linux is great, I dont want to loose my $1000 laptop battery as I invested extra bucks especially for battery with extra capacity. Any way, as I am using dual boot with Windows and Linux, I do have NTFS partitions. As per color scheme of the terminal, if you list the items in the NTFS mount in terminal, they all come up with an ugly look as below  so as you can see it, its completely not good. So upon searching I came across below solution via Stackoverflow If you are using zsh then open file ~/.zshrc, if bash then ~/.bashrc and paste following code at the end, save and exit from the file. Once exited, execute exec $SHELL  command, and it equal to source ~/.zshrc or source ~/.bashrc eval "$(dircolors -p | \    sed 's/ 4[0-9];/ 01;/; s/;4[0-9];/;01;/g; s/;4[0