Microservices on EC2

Network and deployment configuration for setting up microservices with http proxy / load balancer and bastion on EC2. This involves securing the EC2 instance and ensuring client requests are routed correctly to http proxy / load balancer. Setup a common VPC for all EC2 instances, create public and private subnets, enable Internet Gateway for public subnet and setup NAT box for private subnet, and add routing table entries to route traffic. Setup Security Group that allows inbound traffic for HTTP and HTTPS.

Read more

Node, MySQL on EC2

This article summarizes the instructions for configuring an EC2 instance to run Node.js webapp with MariaDB backend, proxied via Nginx. Our first prefence is to use packages available in amazon-linux-extras. Both nginx and mariadb are available in extras. For Node.js we compile from source, install nodejs to yum repolist, perform yum install for nodejs. For production mode setup and to provide resiliency against instance restarts, we manually create systemd service for nodejs.

Read more

AWS Savings Plan

AWS Savings Plan is a flexible pricing model that can help reduce AWS bill by up to 72% compared to On-Demand prices, in exchange for a 1-year or 3-year hourly spend commitment. AWS offers three types of Savings Plans: Compute Savings Plans, EC2 Instance Savings Plans, and Amazon SageMaker Savings Plans. When you sign up for a Savings Plan, you will be charged at the Savings Plan price, which is inclusive of your savings rate, for usage up to your commitment. AWS recommends using Savings Plans instead of Reserved Instances.

Read more

Nginx on EC2

Best practices for setting up nginx webserver on EC2 instance. This involves securing the EC2 instance and ensuring client requests are routed correctly to webserver. We need to setup a VPC which allows public inbound requests, a corresponding public Subnet and Internet Gateway, and routing table entries to ensure incoming requests are not dropped. Next step is to setup a Security Group that allows inbound traffic for HTTP and HTTPS. This is a simplistic single server setup so we will enable SSH for easy administration. For more robust setup, should use Security Manager (SSM) instead of SSH. Since it is a webserver we will allocate elastic IP address that provides static IP address for webserver. We will create user account and install nginx service on the EC2 instance to complete the setup.

Read more

Autonomous Data Bots

Today we are at a place where its practical to deploy autonomous data bots on edge computing to collect data and make intelligent decisions. We have been incrementally moving towards this goal over the past decade. This post delves into the various stages in evolution towards autonomous data bots (1) Remote Agents, HTTP Tunneling & Long Polling (2) Self-Upgrading Programs (3) WebSockets, SSE, and HTTP/2 Server Push (4) Self-Sustaining Bots. sThe data bots are autonomous, manage their own lifecycle while running on edge networks, and communicate with central cloud servers for data and knowledge exchange. Since the data bots have secure access to corporate data they are responsible for real-time data ingestion to the cloud, into a central data lake. The central data lake is used by machine learning models to build knowledge, and knowledge service is accessible by bots and other clients. In addition, there is a relay service running in the cloud that serves as communication mechanism for data bots that are spread out geographically.

Read more

AWS Glacier Backups

A short list of commands to help zip or image data and content into mid-size chunks that can be stored in S3 buckets. Since we are storing backups on AWS S3 Glacier, which needs to be restores before access, we want to keep the number of files reasonable. AWS charges for each API request, so incentive to store bigger files. The max limit on single file is 4GB. So lets go with file size in the range of 100MB - 3GB.

Read more

Grocery Listr App

Grocery Listr is your ONE app for lists. It is a convenient way to organize grocery lists and shopping lists. Create multiple lists, automatically group items into categories, and share your lists with friends and family. Save your favorite recipes and use them to create lists. More details about the app at http://level68.com/glist and you can get the app from iTunes Store. SMART LISTS: Start typing an item name and the app will suggest relevant grocery items. Choose items and the app will automatically add correct category and units. Sort items by category or drag items to reorder. Make copies of a list and manage multiple lists. The autocomplete functionality for items is implemented using Levenshtein edit distance algorithm to allow for super fast rendering. The app builds up knowledge for items as user adds items to lists and this allows for personalized suggestions in autocomplete feature. SHARED LISTS: Share your lists with friends and family and collaboratively work on lists. Add items, cross off items, see updates in real-time, and get instant change notifications. The user identity is verified using Facebook OAuth and the server maintains a sharing graph between users. This allows for seamless N-directional sharing of lists. The app makes use of APN notifications to inform the user of list updates as they are changed in real-time by other users. RECIPE LISTS: Grocery Listr App allows you to create recipes in addition to shopping lists or grocery lists. A recipe is a special kind of list that gets included in the smart search invoked when you enter grocery items to any list. Add a recipe to a grocery list, and the correct quantity/amount of recipe ingredients will be added to your list. The app comes loaded with default recipes, make any list a recipe by turning ON recipe slider.

Read more

Nginx, Node, MySQL on VPS

This is a writeup to setup full node stack on a VPS instance. The min memory requirement for the VM is 256M, but ideally should be 512M or higher. I’m currently using VPS instances from www.ramnode.com . It describes how to setup a VPS (virtual private server) to run Nginx, Node.js and MySQL on CentOS 6.x. Here’s a quick overview of how to secure a VPS (virtual private server) running CentOS 6.x and configure it (1) Secure the server (2) Setup iptables (3) Setup MySQL (4) Setup Nginx (5) Setup Node.js

Read more

Stock4Q 2.0

Stock4Q 2.0 is a rewrite to convert the original UIWebView based app to a native app. It took me much longer to get back to the rewrite; native apps were the new hip thing 2 years ago, but better late than never =).

Read more

Node.js and JavaScript

Functions can take a callback and invoke upon their return value. As a programming style developer should think that a function is never allowed to return to the caller, instead it passes on control to the callback function passed as an argument to it. This provides and effective technique for non-blocking programming. In functional programming, you pass functions around as data, shuffle them around and execute them when needed.

Read more