Monday, April 27, 2020

Setting up VSCode for Go Programming

  • Idea behind Golang is to minimize the number of lines of code.
  • Primary use of Go is to write server-side programs or command line programs.
  • Creators of Golang - Ken Thomson, Rob Pike and Robert Griesemer
  • Modern standard library
  • Compile to single native binary - no runtime required.
  • Has garbage collection built in
  • Simple, strongly-typed, procedural language with object oriented features - very few language features have been added since 1.0 release
  • Built-in concurrency
  • Fast to compile and run quickly
  • Some popular Go projects:
    • K8s
    • Docker
    • Prometheus
To setup an IDE for Go - Visual Studio Code is a good choice.
  • Setup VS Code for Go development by installing the “Go” Extension from Microsoft
  • Also install the Go packages by:
  • Cntl + Shift+ P or View > Command Pallet
  • Enter: Go: Install/Update Tools
  • Select All and Click OK.
  • Go to Settings for Go Extensions - Look up “Infer GoPath” setting and enable/check it.
Now you should be able to use the IDE to edit and compile/run go code.
Also watch this screencast https://www.youtube.com/watch?v=XCsL89YtqCs on writing, building, installing and testing Go code.
Set GOPATH environment variable to a directory where your go code will reside.
For example: ~/go directory.
export GOPATH=~/go
Under ~/go create 3 directories that go requires:
src, pkg and bin
At any point look for the go documentation as:
> go doc fmt.Println

Following is a hello world program that will go in ~/go/src directory.

package main
import "fmt"
func main() {
    fmt.Println("Hello, World")
}

In VS Code launch the Terminal (Cntl + Shift + `) or Terminal > New Terminal.
To build the program:
> go build hello.go
> ./hello
To directly run the program and not build it first:
> go run hello.go

Tuesday, April 21, 2020

Creating a docker swarm cluster with virtualbox

On the host system:

1. Install virtualbox:
sudo apt install virtualbox

2. Install docker:
sudo apt install docker.io

Add user to docker group:
sudo groupadd docker
sudo usermod -aG docker $USER

Either manually create 3 VMs (1 manager and 2 workers) or use docker-machine.

Note: With Secure UEFI boot enabled in BIOS installation of virtualbox requires us to generate a MOD key protected by password. When installation completes we are required to reboot and then enroll the MOD key by entering the same passphrase for the key.


Approach 1 - Manually create 3 VMs  (1 manager and 2 workers) - Recommended
Networking for the 3 VMs should meet the following requirements:
1. We should be able to ssh to each of the ubuntu VMs from host system.
2. We should be able to access internet from ubuntu VMs. This is required for the docker registry access.
3. Lastly, each VM should be able to reach the IP address of other nodes in the cluster.

If installing ubuntu VMs also install docker -- this can be selected during OS install .. but you will still need to add your user to docker group post installation.

To setup networking for the VMs:

1. Virtual Box > Host Network Manager > create an adapter (it will be named vboxnet0 by default) say with the following config:
DHCP - Enabled (though this is not best way but generally the IP allocated to a VM wont change and it saves the effort of manually configuring the static ips on each VM)

Refer - https://www.tecmint.com/network-between-guest-vm-and-host-virtualbox/

Configure Adapter Manually :
IPv4 address: 192.168.56.1 -- this becomes the gateway address
IPv4 Network Mask: 255.255.255.0
Leave the IPv6 settings to default

On DHCP tab:
Server Address: 192.168.56.100 -- the DHCP server
Server Mask: 255.255.255.0
Lower Address Bound: 192.168.56.101 -- first VM's ip address can begin with this.
Upper Address Bound: 192.168.56.254

2.  Select each ubuntu VM > Settings > Network > create 2 Network Adapters.
Network Adapter 1 ->
  • Check the option: “Enable Network Adapter” to turn it on.
  • In the field Attached to: select Host-only Adapter
  • Then select the Name of the network: vboxnet0
Network Adapter 2:
  • Check the option: “Enable Network Adapter” to activate it.
  • In the field Attached to: select NAT
For ease of being able to ssh to VMs by name:
Add the following entries to /etc/hosts (change to your preferred names) on the host system:

192.168.56.101  manager
192.168.56.102  worker1
192.168.56.103  worker2

Also to enable ssh without password:
create ~/.ssh directory and a file under it called authorized_keys
mkdir -p ~/.ssh
echo "[public key]" >> ~/.ssh/authorized_keys

Now you can ssh to the VMs without having to type in the password. For e.g.:
ssh [user]@manager 

Once on the VM, try doing nslookup www.google.com and verify the internet connection is working.
Also verify you are able to ping the other 2 node ips.

Approach 2 - Use docker-machine
To create via docker-machine use the command though i prefer the above approach as it gives more flexibility to choose our preferred OS version to install instead of having to live with the version that comes with docker-machine. Also with docker machine approach you end up running one additional VM which runs docker. On a Linux host we dont need that as docker engine can run natively on the host system rather than requiring a separate docker host VM.

docker-machine create -d virtualbox default

The above command will create a VM with name "default" that will be used as host for running the docker engine and additionally will create 3 nodes for swarm cluster.

To Setup Swarm mode:
On Manager node:

$ docker swarm init --advertise-addr 192.168.56.101:2377 --listen-addr 192.168.56.101:237

where, 192.168.56.101 is this manager node's ip address.

We only have one manager which also is the leader. Docker swarm supports having more than one manager nodes but there can be only one leader among them at any given time. We run the swarm init command on the leader node and all other manager nodes will then join the swarm cluster using the manager token.

On 2 Workers:
Run swarm join command for worker nodes to join the swarm cluster.

$ docker swarm join --token SWMTKN-1-4azauf7ujxp711zzwb1ihfluqjy5om6pa4zlicmm7pq3l0svcp-d2bgy5mtsl0w82n99suvb1uu6 192.168.56.101:2377 --advertise-addr 192.168.56.102:2377 --listen-addr 192.168.56.102:2377

The above command will be given in o/p of swarm init.

To get the above commands again anytime following commands can be used on the manager node to get it:

docker swarm join-token manager
docker swarm join-token worker

Running docker info will show there is 1 manager and 3 nodes in swarm cluster and that swarm is active. It will also show if the current node is a manager or not.

To deploy a test app (an example from nigel poulton's course on pluralsight.com).
docker service create --name psight1 -p 8080:8080 --replicas 5 nigelpoulton/pluralsight-docker-ci

docker service ps psight1

The above command will show which node is each replica running on.

$ docker service ps psight1

ID                  NAME                IMAGE                                       NODE                DESIRED STATE       CURRENT STATE            ERROR               PORTS
jk55y1btc0mo        psight1.1           nigelpoulton/pluralsight-docker-ci:latest   worker2             Running             Running 40 seconds ago                       
3tlq4zb5s78m        psight1.2           nigelpoulton/pluralsight-docker-ci:latest   worker1             Running             Running 40 seconds ago                       
tonkv7bmjei5        psight1.3           nigelpoulton/pluralsight-docker-ci:latest   worker2             Running             Running 41 seconds ago                       
znoek7dwq6x5        psight1.4           nigelpoulton/pluralsight-docker-ci:latest   manager             Running             Running 41 seconds ago                       
teg2amzw2f73        psight1.5           nigelpoulton/pluralsight-docker-ci:latest   worker1             Running             Running 40 seconds ago                     

That's it! Now we have a working swarm cluster that we can use to deploy apps on.

Using pyenv for managing multiple python versions

Reference: https://realpython.com/intro-to-pyenv

Working on projects that require different python versions... pyenv can help manage the multiple python versions for each project by installing multiple python versions locally or even makes working with virtualenv easier (no need to activate and deactivate every time when we switch into and out of a project).

Install pyenv on ubuntu:

$ curl https://pyenv.run | bash

Add these lines to .bashrc or .zshrc

export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

Now restart your current shell:

$ exec $SHELL

Using pyenv:

pyenv installs all python versions under ~/.pyenv.

$ pyenv install --list | grep " 3\.[678]"

$ pyenv install -v 3.8.2

The above command will install python version 3.8.2

➜  ~ pyenv versions                       
* system (set by /home/rwatsh/.pyenv/version)
  3.8.2
➜  ~ pyenv which python
/usr/bin/python

As seen above, currently the system's python is active.
To change to the new python we installed:

➜  ~ pyenv global 3.8.2

➜  ~ pyenv which python
/home/rwatsh/.pyenv/versions/3.8.2/bin/python

➜  ~ pyenv versions 
  system
* 3.8.2 (set by /home/rwatsh/.pyenv/version)

➜  ~ python3 -V     
Python 3.8.2


The pyenv which python command shows that python 3.8.2 is installed under pyenv root directory ($HOME/.pyenv). Pyenv builds python from source and installs it under its root directory. 

Creating virtualenv via pyenv:

➜  pyenv virtualenv 3.8.2 myproj
pyenv-virtualenv: `/home/rwatsh/.pyenv/versions/myproj' already exists.

Then in your project directory run:

➜  pyenv local myproj           
(myproj) ➜  myproj 

This will use the virtualenv under your local project directory. It creates a .python-version file to track the virtualenv being used in the project directory.

(myproj) ➜  cat .python-version 
myproj

(myproj) ➜  pyenv which python 
/home/rwatsh/.pyenv/versions/myproj/bin/python


Since we added eval "$(pyenv virtualenv-init -)" to run in your shell virtualenv associated with the project directory will automatically be activated when we cd to that directory and deactivated when we move out of it.

We can also manually activate or deactivate as:
$ pyenv activate 
$ pyenv deactivate

Thus, with pyenv we can:

  • Install multiple versions of Python
  • Switch between the installed versions
  • Use virtual environments with pyenv
  • Activate different Python versions and virtual environments automatically

Sunday, April 19, 2020

Using Sublime Text 3


I had purchased the license of Sublime Text 3 couple years ago when i was using it on my Mac. But there were other options available on Mac then and for whatever reason i did not end up using Sublime Text on Mac as much as i had expected to. The good thing about this editor is it is cross-platform and so is its license (which was a pleasant surprise). When i moved to using Ubuntu 19.10 last year i could get all my programming IDEs on it but i still needed some light-weight text editor for taking quick notes and writing quick programs and scripts. I tried out Sublime Text 3 and my old license that was not getting any use and it worked like a charm. I can now use my Sublime Text for that purpose and it is serving me well.
I like this cheat sheet (which by the way is the first one a google search for a cheat sheet for Sublime Text will return) - https://www.makeuseof.com/tag/sublime-text-keyboard-shortcuts-cheat-sheet/

Sunday, February 09, 2020

Ubuntu 19.10 on T490

I got a Lenovo thinkpad T490 in November 2019. It came with windows 10 home, 8GB built-in (soldered to board) RAM and 256 GB SSD with i5-8265u CPU (1.6GHz) quad core. Display size is 14" (1080p). Thinkpads are known for their excellent keyboard and i wanted to get a laptop with a good keyboard for mostly coding and personal learning (taking notes and practicing as a i learn something new). I got a macbook pro in 2015 and it still serves me well but it is a 15" macbook pro which is heavy to carry around. The T490 weighs about 3lbs and is pretty sleek.

I got a 1TB SSD and 16GB of RAM to upgrade the laptop. There is only one SSD slot so i had to replace the 256GB SSD with 1TB one. There is one external RAM slot and it had nothing on it so i added the 16GB RAM to it thus making total of 24GB RAM. Then i installed Ubuntu 19.10 (the latest as of that time) and instalation was a breeze. With the upgraded hardware, Ubuntu works very well.

I have since been using this as my main laptop at home. For taking any notes i find onlyoffice a great free alternative to MS Word. Other developer tools i use are terminator primarily for running kubectl, docker, vi, git etc. For IDE, i use intellij or pyCharm or VS Code. Terminator lets one split the terminal into multiple terminals all visible within the same window. This makes working on say a docker swarm cluster for example easy when we can be logged in each cluster node in the different terminals within the same window and be able to see each of them at the same time. This helps being more productive seeing all terminals side by side at the same time instead of having to switch between windows or tabs.

On the downside, battery life is not so great with Ubuntu and gives a 2-3 hrs of run time only (though i have read that battery life is much better with Windows 10 so it is more of an integration issue with Ubuntu). Also i have not setup fingerprint reader with Ubuntu but it did not work out of the box post install.

Update 04/17/20:
I updated to 20.04 Ubuntu (Focal) beta. The upgrade was pretty smooth from 19.10 to 20.04 LTS. It runs 5.4.0 Linux Kernel. I use Ubuntu with Gnome/Unity desktop environment. I am yet to explore all the new features in this release but so far have changed to Night Mode settings and this cuts down on the blue light effect of the screen during night time thus making it easier to use the laptop for long.

I seldom use my Macbook pro 2015 laptop and most of the learning (my main purpose behind getting a Linux laptop) is being met by T490 very well. Battery life remains to be an issue even with the newer release and i was hoping it will come close to the performance people claim they get when running Windows 10 on T490.

Friday, January 17, 2020

FIRST Tech Challenge Season 2020


Rushil has been part of SkyRise Robotics FIRST Tech Challenge (FTC) team (# 16525) since last year. We started our journey in 2019 June. I was looking to have him join a team but could not find one nearby so with the co-operation of some like-minded parents in our community we formed a team of 8 kids comprising of 7th and 8th graders. The minimum grade to qualify for participating in FTC is 7th grade.

As a pleasant surprise we found that a veteran team (Iron Eagles from St Dominic Savio School) who had been participating in FTC for several years and were actively involved in the Austin Metro League management were available to mentor our team. The school was right next doors to our community so it was convenient for us to meet the mentor team.

One of the parents in our team had extensive experience with building robots.

Due to all these favorable factors our first year in FTC has been fantastic and a memorable experience.

At the time of this writing, we have participated in 3 of Austin Metro League meets where each team gets to play 5 games per meet. We are currently preparing for our League Championship meet on 2/1/20 at Vandergrift High.

Things we learned:
Hardware:
  • Learned about different types of gears - spur, bevel, worm
  • Rack and pinion
  • Chain and Sprocket Drives
  • Belt and Pulley
  • Attaching arms to a motor
  • Controlling picker/claw with Servo motors
  • Motors 
    • Servo
    • 12v DC motors 
  • Sensors - Gyro
  • Cable management 
  • Different types of robot movement - Encoder based vs Time based.
Software programming:
  • Block vs Java programming
  • Operator controlled vs Autonomous mode
  • Using Android Studio IDE
  • Passing input from Logitech gamepad to Robot - Tank Drive vs Point-of-View Drive
  • Setting up WiFi Direct connection between 2 Android phones
  • Programming Mecanum Drive
  • Using PTC VuForia to detect skystones. 
CAD and 3D printing:
  • CAD Modeling using Fusion 360
  • 3D printing parts of the robot
Fundraising - conducted a class for kids in the neighborhood teaching Scratch programming for $5/kid. Had a good turnaround.

Community Outreach - conducted a session at a local library demonstrating our robot, letting kids in the library try to run it and in the meanwhile promoting FIRST mission to them and their parents.

Timeline of events:
  • Started in June 2019 - formed a team of 4, registered team with FIRST
  • By August 2019 - team size grew to 8
  • Fundraising in August 2019 
  • By September 2019 - purchased the robot kit and started building a basic Chassis
    • Attended SkyStone Season kick-off event at Vandergrift High
  • October 2019 - Built the chassis with 2 powered wheels and 2 omni-directional wheels.
    • Practiced for the first AML Meet in November
  • Austin Metro League First Meet in November 2019
    • Changed the Robot wheels to Mecanum wheels.
    • Improved the Arm picker to work more reliably.
  • AML 2nd Meet in December 2019
  • Received grant from Dell via FIRST in Texas.
  • Community outreach at Library in December 2019
  • AML 3rd Meet in January 2019
Team SkyRise with their robot at AML meet #1.


A closer look at the robot kids built.
Overall this has been a good endeavor and all the kids in the team learned several things about making the hardware, the software and working together as a team - cheering for each other and helping each other out.

I think participating in a STEAM program like FTC or FLL (and there are several others) goes a long way to kindle the fire of learning by doing - in essence it is project based learning where kids actively participate in building a robot and in the process learn about engineering, doing math and thinking scientifically and using technology (for example 3D printing) creatively. 

Wednesday, January 01, 2020

Installing single node kubernetes cluster using kind

Refer https://kind.sigs.k8s.io/
1. Install go
2. Install docker
3. Execute:
GO111MODULE="on" go get sigs.k8s.io/kind@v0.6.1 && kind create cluster
4. Run kubectl to get the cluster status.

```kubectl get ns```

Tuesday, December 24, 2019

Book Review: The Silent Patient by Alex Michaelides


The Silent PatientThe Silent Patient by Alex Michaelides
My rating: 5 of 5 stars

A debut book by the author and a masterpiece of a work. Theo Faber is a psychotherapist and is trying to treat his patient Alicia Berenson who has gone silent after murdering her husband Gabriel. The story moves very slowly but the end is very nicely done. Highly recommended.

View all my reviews

Thursday, December 19, 2019

Shortcuts for kubectl for bashrc

alias k=kubectl
alias kp='kubectl get pods'
alias ks='kubectl get services'
alias kn='kubectl get ns'

function kexec() {
        kubectl exec $1 -it -- /bin/sh
}


function kdelete() {
        kubectl delete pod $1 --grace-period=0 --force
}
function krun() {
        kubectl run $1 --image=$2 --restart=Never --dry-run -o yaml
}
function kapply() {
        kubectl apply -f $1
}

Wednesday, December 11, 2019

Installing minikube on Ubuntu

Following are the steps for setting up minikube on Ubuntu 19.10:
1. Install KVM
https://help.ubuntu.com/community/KVM/Installation
sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils

2. Install minikube
https://kubernetes.io/docs/tasks/tools/install-minikube/
https://github.com/kubernetes/minikube/issues/2412

Set default VM driver as KVM.
minikube config set vm-driver kvm2
minikube delete
minikube start

$ minikube status
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

3.  Install kubectl
https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-linux

$ kubectl get nodes
NAME       STATUS   ROLES    AGE   VERSION
minikube   Ready    master   59m   v1.17.0

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:12:17Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}


4.  Install docker
sudo apt install docker
sudo apt install docker-compose

sudo groupadd docker
sudo usermod -aG docker $USER
docker run hello-world

Thursday, September 05, 2019

Book Review: What I Talk About When I Talk About Running by Haruki Murakami, Philip Gabriel (Translator)


What I Talk About When I Talk About RunningWhat I Talk About When I Talk About Running by Haruki Murakami
My rating: 5 of 5 stars

A memoir on how running became an important part of author's life. This is a short book where author recounts how he started running one fine day out of the blue when he used to be a chain smoker and decided to change his life by running every day. He stuck to the habit and ran almost 6 days a week, an hour a day, almost covering 6 miles on an average every day, thus running 36 miles a week and running almost 1900 miles a year. At the time of writing this book author has been a runner for 2 decades. There are several books on running - some are about laying out plans for beginners that they can follow like a 20 week plan for preparing for your first marathon, there are others in the same vein about cooking recipes suitable for a runner, and then some about experiences of professional runners. Most of those books have been written by authors who are not novel writers or professional story tellers. This book stands out as being written by an author who is a professional writer who has written several novels of great acclaim and who also happens to be a mature runner with enough experience under his belt to be able to tell others what worked for him or to just recount about his experiences as a runner. It is a short book and written in a way that will engage the reader. I am a beginner in running and this book was a pleasure to listen to so much so that i will be listening to it couple more times. Author's routine of running 6 days in a week may not be good for a beginner as it may tire their knees and make them more susceptible to injury and that is where i plan to go back to the books that cater to beginners and use the information on how to train from there instead. But this book serves well as a good motivator for anyone interested in running - be it a beginner or an experienced runner.

View all my reviews

Sunday, May 19, 2019

The Zen of Python

Recently discovered this easter egg 😃

>>> import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

Saturday, May 04, 2019

Passed Oracle Cloud Infrastructure 2018 Architect Associate (1Z0-932) Exam

I passed my Oracle Cloud Infrastructure 2018 Architect Associate (1Z0-932) Exam today at local prometric testing center with 83% (minimum required to pass is: 65%). I have been using OCI cloud at work on a daily-basis and had prepared for 2 weeks for the exam and i feel the exam questions were very well selected and tested from almost all areas covered in the Foundation and some from Advanced training course at - https://cloud.oracle.com/iaas/training.

My study notes from the exam are available at: https://github.com/watsh-rajneesh/oracle-cloud-architect-certification/blob/master/oci_architect_associate_study_notes.pdf 

Exam had 66 questions. The questions were well distributed across all topics in the syllabus. Though the Level 200 course is optional but there were a few questions that were from material in that course so i will advise anyone taking this test to not treat it as optional and do go through all materials.

Monday, April 15, 2019

Built a gaming PC

My son Rushil became interested in video gaming couple years ago when we got him XBox 360 and then an XBox One S. The next level up for him was to build his own gaming PC. The below youtube video comes close to the specs of the PC we built:
First we picked the parts at the https://pcpartpicker.com/ which is a great website to select the compatible parts and it even gives the lowest priced website where you can buy the part from. Our spec was the following:

  1. CPU - Intel - Core i5-9600K 3.7 GHz 6-Core Processor 
  2. CPU Cooler - Phanteks - PH-TC12DX_BK 68.5 CFM CPU Cooler
  3. Motherboard - Asus - ROG STRIX Z390-E GAMING ATX LGA1151 Motherboard
  4. Memory - Corsair - Vengeance LPX 32 GB (2 x 16 GB) DDR4-3200 Memory
  5. Storage - 
    1. Western Digital - Blue 500 GB M.2-2280 Solid State Drive
    2. Seagate - Barracuda 2 TB 3.5" 7200RPM Internal Hard Drive
  6. Video Card - MSI - GeForce RTX 2070 8 GB Video Card
  7. Case - Corsair - Crystal 570X RGB White ATX Mid Tower Case
  8. Power Supply - Corsair - TXM Gold 750 W 80+ Gold Certified Semi-Modular ATX Power Supply
  9. Operating System - Microsoft - Windows 10 Home OEM 64-bit
  10. Peripherals - 
    1. Headphones - SteelSeries - ARCTIS 7 2019 Edition 7.1 Channel Headset
    2. Keyboard - Corsair
    3. Mouse - Razer
    4. Monitor - Dell S2719DGF (Freesync monitor which can run in GSync compatible mode on dual port with 155Hz refresh rate, 1ms response time)
  11. Funko Pop toy - for fun we put this in our case - a spiderman toy.
Overall it became a more expensive system than he initially thought but the end result is XBox one is now not as much used as the PC. I was a bit reluctant to spend so much on building a PC and havnig never done this before was not sure if we will be able to do it as easily as the videos on Youtube show the process to be. But i bit the bullet and during his spring break we father and son - sat together building it and it was a bit more than half a day worth of work to get the rig up and running. At the end of the day my son was quite satisfied - he was more confident than me to start with :) that we will be able to pull this off as easily as youtube videos showed.

