IP Address Classes

The table below shows the IP address classes. This could be handy for someone trying to remember possible IP ranges of a particular IP class. The first 8 bits of the IP address are used to determine the class. Class Address Range No. of Network Hosts A 1-126.x.y.z 126 16,777,214 B 128-191.x.y.z 16,384 65,534 C […]

Continue Reading…

How to setup static IP address on Red Hat Enterprise Linux 8

Setting up a static IP address on your REHL or CentOS is simple. Prerequisite This how-to guide requires that you have administrative access to the Linux operating system. Steps 1. Inside the REHL Operating system, open the terminal and head to /etc/sysconfig/network-scripts cd /etc/sysconfig/network-scripts Using ls command, you can see the available network devices. 2. […]

Continue Reading…

How to change MySQL’s root to use mysql_native_password in Ubuntu

After installing MySQL, log in to it via terminal with $sudo mysql -u root Once inside MySQL, we will need to change the default plugin authentication to mysql_native_password and set a password for root. mysql> ALTER USER [email protected] IDENTIFIED WITH mysql_native_password BY ‘password’; mysql> exit You can now login in MySQL as root using the […]

Continue Reading…

Generate a self-signed certificate for Golang

Use OpenSSL generate a self-signed certificate for Golang. In this code snippet I created a certificate with validity of 15 years. openssl genrsa -out server.key 2048 openssl req -new -x509 -sha256 -key server.key -out server.crt -days 5475 Once you create the certificate and key you can use it in your Golang HTTP like this log.Fatal(http.ListenAndServeTLS(“:”+port, […]

Continue Reading…

Randomly create a time.Sleep in Golang

To randomly create a time.Sleep in Golang you can use the code snippet below. You may want to simulate a load in your web server and have an arbitrary seconds or minutes before getting the reply. rand.Seed(time.Now().UnixNano()) delta := rand.Intn(60 + 1) // randomly generates numbers 1 to 60 time.Sleep(time.Duration(delta) * time.Second) // sleep and […]

Continue Reading…