Have you ever wondered why your life, literally and physically, moves out of balance when you are going through a stressful time? Your diet is usually the first thing to go out of control. You stop cooking, and even when you eat out you stop taking the right decisions and start picking all the wrong foods.

Your closet, room and home is usually the next thing to go out of control.

Give me your diet journal for the last one month and I can probably tell you how productive or nonproductive your month was. Let me visit your home on a surprise visit and I'll probably tell you exactly which phase of life you're going through.

And then as these little things go out of control they create a cycle of more panic and anxiety in your life, which in turn leads to more things going out of control.

On the other hand, have you also noticed how doing just a few simple things, can have a profoundly positive impact on your life and your self-confidence? For example, when you consistently wake up early in the morning, work productively (just for a couple of hours a day), when you consistently eat right, play music, workout; go for a run; or do whatever it is that you do; life feels so… awesome and even your work life and productivity begins to improve.

All of us has at least one thing which if we do right and consistently, we feel in control of our lives and when we don't do that one thing… that's usually a sign that we are losing control and going into a state of depressed helplessness.

That one thing can be different for different individuals. For some, it's waking up early. For others it’s making their bed after they wake up. For many others I know, their daily workout happens to be that thing. Everyone is different but most people have at least one thing which creates a perception of control for them. It makes them feel happy, makes them feel like they are in control of their lives and doing that one thing, makes them feel strong.

We are creatures of control. In an uncertain world where most of us have very little control over anything, including our survival, any perception of control that we can create for ourselves makes us feel safer and stronger than folks who are unable to create that perception.

In the larger scheme of universe where you are an insignificant speck of dust, who could cease to exist because of a simple road accident, an illusion of control makes you believe that what you do matters and as a result of that, you matter.

If you can pick up one habit, and stick to it, even when life throws its shots at you, you are telling yourself that you take active deliberate decisions and your life runs on those decisions; not a random chain of events controlled by mere chance. You are taking a stand against helplessness. This is why social scientists call these keystone habits.

This is why when you pick up a keystone habit your life starts to change. For example, most smokers who cultivate the habit of running quit smoking. Most folks who start working out or practicing a musical instrument get better at their work life.

You might say that the perception of control is just an illusion, and I might even agree with you, but that perception of control is exactly what allows us to get up in the morning and go to work. That perception of control is what allows survivors to fight dreadful diseases and even though this would sound a little cliché I would argue that this perception is exactly what powers most of our space programs and allows individuals to climb mountains. Of course rockets have exploded in the past and people have died while climbing mountains but that perception and illusion of control is what enables the astronauts and the climbers to roll the dice, take a chance and succeed.

I have a personal theory that as nerds most of us love programming because in an uncertain world, programing computers creates a perception of control and that perception makes us feel strong and empowered. Hey, we can't change everything, but at least we get to control what's behind the screen of that machine.

All my life, one of the most valuable things I’ve learned it is the idea of inching forward slowly and yet consistently using keystone habits and creating a perception of control is your only chance at that forward movement.

This is why every time I start feeling a sense of helplessness, I fall back to some of my keystone habits to regain that perception of control again. I start writing code each day; I start my daily work out session and I come back to this blog and start writing consistently. And I begin reading. These are four keystone habits that help me inch and claw out of dark and depressing times.

And before I know it, I feel empowered to change things and I'm control. I know the control is just a perception but it still works magically when it comes to taking me out of a state of helplessness and making me productive again.

What are your keystone habits? Did you do them today? Did you take a stand against the punches life throws at you, and actively take out time to do something you committed to? If not, please give yourself a moment today to think about which your keystone habits are and then make an active effort to execute on them.

I won’t say it’ll change your life, but if you are experiencing a sense of helplessness, there is a good chance it’ll pull you out of it and empower you to change things. One inch at a time. This is your way of telling yourself that you may not be in control but at least you are not completely out of control either.

Go on. Pick a few keystone habits and give them time, consistently. There is a high chance you may regain your perception of control and life will begin to come back in balance soon. If you haven't given keystone habits a chance, you should. I wish you good luck.

Science is all about cause effect relationships. So when I started working out and set out my first fitness goals a few years ago, I turned to science for validation. I read books like Spark which were all about how workouts can re-wire your brain. If a qualified doctor or researcher shows me a study that involves a sizable number of individuals, control groups, placebos and an output built on causation, I tend to get convinced much more easily about doing something compared to a random individual giving me health and wellness advice. It's probably why I like Headspace; because it approaches Meditation with a scientific approach rather than a random guy telling you that 'meditation is good for you'. It's also the reason why in the last decade I've literally read dozens if not hundreds of book on neuroscience, health, fitness and wellness. I have a lot of respect for science because it explains 'why' something works.

Having said that, modern day science has it's own set of quirks. One of the primary problems with modern day science, particularly when it comes to wellness, is the more you read, the more contradictions you encounter. As much as I respect science and scientists, (as I grow older) I am starting to realize that If you want to get completely confused about something really simple, get a bunch of scientists with sufficient funding, contradicting opinions and conflicting interests and ask them to research a topic. Once you've done that, you can sit back and watch in awe as they come back with their elaborate research results with contradicting conclusions and confuse the crap out of you. We like to believe that the years of experience and expertise in a topic makes doctors and scientists better than the rest of us, when in reality, Experts are just as human and are affected by the same biases as the rest of us.

Take for instance the vegan diet. The china study was one of the most detailed elaborate scientific study about how the vegan diet works and heals your body. Just when you thought the science was clear about vegan diet, studies on carnivorous diets started evolving. And this isn't a single isolated example of scientific contradictions when it comes to health and wellness. Take any single simple nutritional opinion and you will see experts fighting in the battle ring of ideas, everyone with equally compelling arguments and 'scientific research' to support their opinions.

