Archive for the Uncategorized Category

[ REVIEW ] PACKT Publishing’s Video courses on “Building Your First Application with Go”

Posted in Uncategorized with tags , , , , , , on April 25, 2014 by abhishekkr

Recently I was asked to review PACKT Publishing‘s Video courses on “Building Your First Application with Go” from Rostyslav Dzinko. I’ll accept I thought it would be just beginner’s stuff looking at the title, but designer of course has managed to bring in an interesting flow and some good practice points along the flow.


The course structure is very broad, let not the course title make you take a narrow view. It covers from the mere basics of downloading and installing Golang compiler. Then slowly moves on to teach how to build a full working web application for image effects with some good dev practices.

What would you gain from it?

It’s formed of 8 fine sections which gradually make you familiar with different constructs of Golang internals.

The first section covers getting your workspace ready to try out Golang programming and strcture of a Golang program. It introduces to tools provided by Golang for seeking help, checking respective environment variables, lint formatting the code, running/building/installing Golang program. Shows example of a program taking input, processing the value and sending it to standard output. Then it ends with single line and multi-line style of commenting and quickly ends with introduction to Godoc way of Golang Code Documentation.

The second section starts with basic definitions of variable and constants, scope availability and then discusses the type inference capability. It details out all the important data types and example usages of each. In the end Narrator points to “strings” packages for learners to go and explore, which is good in a way not to serve everything on a platter. While giving intro to maps the Narrator also gives a taste of easy serialization/deserialization of data in Golang using example of “encoding/json” module.

The third section focuses on Control Structures. Covering if-else and switch-case for conditional logic, few variations of for for loop. It also talks of handling error and comma-ok notation returned.

The fourth section is about structuring the code with package and functions. Examples are given of functions, anonymous functions, packages, init functionality in packages and usability of deferred execution.

The fifth section familiarizes learners with the example of practicing Object Oriented Programming using Golang constructs. Narrator starts with insight on use of Structures in Golang with some examples and how can behaviors be added to Structures. A very good work has been done at explaining interfaces with gradual examples. It’s one of the philosophically misunderstood thus hated feature of Golang ad the Narrator has done a good job in averting that for beginners.

The sixth section is dedicated to one of the forte of Golang, concurrent system programming. Narrator shows some neat easy examples around usage of Goroutines and then brings in a better usable approach with “runtime” and “sync” package features. Then he explains well on role of Channels with good usecase examples. He showcases use of buffered channels, fan-in pattern, fan-out pattern also in a very simple but clear way.

The seventh section is their to make learners familiar with Golangs built-in package power for web application development. There are examples here for running a web server, handling routing, using HTTP GET request parameters. Narrator also gives a quick demo on using “Gorilla Web Framewoek“‘s routing and query param capabilities giving a sample Golang being ready for advanced web-app development. HTML Templating library is also covered in a decent manner. It ends with intro to panic and recover feature of Golang, which are not specific to web programming but specific to any good Golang project.

The eigth and final section is all about using what all has been covered so far and turning it into a real world web application capable of uplaoding an image; then performing color inversion and rotation on it. Narrator uses Golang’s “image” package for image transformations and the upload files are just kept in memory map of image filenames to file-data blobs. Then in the end he refactors the grown messy code into independent packages with real scenario implementation on interfaces. He also introduces a smal test case showing how code can be tested in Golang while introducing httptest library.

Occassional mentions of few philosophical decision is also there.

What could have been better?

