Dipesh Majumdar

Blog and Paintings

empower sed to to work on case insensitive strings

This is what you need to do in a macOS:

brew install gnu-sed

The end of the installation looks like this:

==> Pouring gnu-sed-4.7.mojave.bottle.3.tar.gz
==> Caveats
GNU "sed" has been installed as "gsed".
If you need to use it as "sed", you can add a "gnubin" directory
to your PATH from your bashrc like:
==> Summary
/usr/local/Cellar/gnu-sed/4.7: 12 files, 562.0KB


Now not only author but also AUTHOR will get changed to publish

sed -e 's/author/publish/gI' deploy.yaml | tee edited.yaml

variable substitution in for loop with curly brackets

Requirement - 

I want to calculate the no. of AEM_INSTANCES which I am passing as an argument to a shell script. Suppose the name of the script is and I want to pass 5 AEM Instances... the usage will be: ./ 5

for i in {1..${TOTAL_AEM_INSTANCE}}
do echo $i AEM_TYPE=publish${i}
echo ${AEM_TYPE} done

Unfortunately the variable substitution is not possible like above...

So the Solution is with sequence as shown below - 

#set -x
for i in `seq ${TOTAL_AEM_INSTANCE}`
do echo $i
echo ${AEM_TYPE} done

To those who seek to be noticed...

Be so good in your craft that people are bound to notice you.  - Dipesh Majumdar

vi editor tips and tricks

  1. go to top of screen or the beginning of the file
  2. go to middle of file
  3. go to end of file (b) Go to the 10th line
  4. start inserting just above the cursor line (better than i)
  5. start inserting below the cursor line... though i rarely need this because i like to insert from above cursor line
  6. go to 9th line of job.yaml
  7. find out all occurences of the string job in job.yaml
  8. traverse word by word - forward and then backword
  9. traverse left right
  10. traverse up and down
  11. delete to end of word. but if word: the : wont be deleted so now delete complete word
  12. delete word up until next space
  13. go to a particular character say - t
  14. go back to a particular character say - T
  15. go to beginning of line and then to end of line
  16. yank till just before a particular character, say d
  17. yank till a particular character including that character, say d
  18. See lines in a particular file and then stop seeing lines
  19. Indent Line 13 to 18 in a file by two spaces
  20. Ok your curser points to a particular word - how will you go to the next occurence of the same word


  1. H (or gg)
  2. M
  3. L  (or you can do a capital G - which means the end of file and not screen).  b) 10G
  4. O
  5. o
  6. vi job.yaml +9
  7. grep -in job job.yaml
  8. w for forward and b for backward
  9. h and l
  10. k and j
  11. dw  word and dW for complete word
  12. as you would all know the meaning of dd - which is to delete a line... and x - which is to delete a character... have you ever thought about as to how to delete a group of characters till a particular character. Well the answer is: dt<that_character>.... so it can be like dt<SPACE> if you want to delete till the next space character.
  13. ft
  14. fT
  15. 0 $
  16. ytd
  17. yfd
  18. set numbers && set nonumbers
  19. 13,18s/^/  /g
  20. *


links and references:

Difference between awk and cut

$ docker images |grep simplev01
dipeshm77-ubuntu                                        simplev01                e5337522d045        About an hour ago   210MB
ubuntu                                                  simplev01                e5337522d045        About an hour ago   210MB
dipeshm77/ubuntu                                        simplev01                e5337522d045        About an hour ago   210MB

In the above query result if i want only the image-id of docker we can use awk

$ docker images |grep simplev01 |awk -F ' ' '{print $3}'

"cut -d" can also be tried but it doesn't give the desired result - 

$ docker images |grep simplev01 |cut -d ' ' -f 3

<<<<no output here... which is because of unnecessary spaces that spoils the show>>>>>>

Get rid of unnecessary spaces:
$ docker images |grep simplev01 | tr -s ' '
dipeshm77/ubuntu simplev01 e5337522d045 About an hour ago 210MB
dipeshm77-ubuntu simplev01 e5337522d045 About an hour ago 210MB
ubuntu simplev01 e5337522d045 About an hour ago 210MB

Now "cut -d" gives the desired result

$ docker images |grep simplev01 | tr -s ' '  |cut -d ' ' -f 3



escape single quote and forward slash in sed command

Requirement is pretty simple - 

In my .gitlab-ci.yml file i need  this line - 

kubectl -n data-import logs ${WHICH_POD} --tail 40 |grep -v admin |grep -A6 add |grep true |awk -F ':' '{print $2}' |awk -F '}' '{print $1}' >ci/switched_true_false.txt

to be replaced by 

kubectl -n data-import logs ${WHICH_POD} --tail 40 |grep -v admin |grep -A6 add |grep true |awk -F ':' '{print $2}' |awk -F '}' '{print $1}' |uniq >ci/switched_true_false.txt


