Saturday, August 31, 2019

How to restart AWS Elastic BeanStalk instances on a schedule

We wanted to restart all AWS Elastic BeanStalk instances at a given time during the day, every day. To perform this task, there are many solutions. Some of them involve, setting up a lambda function and writing some code etc, what we wanted was something quick and not a maintenance nightmare.

Hence, I thought, all we need to do is re-start the instance on a schedule, whats the best way to do it? Cron jobs flashed as a possible answer!

The Problem

The environment we were talking about was an Elastic BeanStalk Auto-Scaling environment, which meant that EC2 instances will be added and removed on demand.

If we were going to use cron jobs, we needed to make sure that whatever instances are currently in service, they all honour the cron job at all times. This means, new instances that get added on demand, in service should automatically have the cron jobs setup on them too!

The Solution

To do this in the easiest possible way, we ended up using the Advanced Environment Customization with Configuration Files (.ebextensions). AWS Elastic BeanStalk has a feature where we could provide configuration files bundled with our web application source code. These files are basically configuration files under the directory named ".ebextensions".

Now, to setup the cron job reliably on Elastic BeanStalk instances, all we needed to do was to add the "cron-linux.config" file under the ".ebextensions" directory and bundle it with the application source code which gets deployed to the environment.

The folder structure would look like this

The cron-linux.config will be YAML file. Here are sample contents of the cron-linux.config file, this setup re-starts the Elastic BeanStalk instance every day at 0530 hrs.

Thats about it, deploying this along with you source bundle on the environment ensures that the environment instances are restarted every day at 0530 hrs without fail!

Wednesday, July 31, 2019

Majestic Meghalaya - Part 3

This is the last post that will cover the remainder of our mesmerising trip to Meghalaya. If you haven't already checked out the Part 1 and Part 2 of this series, I would strongly encourage you to do so right away.

After a full day trek to the Double Decker Living Root Bridge it was time to relax and spend the evening at the hotel. Next day we visited the beautiful town of Cherrapunji. It has got some breath taking scenery. We saw a tall waterfall called the NohKalikai waterfall. It's a very tall waterfall with beautiful stream of water falling throughout the year. It also has an interesting back story to it on why it was named NohKalikai, I am not going to tell the story because locals do an amazing job at narrating it and I don't want to spoil the fun.


After breathing in the beauty of NohKalikai waterfall, we moved on to visit the Mawsmai Cave. The caves are beautiful well maintained. At some points you will have to cross natural water, while at others you have to pass through very narrow zone, overall a great experience.



Next we visited one of the lesser know places called the Garden of Caves near Cherrapunji, it's a beautiful place with lots of things to see in it. We also drank the medicinal mountain water and collected a bit of it in a lush green bamboo stick to carry it along with us.


It was now time to say good bye to Cherrapunji and move on to the last destination in our trip. The formidable Kaziranga National Park.  By late evening we reached our hotel at the Kaziranga National Park. We were all very excited for the next day, especially because in the morning we will be visiting the Park for an Elephant back safari!

Next day, we all woke up very early and reached the Kaziranga National Park gate well in time. Before this I had been to many Jeep and Bus Safaris, but an Elephant Back Safari was a first time event for me. It is one of a kind experience! You basically get to sit on the elephant and mahout takes us in the jungle to see Rhino's, Tiger's, Deer's, Bird's and other wild creatures. 

A funny incident happened during our ride, our elephant decided to race with other elephant nearby and for a good minute or so we were forced participants to our very first elephant race! It was both funny and adventurous at the same time :D

After this safari, we did 2 more Jeep safari one in the evening and another in the morning the next day.
 In addition to the wild animals, Kaziranga National Park is filled with rich flora and fauna.
In the evenings, after the safari we saw the traditional north east cultural program. Lots of talented artists can be seen performing, while wearing traditional north east attire. I would strongly recommend everyone to see it at least once.


Truly, the trip to Meghalay was majestic and mesmerizing. We came back with our hearts filled with joy and lots of love for the beautiful state and its lovely people!

Sunday, June 30, 2019

Majestic Meghalaya - Part 2

In this post, I will cover the remainder of our mesmerising trip to Meghalaya. If you haven't already checked out the Part 1 of this series, I would strongly encourage you to do so right away.

After visiting the beautiful Umngot river, we visited a true natural wonder. The single decker living root bridge, its a natural marvel and I was blown away looking at its awesomeness! 