(There is a fair possibility that I missed Narrator doing it but if I didn’t miss it.)

  • In third section Narrator doesn’t cover for-range usage, though uses it in fourth section and further later. Range brings a very widely implemented practically used power to for control structures.
  • Narrator forgot new behaviors can be added to any local type, not just structures. An example on this would have eased up how behaviors can be added to a local type declared on string (or other).
  • In Section 8, when Narrator starts to use “image” package for Image Upload and other actions… in certain functions (like HandleUpload) identifier of “image” name has been used. When “image” package is already imported, no identifier should have been named so. It doesn’t error out because “image” is not used in that function scope as a package, but it’s still not a good practice and can result into error as function get changed over time in real scenarios.
  • Some of the important philosophies that learners of this course shall look at after completing are, to have better understanding of certain things in Golang
  • Would have preferred if he did demo of “hello world” on and then moved to system installation with editor driven coding. It gives learners a very easy taste of it first and also show how easy is it to tryout Golang. Also can be projected as a starter place to browse through examples for more understanding of good and bad code.
  • One thing could have been improved on showmanship of course, that is showing build result of code in Editor windows’s pane. Almost all good editors today have addons for Golang providing this and lot more. Since Narrator was using “Sublime Text“, he could have used plugin “GoSublime“.


It’s a lot more hands-on than theory which is great. Though out of 8 sections, first 7 sections are mainly focussed towards beginners in Golang who want have a complete understanding of it and are preapred well for it (they are like covering Effective Go in a video). Still the last 8th section can be utilized by even intermediate level Golang developers who understand the constructs of it but face hard time bringing in good development practices they have been using in other programming languages. I felt some bits missing here and there which I’ve already mentined in “What could have been better?” para above.

There two good things about this course that I want to highlight: * Usage of examples and then building over them for coming part of course showcases how to finely grow a spiked Golang code. * Cleverly covering few good developer practices by hugely improving upon the mess of code written for “First Application (WIMP)”. The coding practice worried me in intial part of the section but when Narrator refactored it, the intention was clear.

Overall, it’s a good course for anyone trying to get started in learning Golang or are in their early stages.

[a.Bionic] Mayan Confusion Comic of 21 Dec 2012 World End

Posted in Uncategorized with tags , , , , on December 23, 2012 by abhishekkr [22/Dec/2012]

Mayan Confusion Comic

…..original blogpost

[] FSF Richard Stallman reports Spying Ubuntu; Canonical getting offensive

Posted in AbhishekKr, Uncategorized with tags , , , , , , , , on December 11, 2012 by abhishekkr [10/Dec/2012]

One of the most (the most for some years) popular Debian-based Linux Distro, Ubuntu has been found to be using a user behavior analyzing feature to serve more user need accurate advertisements.

RSM did compared it to a proprietary malware product doing user surveillance for self-profit. As in selling out there users for money which trusted the software because of it’s promotion by various OpenSource promoters and users (at least me and people I know) tried/use it  under the pretenses of it being on the guidelines of Free Software.


There have been a reply to it by few people, one being from Jon Bacon (some Ubuntu Community Manager) which came to my notice from HackerNews Top List.

He calls RSM being Childish on his stand…..

… here to read full post

[tek.walk] Varnish sometimes fails but doesn’t tell

Posted in Uncategorized with tags , , , , , , , , , , , on October 22, 2012 by abhishekkr [22/Oct/2012]

… round-robin” configuration. It was creating names that way to avoid name collision for same service running on different nodes load-balanced by Varnish-Cache.

We checked for the configuration correctness

varnishd -C -f /my/varnish/config/file

It passed.

We started the Varnish service

/etc/init.d/varnish start

It started.

We tried accessing the services via Varnish.

It failed saying there no http service running at Varnish machine:port.

So, the length of backend name there does effect but the VCL gives no error when starting Varnish-Cache.

BTW, from the checks performed… the maximum character backend name working for the configuration was 44 Character long.

… here to read full post

[a.Bionic] Dream Automation

Posted in Uncategorized on September 1, 2012 by abhishekkr [30/July/2012]

Dream Automation from 502 to 200

… here for original post

[god4evil] why do you have to do what you have to do

Posted in Uncategorized with tags , , on September 1, 2012 by abhishekkr [24/July/2012]


anyone you meet… everyone has a plan…..
for today, tomorrow, the day after, week after, after fortnight, month and some even an year or more… some have freakin’ whole life planned out…
some have an after plan for their next plan and others have an alternate in-case-of failure plan set for the plan before…
what the heck, why… why… why…