Definitely this can be done in many ways... but i was using sed command... and was already having a nightmare. So thought about creating a note in the vast ocean of internet with the hope that many be it helps someone....

the command used was:

cat  /tmp/.gitlab-ci.yml |sed 's/'\''{print \$1}'\'' >ci\/switched_true_false.txt/'\''{print \$1}'\'' |uniq >ci\/switched_true_false.txt/g' >/tmp/.gitlab-ci-new.yml



Reflecting on 'being adult' on Dashami...

At a time when Durga Puja has remained a distant childhood memory, the advent of the special occassion or the end of the festivity has ceased to churn emotions of joy and sadness...
however i miss the innocent happiness of childhood in just being able to be part of the festivity.

Friends and family together...flocking around Goddess Durga... going out to see the different pandels in kolkata and staying awake the whole night... these used to mean a lot...

Quote from Eugene Ionesco very nicely illustrates this - 
The end of childhood is when things cease to astonish us.  When the world seems familiar, when one has got used to existence, one has become an adult.

Happy Durga Puja to all!

Sony WH-1000X M3 Headphone Review

An opportunity may arise out of nowhere

My opponent had a rating of 1270 and mine was a mere 1130... i was skeptical - not sure of winning... however i didn't want to go down without a fight! I opened up my pieces with caution. I thought and analysed hard before my moves... and my opponent was taking  a lot of time to make his moves. As the clock ticked by...  i thought of taking a quick break and then return to the game. As I got back... suddenly, out of nowhere I spotted a great opportunity for a double attack. 

Well my bishop sitting at b7 was aiming at his rook on h1 (though there was a pawn as a cover).  Because my queen was at g5  so in the event of an exchange he might lose more - so to prevent that situation he moved his rook to g1. This gave me a glorious opportunity to eat his pawn with my queen at e3. now in order to come out of check - he had to lose his rook - there was simply no other way - and out of remorse he RESIGNED!

I learnt 2 lessons from this game:

1. Let your opponent be strong - it really doesn't matter - you play your role with an unperturbed mind and focus on your work at hand. There is no control that you have on the external factors - in this case the higher rating of my opponent. I really can't do much about it. So if i start giving it too much of an importance I will lose my own confidence and my focus. Rather I should remind myself that on many occasions I have won against a higher rated player. You never know - an opportunity may arise out of nowhere! 

2. Assign tasks/responsibilities to your team members that might trigger benefit somewhere else that you might never think of. Don't make them sit idle and do nothing. In this case my team member bishop forced my opponent to move his rook thereby enabling the double attack by my queen - my queen might take  credit - but it was the bishop that had caused it. It's because my bishop was assigned to take care of the longest diagonal of the chess board, i.e,the longest (read largest) responsibility.


LENOVO ideapad 530S Review

The eye that never blinks

How to post notification on slack channel with bash script

In order to do this first go to your slack channel (home page) and scroll down... if you look towards left bottom part you will see a link: APP

Click on that and then click on "view app directory"

Then click on button "get essential apps"

You can see a search place with a magnifying glass

Search "Incoming WebHooks" and then click on incoming webhooks

you are in the "incoming webhooks" home page now - here you can add a new configuration on a slack channel... you can also see existing configurations for the slack channel... here get the incoming webhook url by editing on the required configuration. 

Grab the incoming webhook url and use it to the members of slack channel with the required messages...

For example with http response code - 404/500... you can put the response in a variable and post the variable in the slack channel as an alert in this way - 

curl -X POST -H 'Content-type: application/json' --data '{"text":"ALERT!!! http response for POST </some/api/call/url> :'"$HTTP_RESPONSE"'"}'



I have lost count of the abstract head paintings and now I generate a 8 character random string as unique identifier... I thought that will make it much simpler to name these paintings...

kubectl basic commands

kubectl get <resource_name>

All the resources offered by k8s api can be queried and known by the simple kubectl get  command

these are - 

certificatesigningrequests csr
componentstatuses cs
configmaps cm
customresourcedefinition crd, crds
daemonsets ds
deployments deploy
endpoints ep
events ev
horizontalpodautoscalers hpa
ingresses ing
limitranges limits
namespaces ns
networkpolicies netpol
nodes no
persistentvolumeclaims pvc
persistentvolumes pv
poddisruptionbudgets pdb
pods po
podsecuritypolicies psp
replicasets rs
replicationcontrollers rc
resourcequotas quota
serviceaccount sa
services svc
statefulsets sts
storageclasses sc
kubectl get no