Experience building it: 
  1. We first opened the case and referred to its manual on putting a mother board.
  2. The ASUS motherboards are builder friendly in that it came with wifi built in in our model and was easy to put in the case. The I/O cover was already in place.
  3. Then we put the CPU on the mother board.
  4. Then the cooler system which also seemed more complex than it actually was to assemble. We put the thermal paste on the CPU and followed the directions as closely as possible in the cooler system's installation manual.
  5. Put the memory cards on the motherboard.
  6. Put the powersupply in the case.
  7. Put the SSD and the HDD in the case and wire it to the motherboard.
  8.  Put the video card in the PCIe slot.
  9. Manage the cables - this took a while to route through the right slots in the case. 
  10. Power on the system - insert the USB drive to install Windows 10 Home Edition.
  11. Install the latest updates for BIOS from motherboard manufacturer's site.
  12. Install latest graphics driver from NVidia.
  13. Install GSync Experience from NVidia - we got one game to download for free as part of the promotion NVidia had during that time.
  14. Install steam and any other gaming apps.
So it was a good experience and can indeed be done as easily as the pros do it in the youtube videos. We take a bit longer but it is a fun endeavor. My intent was to encourage my son to be further his interest in electronics and STEAM by letting him build his own gaming PC. He did most of the research and before we nailed down the parts he did a very thorough research on them and why we should pick what we ended up picking balancing between cost and performance of the rig. He started with AMD Ryzen based system but moved to an Inel + NVidia combo with CPU and GPU that can be overclocked. I was pleasantly surprised at the knowledge he acquired about the specs of these parts in the process - referring to benchmarks on CPU, GPU, DDR RAM and NVMe M.2 SSD storage that we went with. Picking the parts took him several months and was the best part of the letting him build his own first gaming PC.

