Sunday, July 17, 2016

Do us a favor, GOP - do not nominate Mr. Trump

This is a cry in anguish.

As a nation, we are about to commit a travesty and nominate a racist, egomaniac, misogynist and generally unfit for office, candidate for President. To show that these are not merely "labels", allow me to provide instances that illustrate these traits in Donald Trump. In fact, there are so many outrages that is hard to keep track of all of them, put them in context and list them here.

When Indiana-born U.S. District Judge Gonzalo Curiel was hearing a suit against Trump University, Donald Trump went on a tirade against the respected, federal judge "because he is a Mexican". His bigotry does not stop there. When he saw an African American in one of his rallies, he remarked, "Look at my African-American over here".

Aside from Trump's public, sexist behavior (at the Republican debate) against Fox's Megyn Kelly, he has consistently insulted, stereotyped and belittled women. He has taken the time to insult notable women like Sarah Jessica Parker, Bette Middler, Rosie O'Donnell and Cher. In fact, the Telegraph maintains a site that keeps track of all his offensive remarks!

His shocking ignorance of government policy is even more appalling. I think Cheryl Cook-Kallio's We The People students at Irvington High School know more about Government than Donald Trump. He appears to know next to nothing about the issues that would confront him in the job. If you like chilling horror stories, read the transcript of his meeting with the Editorial Board of the Washington Post. It is not as if the editors were trying to play "gotcha" or "trap" him. In response to straightforward questions, Trump's responses are vacuous. On topics ranging from racial disparity to foreign affairs his responses are vague. As Eugene Robinson aptly opined, "How is it conceivable to put a man who knows so little in charge of so much?"

The likes of George Bush (father and son, the 41st and 43rd presidents) and Mitt Romney have shown statesman-like courage and refused to show their support to Trump. In fact, the only living republican president or presidential candidate who will be at the Republican Convention is 92-year old Bob Dole. Even the most ultra conservative republican journalist, George F. Will has written an eloquent, scathing attack on Donald Trump.

I think President Obama summed it best when he said, in six short sentences, everything that is wrong about Donald Trump. This is not party politics playing out. Just a concerned citizen expressing his opinions.

Despite all of this, there are some polls that show Trump ahead of Clinton in the race to the White House. It is too late in the process to find another candidate to represent the Republican Party. So, this is a request to the GOP to sit this one out. Do not endorse Donald Trump. He has indicated that he will run as an independent. That is better than sullying the party of Abraham Lincoln (1861), Theodore Roosevelt (1901), Dwight Eisenhower (1953) and Ronald Reagan(1981). You can have your convention and groom candidates for the 2020 elections. Have the dignity and courage to say that there will not be a representative of the Republican Party in the 2016 elections.

After I published this blog, I came across a video (embedded in the following NY Times article) where David McCollough expresses a similar opinion more eloquently.

Sunday, December 27, 2015

The Martian

Being a Silicon Valley Engineer, one's interest is piqued when reading about Andy Weir's story about how he self-published his book - because no publisher wanted to touch it. After it became popular on Kindle, Crown Publishing finally published the book - that Joe Morgenstern (of Wall Street Journal) said was the best pure science fiction novel in years.

When the book is made into a movie directed by Ridley Scott, it became a "must see".

The movie certainly did not belie expectations. The thesis of the movie is how astronaut Mark Watney (played by Matt Damon) is presumed dead after a fierce storm and gets left behind on Mars. Watney survives the storm and must draw upon all his ingenuity, training, science, engineering, wit and spirit to subsist to find a way to signal to the command center in Earth that he is alive. You love the way Watney uses-science-to-solve-problems. Even the non-science folks in the audience will find themselves applauding and egging him on to succeed. Sometimes he is foiled by Nature and sometimes his is foiled by error. He never gives up even when all hope seems to have faded.