How many bananas should you eat on any given day - more or less? Are cocoa beans really good for you or are they dangerous and toxic? Is running good for you or can it kill you? Is soy a superfood or a cancer causing poison? Are mobile phones useful tools that make you super productive or is the radiation from your cell phone killing you and / or making you impotent? Is high cholesterol really connected to heart issues or is that just a medical hype? If you have cholesterol should you take statin drugs or should you continue to try curing it with lifestyle changes? Try googling any of these supposedly simple questions that you would think science would have figured the answers to by now. Instead, all science has to offer to you in most of these cases is complete confusion and contradictions.

As far as I am concerned, confusion is fine. I am all for confusion. To an extent, I even love confusion. The problem I have with modern science however, is that scientists are now turning to leveraging our primal fear of death to force their 'opinions' (disguised as 'research') on us. And to be honest, most of the information you see out there today isn't even real science.

Someone from the Vegan community wants to prove a point and so touts Vegan Raw diet as a silver bullet and tells you that if you eat dairy you will die. Someone else from the dairy industry fights back by touting Soy as the most toxic substance and argues that if you eat Soy or drink soy milk you will die. Right in the middle of these two far end opinions are regular pragmatic folks like us, who are being constantly influenced by both sides which are leveraging our primal fear of death to push their opinions, agendas and lifestyles on us.

As I grow older, when it comes to my own health and wellness, I am learning how to take these 'scientific' studies with a grain of salt. I am starting to realize that a study based on one individual (you) which most scientists tout as 'anecdotal' is sometimes just as important for your health as any other scientific study done by an expert. When it comes to your own wellness, anecdotal results of what works and does not work for you is sometimes much more important than a doctor telling you what's good for you. Milk, may or may not be good according to science, but if you are lactose intolerant or it makes you feel crappy, it isn't good for you. The fact that milk makes you feel crappy, is reason enough to stop milk even if all the science in the world is telling you milk is harmless or does wonders to your health. On the other hand If you love milk, and it makes you feel energized, continue having milk - don't stop just because the china study says drinking milk is bad for everyone. Your body is your lab, try different things in moderation and see what works and does not work for you.

I had recently developed ulcers in my food pipe which eventually caused some serious gastric issues. I was burping all day long. After going to over four doctors, all of whom had different opinions on what was causing my gastric issues, and after sticking a tube down my throat and conducting a painful endoscopy, I was prescribed a bunch of medicines, which was supposed to fix these ulcers for most patients. All the medicines did however, was temporarily mask the symptoms. Even the masking of symptoms barely lasted for a few weeks after which the symptoms resurfaced again. The moment I would stop the meds I would return to where I was. After going to the same doctor for six months, the symptoms resurfacing every couple of weeks, I went to a new doctor only to be prescribed a different set of tablets.

After a few of these visits someone at work accidently talked to me about infusions made with holy basil and ginger. All you do is you dip them in water like a tea bag and then drink the water. By that time, I had had been prescribed over half a dozen medication by at-least four qualified doctors and nothing had helped; so I was pretty desperate. In an act of desperation I did a quick search on how ginger and holy basil help with gastric issues and bumped into some articles where they had helped individuals with similar symptoms as mine. I started the infusions and within two days, my gastric issues were gone. Placebo? Who knows. Anecdotal? Absolutely. Scientific? Absolutely not. Did it work for me? Hell Yes, it did!

Most of us tend to see our bodies as a machine and if there is anything wrong with it, we walk into a doctors office as if the doctor was a mechanic for the machine. Going by this analogy, most of us know our cars better than we know our own bodies. We can change tires, jump start the engine and we know the kind of gas our car works best on, but we don't seem to know even the basics of our own bodies. How many of us know the power of breathing, regular workouts, meditation, using basic food and herbs as medicine and the science of eating well? How many of us have genuinely experimented with some simple home remedies and herbs to heal ourselves? How about experimenting with different kinds of workouts - from weight training, to cross fit to running, which one works the best for you?

I'm not saying don't go to the doctor for a serious sickness. While your doctor can and will help you with your sickness, it's also equally important that you take control of your own body and start tiny experiments and be mindful about what works for you and what doesn't.

Do you know which foods make you feel like crap? Do you know which foods energize you? Do you know how you can lose some weight or gain some of it back if you really wanted to? Do you know what spikes your blood pressure and what causes it to be normal? Have you tried lowering your cholesterol naturally? Caring about your own wellness is just as much your responsibility as it is your doctor's job.

I'm not saying stop your medications if you have a serious medical condition, but as a parallel step you can start working along with your physician, start some small natural harmless life style changes along with your medication and start observing what works and does not work for you. And as you begin to start using your body as a playground or a lab for your own wellness, you'll get to know yourself better, you'll start having some seriously interesting experiences and over a period of time, you might even start listening to the patterns of your own body which might help you heal yourself and become an exception in a 'scientific study'. When it comes to health, wellness and happiness you are your own scientific lab. You don't have to wait for a bunch of scientists to tell you what to eat or how to do some basic healing - just like you don't need a mechanic for replacing your car tires.

Back in 2008, about ten years ago, I wrote this blog post where I self righteously proclaimed that when it comes to the time you spend at work, eight hours a day aren't good enough and everyone should spend way more time at their workplace. Like an absolute idiot of the highest grade and kind, who has no life outside of work, I announced:

Eight hours a day might be good enough for a job but they may not be good enough for a profession. And they are absolutely no good for keeping a passion alive. If you can’t love what you do, maybe you need to stop right now. Look harder for profession you can love. Seriously, if you are going to be an unknown-programmer who writes depressing programmer poetry - it’s best that you chase your dreams in a profession you love.

Work less, stay focused and if you find yourself moving into a constant firefighting mode for fifteen hours a day and you cannot get shit done, learn how to say no, logout and get some sleep. The same applies for your team if you happen to be leading one.

If your definition of work is producing real and efficient output, the real figure would be more around 25 hours a week.

Let’s be real here - Most work that you do at work is not really work – Filling timesheets, expense-sheets, TPS Reports (:) ) and goofing around with colleagues / friends isn’t work. Reddit isn’t work either. :)

Spend about 30 hours a week “in flow” without gossip, chats, email, twitter and a thousand other beeps and popups distracting you and you should be a star performer at work.