Sunday, March 31, 2019

Starting exercising


I recently moved to a new home in Austin and now have enough space to arrange my exercise equipments that i bought over the past couple years in our garage. We have a 3 car garage and 2 cars so had an extra car's worth of space left to use for my exercise equipment. Its been a while have exercised - and after having started it finally i felt i should write about it on my blog :).

I am planning on continuing this regime of exercising for 30 mins or so at home daily - as a habit.

Monday, December 31, 2018

Book Review: The Word Is Murder by Anthony Horowitz


The Word Is MurderThe Word Is Murder by Anthony Horowitz
My rating: 5 of 5 stars

This is the first book in the series of Detective Inspector Hawthorne's investigations. Author is narrating the story first hand as he too plays a part in the story. Author has signed up to write about a murder investigation that inspector Hawthorne has been working on.

The story begins with the a middle aged woman going to an funeral parlor to arrange for her funeral proceeds. A few hours after her meeting with the undertaker she is found strangled at her residence. Some items are missing to give an impression of burglary being the intent behind the murder. In the past (10 yrs ago) a child was killed in a road accident and the driver in the car was the same middle aged woman who is murdered. The lady's son is a famous actor in Hollywood and he flies down to London to attend his mother's funeral. On the day of the funeral the actor son also gets murdered in the most gruesome manner.

