Blessed with a daughter

The last post I was able to write was January 20, 2017.  I am starting again after almost 1.5 years as December 2016, I was blessed with the most precious baby girl.  I have had no time to write a blog since then as all my free time is occupied by my lovely doll.  In the past year, I moved from always working for startups (Nomis Solutions followed by Lyra Health) to working for a large organization like Intuit Inc.

Leaving Lyra Health was a really big decision for me and I am so grateful to the team at Lyra Health for making me feel this valued.  It was immense pleasure working in behavioral health space and get guidance from Jenny Gonsalves and Albert Baranchuk.  I am sure that under David’s leadership, Lyra is going to do some awesome work and is a company I am glad that I contributed to.  I learnt a lot about working with AWS, Twilio APIs, managing projects from start to finish and managing third party vendors for email communication (SalesForce and SparkPost) and Okta for authentication.

Lastly, I am now a certified AWS Solution Architect – professional and cloud practitioner.  Two certifications that I find valuable.  At Intuit, I have been focused on working with Kubernetes deployment, managing AWS clusters and DevOps related tasks.


Sending SMS with Twilio using node.js

This blog post is more of a tutorial for myself.  Prior to trying this out, from the online twilio account buy a phone number that allows SMS communication.

The first step is to simple install twilio sdk for node using following command in the directory where you want to send messages from.

mkdir ~/twilio-code
cd ~/twilio-code
npm install twilio

Create a file under the directory twilio-code and name it sendTest.js


//require the Twilio module and create a REST client
var client = require('twilio')(accountSid, authToken);