Once you do that for a few years, you can spend more time at work if you love what you do and experience flow but keeping tab of the “number of hours” and just spending time in office to meet that number doesn't make you more productive.

Ask me the same question today and I will tell you that I strongly believe that if anyone did real focused deep work for 15 hours a week, they would be awesome. At 20 hours a week they would probably be top performers in most workplaces.

The early part of this blog endlessly talks about 'passion for work' one post after another. I even wrote childish poems on my passion. Then as I grew older I started questioning what passion really is and my idea of passion completely flipped on it's head. Now I genuinely believe that passion is one of the most overrated things out there.

What's going on here?

Why are my opinions changing in such strikingly contradicting ways?

If you look at the tone and style of my original post on spending more time in office, it's loud, opinionated, assertive and authoritative. Now my tone is much more toned down and inclusive. My opinions are changing over time and so am I. What you see is a classic example of Strong Opinions, Weakly Held. When you give yourself the freedom to change your opinions (even the ones which are really strong) you give yourself the freedom to change your personality over time and evolve as a better person.

I do realize that I sometimes confuse people with constantly evolving opinions. One could argue that if your opinions change so frequently, what is your fixed reality and can your current opinions at any given time be trusted? When you are constantly growing and your opinions are constantly changing evolving, it's easy to confuse yourself as a phony or to give an impression to others that you are clueless... or even worse; that you are actively trying to just prove them wrong by confronting their ideas and opinions because you have a secret vindictive agenda against them.

But then, changing opinions, ability to contemplate, question and challenge both sides of the same idea is what makes us fundamentally human. This is exactly how everything from medicine to space theory has evolved. Doctors for example, know something; till the time there is a breakthrough and then everything they know is wrong and they must unlearn what they know and learn, know and believe something completely contradictory.

In the medical space, every new breakthrough changes everything the doctors know about a particular disease and it's treatment. It doesn't mean that what the doctors knew before was completely useless. It was still saving lives. But the new knowledge and the newly formed approaches to treatment just takes the science of medicine forward and a doctor who is willing to evolve rapidly with the evolving science of medicine is able to help his patients better. There are times for instance when medical science sometimes goes full circle and even starts looking at medicines that were used hundreds of years ago. The doctors who are using science to learn from ancient medicine aren't losers. They are just willing to entertain the thought that maybe they don't have all the answers. It's called research for a reason. You search something, you have an answer, and then you search the answer to the same question again; re-search.

“It is the mark of an educated mind to be able to entertain a thought without accepting it.”

And sometimes when you entertain really good ideas and give them a fair chance, you become a better human being. The process is not about jumping from one idea to another like a monkey. The process is about questioning everything with logic, intellect and with the eye of a philosopher who wants to get to the truth. One philosopher who played this game rather well was Socrates. I find this episode about Socrates particularly amusing:

After his service in the war, Socrates devoted himself to his favorite pastime: the pursuit of truth.

His reputation as a philosopher, literally meaning 'a lover of wisdom', soon spread all over Athens and beyond. When told that the Oracle of Delphi had revealed to one of his friends that Socrates was the wisest man in Athens, he responded not by boasting or celebrating, but by trying to prove the Oracle wrong.

So Socrates decided he would try and find out if anyone knew what was truly worthwhile in life, because anyone who knew that would surely be wiser than him. He set about questioning everyone he could find, but no one could give him a satisfactory answer. Instead they all pretended to know something they clearly did not.

Finally he realized the Oracle might be right after all. He was the wisest man in Athens because he alone was prepared to admit his own ignorance rather than pretend to know something he did not.

Challenging your own opinions and opinions of people around you can be fun. But like all good things it comes at a price. To lead a happy life with constantly evolving opinions, and to embrace the constant questioning of opinions through discourse, you need like minded people around you. People who understand that you are challenging their thoughts and opinions not because you don't 'support' them or you don't 'trust' them; but instead, you are just trying to probe deeper and form your own opinions, ideas and relative reality; so that when you independently come to the conclusions they have come to, you can trust and support them with even more conviction. Sometimes you probe and question ideas and opinions not because you want to fight these ideas and opinions, but because you want to believe them and embrace them with your own independently formed conviction. By questioning and challenging people with your own logic and pragmatic thinking you're trying to make their truth, your truth and make their opinions, your opinions.

With time, I am learning that not everyone wants to understand a philosophy of having strong opinions weakly held. Not everyone wants to dissect opinions they hold strongly and inspect them. There are people who are thin skinned and easily offended. As I grow older I am starting to realize that people often have a fixed reality of life. A fixed map of how they navigate their world and a fixed set of ideas which let them differentiate between good and bad. I am starting to believe that even people who live their life based on a single story should be allowed to live, peacefully.

And if you really want to focus on your intellectual growth and the quest of the truth through logical debate and discourse, without room for feelings or fear of offending someone, you will always find plenty of adventurous people who are open to the idea of fierce logical intellectual arguments and putting their ideas in the intellectual battle ground with yours, match after match to see which ones win and which ones perish, without taking it personally. People who are open to even accepting and embracing your ideas if they win on the merits of logic and depth. People who don't necessarily agree with you all the time; but people who are... your tribe. People who aren't ashamed to learn from you and people who have the capacity to teach you. People who also believe in strong opinions weakly held and the evolution of thought.

The beauty about having documented your thoughts for decades is that you have a live written running documentary on how your brain is evolving. Your writings shows you how you have evolved and changed as a person over decades. Every-time I go back and read a post or two on my blog, all I find is contradictions. Sometimes the contradictions are so strong that I feel the urge to delete my older posts in an attempt to scrub my stupidity off from public eye; but then, this stupidity and evolution is what makes me... me. It should surprise me, or depress me, or make me feel all confused and phony, but it doesn't. It just makes me happier and open to embracing new stories, ideas, opinions and realities.