Metropolitan police hires consultant detective inspector Hawthorne to investigate this murder.

Inspector Hawthorne contacts the author to write a book about this investigation as it unfolds. The risk was that if someone else from Met solves the case before Hawthorne does then there will not be any point in writing a book. Author accompanies Hawthorne as he interviews all suspects. Eventually Hawthorne solves the mystery. This approach to writing is reminiscent of Sherlock Holmes and Dr Watson where Dr Watson writes about Holmes' investigations.

Overall the story is fast paced and not too long so it does well in retaining reader's attention. Looking forward to the second book in the series - the sentence is death - which is due for release in June 2019 in US.

View all my reviews

Book Review: How to Win Friends and Influence People by Dale Carnegie


How to Win Friends and Influence PeopleHow to Win Friends and Influence People by Dale Carnegie
My rating: 5 of 5 stars

What a great book .. it is full of common sense techniques on how a human being should interact, converse or deal with another human being. The book does not talk about any magical ways of influencing people, nor does influencing mean cheating people. It is about understanding what generally works with most humans and the results are a win-win for both parties who are interacting and not just one benefiting at the cost of the other.
I listened to the audio book so i could not take any notes then but thankfully several others on the internet have done. I am referring to https://fs.blog/2012/07/how-to-win-fr... and will elaborate some of the points in my own words (for examples on each of these points you should read the book as it is full of anecdotes related to each item below):
Part 1 - How to influence people:
When dealing with people, let us remember we are not dealing with creatures of logic. We are dealing with creatures of emotion, creatures bristling with prejudices and motivated by pride and vanity.