The most appealing facet of the movie to me was the fact that it had no gun-toting, evil-minded villain. There is a sense of humanity and instinct of survival built into every frame. You find yourself rooting for Matt Damon not for some contrived reason (of getting back home to his anxious, forlorn wife or children), but because you want his courage, hope and doggedness to succeed.

Inevitably, this movie will be compared to Appolo 13. Twenty years later, I must admit that I watch reruns of the Ron Howard classic. Appolo 13, however, had too many emotional strings and sentimentality. Martian, on the other had, succeeds with wit and humanity. It is incredibly enjoyable and totally worth watching

Friday, December 19, 2014

Freedom (or lack thereof) of Expression

Earlier today, the FBI formally accused North Korea as the perpetrator of the cyberattack that brought Sony Pictures to its knees resulting in their caving into the demands of pulling the movie The Interview from theaters. This work of fiction has a plot where journalists secure an interview with North Korean dictator, Kim Jon-un. They are subsequently instructed by the CIA to assassinate him. For North Koreans, the plot "touched a nerve inside the regime, which takes a dim view of satirical treatment of its leaders and is notoriously paranoid about perceived threats to their safety." There are a couple of facts in this chain of events that baffles me:
  1. A sophisticated cyberattack (arguably the most damaging attack carried out against an enterprise) was carried out in a country where citizens are thought to lack basic internet access
  2. Hollywood executives reportedly screened the ending of The Interview to the state department and got their "official blessing"
This is certainly not the first controversial film to be made by the film industry. Recently, there was an outcry when the screening of Kamal Hassan's Vishwaroopam was banned in Tamil Nadu because it portrayed Muslims in poor light. This ban, however, was executed by the Government - in the pretext of promoting "Cultural Harmony". If anything, President Obama came out saying that Sony made a mistake in pulling the film. I can't think of any other time in history when the studio capitulated to threats.

The Interview was slated to be released on Christmas Day - along with other blockbusters including the final Hobbit film. Despite its decent reviews, it would have been hard to make a huge impact in the BoxOffice. With the pulling of the film, almost every one will want to see it when it is ultimately released.

Friday, November 21, 2014

Starting replication for a very large MySQL database on Amazon EC2

In this post, I will outline steps used to start replication of a very large MySQL database from scratch.

Here is the problem that we faced:
  1. I had set up Master-Slave replication for a MySQL database in the beginning (using the simple steps outlined here)
  2. On both the Master and the Slave server, I had /var/lib/mysql point to an, IOPS optimized, EBS disk
  3. Since this data was very critical, I had set up a cron job to backup the database on the slave server
  4. I was monitoring the Master MySQL server with NewRelic and set up alerts when CPU, Memory or Disk consumption reached certain thresholds
  5. There were three mistakes that I did (for those of you setting this up from scratch):
    • Not setting up NewRelic on the Slave Server
    • Performing the backup on the same EBS disk as the DB partition
    • Not "cleaning up" or archiving older backups
  6. As a result of these mistakes, the Slave EBS disk became full and replication stopped
  7. I was blissfully unaware of this until a few days passed
  8. I cleaned up the Slave EBS disk, but I did not know where or when the replication stopped. So, I could not just resume the replication
At this time, here were the constraints that we were dealing with:
  1. There were already over 10m records in some tables and 60m records in some other tables.
  2. This was a live, production, system - so shutting it down (with a READ LOCK) was not an option
  3. Performing the replication and doing the database back up remained to be critical
  4. This task had to be completed in a few hours - because without it we ran the risk of being exposed
These constraints ruled out:
  1. Following the replication steps in the beginning of this post - since we could not do a READ LOCK
  2. Backing up the Database (on the Master) and restoring on the Slave - this would take too much time
Given these requirements and constraints, all the documented methods for resuming the Master Slave replication were ruled out. Here are steps taken to accomplish this task:

On the Master server:
  1. Edit my.cnf

  2.  server-id=1  
     binlog-format= mixed  
     binlog-do-db={DB to replicate}  

  3. Restart Master MySQL server

  4. In the mysql command line on the Master, run the following commands:

  5.  CREATE USER replicant@{SlaveDBServerIP};  
     GRANT REPLICATION SLAVE ON *.* to 'replicant'@'{SlaveDBServerIP}' IDENTIFIED BY 'r3pl_us3r';  
     GRANT RELOAD ON *.* TO 'replicant'@{SlaveDBServerIP};  
     GRANT SUPER ON *.* TO 'replicant'@{SlaveDBServerIP};  

  6. Take a back up of the database in the Master MySQL  server using:

  7.  mysqldump -u {user} -p{password} --skip-lock-tables --single-transaction --flush-logs --hex-blob --master-data=2 -A > dump.sql  

  8. Get the master_log_file and MASTER_LOG_POS from the MySQL dump:

  9.  head dump.sql -n80 | grep "MASTER_LOG_POS"  

  10. On your AWS console, take a Snapshot of the Volume housing your Master MySQL DB:
  11. Now create a Volume using the Snapshot-Id from above in the same AZ as the SlaveDB

  12. Attach this Volume to the SlaveDB instance
On the Slave Server:
  1. Point /var/lib/mysql to the mysql directory in the newly attached volume

  2. Start MySQL and verify that the MasterDB is now available on the slave server. Note that some records (towards the end) may be missing. That is ok. The steps that we will perform below will sync the DBs.

  3. Edit my.cnf

  4.  server-id=101  
     binlog-format = mixed  
     log-bin = /var/lib/mysql/mysql-bin.log  
     relay-log = /var/lib/mysql/mysql-relay-bin  
     log-slave-updates = 1  
     slave-skip-errors = all  
     read-only = 1  
     binlog-do-db={DBs to be replicated}  

  5. Restart the Slave

  6. In the mysql command line, run the following commands

  7.  change master to master_host={IP.Address.Of.Master},  
     STOP SLAVE;  

    The Output will look similar to this:

     Slave_IO_State: Waiting for master to send event  
     Master_Host: master_ip  
     Master_User: rep_user  
     Master_Port: 3306  
     Connect_Retry: 60  

    It may take a while to reach this state - depending on how many records need to be synced

Monday, July 28, 2014

Remembering Amma ...

Last week (the week of July14th) there were a few events to commemorate the one year anniversary of the passing of Amma, Smt. Sharada KrishnaMoorthy.

On Wednesday, July 16th, was the "Oona masyam" ritual. On Thursday, July 17th, there was a "Thiruppgazh Anbargal" Sharada Krishnamoorthy Ninaivanjali Bhajan. Below are a few photos from this Bhajan (you may click on the photo to see an enlarged version of it):

A short, sample, video from the Bhajan is included here:

On Friday, July 18th was the "Sodha Kumbam".  Then on Saturday, July 19th was the "Masiyam", followed by the "Shrardham". This was attended by a few close relatives. Some pictures from this day are uploaded into this album:

The final "Subha Sweekaram" function was on Sunday, July 20th. This was very well attended by friends and relatives. Pictures from this day are uploaded into this album:

The following is the text of the "speech" that I gave at the conclusion of the event.

I started by rendering Unnikrishnan's "Uyirum Neeye" as a dedication to Amma:

I thank all of you for taking the time from your respective schedules to be present here to pay homage to Amma's soul.

Let me begin by narrating a short story. There was a king who received a gift of two magnificent falcons when he visited a neighboring kingdom. They were peregrine falcons, the most beautiful birds he had ever seen. He wanted to see these birds everyday - so he placed them on a tree outside his bedroom.

The king was, however, disappointed that though one of the falcons was flying majestically and soaring high in the sky, the other bird did not move from its branch since the day it arrived.

The king summoned his ministers, healers and sorcerers from all over his kingdom to tend to the falcon, but no one could make the bird fly.

He then announced a reward to anyone that could make the bird fly.

Soon, a woodcutter walked into the court and said, "I can make the bird fly".

