Comparison between Ansible and Puppet

Key differences between Ansible and Puppet: No single master server. You can simply install ansible on any server and that can then act as the muster. In Puppet, that’s not possible because the puppetmasters url is hardcoded into each puppet agent’s puppet.conf file. Orchestration is done via the “push” system […]Read more »

Golang – Organise your code using functions

Functions are a block of code that can call in your code. Functions and Packages are the 2 main ways used for organising code in Golang. You can feed parameters to functions and functions can also return values. You can call one function from inside another function.

Setup a Workspace for Go

Before you can start writing Golang code. You first need to set up a Workspace. A workspace is just a folder that will store all your Golang related stuff. In my case I’ll create a workspace called ‘go_project’: $ mkdir /root/go_project A workspace needs to have 3 top level folders […]Read more »

Installing Golang

Installing golang is really easy, just following the instructions in the official guide. However here are a few other ways to install Golang: RHEL/CentOS install tips A quick way to install golang is via yum: yum install golang But note that there’s a good chance the Go version yum installs […]Read more »

Golang Tutorial

What is Golang? Golang (aka G0) is a relatively new programming language Google that has taken the IT world by storm. It was released in 2009 and already some of the biggest applications are written in Go, including Docker, Terraform, and Kubernetes. This is a series of bitesize tutorials that’ll […]Read more »

AWS Cost Explorer CLI demo – filtering costs by cost allocation tags

Here’s a quick example: $ cat filter.json { “Tags”: { “Key”: “role”, “Values”: [“webserver”] } } $ aws ce get-cost-and-usage –time-period Start=$(date +”%Y-%m-%d” –date=”-24 hours”),End=$(date +”%Y-%m-%d”) –granularity=DAILY –metrics BlendedCost –filter file://filter.json RESULTSBYTIME True TIMEPERIOD 2018-08-09 2018-08-08 BLENDEDCOST 22.30 USD References: http://blog.xi-group.com/2015/01/small-tip-how-to-use-aws-cli-filter-parameter/ https://medium.com/@nachomillangarcia/prometheus-alerts-for-aws-daily-costs-3374137d1371

S3 – Use IAM role to grant S3 access to ec2 instances

Not sure if this is article works (at least it works without setting up any bucket policies). Need to investigate further. I recently discovered that you don’t need to set up S3 bucket policies in order to give an EC2 access to an s3 bucket (or folder). Say you want […]Read more »

RHCE – rough notes

page 4: systemctl –type=service list all running services: systemctl –list-units –type=service list all services, running and not running: systemctl –list-units –type=service page 6: lists the units that this unit depends on: systemctl list-dependencies UNIT shows what other services depends on the following unit: systemctl list-dependencies UNIT –reverse this forcefully disables […]Read more »