The only way on earth to influence other people is to talk about what they want and show them how to get it.

1. Don't criticize instead tell others about what you find good in them. Criticism is futile because it puts a person on the defensive and usually makes him strive to justify himself. Criticism is dangerous, because it wounds a person’s precious pride, hurts his sense of importance, and arouses resentment. …. Any fool can criticize, condemn and complain—and most fools do. But it takes character and self-control to be understanding and forgiving.
2. Be honest in your appreciation. No one likes insincere praise (flattery).
3. Kindle the desire in the other person to want to do the thing you need them to do so you both benefit.

Part 2 - How to be liked by other people or make a good first impression:
1. Be genuinely interested in other person.
2. Smile while talking to others. It gives a positive impression and also makes the other person feel comfortable talking to you.
3. Remember a person's name (as that is the sweetest thing for them).
4. Be a good listener. Encourage the other person to talk about themselves. Many people like to talk about themselves.
5. Talk in terms of other person's interests - how what you are proposing to them will benefit them.
6. Make the other person feel important - and do it with sincerity. One way to do so will be to mention their good in front of others so they feel they are being recognized and will feel important that way. But we should only praise them for what we see as good in them sincerely.

Part 3 - How to win people to your way of thinking:
If there is any one secret of success, it lies in the ability to get the other person’s point of view and see things from that person’s angle as well as from your own.