Life is so much more than living with just a single story. And if you are the thin skinned kind who wants me to trust you without questioning your opinions or if you want me to not ask questions for the fear of offending people, I won't judge you, but all I will do is make one last humble attempt to try and nudge you towards seeing multiple sides of the same truth and see more than one story of your life. I can't guarantee you success or happiness, but I can tell you that life becomes much more interesting when you do that. Here is to curiosity and adventure of seeking your own truth and then re-seeking it. This year, instead of throwing in emotions and feeling all offended anytime your ideas are challenged, throw your ideas in the ring of logical debate without excessive emotions, see if they win only on the merit of logic, let them go if they don't, embrace new ideas and enjoy some controlled confusion. I promise you, you will see your life become much more colorful. Happy new year.

Most of us underestimate the influence of our environments on your daily lives. I've done blog posts where I cite books which tell you how your will power is a depleting resource and how relying on your will power is a recipe for failure. Triggers, by Marshall Goldsmith is a book that starts with the idea of how the triggers in the environment around us influence our lives and then takes a thought provoking journey through how you can go from triggers constantly and impulsively influencing your life, to you yourself becoming a trigger for positive change in your own life and the life of others you love.

The book suggests multiple ideas and tools to introduce better mindfulness in your life, to avoid mindless drifting and get better control of your life and your behavior. One tool I found particularly interesting while reading the book was the idea of active questions using a daily questionnaire. The author argues that most of the surveys (and even the questions we ask ourselves) are passive and because they are passive they tend to bring about very little behavior change in our lives.

Marshall explains this through his own study:

In the first study, we used three different groups. The first group was a control group that received no training and was asked “before and after” questions on happiness, meaning, building positive relationships, and engagement.

The second group went to a two-hour training session about “engaging yourself” at work and home. This training was followed up every day (for ten working days) with passive questions:

How happy were you today?

How meaningful was your day?

How positive were your relationships with people?

How engaged were you?

The third group went to the same two-hour training session. Their training was followed up every day (for ten working days) with active questions:

Did you do your best to be happy?

Did you do your best to find meaning?

Did you do your best to build positive relationships with people?

Did you do your best to be fully engaged?

At the end of two weeks, the participants in each of the three groups were asked to rate themselves on increased happiness, meaning, positive relationships, and engagement.

The results were amazingly consistent. The control group showed little change (as control groups are wont to do). The passive questions group reported positive improvement in all four areas. The active questions group doubled that improvement on every item! Active questions were twice as effective at delivering training’s desired benefits to employees. While any follow-up was shown to be superior to no follow-up, a simple tweak in the language of follow-up—focusing on what the individual can control—makes a significant difference.

Marshall then goes on to introduce his readers to the idea of active questions that you ask yourself daily. He advices that you appoint a designated coach (could be a relative or a friend) and run through these set of questions with them every night, creating a sense of accountability and mindfulness. You can rate yourself on these questions on the nightly basis (almost like a quick scrum meeting about your own life) and then do incremental improvements over time. I've been doing this using a personal quick and dirty survey for myself for a few days and it works. For example here is one set of personal questions from my overall list of questions I ask myself each night:

Of course there are a few more questions for my professional life, work life and relationships too, but you get the idea. Notice the focus here is on 'trying your level best' (though I seem to also provide some value to the outcome, this is not originally the idea presented in the book).

The simple fact that I would be going through this set of questions every night with a loved one and will be answering these questions honestly, provides me with a the much needed nudge to do my best to be able to answer each of these questions positively. Since this is the first time I am doing this, I am focusing on Mini Habbits with a 25 minute single pomodoro session for each of the things that really matter to me.

Having done this exercise I highly recommend it. If nothing else it makes you a little more mindful about your life and where you are spending it. Marshall promotes an old idea, that the planner within you is literally a different person than the doer within you. And it's easy for the planner within you to think up of grand optimistic plans but it's the doer who has to deal with the environmental triggers and fight procrastination.

What I've discovered is that the right questions, asked in the right way can help bring the planner and doer within you in touch with each other and the realities of daily distractions. When I meet my planners expectations, I'm happy. When I don't, at least I am aware of slipping up and am a little bit more mindful the next day. Active questions that you have a relative, friend or loved one (or even yourself) ask you every day can be an extremely powerful tool if you indulge in the exercise every single day. Go ahead, try it out. I've personally tried it and I highly recommend it.

Back in 2006 when I started this blog if you asked me to meditate or to visit a yoga class, I would have told you that you were out of your mind. Fast forward twelve years and almost every day of my life starts with and includes some form of Yoga, fitness workouts and/or meditation. Sometimes, the things we laugh at when we are young become an integral part of our life. Sometimes, we just ‘grow into’ things.

My first attempt at finding balance came back in 2010 with fitness and workouts. I started resistance training at an office gym and was instantly hooked. Over the years that followed, I did Resistance Training, Weight training, cardio and every other form of fitness workouts I could find.

I ran half marathons and 10K’s and when it comes to fitness, it would not be an understatement to say that I… got my act together. I went from being grossly underweight to being the right weight. I went from being moody and temperamental to being calmer and happier, and I went from being tried all the time to being functionally fit and feeling good. Fitness, changed me as a person.

Even today, I am a big proponent of physical fitness, especially for nerds. Till date, I go for long runs and like to break a sweat at my very own personal home gym. Workouts do as much for your mind as they do for your body. There are books that cover this topic and then there are books dedicated on research that describes how workouts rewire your brain.

But workouts, for me were just the tipping point that introduced me to the idea of overall wellness and understanding how changing small external habits on the outside, can have so much impact on the inside.

I’m an Indian, and I’ve been unknowingly mediating for most of my adult life through prayers, but I formally met meditation when my professional life started taking it’s toll on me. Physical fitness is great, but sometimes, your monkey mind creates more problems for you than it solves and I first met mediation through videos on YouTube, like this one and this one when I was tired of run on the proverbial corporate treadmill and was mindlessly surfing random videos on YouTube out of burnout and frustration. When I did Meditation, it seemed like a natural next step from fitness so I immersed myself into it and never looked back. Soon I met Yoga, and yoga seemed like a natural next step to meditation so I started tinkering around with Yoga too.

