Tutorials
Golang : Convert IP address string to long ( unsigned 32-bit integer )
Here is another way of converting IPv4 string to long ( unsigned 32-bit integer ). Pretty similar to the previous….... read more
Golang : Format numbers to nearest thousands such as kilos millions billions and trillions
Problem:
You want to format a given number to the nearest thousands such as kilos, millions, billions, and trillions. For….... read more
Golang : Print how to use flag for your application example
Just a short tutorial on how to usage flag
package to check for the number of flag arguments require by….... read more
Golang : Check whether a network interface is up on your machine
Problem:
You have multiple network interfaces on your machine and you need to know the status of a particular network….... read more
Golang : Get the IPv4 and IPv6 addresses for a specific network interface
Problem:
You need to find the IP address of a specific network interface on your machine for developing your application.….... read more
Golang : How to check if a date is within certain range?
Problem:
You are processing a large number of raw data files with dates as timestamps. However, you are only interested….... read more
Golang : Converting a negative number to positive number
Helping out a friend here to figure out why her totalizer formula is spitting out incorrect result. Apparently, what she….... read more
Golang : How to make a file read only and set it to writable again?
Problem:
You want to set a file to read-only
mode and also want to test if a file is really….... read more
Golang : How to check if a file is hidden?
So, how to check if a file is hidden? The solutions below are OS dependent. One for Unix/Linux and another….... read more
Mac/Linux/Windows : Get CPU information from command line
Writing these down here for future references, will be handy with comes to identifying a machine's CPU information during system….... read more
Golang : Forwarding a local port to a remote server example
Got a strange request yesterday. A friend who is an IT manager in his company needs to implement some control….... read more
Golang : Get final balance from bit coin address example
Here is an example of how to query blockchain.info to get the final balance(amount) with a given bitcoin transaction address.….... read more
Golang : Force your program to run with root permissions
Problem:
Because of security requirements, you need to create programs that can only be executed with the proper root
permissions.….... read more
Golang : Populate slice with sequential integers example
Helping out a friend here, putting the code example down here for future references. Basically, he needs to generate a….... read more
Golang : Get current time from the Internet time server(ntp) example
There are times when a program needs to have accurate machine time. For example, the make
command found in Unix/Linux.….... read more
Golang : Find network service name from given port and protocol
In this tutorial, we will learn how to discover the list of available network services on a machine. This method….... read more
Golang : Convert IPv4 address to packed 32-bit binary format
There are times when we need to deal with low-level network functions such as dealing with C program and the….... read more
Mac/Linux and Golang : Fix bind: address already in use error
Not really a tutorial. However, it is good to put this here as a guide for junior software developers.
….... read more