1. The only way to get the best of an argument is to avoid it. Don't argue.
2. Show respect for the other person's opinion. Never say - you are wrong. That will hurt their pride and they will become defensive.
3. If you are wrong, admit it quickly and emphatically. This goes a long way at times to prove to the other person that you are being honest.
4. Begin in a friendly way. Don't get to the complaint you have to tell the other person right away ... beginning in a friendly doing some loose talking before gently putting across your point of complaint will make the other person more receptive to your point of view.
5. Get the other person to saying - "yes"es. This is called the socrates way.
6. Let the other person do a great deal of talking.
7. Let the other person feel that the idea or ownership of the work is theirs.
8. Try to see other person's point of view.
9. Be sympathetic with the other person's ideas and desires.
10. Appeal to the nobler motives.
11. Dramatize your ideas.
12. Throw down a challenge (this works especially well for kids).

Part 4 - How to be a leader without offending or arousing resentment:
1. Begin with praise and honest appreciation.
2. Call attention to people's mistakes indirectly - so as to not hurt their pride.
3. Talk about your own mistakes before criticizing the other person - this will soften the blow for the other person as they will realize that you too are not impeccable.
4. Let the other person save face.
5. Praise the slightest improvement and praise every improvement. Be "hearty in your appreciation and lavish in your praise".
6. Give the other person a fine reputation to live up to.
7. Use encouragement. Make the fault seem easy to correct.
8. Make the other person happy about doing the thing you suggest.