These wonderful structures have meticulously grown over a period of time and are among the biggest attractions in Meghalaya. In fact I would say this, if you could only see one natural wonder in your life then, do visit the natural wonder of Living Root Bridges in Meghalaya.

No photograph or written literature can justify its beauty, it's one of those things, "You got to see it, to believe it!"
Single Decker Living Root Bridge
We trekked a bit to see the beautiful bamboo tree top structure which watches over the India-Bangladesh border. We reached there at the right time to see the beautiful evening sky.

Evening Sky at India-Bangladesh border view point
After a satisfying day filled with beautiful experiences we were ready to crash into our home stay cottage at Mawlynnong - Asia's cleanest village.

The village is extremely clean, the best thing about this place is, you cannot find any barren piece of land. Every lane, every corner is covered with beautiful greenery. 

We had an enchanting experience while doing our morning walk in the village.



After our hearts were filled with beautiful memories of Mawlynnong, it was time to start moving towards Cherrapunji.

Cherrapunji is also called "Scotland of the East" and it does full justice to this title. Its one of the most beautiful places I have ever visited. On the day when we reached Cherrapunji we decided to do a trek to see the beautiful Double Decker Living Root Bridge. It takes about 8 hrs to go to and fro, but it's well worth the time. One has to climb up/down about 3000 steps one way before you can reach the Double Decker Living Root Bridge. 

The journey itself is extremely beautiful, you pass through beautiful waterfalls filled with turquoise water


You also pass through a couple of hanging bridge, while walking on them you can clearly see whats below you and its quite a thrilling experience.


After the trek and enjoying beautiful nature all along, we finally reached the Double Decker Living Root Bridge and boy what a sight it was!

Double Decker Living Root Bridge


Seeing the Single Decker Living Root Bridge is a marvel in itself, looking at a Double Decker version is beyond words. Near the Bridge there is a small waterfall a water pool. In the pool there are hundreds of small fishes which give you free foot pedicure!


I had initially though, I would fully describe the remainder of our Meghalaya trip in this post, but there is just so much to see and so much to share, it deserves a few more posts!

Sunday, May 26, 2019

Majestic Meghalaya - Part 1

We were looking out for next holiday destination for a family vacations. After evaluating a few options, we narrowed it down to Meghalaya. We had already been to Sikkim earlier and we were extremely impressed with its beauty and overall we had a very memorable experience. We were expecting the same and more from Meghalaya. We booked the customised itinerary via Travel Triangle

I was in for a very pleasant surprise, Meghalaya is not only culturally very rich but also extremely beautiful. The mountains, picturesque villages, beautiful water bodies, lovely landscapes, you name it and its there!

We landed in Gangtok and went straight to the famous Kamakhya Temple. It's a beautiful temple with rich history.

Kamakhya Temple

We reached Shillong pretty late in the evening so we decided crash at the hotel. Next morning, we were greeted with jaw dropping landscapes, beautiful cherry blossoms in full bloom, and beautiful gardens.






Cherry Blossoms

Wards Lake

One important thing that we noticed as soon as we entered Meghalaya is the amount of cleanliness maintained by each and every individual, this is I think a common sight in the entire north east. Sikkim was super clean too!

Next day, we continued our journey towards Dawki and Umgot, on the way you can see some majestic views of mountains with full green cover.


At Dawki you can see the India-Bangladesh border and the friendship gate.

Next we went for a boating trip on the Umgot river.


Umgot river is a beautiful river, you can see the bottom of the river bed through the crystal clear water!



By this time, we were truly mesmerised by the beauty of Meghalaya. In the next post, I will cover the remainder of our trip.

Sunday, March 31, 2019

We Are Hiring!

We Are Hiring! Yep, you head me. We Are Hiring!

If I had to describe my entire journey at Makkajai in one word, it would be "FUN". Every single day has so much to offer, new challenges, newer and bigger problems to tackle, lots and lots of learning and above have lots of fun!

It's a company that I co-founded, so I am programmed to like it. However, here are some data points that might help you decide for yourself. Here is a small list of achievements from the past year

  • We have written code in about 8 different programming languages.
  • Build lots of tools and services to enable our marketing team drive organic growth
  • Built and released 3 new games, with a very thin DEV team.
  • Did numerous hours of play testing of our games with actual kids. Incorporated play testing feedback into our apps.
  • Our Content team built 60 books worth of printables which is available to print from our apps

We are growing, we want to do even more awesome stuff.

If you are bored doing routine stuff, if you are in your comfort zone and that scares you, here is your opportunity. 

Click Here to see all our open positions, apply only if you don't fear challenges and are ready to make a real impact on learning outcomes for millions of kids worldwide!

Wednesday, February 27, 2019

How To Pass User Defined Properties To Android APK

We were looking around for ways to pass additional information to our Android app at run time. Main intent behind this was, to effectively test certain flow in the app - one such example would be the In-App Purchase flow.

One way of achieving this is by setting properties via ADB and reading their values from within the app via code. This post is about documenting the steps needed to achieve this.

There are two main parts to the solution
  • Setting the properties via ADB on the command line
  • Reading the property value from within the app via code and using its value to alter the app behaviour.

Without further ado, let's look at the actual code needed to achieve both parts.


The Solution

Setting the properties via ADB is pretty straightforward and we can easily do it with one line of code as follows


Here we are setting the property "log.tag.GITIAP" to value "DEBUG"

Reading the property value from within the app via code, needs a little bit of work. Here is the full code that will let you read the property "log.tag.GITIAP".


That should do it! When you call the method "PropertyHelper.initializeProperty()" it will set the value of "gitIAPValue" to the value that was passed via ADB.


Thursday, January 31, 2019

The EMI on Card Scam

It's pretty common practice to convert big spends on EMI. The EMI is sometimes marketed as "No Cost EMI" and sometimes it comes at a declared interest rate. Whether we purchased the goods online or from physical stores, option to convert the transaction to EMI is available.

This post describes, how Customers are scammed into paying more by the Card companies by hiding an important detail related to the EMI conversion.

Recently, I bought a Mac Mini for Rs. 100605. Because of its high cost, I decided to convert the transaction to a 24 month EMI. At the time of purchase the sales people explained me that, I will be charged 15% annual interest on the EMI transaction.

They told me, the total Interest charged over 24 months would be Rs. 16467. Hence at the end of 24 months, I would be paying Rs 100605 + Rs 16467 ~ Rs 117072.

This was perfectly fine with me as I knew exactly what I was getting into and how much extra I am paying.

After the transaction was over they even gave me a charge slip which had the details of the transaction such as

  • Tenure : 24 Months
  • Base Amount: INR 100605.00
  • Applicable Interest Rate (P.A.): 15%
  • EMI Amount: INR 4877.99
  • Total Amount (with interest): INR 117072

All of the above details were clearly mentioned on it. Below is the picture of the actual charge slip I received. Focus on the Red box for now, which highlights the above details.

Charge Slip

Notice how the "Total Amount (with interest)" matches the exacted total amount we calculated above. Till this point, I was super happy, transaction was done with transparency. I knew exactly how much am I paying. I even told my friends that these EMI transaction are great and now they have become pretty transparent.

Little did I know, I am in for a big surprise. After a few days, I was sent an Amortization Schedule from the bank. Out of curiosity, I checked the schedule to see if the totals are matching up. To my surprise, bank was charging 18% GST on top of the interest! 

On the interest amount of Rs 16467 they are charging 18% GST. This was over and above the marketed 15% annual interest.

This meant that, I am paying Rs. 2964 extra on top of Rs 16467 interest. It translates to extra outflow of Rs 16467 + Rs. 2964 = Rs 19431. Total outflow = Rs 100605 + Rs. 19431 = Rs. 120036! 

Here is the Amortization Schedule sent to me by the bank.

Amortization Schedule


Whats the scam here? 

Card company choose to conveniently hide the fact that GST will be charged over and above the marketed interest payout. No where on the charge slip do they mention the total outflow as Rs 120036. In fact they scam the customers by mentioning the Total Amount (with interest) = Rs. 117071.

Now sift your focus to the Green rectangle of the charge slip, bank simply mentions that "GST applicable on Interest and Processing fees" now thats convenient!

I was never told about this before the transaction. In fact, I had failed to notice this line even after the transaction. Only when I checked the Amortization Schedule and checked the charge slip again, I realised how I was scammed!

Please, please beware of what you are getting into and how much extra are you going to pay for any EMI transaction! Generally speaking customers end up paying 2.5-3% extra interest over and above the marketed annual interest rate!

Have some Fun!