The next morning, the king was thrilled to see the falcon soaring high above the palace gardens. He summoned the woodcutter to give him the reward. After giving him the reward, the king asked him, “How did you make the falcon fly?”

With his head bowed, the woodcutter said to the king, “It was very easy, your highness. I simply cut the branch where the bird was sitting.”

Many of us (and I include myself in that category) are like that second bird. We have our comfort zones and are hesitant to stray away from that zone. Amma was different. She was like the first bird - soaring all the time. She was always trying new things. I am sure that up there, Steve Jobs is continuing to innovate and when he needs somebody to test out his latest innovation, Amma is one of the first to try it!!

She was creative and passionate about art and music. If she had to sing at a wedding - whether it was Preethi and Mani's wedding in Maryland or Janani and Avinash's wedding in Chennai, she would compose a song for the occasion, set it to a unique tune and render it at the wedding. In contrast, when I decided to sing today, I merely repeated a popular Unnikrishnan song. Given her interest in music, I would like to announce that we are establishing a trust in her name. This trust will be focused on teaching young children music and other art forms. We are still in the process of establishing the trust, etc. We will provide details of the trust and other relevant information at the following URL: I have contacted the founders of They have agreed to include Amma's profile. I am in the process of creating and sending this to them. These details will also be available at

I would like to conclude by playing a lullaby. You may think of this symbolically as a lullaby for her soul. She used to sing this lullaby to us when we were children. Later, she would sing this to her grandchildren - when we recorded it (on cassette tapes) and digitally transcoded it. Another tidbit about this song is that it was originally composed by Irayimman Thampi - a composer from Kerala. When Bombay Jayashri was nominated for the Oscar for Pi's Lullaby, Michael Danna and Jayashri were sued by the Irayimman estate for plagiarism. It was finally determined that the lyrics are generic enough that it would not constitute any intent to plagiarize . In essence the lyrics imply that a child sleeps not because he is sleepy, but because he feels safe. In some sense, by playing this lullaby, we are wishing Amma's soul a safe passage. There was no Wikipedia when this song was recorded. So, she did not know the lyrics of the whole song. In her own creative style, she concludes the song with a verse from another Neelambari song!

Sunday, June 1, 2014

Go to your room, Mother - a play by Sanjiv Desai

When I got word a month or so back that two of my class-mates (from undergraduate in BITS, Pilani) were involved in a play, I had to get tickets in a show of support. I had seen an earlier play, Noor, from the same production unit a year or so back and had enjoyed it thoroughly - particularly the acting of Sanjiv Desai who did a fabulous job in the role of a eunuch (in whose eyes the story unfolds).

This time, Sanjiv Desai had written the play. I learned that he was not making the trip from Delhi this time around. Another friend, Amit Sheth, had designed the sets and the sound.

The play was at Montgomery Theater in downtown San Jose. It was being done as a benefit for Maitri - a non-profit organization helping families from South Asia facing domestic violence.

The play starts with us learning of the demise of a successful businessman, Mr. Dalmia and how his widow, Purnima Dalmia (played by Seema Karnik) is suddenly faced with the realities of having to deal with finances, bills, etc. In a moment of weakness, her daughter-in-law, Rita Mansingh (played by Sindhu Singh) asks her to move in with them. The next, delightful, sequence is played out between Rita Mansingh and her husband, Rajiv Dalmia (played by Basab Pradhan) - where she tells him that (since they are empty nesters), she invited his mother to stay with them. She leaves the task of informing her own mother, Sheela Mansingh (played by Rashmi Rustagi) to her husband, Rajiv. By the time Rajiv informs his mother-in-law, Purnima has already gloated about her "status" to Sheela. Rajiv is left with no choice but to ask Sheela to move in with them as well.