As I grew older, I became more and more interested in going from ‘playing the games’ that we all play in life, to plugging myself out of the game. I leaned more and more towards practices like Mindfulness, Meditation and even Yoga. Every once in a while, I loose balance and indulge in the act of cribbing, arguments, complaining or playing ‘the game’ at work or even my personal life, but then life tools like mindfulness, mediation and yoga help bring the balance back in my life and they help me disconnect from the fast moving mindless-life-on-auto-pilot, take a much needed brief pause and look within.

In the world of programming, we often need focused attention when building programs and writing code without repetitions. Think of it as being “in the zone” or as some know it, in the “flow” state. This is when you submerge yourself in your text editor and forget about everything else. Your mind is only thinking of that present moment. Being in this mode, you fully experience that “coding high” of writing functions that make or do things to achieve a bigger goal.

Though the experience is mostly anecdotal, I’ve seen how I am much more productive during the months when I meditate compared to the months when I don’t. But then, most of mindfulness, meditation, yoga or even physical fitness is not just about making you a better programmer or making you more productive. It is all about giving yourself some time to step back and look within. It’s about making You a better… You.

As I grow older, I am starting to realize that while the latest, hottest version of Angular may have an impact on my career; my mind, my body and my own well being are things which have a much deeper impact on my life and the lives of those I love.

As I grow older, when I flash a new rom on my phone, I am realizing that having apps like Headspace on my phone is much more important than having Twitter, Facebook, WhatsApp and dozen other noise creating apps. I use Greenify and silent apps like WhatsApp and Twitter and check them not more than once a day (or preferably a week); and as I grow older, I’ve started realizing the importance of keeping your phone away and scheduling some time to disconnect from life-on-auto-pilot and take a pause.

And if there one idea I want to leave you with at the end of this post, it is to take out an hour (or two) a day for yourself – your own body and your own mind. For some it might be fitness, for some meditation, for some yoga and for some it might just include going on really long runs or a mix and match of all of these. Whatever it is that you do, use that hour or two every day to indulge in the act of mindfully nudging yourself to become a better You. Because when you become a better – happier – you, you automatically become a better programmer.

If there is one single thing has the highest negative impact both on your professional and personal life, it is Drama.

When I wrote my first book a couple of years ago, the book had an entire Chapter dedicated to drama and why most people love it:

This movie starts with the camera giving a wide angle shot of the hero who shows up to work every day early morning before anyone else has arrived and with focused eyes stares at his computer screen, his fingers flipping keys on his keyboard for the next four hours; then he gets up for a cup of coffee when others arrive. He spends about 20 minutes of casual conversations with colleagues where he discusses a few technical problems, the weather, a particular book that he has been reading and what his kids have been up to.

Sometime during the day this hero of ours also attends a daily status call for about 20 minutes. During the afternoon he takes a break, eats lunch, returns to his desk and works for countless hours staring at the screen, his fingers dancing on the keyboard once again. He even works late night after his wife has slept.

The hero does this for 15 years of his life before he gets really successful and financially independent.

What would you tell me if I told you we are planning a next big budget movie with this hero of ours as a central character. The entire script of the movie is going to revolve around this hero's life.

"But that's a boring story! That'll never be a big hit! “– you respond.

Exactly!

You know why? Because it's hard to make the average middle class spend their money on movie tickets (and overpriced popcorn) without an overdose of drama.

My contention here was simple. Drama is tantalizing, Drama makes you feel like a victim who is suffering... like a hero or heroine of your own story who is going through a horrible time in a horrible universe but will ultimately emerge successful.

To make things worse, drama is spicy, it keeps you on your feet, gives you a strange combination of adrenaline rush for your brain and an excuse for your learned helplessness.

The worst thing about Drama though, is that it’s incredibly easy to create in your life. All you have to do is get depressed, annoyed, angry or take offence to something… anything… no matter how ridiculously small that thing is.

Now repeat. Keep taking offence to small things, keep getting annoyed, angry and depressed about small things in life and very soon you will have a drama packed life sitting on an emotional rollercoaster with it’s constant ups and downs.

Drama might create the spice your brain subconsciously craves, but it is dangerous, self sabotaging and it almost never leads to long term success. It’s usually the guys who are silently living a drama free life who are eventually shaping their own lives, the life of loved ones around them and eventually making dents in their own little universes. I still stand by what I wrote in my own book two years ago:

The story of silent people staring at computer screen for hours and typing away quietly day after day for weeks, months or years, doesn't make a best-selling novel or a movie that tops the charts or good television.

But it does make successful businesses, successful careers and sometimes – history.

So the sooner you resolve to a drama free life with hard work the better off you will be in your career.

Getting rid of drama from your life is easier said than done though. Learning how to lead a drama free life is life long process; particularly since Drama tends to manifest itself in multiple forms in our lives and sometimes even shows up uninvited. Which is probably why there have been entire books written on the topic of living a drama free life!

When the organization we work in is going through a difficult time and firing folks, we indulge in drama by gossiping around and discussing the firings with other colleagues rather than focusing on and silently preparing for our next interview. When a close friend of ours is going through a difficult time, we make his drama ours rather than calmly telling him to snap out of it.

2017 was a drama filled year for me. It was a year when I saw close a friend struggle with bad health issues. A year when a relative was diagnosed with a terrible disease and had to go through surgery. It was also the year when I changed my job after four years of being happily settled in one organization. And it was a year when I was prescribed medication for high cholesterol and told I would ‘have to’ take them. That and there there were a few more things that, for lack of a better word, were let’s just say… ‘eventful’.

So, 2017 does seem like a drama packed year when I look back.

But then, 2017 was also a year when I turned to a no-oil, no-sugar, vegan diet and hopped on to Headspace for my daily meditation. 2017 was also a year when I started running and working out again very actively. And 2017 was also a year when my cholesterol dropped by over sixty points in a couple of months using just diet and workout, without taking any medication which I had been initially told I would ‘have to’ take and continue taking them for the rest of my life.

