Fix corrupted Terraform state

Lets say you corrupte your terraform state. There are multiple ways in which you can corrupte it. So I am not gonna tell how we corrupted it. In order to fix it, 1) You have to remove unneccassary resources from the state. terraform state rm resource.resource_id #eg: terraform state rm google_container_node_pool.node_pool #eg: terraform state rm google_container_cluster.cluster 2) You have to import the actual state into the state file (Make sure import is available for your resource)

Which scheduler scheduled the scheduler in minikube ?

In oneliner, minikube is a tool that makes it easy to run Kubernetes locally. In kube-system namespace, we can see result like below, $ kubectl get pods -n kube-system -o name -l tier=control-plane pod/etcd-minikube pod/kube-apiserver-minikube pod/kube-controller-manager-minikube pod/kube-scheduler-minikube #scheduler is running, but who scheduled ? Whenever we create pod(rs/deployments/sts/ds), Scheduler is the one which schedules this pods into any of the available node (in minikube, there is only one). In minikube, kube-scheduler-minikube is the one who schedules.

Not all machines are pingable

To check if a machine(IP) is reachable, I only used ping. If ping is not working, then I will come to a conclusion that IP is not reachable. If you are like me, please read further. How Ping works? Ping sends the ICMP Echo to the given IP and waits for the ICMP Echo Reply. If we get the Echo Reply, then ICMP server in the given IP is able to send response to our Echo request.

Resolve vs Reach

I have seen lot of people confuse between resolving dns vs reach IP. So this small blog. Inorder to get data from any computer we need to know the address of the computer which is IP address. Let’s say we want to get some data from google and its IP is 172.217.31.196 (currently). Its very hard to remember this IP and also they can have multiple machines(IPs) which will give the same data (horizontal scaling).

My OSS Journey

I would love to quickly share my OSS Journey. I will keep it very short. I am writing this now (on September 2019), because I am gonna celebrate my first anniversary of my OSS journey by this October. Before one year (October 2018) Now (September 2019) No PRs to any tools/libs 31 PRS (25 Merged, 3 Open, 3 Closed) refer Know at hight level what the tool is doing Know what internally it is happening (you might get to know which function is getting called :-P) Okay to live with bugs Raise issue or fix the bug (refer) Okay to live with existing feature Trying to think what feature is helpful for me (and for others also) Not attached to any tool/lib Feeling proud about the tool/lib People from different planet can only contribute No they are just like me No tools by me Have atleast one tool (gg) Nothing special about me My resume shines No cool tshirts Have two tshirts (Hacktoberfest, TW Internal hacktoberfest) Note: You have to be logged in github to see the above pr and issue links

Theme of my website

Backbone of my website: I am using hugo to build this website. Thanks to Aswin Karthik for his blog by which I setup this website. Just write markdown files and push, and travis-ci will publish your website. So cool !!!. There are lot of themes available here. After some search, I landed to current theme which is hyde. I really liked the theme and it saved lot of my time.

How I am using fzf for every 5 min of my programming life

Installation for new users $ brew install fzf $ $(brew --prefix)/opt/fzf/install # useful key bindings and fuzzy completion Note: Its better to use key bindings and fuzzy completion Default options that I use export FZF_DEFAULT_OPTS='--height 40% --reverse --border' My usages To Search in command history: CTRL + R To Change directory: cd + (CTRL + T) # type cd and then press CTRL plus T or cd ** + TAB To find and open files in vim(or any editor): vim $(fzf) vim + (CTRL + T) vim ** + TAB vim $(fzf --preview 'cat {}') You can even search and open multiple files using tab

Super cool exec command

exec (built-in command) We can use exec for two use cases (as far as I learned today :-P) To create independent shell from current shell Usual way: $ bash # created a bash shell $ #do whatever you wanted $ exit # will go back to the shell which it created Using exec: $ exec bash #created a bash shell and killed the current shell $ #do whatever you wanted $ exit # will not go back to the shell which it created.

About

I’m a coding freak who is always interested in solving/seeking challenging problems. Being in Thoughtworks, I found a lot of opportunities to work in various domains, few of them being - devops tools(docker, kubernetes, terraform, etc), mobile(both iOS and Android), micro services architecture. In all experiences on my projects, we have used a ton of open source tools and benefited a lot. After taking a lot from community I felt its only natural to give back as well.