View all my reviews

Saturday, October 13, 2018

Book Review: The Lottery by Shirley Jackson


The LotteryThe Lottery by Shirley Jackson
My rating: 5 of 5 stars

In a village of 300 people, an annual ritual takes place called the lottery. All village folks, men, their wives and their children come join the occasion. Children collect stones and pile them up in a corner. Every family has a representative that picks a piece of paper from a black box. There is one paper that has a black dot in it, the rest are blank. The surprise is the winner in the lottery is stoned to death by the villagers as an act of sacrifice so the farmers get good corn produce that year. In the words of 77 years old Old Man Warner - "Lottery in June, corn be heavy soon".

View all my reviews

Tuesday, August 07, 2018

Moved to Austin


We recently moved to Austin - a.k.a. the capital of the lone star state Texas and Silicon Hills (due to its growing tech worker population). It is also touted as the #1 place to live in the US these days.



Things we love so far about our move here are:

  1. Warm place - it gets pretty hot during summer but coming from eastern part of India we have already seen such heat in summers and it did not feel any different.
  2. Warm people - one can feel the warmth and genteelness of locals when communicating with them. 
  3. Small town feel - things are newer but spread out so it is common to see large tracts of open spaces with trees and shrubs.
  4. Open spaces and greenery 
  5. Lakes and hills - there are lakes and on western part of Austin there are hills too. 
  6. Mostly newer buildings - in general most constructions seem relatively new.
  7. Far less crowded than Silicon Valley - less number of people in general but population is growing here as more people move from other more expensive parts of US to Austin.
  8. Far less traffic on road than Bay Area
  9. Most major tech employers present - though the number of positions open in those employers may be a fraction of their offices in Silicon Valley yet many of the big companies of the Bay Area have a significant presence in terms of the number of employees they have here.
  10. Lower cost of living - a gallon of gas is $1 cheaper, no state tax, no sales tax and things in general cost less. 
  11. Lower housing cost - it is higher than many other cities in Texas but still way lower compared to Bay Area.
  12. New construction homes - we can still find plenty new homes at close proximity to work places and good schools (though they are typically higher priced and price reduces as we move further away from where most jobs are).
  13. Excellent schools - schools get 1% of the 2+% property tax so they get good funding i think. Most schools seem to have newer campuses - at least the ones we saw did.
We got an apartment in the north eastern part of Austin bordering Round Rock city. The Round Rock ISD is 21st largest school district in Texas and has some very good schools. This part of Austin has all amenities (classes for kids, restaurants, cinemas etc) available at a short distance so it is quite convenient for families. Also this part of Austin is where most of the major employers have their offices, apart from downtown area of Austin. There is metro train that makes the commute to downtown convenient. 

We are yet to explore the city and all that it has to offer but from what we saw thus far we have found no reason to regret though we still miss our friends and our San Jose home in the Bay Area.



Popular micro services patterns

Here are some popular Microservice design patterns that a programmer should know: Service Registry  pattern provides a  central location  fo...