[dipesh.majumdar@some-instance ~]$ kubectl get no -o wide
NAME            STATUS    ROLES     AGE       VERSION                   INTERNAL-IP     EXTERNAL-IP     OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME   Ready     <none>    9d        v1.9.8-2+af27ab4b096122   Ubuntu 16.04.4 LTS   4.4.0-127-generic   docker://17.6.2   Ready     <none>    9d        v1.9.8-2+af27ab4b096122   Ubuntu 16.04.4 LTS   4.4.0-127-generic   docker://17.6.2   Ready     <none>    9d        v1.9.8-2+af27ab4b096122   Ubuntu 16.04.4 LTS   4.4.0-127-generic   docker://17.6.2

[dipesh.majumdar@some-instance ~]$ kubectl get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS    CLAIM                                      STORAGECLASS       REASON    AGE
pvc-0e7ae29e-8119-11e8-80c5-4a1xy09543ad   20Gi       RWO            Delete           Bound     default/gitlab-gitlab-config-storage       ibmc-file-bronze             3d
NAME                               STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS       AGE
gitlab-gitlab-config-storage       Bound     pvc-0e7ae29e-8119-11e8-80c5-4a1xy09543ad   20Gi       RWO            ibmc-file-bronze   3d
[dipesh.majumdar@demo-instance ~]$ kubectl get po
NAME                                       READY     STATUS    RESTARTS   AGE
gitlab-ee-nkbsm                            1/1       Running   0          6d


peaq laptop review

This laptop:  PEAQ PNB S2415-I5N1 is available in mediamarkt  Netherlands... 

One day while i was taking a casual look at all the laptops displayed in a mediamarkt store - i happened to see this big 15.6 inch laptop - immediately i started typing on it and found the kyeboard was actually very good to type on - and i found the display of the screen good too.... what more i came back - did some more research and decided to place an order online through the mediamarkt online store - 

The price is around 450 euro - I got some 50 euro discount without which it would have been 499 Euro I guess...

I bought it online from mediamarkt site on 27.may.2018 and got it on 28.may.2018 - fully sealed....

....Unboxed on 28.may.2018 and have been using ever since.  At 500 euro the specs are awesome and you can't get such quality at such a low price. the specs are give below - 

Operating System Windows 10 Home Resolution 1920 x 1080 Optical drive No Form Factor Fixed Screen Aspect Ratio 16: 9 LED backlight yes Screen size (inch) 15.6-inch Display size (cm) 39.6 cm Screen Diagonal (cm / inch) 39.6 cm / 15.6 inches Image resolution Full HD

Specs are as shown below...

Display: 15.6 inch (1920 x 1080) 
Processor: Intel Core i5-6200U 
RAM: 8 GB 
Storage: 128 GB eMMC + 1 TB HDD 
Graphics card: Intel HD Graphics 520

Now let me write the pros and cons - 

pros -


1. cheap price and fabulous quality

2. keyboard is nice and big - the keys have a nice responsive kick that i found very comfortable... i tried a few other expensive laptops but was massively disappointed by the key repsonse my fingers received... just to let you know - i just love to type and i type very fast and if i don't get a proper keyboard - no matter how impressive the other features are - it will be a big NO NO - but not with this laptop - i was impressed and still am after 30 odd days of rigorous use... a big thumbs up

3. display is quite good at this price...

4. pretty fast response time - switch it on and it doesn't take much time to come to life... its pretty fast


cons -

1. Biggest disappointment is the battery - battery doesn't last that long and your power cable has to be somewhere near...

2. There is no indication of caps-lock - no way to know that your caps-lock is on or off - no light indicator on the Caps Key!

3. The DOT (or fullstop) key is very small and it's an irritation. Bad design!!!

4. Build quality of laptop is not good; screen looks very much vulnerable as the bezels are so weak and screen is wobbly/shaky if you just touch it gently... 

5. shift + right or left arrow - should selct the words - which doens't work at all and that's irritating... really really irritating...


FINAL VERDICT - considering that it is only 499 Euro and all the features it has - I would still recommend this... however if you can spend more - definitely go for a branded and better laptop with good build quality.

generate ssh keys in linux

