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

Setting up a static IP address on your RHEL or CentOS is simple. Prerequisite This how-to guide requires that you have administrative access to the Linux operating system. Steps 1. Inside the RHEL 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…

Login as Jenkins in Linux Terminal

You may need to setup an SSH keys or environment variables to your Jenkins installations. One of the easy way to do this is to setup those environment variablesinside the jenkins user account. If you installed Jenkins in CentOS or Ubuntu via YUM or APT; These package managers will setup a jenkins user account without […]

Continue Reading…

Golang Linux Daemon

You build your first Golang web application and running in a remote server via SSH. The problem with that is once the SSH session is terminated it also kill any running programs associated with that SSH session. Using nohup solves this problem but I think this is okay during development and testing phase. A better […]

Continue Reading…

Generate a self-signed certificate for Golang

Use OpenSSL generate a self-signed certificate for Golang. In this code snippetI 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, configuration.HTTP.ServerCert, […]

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…