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.

Popular micro services patterns

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