first of all and the most basic of all….. how did you concluded what you have to do something that you plan to do…

what you plan gets mainly intercepts what you are, where you are and when you are there


… here to read full post

[just.few.tuts] DevOps AND 12FactorApp ~ some obsolete & much valid

Posted in Uncategorized with tags , , , , , , , , , , , , , , , , , on August 21, 2012 by abhishekkr [28/July/2012]


Actually what 12FactorApp is… it is a good set of ideas around basic set of concerns. The concerns are right, the solutions suggested are situational and the situation is the default/basic setup. With the teams following good DevOps-y practices, they don’t turn out to be exactly same.


What @12FactorApp doesn’t suit at all for DevOps-y Solutions

  1. ~
  2. Dependencies
    [+] Obsolete: ‘If the app needs to shell out to a system tool, that tool should be vendored into the app.’
    Changed-to: Make your automation configuration management system handle it.


Cumulative Correct Concerns 3C@12FactorApp and DevOps-y Solutions

Overall aiming to achieve a easy-to-setup, clean-to-configure, quick-to-scaleand smooth-to-update software development ambiance.
The 12 Concerns+Solutions:

  1. Problem: Maintaining Application Source Code
     Using Version Control Mechanism, if possible Distributed VCS like git. Private hosted (at least private account) code repository.
    b. Unique application


… here to read full post

[just.few.tuts] how to host your public YUM (or any) repo on GoogleAppEngine

Posted in Uncategorized with tags , , , , , , , , , , on August 21, 2012 by abhishekkr [17/July/2012]

came up with is:
it’s nothing fascinating but just a re-mixed usage of project created from gae-flat-web.
you can access base skeleton of this re-mixed gae-yum-my (the easy way to host your yum repo online) at which also has rpm served for gae-flat-web.
now to see how you could get one too~

First Task, register a new portal


… here to read full post

[just.few.tuts] Puppet ~ Beginner’s Concept Guide [Part#2] :: The Road To Modules

Posted in Uncategorized with tags , , , , , , , on August 21, 2012 by abhishekkr [8/July/2012]

[] Puppet Modules?  (no, no….. nothing different conceptually)
Puppet Modules (like in most other technological references,…..

[] Logic of Structure Logic  (just how is your module structured and )
The different components of …..

[] Modules Fundamental Live  (mean the actual code sample…..)

… here to read full post

[tekwalk] [puppet] quick PuppetMaster Service Script

Posted in Uncategorized with tags , , , , , , , , , , , on July 3, 2012 by abhishekkr [25-April-2012]

#!/usr/bin/env ruby
module PuppetMaster
  def self.puppetmaster_cmd
   ‘puppet master –debug –verbose’
  def self.start
    puts “Starting Puppet Master in Debug+Verbose+Daemon mode logging to /var/log/puppet/a.log”
    puts “Started.” if system(“#{puppetmaster_cmd} >> /var/log/puppet/a.log”)
  def self.stop
    puppet_master_ps = %x{ps aux | grep -e ‘#{puppetmaster_cmd}’ | grep -v grep}
    puppet_master_pid = puppet_master_ps.split[1]
    if system(“kill -9 #{puppet_master_pid}”)
      puts “PuppetMaster with pid:#{puppet_master_pid} has been killed.”
      puts “Failure killing PuppetMaster with pid:#{puppet_master_pid}.”
  def self.status
    puppet_master_ps = %x{ps aux | grep -e ‘#{puppetmaster_cmd}’ | grep -v grep}
    puppet_master_pid = puppet_master_ps.split[1]
    if puppet_master_pid.nil?
      puts “No PuppetMaster found.”
      puts “Running @ #{puppet_master_ps}”
case ARGV.first
when ‘start’
when ‘stop’
when ‘restart’
when ‘status’
  puts <<-PMUSAGE
$service puppetmaster (start|stop|restart|status)