to: "+11234567890",
from: "+19876543210",
body: "How you doin?",
}, function(err, message) {

Now running node sendText.js command from the command line, you will be able to send the text message easily.  Each text message sent using twilio is charged some amount so be careful with your testing or use the test SID and AuthToken that Twilio provides.


Scheduled call forwarding using Twilio, AWS Lambda & API Gateway


I was recently tasked with implementing time based call forwarding at my workplace.  My company has an onsite team that takes calls on a zendesk provided number during business hours and we have a team offshore that would get any incoming calls outside our business hours.  We wanted the ability to automatically route incoming calls to Zendesk between the hours of 5 AM to 5PM and to the third party vendor outside of these hours.  Initially, we were working with 8X8 to use their service but due to the need to route calls and the call quality provided, we switched to Twilio.


We are going to use Twilio as our provider for phone numbers. Any time there is a call to the twilio provided number, we can take action by connecting to a certain URL.  In other words, Twilio provides the ability to call a POST or GET on some URL to manage how we handle calls.  For low volume of the calls initially, we will be using AWS Lambda/API Gateway as it is easily scalable and relatively cheap service. In future, if the call volumes increase beyond a certain point, we can expose an endpoint from within our app to handle the response for call forwarding.

TwiML Bins

For simple call forwarding with no scheduled switch, Twilio provides a nice XML like language called TwiML (Twilio Markup Language).  When we port numbers to Twilio, twilio provides us with the ability to call external URL using TwiML (Twilio Markup Language) or webhooks.twilio_1

If you navigate to Phone numbers and purchase a number, you will be taken to the screen as shown above.  You can setup simple call forwarding at all times by clicking on the + sign next to TwiML dropdown which will take you to the screen below and allow you to configure the call forwarding to number 1-123-456-7890 in my sample case.
For more information on the TwiML syntax for the Dial verb, you can navigate to Dial Verb API.  For our requirement to allow call forwarding for specific hours, however, this approach will not work.  TwiML doesn’t allow complex conditional call forwarding.  To allow for that, we need to host our own webhook code online.

AWS Lambda

AWS Lambda is a compute service that allows user to upload code that will be run as a service on AWS infrastructure.  In our case, we want to trigger the execution when we have a call event on any of the twilio numbers.  I am using Node.js for the project because it has a good support community for Lambda on AWS.  What we want to do is check for the time of the day when the call is generated and based on that respond with a different TwiML to forward call.

API Gateway

The API gateway will be used by us to provide REST endpoint for the Twilio webhook.  On any incoming call, Twilio will hit the API Gateway endpoint that will trigger the Lambda function and pass back the XML response to Twilio webhook thus forwarding the call.

Node.js callForwarding.js code

  • Install node.js
  • Create a folder called twilio-code
  • npm init

    This will setup the node project with package.json file

  • npm install moment

    I have used moment library to compare the hour of the day. AWS uses UTC time so factor that in the code.

  • Create the twilioCallForwarding.js code and test it locally
  • Final step is to zip up the contents of twilio-code folder in a file named

twilioCallForwarding.js code

var moment = require('moment');
var now = moment();

exports.handler = function (event, context) {
// Event will contain the information passed from Twilio to Lambda.
console.log("Event information: "+JSON.stringify(event));

qryObject = parseQuery(event.reqbody);
var numCalled = qryObject['To'];
var openXml = '<?xml version="1.0" encoding="UTF-8"?><Response><Dial timeout="60">';
var closeXml = '</Dial></Response>';

// Check for time and act accordingly
var hour = now.hour();
responseXml = '';

// Remember that AWS uses UTC time and I used PDT time
if ((hour >= 12) && (numCalled == '+19876543210')) {
responseXml = openXml+'+11234567890'+closeXml;
} else if (numCalled == '+19876543210') {
responseXml = openXml+'+12345987600'+closeXml;

// Log responseXml for verification


// Twilio call passes parameters as application-x-www-urlencoded that need to be parsed for our use and hence we will use the following method to parse it.
function parseQuery(qstr) {
var query = {};
var a = qstr.substr(0).split('&');
for (var i = 0; i < a.length; i++) {
var b = a[i].split('=');
query[decodeURIComponent(b[0])] = decodeURIComponent(b[1] || '');
return query;

AWS provides the handler function with two arguments of event and context (additionally you can also have error as an argument) and refer the lambda documentation to refer how we use them.  Event normally stores parameters that were passed as part of the POST request and context will store the state and response value from Lambda function.

Setting up AWS Lambda

Once you login to the AWS management console, navigate to Lambda under compute section.  On clicking the create a new function link, you will be navigated to blueprint page.  In this case, select runtime of ‘Node.js 4.3’ and filter for ‘twilio-simple-blueprint’.

This will take you to the configure triggers page.  We want our trigger to be an HTTP POST call from Twilio and we will be using API Gateway to handle the event trigger.  Configure the service as following figure shows:


Lastly, we get to the configure function page.  Name your function the same name as the .js file which will be the entry point to the Node.js code and that contains the exports.handler function.  Modify the handler on the config UI to be twilioCallForwarding.handler.  As we are not going to access any other AWS data (RDS, S3, etc) we don’t need to define a VPC for the function.  The final screen after configuration is as follows:


Notice that I have used an existing role that I had created previously for another project.  This role has policies defined that allow access to AWS Lambda, Cloudwatch, API gateway and S3 bucket operations.  Upload a zip named which contains the .javascript source files and all necessary node_modules and head onto the next review screen.  Once you review the function, we can proceed to test the function and verify results.

Setting up API gateway

Proceed to Amazon API Gateway service and click on Create API and enter values as below.


This will create an API for us that we need to add methods/endpoints to. Amazon refers to them as resources.  Click on Actions dropdown and create a New Child Resource with name CallForwarding having resource path of callForwarding.  Select the newly created resource and add a new method to it for POST operation.



Next, we will setup the POST method to use our Lambda function located in us-west-2 region.  This will take us to a screen with Method execution flow outlined.  Click on the Integration Request and open the Body mapping templates.  Twilio uses form-urlencoded type to send parameters across which include information such as From number, to number, region of call origination, destination of call, state of the call, etc.  Add a mapping template for type ‘application/x-www-form-urlencoded’ and text as shown in the diagram below and click save to save the changes.


Modify the Method Request to be open for everyone so as to allow everyone access to the API without the need for API key.  This will allow Twilio to call our Endpoint from outside the amazon network.

Next, navigate into the Method Response section and add a Response Model to allow for application/xml response as Twilio expects xml response from our service to redirect calls.  Don’t worry about the response headers as they will be set automatically later on.


Lastly, we need to configure the Integration Response section and add Body Mapping Template that will return application/json with following template:


Now navigate back to the method execution screen and click on our resource method. From the Actions dropdown, select Enable CORS and test the API endpoint.

As a final step, we need to set the URL provided by the API gateway in the Twilio webhook section for phone numbers as shown in the diagram below.  Now calling this Twilio number will forward calls depending on the time of the day.


Windows USB/External HDD on OSX

It is such a pain to open any external hard drive or USB stick that has been written and formatted on a windows machine when trying to open it up on a macbook.  I was trying to access photos on my external hard disk that had been originally formatted using a Windows 7 OS (thus NTFS file system) and I could only read the files on my macbook but make no edits to them.  I read online that there are some paid tools that allow you to access the files on such drives but I try not to pay for tools that I’ve never heard of.  The other option is to re-format the drive on mac but that causes wiping out all data on the drive.

I came across the following steps that allow you to enable Mac OSX 10 to access files on such external hard drive without formatting it or losing any data.  Note: You need to have sudo rights (or be the administrator with root privilege) to perform the operation.

Run the following steps on mac OS terminal (can be started by pressing Command + space and typing terminal) :

$> sudo vi /etc/fstab

In the vi editor, add the following line:
LABEL=WESTERNDIGITAL none ntfs rw,auto,nobrowse

and then type :wq! to exit the vi editor window. On the terminal run:

$> diskutil unmount WESTERNDIGITAL
$> diskutil mount WESTERNDIGITAL

Note:  Replace WESTERNDIGITAL with the name of your drive in all lines above with the drive name as showing up in finder window.  If your drive name contains spaces, use quotes around the name e.g. “WD DRIVE”.  You can also find the name by running :

$> ls /Volumes/

There will be a Macintosh HD and the other will be your USB/External HDD. It might happen that the finder window will not show your drive once you have made the change mentioned above.  To open the drive with RW mode, run following in your terminal window:

$> open /Volumes/WESTERNDIGITAL

White Water Rafting

With sunny summer days around in the month of June, a friend of mine decided to arrange for white water rafting trip.  Having never done it before, it seemed like a really swell idea and I agreed to do it on a Saturday morning.

We drove to Lotus camp near Placerville, CA early in the morning from San Jose.  The company that provided us services for the day was Action Whitewater Adventures.  Our guide was a cheerful Costa Rican named Marcello.  We had opted for a full day river and that meant rowing for nearly 3 hours at a stretch.  The water was really pleasant and the second part of the river contains some really cool Level 3 rapids.  We had fun the whole day with shoting and screaming and made some friends for the duration of the day who were on another raft but with the same company.  Groupon keeps giving deals for rafting and do keep an eye out for it as a full day of rafting, also including lunch, was about 90$.

At the end of the trip, Action Whitewater Adventures allows you to purchase pictures from the rapids for around 50$ for 1 rapid, 75 for 2 rapids and 100$ if you want to purchase all pictures.  There are some independent photographers around who charge a bit less than AWA, one example being Sierra Nevada Pictures.  Make sure to apply tons of waterproof sunscreen when you go because you will be mostly under the UV rays of sun and I had a severe case of sunburn on my knees.

We were super sore from the whole day activity and went over to Punjabi Dhaba, an authentic punjabi dinner place near I-80 of Sacramento.  We munched on the dinner buffet before heading back home and directly to bed to sleep.


Lastpass Password Manager

I was recently introduced to this Chrome browser extension called Lastpass.  This is a really handy extension that allows you to store passwords for multiple sites.  The advantage is that I have one single 20 character mixed password that I use to log into Lastpass and then using lastpass, I can generate passwords that are 50-100 characters and I don’t have to remember them.  It provides the following benefits:

  1. Extra security:  I no longer have to use the same password for multiple sites so that I remember it.
  2. Autochanging password: One of the nice features is that lastpass reminds you to change password every set duration.  This is useful for banking or applications that contain sensitive data
  3. Sharing passwords: I can share passwords with other users within my team without giving out my actual password and I can then change the password

I just love this service and you should also give it a try.  They have a free version that is really good and once you start using it, you can upgrade to the premium service that is 12$ a year.

Captain America : Civil War Review

**** Star movie!

Captain America: Civil War could very well have been named Avengers as it includes one and all from the Marvel universe.  We have Captain America, Iron Man, Ant Man, Spider Man, Black Panther, Bucky or the Winter soldier, Black Widow, Falcon, Hawkeye, War machime, Vision, and many more appear in the movie.

Captain America wants to save Bucky and Iron Man wants to kill him.  There is another trajectory about the government wanting to possess more control over the Avengers as they have had some civilian fatalities and there are a few that think that they are a hindrance if left to be on their own.  Russo brothers do an amazing job with direction and so does the cast.  There is a scene with Robert Downey Jr. as a teenager that has really good VFX as well as the sequence where the two sides fight each other at the airport is a nail-biting action sequence.  The starting chase scenes are also nicely done and there is no dull moment in the movie where you feel bored.

Lately we have had a lot of movies that are dark and grim with the superhero brooding over the meaning of his existence and it is a relief to have movies like Captain America Civil War bring a fresh perspective to superhero movies.  There are some really witty one-liners especially from Spidey, Iron man (as usual) and Ant-Man.

I would say the movie is a must watch for all superhero fans… Marvel has got movie making business perfectly taken care of and are bound to make Stan Lee millions.

The Comcast Nightmare

After using streaming services like Netflix, hulu, etc. I found a deal with Comcast where they offered a nice TV and Internet bundle for around 50 bucks.  I signed up for a deal after being on a chat for about an hour!  The shipment for the settop box was shipped via UPS and was scheduled to arrive in 3 days.  So far so good!

I had to go out of town for a few days and I was not able to pick the box from UPS at which point I was anyways using the xfinity streaming services so didn’t miss the set top box.  It seems like if you don’t pick the box for cable tv, comcast cancels the other subscription services like HBO thinking you don’t want cable anymore.  They never verified with me or confirmed before cancelling the service for cable TV.  I went into a store and had to ask them to resume the service which after a hour of haggling, the rep agreed to start a new service at the same price.

Today, I finally got the Set top box in mail but they sent me incorrect remote.  Now I can get cable but not use remote to change channels or do anything on the box.  Now I am paying for service that I cannot use and need to walk into a store again to get the right remote.

Although, I have to admit that the customer service has kinda improved since last I contacted them a year ago.  However, a lot seems to be missing with their service.

T-Mobile Torture


I moved to T-mobile last year and apart from occasional glitches, the service is good for what you pay.  However, last week we split our family plan into two separate plans.  I started handling about 7 lines and my friend manages the other 5.  I had a few friends travelling outside the country when we made the change.  2 days after making the switch under my name, all accounts under my name suddenly got suspended!

Cellular technology controls almost everything we do nowadays, ranging from checking emails, streaming radio while driving, watching a show, navigating using Google maps, etc.  My wife was travelling on business and with the service suspended, there was no way for us to communicate.  I called up the T-mobile customer care and they had no clue why the account was suspended.  The only answer I got was a fraud has been detected and there is some discrepancy on your account.  I was asked to fax my ID and SSN card from a T-mobile authorized dealer.  FAX!!!  It is the 21st century and who uses fax anymore?  Also, I don’t carry my SSN card on me at all times.  A warning or heads-up would have helped here.

I went to a store on 1212 El Camino Real, San Bruno and the person working there went over my account, couldn’t figure out what is going on and they told me they didn’t have a fax machine.  I went to another T-mobile location in Tanforan mall, San Bruno.  This time they had a fax machine but it was broken.  I drove down to the south bay as I had to pick my ssn card anyways and went to a store on Brokaw Rd but alas no fax machine again.  I was really frustrated because it had been almost 5 hours without service and driving to different T-mobile stores without GPS was another pain.  Finally, I found a store in Rivermark Plaza, Santa Clara that had a working fax machine and were able to fax the documents.

Once the documents were faxed, there was no way for me to know if they have been received by the frauds team as they are an offline team with no access to customer service reps.  The person at the store mentioned it might well be 24 hours before service will be resumed.  I went home tired and annoyed by the mess.  The next day, I waited till late in the afternoon for my phone to ring but after more than 26 hours without connection, I called the 611 helpline again.  I was told that the back of my ssn card is not clear and so they haven’t started the service!!  There are two problems here

  1. Why would T-mobile wait for me to call them instead of letting me know early in the day that I have to resend the documents?
  2. What in the name of God do you need the back of SSN card for?  There is no information on the back except for some standard message common for all individuals.

I was really agitated by this point and vented some of the anger to the person on phone.  Luckily, they gave me a 24-hour international help center number.  I called this number and spoke to a sensible lady who understood that back of SSN is not at all important and that 8 people are stranded without service.  She was able to get the service resumed in less than 10 minutes!!

I wish that T-mobile gives some sort of warning (24-hours to submit documents) before disconnecting service altogether.  Also, please don’t ask for FAX as not only it is outdated, but most of the T-mobile stores don’t even have the fax machine themselves.

North Yellowstone: Winter 2015


We were discussing where to travel during the thanksgiving break.  We were already late for making reservations and given that it was November first week, most of the famous tourist destinations were either booked or super expensive.  Four of my friends decided to fly over to Phoenix airport and then drive to Albuqurque White Sands national monument for the thanksgiving break.  However, on looking up the state in tripadvisor, it seemed like there was not much to do apart from white sands and given that it would be freezing, camping or staying in tent was not in the option.  While discussing other options, one of my friends suggested Yellowstone… again!

We visited Yellowstone park in 2012 during our christmas break and it was an awesome trip.  Instead of reminiscing about the trip, we decided let’s do the trip again.  Most of the park stays closed for cleaning during thanksgiving break and only part open is a route between Gardiner, MT and Cooke City, MT that passes through Lamar valley.  We called up the West Yellowstone snowmobile company we used the last time named Two Top snowmobile and they confirmed that the park didn’t allow for snowmobiles to go in either.

Finally, the day of the trip arrived and I was super sick with cough and cold and it seemed at a point that I might not go on the trip but I was too thrilled to miss out on it.  We went to pick up our car but the Avis at San Jose airport was out of AWD suv, the kind we needed to drive through the snow storm Cara fast approaching the northern US states.  Moving around from counter to counter at the rental car centre, we finally got a nice AWD SUV with full coverage for ~500$ from Firefly rental.  We started our drive to Yellowstone from San Jose at around 7 pm on 25th November and reached West Yellowstone at around 5 pm on the 26th.  Do make sure to carry food with you as most of the places along the route stay closed for thanksgiving break.  We grabbed lunch at an IHOP in Pocatello, ID and bought some snow tubes from Walmart there.

_DSC0062The drive is a bit longer from West Yellowstone to Gardiner, MT because the internal road from within the park is shut off and that causes us to take a detour via Bozeman.  We had booked a room at Super 8 motel in Gardiner, MT and checking in our stuff, we went right to the North entrance at around 10 PM.  The weather had dropped to a chilly -9 degree F.  However, we got to see a few Bisons and elks resting around a patch of river that had lukewarm water from the volcanic activity in the park.  Tired and stank up from the long drive, we went back to the motel to relax.

The next day we woke up and had a dip at the heated pool in the motel.  They also serve a good breakfast of cereals, toast, yoghurt, coffee, apple and orange juice and boiled eggs.  Many of the places in Gardiner close out early during winter and once you enter the park, it is difficult to find anything to eat unless you cross over the Cooke City.

This slideshow requires JavaScript.


Having had a good breakfast, we left the motel and stopped at mammoth hot springs first.  It is a small spring of hot water that melts the snow and creates nice steam on its way down.  There is a hike that takes you on top of the mountain to get a better view of the valley.  We were able to catch a herd of deers on the park entrance itself.  The whole area had received fresh snowfall and was covered in a white sheet!  It is mesmerizing and beautiful to drive through the open road within the park.  We drove through the Lamar Valley to witness huge bisons just eating through the snow, Elks and deers stopping on the warm street and the hordes of scientists and tourists trying to figure where the wolves are at.  Yellowstone has several packs of wolves and many people visit the park in winter to take a class on the habits of wolves.  We met with a couple from Ireland who showed us how to setup our tripod and shared information with us to visit the park early at around 7 AM the next day to witness packs of wolves in the valley.

We crossed over to Cooke city for lunch at Soda butte lodge.  They had a veggie sandwich for vegetarians and it is possible to rent snow mobiles/skis from Cooke city.  However, we just had our lunch and turned back to Gardiner.  The drive between the two cities takes around 2 hours.  On our way back, we met another group of scientists who showed us Mountain goats on their telescopes.  By the time we returned to Gardiner, the only place open for dinner was K-bar.  I have added information for the restaurants at the bottom of the page.

The next morning, I stayed back as wasn’t feeling well but the others left at around 6 am to catch the wolf packs.  They were able to catch Mollie’s pack and Lamar pack with their telescopes.  It is amazing to watch these wolves walk around the vast valley in early morning.  Everybody was exchanging information about the habits and behavior of the wolves.  Oddly enough my friends also caught a bison mating ritual and it was funny because the male would keep eating, suddenly try to mate with the female and on her rejection, start eating the grass again.

Once the group returned from the wolf chase, we visited Boiling river.  Boiling river is a small natural pool where scalding hot water from the park mixes up with the icy cold river water to provide a lukewarm reservoir for people to bathe in.  There is a small hike to get to the place and in winter the place is not much crowded.  The day we were visiting boiling river, the temperature was -21F.  We took off our clothing and dipped into the warm water.  However, the problem is the water at surface is warm and you still get a icy current at the bottom causing you to scream with cold.  It is a fun activity though and we met a bunch of tourists there.  Getting out of the water is the real ordeal as you are suddenly hit with the force of winter and as soon as I stepped out of the water, my hair turned into solid ice, I stopped feeling my hands and feet for the time I was dressing up.  The walk back to the car from this pool was horrendous with shivers ran through the spine within the large snow jacket and pants.

Places to eat in Gardiner for Vegetarians:


K-Bar is a pizza place that also serves half glasses of beers.  The owner of the place is also a San Franciscan and so we hit it off really well.  He gave us suggestions on the pizzas and we ended up ordering garlic bread with marinara sauce (Their alfredo sauce was watery and tasteless), tostada pizza and a make our own with pesto sauce.  K-bar has really good Pesto sauce and the pizzas were delicious.  Given that we were super hungry after a day filled with snow tubing, waddling snow and running around, we devoured the pizza in no time at all.  We ended up eating twice at K-bar on this trip as this was the only place open till 10 PM.

Yellowstone grill

Yellowstone grill had several veggie options.  We tried their Thai style burrito and black bean burger and both were good.  Their french fries were not that good however but do try out the soup of the day with their grilled cheese which is also delish.  The grill is warm and cozy and is right opposite K-bar.

Tumbleweed bookstore and cafe

Tumbleweed bookstore and Cafe is a small shop with lot of informative books on yellowstone area.  We were lucky to have the owner make warm soup as we entered.  They also had some hummus sandwiches.

Wokking Panda chinese

Wokking panda is a very small chinese place that has a very few vegetarian options.  In case you are bored of the american fare, you can try this place out.  It closes really early at around 8 though so do plan to be here early.  Also, the place can not sit large groups so take out would be your best bet.

Finally, if nothing works there is a subway in a gas station near the park entrance.

Many people claim that Yellowstone is best in summer but we have found it is simply astounding with its wildlife, snow covered peaks, hot water springs and frozen lakes to be a sight to behold in winter.  In case you have time, do stop by at Chico hot springs or Janitzio mexican restaurant in Twin Falls, ID.  A winter wonderland, a heaven on earth; Yellowstone in winter is one of the best places I’ve ever visited.