The rest of the play is the adjustments that the one-big-happy-family need to make. Some scenes seemed a bit long drawn (such as the one where Purnima and Sheela decide which room they will take), while the others were witty and had some very clever dialogs - "If God has any sense, he will stay away from this place". Overall, the play was fast paced and the plot was well developed. The acting by the four main characters - Basab, Sindhu, Seema and Rashmi was simply awesome. Given that the entire play is set in the kitchen and bedroom of Rajiv and Rita's house, the set change between scenes was minimalist. Yet, it was quite amazing to see how quickly the actors changed clothes between scenes.

I noticed that the audience was mostly South Asian. At the intermission, I asked some of the ushers (who seemed to be the only caucasians watching) if they were liking the play. She said, "It is nice to see that the issues are the same across cultures. I am enjoying every bit of the play."

Overall, a thoroughly enjoyable evening. Some of the dialog was risque with double entendre. However, it was never "out of place". The characters were definitely believable in a modern day context. Congratulations, Sanjiv. Wishing more successes to this play and look forward to your next one.

Sunday, April 6, 2014

Panel on "Is Analytics the Killer App for Big Data"

TiE Silicon Valley hosted a panel on "Is Analytics the 'Killer App' for Big Data" on Wednesday, April 2, 2014.

The panel was moderated by IBM's Piyush Malik. Piyush started the meeting by setting the stage and providing context. Enterprises have been using analytical technique and statistical modeling for quite some time. A typical path has been  Reporting -> Discovery -> Analysis -> Alerting -> Forecasting -> Simulation ->Modeling -> Optimization -> Stochastic Optimization -> Cognitive Analytics.

The democratization of Data (due to the "Big Data" phenomenon) has allowed the application of analytics to take this leap forward. In the 1990s the data was on premise and technologies like Terradata were used to provide Descriptive Analytics. The cost for this was a prohibitive $1m / TB. In the 2000s, companies like Neteeza (acquired by IBM in 2010), Greenplum, asterData (acquired by Terradata in 2011) and Informatica used massively parallel architectures to bring this cost down to $100k / TB. Today, using Hadoop and Cassandra stacks with NoSQL and Cloud platforms, companies like MapR and Datastax and able to deliver Predictive Analytics moving towards Cognitive Analytics for a mere $1000 / TB.

While answering the question, "Why BigData?", Piyush said, "1 in 2 business leaders do not have access to the data that they need".

I was reminded of a talk (in the late 90s) by Bill Perry that I had attended (while I was at Sun Microsystems). He was recounting his experience when he was Secretary of Defense. He said that often times, he was asked to make decisions when he did not have all the required data. Yet, the impact of his decision could mean life or death for the soldier. "You have to trust your gut," he said. "Don't always lean towards what will make you 'popular'".

Arif Janmohamed, Partner at Lightspeed Ventures spoke next. He spoke to LSVP's investments in MapR and Datastax affirming their commitment to BigData and the opportunity that the VC community saw in BigData.

Chris Jones, Director of Analytics at AAA was the next speaker. He spoke of his experiences as a consumer and producer of Big Data through his career that spanned Intuit, Adobe, Zynga and AAA.

Sai Devulapalli, Director of Analytics at Ericsson spoke about how they use BigData at Ericsson to make predictions about:

  • Customers - Behavior, Experience, Churn
  • Devices - Uptake, Performance, Failure
  • Networks - Performance, Failure
  • Campaigns - Uptake, Network Impact
  • Services - Uptake, Performance, Failure, Network Impact
Janet George, Managing Director of Accenture Technology Labs spoke next. Previously, Janet worked at eBay and on Hadoop while at Yahoo. She spoke about life events for Small and Medium Businesses and the importance of data in the stages of Expansion, Consolidation and Change in Ownership.

The panel provided an overarching viewpoint on the impact of BigData in enterprises today. However, I felt that some of the bigger questions were left unanswered. No one was willing to talk about solving "Grand Challenge" problems. How about using Big Data to:
  • Find a cure for Cancer
  • Predict the next Earthquake
  • Drug Discovery
If, at the end of the day, Enterprises are able to use "Big Data" to predict which brand of toothpaste I am likely to purchase next, we should be pooling our collective resources elsewhere.