Tutorials
Golang : Extract part of string with regular expression
Below is a simple example of how to extract a specific part of a string with the help of regular….... read more
Golang : Parse date string and convert to dd-mm-yyyy format
A reader enquired on how to use Golang to convert date string such as "28th nov 2016" or "nov….... read more
Golang : Randomize letters from a string example
For this short tutorial, we will learn how to randomize the letters(including symbols and empty spaces) in a string. Such….... read more
Golang : Convert int to byte array([]byte)
Problem :
You need to convert integer variable or constant to byte array ( [] byte ). How to do….... read more
Golang : Test if an input is an Armstrong number example
An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is….... read more
Golang : Lock executable to a specific machine with unique hash of the machine
Problem:
Got a friend that was looking for ways to lock her Golang executable to a specific machine at her….... read more
Golang : Capture text return from exec function example
Problem:
You want to capture the text result return by exec function. How to do that?
Solution:
The code….... read more
Golang : Test a slice of integers for odd and even numbers
Got this question from one of my students and he is from a disadvantaged background(he is a refugee). He wanted….... read more
Golang : Execute terminal command to remote machine example
Problem:
You need to query a remote machine with ssh
to extract information such as memory usage or CPU information.….... read more
Golang : Verify Linux user password again before executing a program example
One of my previous tutorial shows you how to restrict a program execution to root
only and this can….... read more
Golang : Check a web page existence with HEAD request example
There are times when we need to check if a web server is up and running first before querying further….... read more
Golang : Submit web forms without browser by http.PostForm example
Writing this tutorial on how to submit a web form without using a browser. We submit web forms almost every….... read more
Golang : Print instead of building pyramids
Building a pyramid using ancient Egyptians way can be too difficult for more software developers. Just for fun, let's print….... read more
Golang : Calculate percentage change of two values
Here is a simple example on how to calculate the percentage change from two numbers. If the result is positive….... read more
CloudFlare : Another way to get visitor's real IP address
Problem:
Your web server's log such as NGINX's access.log
is showing unusually high and intense query from a couple of….... read more
Golang : Join lines with certain suffix symbol example
For this tutorial,we will learn how to join lines of text into a string and also explore the option to….... read more
Golang : Convert seconds to human readable time format example
Occasionally in the scientific world, we will encounter instruments that gave reading in seconds denomination and in this tutorial, we….... read more
Golang : Login and logout a user after password verification and redirect example
Writing this tutorial for my own future reference. User name and password authentication is a fairly common task for any….... read more