[root@local-some-env ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/
The key fingerprint is:

The key's randomart image is:
+---[RSA 2048]----+
|      blah   |
|     blahhhh.  |
|      o o =.o  o |
|       . * o . . |
|        S+*   o  |
|      . +=+ ..   |
|     o = ..+ ... |
|      * =.  o ...|
|      .X=.   oo. |
[root@local-some-env ~]# ls -ltra /root/.ssh/
total 8
dr-xr-x---. 4 root root  136 Jun 28 14:30 ..
-rw-r--r--. 1 root root  406 Jun 28 14:30
-rw-------. 1 root root 1679 Jun 28 14:30 id_rsa
drwx------. 2 root root   38 Jun 28 14:30 .


rhel vs centos - which one to choose

it's better to choose centos because it's not licensed  and you get the work done just as well as you would have on RHEL ...........................................................................................very little differences if at all there is any - BETWEEN CENTOS and RHEL....

Of course - dear reader, please don't quote me on this - and do your own piece of research... 

i am hoping that centos should be able to do your work without you needing to burn a hole in your pocket... 

so whenever you have the opportunity to launch an instance in cloud - for example in google cloud - choose the os image as centos - that way the monthly billing will be less.... very handy advise - for free - so go - enjoy!!!!!!!!!!!!!!!!!!!!

***************************for example uname -a output for centos can be -  3.10.0-862.3.2.el7.x86_64   

... well right now when i write this it is so - will change in future may be - things are changing fast - real real fast............................

Thiem lost the plot

So what was the French open final all about? For me it was another proof of how talent crumbles before experience. Thiem was an epitome of class and talent but what he lacked was the tactful game plan, knowledge of crucial points where he needed to put more focus and energy - and all this comes with experience. 

Nadal is aging and with age he can no more generate that sustained flow of energy that he could a decade earlier and therefore he depends a lot on strategy. He conserves energy like an old panther who only targets that victim it is confident of running down. Rest of the flock is just ignored -  it doesn't chase them... Just an analogy from what I observed - The great clay court southpaw will not play all the points to the best of his effort... but will only play to his fullest energy at the crucial points...  The points that matter. It's like reading the game like a book and playing it with the mind as much as with muscles... To some extent it's like chess. I have also seen him targetting the weak back hand of players incessantly - and then suddenly coming up with a viscous forehand which is just too fast to chase down. 

And his opponent failed to read that. When Nadal returned the hard shots of Thiem with painful accuracy, Thiem needed to hold on to it a little longer - and then Nadal might have given in... however he falls a victim to frustration and gives up, shortfalls every amateur is vulnerable to - and pretty apparent in this case also. 

Thiem was pretty impressive and his loss in straight sets was a bit too much to digest, keeping in mind the alacrity and power with which he played in the Rod Laver Arena. He might have lost but he definitely gained a lot through this grueling battle. The experience gathered will take him a long way forward in his career, if he applies the learning lessons with the right attitude. 

He needs to understand that he has to persevere a lot more than what he has shown in the final. 

my chess prgress and other things - basically an update on the state of my mind

nothing much really...

I had a rating of 1160 even a couple of weeks before ... but right now it is loitering around the 1100 mark. I am falling below this mark as well. However I am not able to reach 1150 plus any more - forget touching 1200

Ok my aim is to touch 1200 by 03.July.2018

I will check my progress very keenly. 

Now a days I have lost interest in analysing the game - however that's not a good idea. Actually analysing a game only helped me to learn from my mistakes - also it helped me to learn a few tricks - for example if the opponent comes down aggressively with his queen at the start - I know I have to bring my knight up to counter it - and so on... 

now since I don't analyse the game any more - I have stopped learning those tricks. 

Right now the French open is going on.... and just now Djokovic won one of the matches. My mind is on a lot of things... 

I have to take care of a lot of things - and I don't know how to go about it. May be making a to-do-list in an excel sheet and analysing all that I need to do will help. I will do just that. 

I am lot calm and relaxed these days - I am able to sleep well and plan things in advance. I intend to do a lot of things - like practise the devops tools online and also hone my skills in whatever I can lay my hands on... I truly believe that "my technical skill" is my only true friend which can take me to great heights... and so its very important that I develop my skills. Without it I am going to be in bad situation.

I am also a firm believer of dreams and over the period of time I have come to realize that if you don't let go of the vision of your dreams - somehow your dreams will take shape slowly but steadily... it's all a matter of thinking and keep on attempting and aiming high. 


They say - it’s a beautiful world... I say - its a TRAP

View older posts »

About me and the website

This website reflects my ideas, thoughts, philosophy and state of mind. The views and opinions posted in the blogs are completely my own.   

While my daytime job finishes, I start working on various things that constitute my dream world. They are primarily sketching, painting, blogging, reading, writing and thinking. In the weekends and holidays I travel to places, get immersed in photography, think about topics on which I can write or simply spend some invaluable moments with my family. 

I don't have a particular niche. The gamut of ideas that crop up in my mind is simply too wide to fit into a small niche. One moment I might think about ice creams and the next moment about camels and then followed by kites and sky and so forth... no logic or link... I am free to choose my topics in accordance with the timing of their conception and post them in different categories. If you are interested in a particular category, you are most welcome to pick that up and spend as much time as you want.

If you find this website interesting and valuable, do show your support and encouragement by sharing it with others and commenting on the blog posts. Your suggestions and opinions are most welcome. And if you also have a website, you can add that in your comment. 

You might also like to subscribe to my blog feeds, which is,

Thanks a lot for your valuable time...

Dipesh Majumdar