It was a year when I tried to rebuild a few old broken friendships and I was able to get more work and learning done than I had done in the last two years combined. A Year when I finally came back to technical blogging and started devoting time on open source development again.

2017 taught me that there will always be drama that surrounds us and sometimes we don’t have control over just how much drama we find around us. But it’s ok to shrug our shoulders, calm our minds and continue living a drama free life. I’m not saying that the Drama that surrounds us does not impact us; of course it does. This year for example did take its toll on me, but the biggest take away I had from 2017 was that we might have a lot of drama surrounding us, but we get to choose how much of that drama we welcome into our lives and our brains. Sometimes, it’s just best to either focus your energies towards Drama free action that can change things, or if there is nothing you can do to change things, let go and direct your energies on things which keep you happy, focused and in flow.

I’m not a big believer of new year’s resolutions and I see time as an ongoing phenomenon with no milestones. But then, the end of a year and the beginning of new one is always a nice time to be mindful about your own life, and take stock.

2017 started as a drama filled year but by the time it ended it had made me that much stronger at keeping drama out of my life. If there is one thing that I can wish for each one of us (me included) this year it would be a drama free 2018.

This year let’s try to be a little bit more mindful about the drama that surrounds us, the drama that we welcome into our own lives and the drama we create in other people’s life and let’s make a conscious effort to make 2018 a drama free year. Happy new year everyone!

There was a time when making IDE plugins for Visual Studio was for folks
who specialized in art of writing plugins; i.e. folks like DevExpress and Jetbrains. With Visual Studio
Code, writing extensions is no longer a mysterious black art. Even regular
programmers like you and me can write extensions which solve our little
specific problems.

My specific little problem? I hate having to type a semicolon and then
hit enter on every line of code that I write. Specially when the IDE is
auto-completing my brackets and quotes. For example when I write:

Console.WriteLine("Hello

If I have the C# plugin installed in VS Code, VS code understands my
intent and completes the sentence by writing:

Console.WriteLine("Hello[my cursor is here]")

Notice my cursor position in the snippet above? At this point if I need
to end the line I hit the right arrow key twice, then type semicolon and
then hit enter to continue to the next line.

Technically, in the above example, if my IDE was really smart, I should
just be able to type a semicolon where my cursor is, have the IDE
understand my intent, move the semicolon to the end of the line and
automatically move me to the next line so that I can continue coding.

It's just 4 keystrokes per-line (two right arrows, a semi-colon and an
enter), but when you write hundreds of lines of code condensing 4
keystrokes to 1, adds up and goes a long way in making you productive.
Actually, it's not so much about reducing the keystrokes as it is about
being in the flow and rhythm.

At one point DevExpress CodeRush had this feature; and If I wrote:

Console.WriteLine("Hello;

CodeRush would intelligently complete this as:

Console.WriteLine("Hello");

It was a very fluid experience. I used to love that feature. When I
moved to Linux and Visual Studio Code, I lost most plugins like Resharper
and Coderush; but then other free Visual Studio Code plugins made up for
most of what I loved between Resharper and CodeRush. However, I continued
to miss the above feature where the IDE would automatically understand my
intent and move my semicolons where they belong.

So, I decided to see how difficult it would be to write an extension
which would:

Automatically move the semi-colon to the end of the line even if you
type it in between the line (except for special cases like a for-loop or
a for-each loop).

Automatically move you to the next line without having to explicitly
hit enter.

I think a regular programmer like me being able to write a plugin of this
sort, publish it live to a marketplace and have folks download over just a
couple of days says more about Visual Studio Code's highly extendable
design than it says about my talent. By far one of the more amazing
editors / IDE's I've seen in my life.

Because I used an source code of an open source extension on the marketplace
to learn how to get started with writing extensions, and I could see an ever
growing community of open source extensions on the Visual Studio Code
marketplace, I'm also publishing my code on
github.

Go ahead and try
it out. It has already had a couple of dozen downloads; makes me
hugely productive as a programmer when I am inside Visual Studio Code
above all keeps me in flow when I write code. I've been fully supporting
this plugin and closing bugs as and when I find them or if and when they
are reported.

If you do try it out please drop me your feedback / comments in the
comment section of this post and if you find an issue you can always post
it on github or you can always drop a line to contact@thousandtyone.com.
Happy coding!

I’ve always been both; a windows and an Ubuntu user. I’m not an OS zealot and I love both operating systems. My work machine runs on Windows and one of my two laptops at home has been on Ubuntu for a very long time. I love windows because it’s convenient. I love Linux because it’s powerful, seriously geeky and free. Which is why when .NET core team announced the ability to run on multiple platforms (including Windows and Linux), the announcement was like music to my ears. This meant that I could be on the OS of my choice (or fancy) and still do development on a language I love (C#).

This meant that I could now use Linux as my primary OS if I wanted; and that was an itch I really wanted to scratch. This of course, meant that it was time to test where Linux was as an operating system when it comes to being a primary operating system for me as a .NET developer. I’ve already had one laptop with only Ubuntu for ages but I just use that machine for surfing, browsing, watching YouTube and sometimes writing books or posts. Using Linux as a daily driver was going to be completely different. This time around, my goal was to find if I can use Linux as my primary operating system.

With this goal in mind, I decided to look at various Linux Distributions and pick one for my work life. This post is more of a running diary of my experience.

Since my organization wasn’t fully ready to move me to Linux (we’re an all windows shop), I decided to get Linux on a VM and spend most of my work hours there for a few days before jumping in fully. Given that I have 8 GB of Ram and over 200 gigs of disk space with an I5 processor I figured I can have substantial horse power in my VM to spend my work life inside the VM. And because this was going to be a work machine I wanted to try out distributions other than Ubuntu – which is what I’ve been using for years. Why? Because I wanted variety and spice in my life.

After looking at various Linux Distros these are what I short listed:

Mint Linux:

Apparently, this seems like the simplest version of Linux that you hop on to when you move on from the Windows world. Under the hood it’s Ubuntu but it looks and feels more like windows. Which is why a lot of windows users who move to Linux and are confused by Unity in Ubuntu like Mint better. For me, if I wanted an OS that looked and felt like Windows, I was already on Windows and I could just stick to it; so, Mint was not something that appealed to me.

Elementary OS:

I went and grabbed a copy of elementary OS and installed it on a Virtual Box VM only to realize that with 8 GB host, and 4 GB on the Virtual Box the OS was still slow and choppy. When I did that however I wasn’t aware how large an impact on performance small settings like enabling 3D acceleration and GPU allocation can have on the overall speed of Linux on a Virtual Machine, so in all likely-hood it wasn’t elementary OS that was an issue but probably bad configuration on my part.

I read a few posts mentioning that Elementary OS works much better with VMWare Player (which is a free product for trying out and personal use) than it does with Virtual Box so I tried it on VM-Player and it was better; but since this was meant to be a work VM, using VM-Player for work related VM’s wasn’t allowed by the VMWare license anyways. So, I dropped the idea and deleted the VM.

At the end of the day, if Mint looks like Windows, Elementary is inspired by Mac and if I loved Mac machines, I would get a Mac. So the choppy performance of Elementary on a Virtual Box and the fact that it’s inspired by Mac, ruled it out as a distribution that I would pick for myself at this point of time. There is a high chance I may have used it if the performance on Virtual Box would have been better and there is a good chance I’ll revisit Elementary sometime in the future because I genuinely liked and appreciated the user interface but for this evaluation I moved on to other distributions.

Fedora:

I grabbed a copy of Fedora and got it installed, up and running in no time. The Gnome based desktop is… for lack of a better word.. extremely classy. The OS was fast and slick and worked extremely well. I was about to settle down with Fedora, when I realized that the chrome installation that I had done on the OS just doesn’t work. No Errors. No warnings. Chrome just doesn’t start. Actually, chrome starts and then disappears. No Windows. No Screens. (I later encountered a similar issue on Ubuntu and fixed this by starting chrome without GPU and then disabling hardware acceleration using chrome settings. For more details on this fix see the ‘Chrome Blackouts’ on Ubuntu section of this post or read on).

I later moved on to .NET installation and realized that DotNetCore keeps giving an initialization error every time I try to do a “dotnet new”. The command fails with initialization errors. This is because Fedora 25 is not supported by DotNetCore. Turns out, there is a bug in .NET Core which makes it require version 52 of ICU Library and Fedora 25 has a higher version. Here is an unofficial fix but I wasn’t able to make it work; and after wasting hours on this I moved back to the familiarity of Ubuntu.

Ubuntu:

After having tried out three different Distributions I ran out of patience (and almost an entire day) and decided to eventually settle down with the known territory of Ubuntu. Unity is a controversial topic. Some folks love the UI, others can’t stand it. I personally have no issues with it since I’ve used Unity for months on my home laptop and am happy with it. But then having tried Fedora, I had also fallen in love with Gnome 3 and because this is Linux, I realized there was nothing stopping me from running Gnome 3 on Ubuntu. So I did just that and grabbed Gnome 3 on top of Ubuntu after I had installed base Ubuntu. Of course, I could have fetched Ubuntu Gnome directly but I like the manual way better because it lets me switch between Gnome 3 and Unity whenever I want to (or at each login!). I also love the Arc theme so I decided to grab that and install that using the Gnome tweak tool. Eventually however with Gnome 3, I settled for the default Adwaita theme.

Note: Version 16.10 of Ubuntu somehow doesn’t seem to play nice with VMWare Player on my machine, and causes Kernel panics and the famous ‘CPU has been disabled by the Guest OS’ error. However, it worked fine with Virtual Box which is nice because Virtual Box was my preference for virtualization to begin with.

Long story short, at this point, I had the familiarity of Ubuntu, and the newness of the Gnome 3 User Interface that I experienced with Fedora. The best of both worlds:

So I was on Ubuntu with Gnome 3, but I was still far away from making this machine my daily driver. There were multiple other hoops that I had to jump to make this machine usable as a daily driver.

Sound Card Issues:

With Ubuntu installed on my virtual machine; I realize that sound doesn’t work with Ubuntu on Virtual Box. Turns out, after a certain version, Virtual Box doesn’t seem to pick up the right sound card drivers to be used for host and guest operating systems and you need to pick them up manually. For me what worked was Windows Direct Sound on the host and Intel HD Audio on the guest operating system.

I then go to the sound settings of Ubuntu and crank up the volume to maximum value allowed. Actually, I crank it up to 140% of what’s allowed:

Sometimes when I want to sound to go louder I have to go to the terminal and crank up the sound even louder with aslamixer command:

And then the sound works fine. The next thing I was going to need if I was going to use this machine on a daily basis was a stable browser like Chrome.

Chrome Blackouts:

I go ahead and grab chrome and am just about ready to work; when I see a blank black screen each time I start chrome. To fix this I start chrome without a GPU using the command:

google-chrome -disable-gpu

From my terminal window and once chrome starts I disable “Use hardware acceleration when available” by going to Chrome Settings and then into Advanced Settings of Chrome.

Note: This same fix works on on Federo where the chrome window disappears after you click on the chrome icon.

Sluggish Speeds:

My Virtual box is now up and running; I have a browser and sound; but the performance is still sluggish. I crank up the GPU to 128 MB and select ‘Enable 3D Acceleration’ from the virtual box settings which considerably speeds up the virtual machine and makes it fast. I also grab CompizConfig Settings Manager so that I can tweak animations and I disable them to make my system move faster. This speeds up my Virtual Box considerably and makes it actually extremely usable.

But What About Email?

With the basic setup of the OS complete, my next concern is email. Because we use Office 365 at my organization and Exchange at my client’s organization, I needed something that works seamlessly with Exchange Web Services and while evolution comes pre-installed in Fedora, Unity comes preloaded with Thunderbird; which, based on what I’ve read doesn’t work with Exchange services as of this writing. So I grab a copy of Evolution in my Ubuntu and configure my Office 365 emails with it.

Configuring Office 365 emails was relatively easier, though Evolution does tend to loose your preconfigured account the first time you configure them. If that happens open your process monitor, kill all threads of evolution and start fresh and there is a high chance you might find your accounts back. I ended up creating the accounts thrice and then found them all when I killed the evolution threads and started evolution fresh. Then I deleted all of them and re-created a single fresh account. This was of course a one-time issue and things have been fine once the accounts are configured.

Configuring Office 365 accounts were easy. With on premise Exchange accounts however things get a little more complex to troubleshoot. Because my client uses NTML based authentication and Evolution detected that as Kerberos; I kept getting the following error message:

Finding out what the issue here was mostly a hit and try exercise where I tried to use basic authentication and that didn’t work so I moved to NTLM and that worked.

Site Note: the lack of support for Exchange in mature email clients like Thunderbird and the fact that you have to shell out 10$ a year to get an Exchange plugin in Thunderbird is a little disheartening. I have no issues with paying developers for the hard work they put in, but paying to accomplish something as simple as checking email when your entire OS is open source (and free) and every other app on your machine is open source is, for lack of a better word… a little… ironic. So I decided to grab Evolution which supports Exchange free out of the box and battle out the issues. And it paid off. Evolution has been working well both with Office 365 email account and with Exchange email account and I am actually starting to like it a whole lot.

For those of you who haven’t used evolution, the only thing I missed, compared to outlook was free text search. Turns out, Evolution has a very powerful advanced search and you can also turn on expression based searches:

Visual Studio Code:

With everything else configured I set out to load Visual Studio Code (the primary reason why I started to spend a day on making myself a Linux Work VM). Getting Visual Studio Code itself is super easy. You just download the package and you install it using the Application Manager. However, when I start Visual Studio Code I get a blank black screen. This reminds me of the black window in chrome so I go ahead and look for a similar fix. You just start Code without the GPU:

code --disable-gpu

But because we cannot be doing this each time we add this as an alias in our ~/.bashrc file (or in my case I just add it to my ~/.bash_aliases file which bashrc file references which just helps keeps things clean):

alias code='code --disable-gpu'

Once you’ve added the line you need to close your terminal and start it afresh for the alias to kick in. Caveats? First, you can’t open Code from the Icon in Gnome. Second, you can’t do a “Code .” and expect “.” to represent the current folder you are in when working on the terminal. You need to open Visual Studio Code and then do a File / Open… which is not that bad.

Next I follow these instructions to install DotNetCore on Ubuntu 16.10. Then Install the usual plug-ins and I am in business:

And so, with the development environment in place we are now going to need a DB to work with.

SQL Server:

SQL Server installation was by far the smoothest. You just follow the instructions here and then you follow these instructions for installing the client tools. SQL Server claims to require 4 GB RAM but I barely notice any slowdowns post install and the DB has been running blazing fast. I’m actually really impressed with the DB performance thus far.

There are no UI tools like SSMS for SQL Server on Ubuntu so I grab the DBeaver and use that as a visual editor for DB design.

To be honest the performance of DBeaver in a Virtual Box with 4 GB of RAM is extremely sluggish and it tends to slow down the entire VM. At the danger of offending and triggering Eclipse fans, it’s a trend I’ve seen with a lot of other applications that are built on Eclipse. I then move to SquirreL SQL which is light weight but only provides query capabilities and no Drag and Drop DDL capabilities.

I’m still looking for a visual database development tool but for now, between the command line, SquirreL and DBeaver I should be good.

And A Shared Folder with the Host OS:

If you’re going to run in a VM Mode you will probably want a shared folder with the host OS which you can mount automatically so that anything you save there is also available when you are not using Ubuntu. I do that by sharing a specific folder on my host OS with Ubuntu using Virtual Box settings:

And I’m set for now. All ready to take my newly created VM for a spin and because my VM is just 12 Gb, I decide to take a full backup of my VDI file instead of taking a snapshot. My entire disk file size after installing everything I need, is about 12 GB, so it’s still a file I can carry on a 16 GB drive.

My Overall Experience:

I’ve been a happy Linux user on and off on at-least one personal laptop for over 15 years and Linux has come a long way, but even today, every time I decide to spend a day with various Linux distributions to see where they are and play around with them or try to expand the scope of Linux in my life, I encounter some hurdles which I have to jump and I eventually end up learning new things. That is what makes me angry at Linux sometimes. It’s also what makes me love Linux most of the times. Let’s just say it’s a healthy relationship – the kind that you have with your friends, wife or your kids. :)

If you’re an average office user who is Installing Linux on a bare metal modern day laptop, Linux has indeed come a long way, is very usable and your learning curve might be minimum. You probably can get started almost as easily as you do with windows. But if you plan on using Linux as a primary work machine (especially in a Virtualized environment because your office is on windows) there is a high chance you’ll hit a few bumps but among the dozen odd distributions of Linux and a couple virtual machine solutions and a couple of dozen workaround, you should not take more than a couple of hours to be completely up and running and that (genuinely; without the slightest tone of sarcasm in my voice) is not such a bad thing at all.

My overall experience after spending a day playing with Linux with the idea of using it as my primary work environment is that it has come a long way and I encourage each one of you to try it for a month as a primary work OS; even if it happens to be on a VM! With Visual Studio Code, .NET and SQL Server all running on it, there should not be any reason why you aren’t taking Linux for a test drive.

On another different note, I am loving the new Microsoft for making things like this even possible. It takes a lot of courage for a company of Microsoft’s size to embrace a truly open world where everything they build from Development platforms to development tools and even databases run on multiple platforms.

Here is a big thumbs-up to both the DotNetCore team and the SQL Server team for embracing openness. When we have open choices like these for developers, everyone wins. I’m genuinely impressed with what I have experienced and I’ve been on this VM as my primary machine for a week and nothing has broken. Pure Awesomeness.

Update: After using the Virtual Machine for a few days I finally took the plunge and decided to move to Linux on my work machine. All the GPU issues I had to work around in this post are non-existent on a bare metal install and the same Ubuntu + Gnome combination has been working really well for me during the past few of days.