Awk tips and tricks

by Vikrant
January 9, 2022

This article is providing some tips with usage of awk. It’s easy to find examples related to printing fields but sometime task at hand is much complex and it’s difficult to find examples. Purpose of this article is to put together collection of few complex awk tasks.

golang slice of struct

by Vikrant
June 13, 2020

If your input data is known to you then creating struct for parsing the data could be a best choice. In this article I am parsing /etc/passwd file in which entry consists of 7 columns.

golang parse df output hard way

by Vikrant
June 13, 2020

This is completely a hypothetical scenario to bolster my golang skills. Indeed ample amount of options are available in df to get the desired output but I intentionally chose default options which I usually use. Purpose is to get the total storage provided by remote filesystems in MB.

golang complex map operations

by Vikrant
June 13, 2020

If you are from python background, map in go is similar to dictionary in python. When you are writing a complex program simple key,value pair dict is not sufficient enough. You may be using python defaultdict to create complex nested dicts. I was trying to solve similar problem with go and thought of documenting it for future reference and benefits of other.

How to parse json using golang

by Vikrant
June 12, 2020

During lockdown I started learning golang. In this series I will be posting articles useful for system admins starting with go. I don’t want to go into very basic stuff related to go which is covered in on-line courses. I will try to keep the examples interesting enough to cover two/three topics. Today topic is about parsing json with golang.

How to use stackdriver logging and error reporting in python?

by Vikrant
September 22, 2019

I started working with saltstack sometime back it’s fair to say that I am on learning curve. I was reading about beacon and reactor concept of saltstack. I thought of running one excercise in lab environment to get hands on experience.

How to use stackdriver logging and error reporting in python?

by Vikrant
July 21, 2019

Stackdriver is another wonderful product from google. We are using stackdriver for centralized logging from all VMs and bq for analytics on the collected logs. We are running bunch of scripts to dynamically start the instances depending upon the workload, we recently started exploring using stackdriver as a logging handler in the scripts to send all the logs to stackdriver. Stackdriver is not only about logging and monitoring; other hidden useful bits of stackdriver are error reporting, profiling, tracing and debugger. Last three features are used for application monitoring. In this article I am sharing information on the usage of stackdriver logging and error reporting.

BigQuery various table types

by Vikrant
July 14, 2019

Partitioned tables are a special kind of table in dataset that is divided into segments called partitions to easily query the data. Maily two type of partitioning exist in BQ: