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

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

In some MySQL installation in Ubuntu. You cannot login as root because it is not configured to use mysql_native_password. In this post, I will teach you how to enable mysql_native_password. Log in to MySQL 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 root@localhost IDENTIFIED BY 'password'; mysql> exit You can now login in MySQL as root using the password you set....

October 8, 2020 · John Pili
jenkins-featured-image.webp

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 variables inside 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 login capability and shell. That means you cannot simply SSH to it. Using your other Linux account you can login as jenkins using the command snippet below....

August 14, 2020 · John Pili
golang-linux-daemon.webp

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 way to deploy your Golang application into a Linux production environment is create a systemd entry making it as a daemon program....

July 28, 2020 · John Pili
randomly-create-a-time-sleep-in-golang.webp

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. package main import ( "log" "math/rand" "time" ) func main() { rand.Seed(time.Now().UnixNano()) for i := 0; i < 15; i++ { delta := rand.Intn(6 + 1) // randomly generates numbers 1 to 6 time.Sleep(time.Duration(delta) * time....

July 2, 2020 · John Pili
Bus Seat Reservation UI Concept

Bus Seat Reservation User Interface Concept using Vue.js

In response to this facebook post. I created a simple bus seat reservation user interface using Vue.js and SVG. I started by preparing an SVG image of the bus seat and then render the SVG elements using Javascript (VueJS). You can use a raster image (sprite) for this but I prefer to use vector graphics (SVG) because it allows me to control the stroke and background color programmatically. The bus seat vector image looks like this...

May 27, 2020 · John Pili
MySQL Query – List Records That Don’t Exist From Another Table

MySQL Query – List Records That Don’t Exist From Another Table

Suppose you want to retrieve a list of products that are not in promotion. SELECT * FROM product t1 LEFT JOIN promo_product t2 ON t1.idProduct = t2.product_idProduct WHERE t2.idPromoProduct IS NULL

May 17, 2020 · John Pili
html5-pre-selected-disable-default.webp

HTML drop-down placeholder

Do you ever wanted to have an HTML drop-down with default selected value (placeholder) that the user cannot re-select once they selected any valid value options? It can be done easily by adding selected and disabled attributes on the option element. Code Snippet <select> <option value="" selected="selected" disabled="disabled">-- SELECT --</option> <option value="ACTIVE">ACTIVE</option> <option value="INACTIVE">INACTIVE</option> </select> Try it! -- SELECT -- ACTIVE INACTIVE

April 15, 2020 · John Pili
create-android-studio-shortcut-on-ubuntu.webp

Create Android Studio Shortcut on Ubuntu 18.04

You can easily create an Android Studio shortcut by creating an desktop entry using the following the steps below. In this guide, my Android Studio is installed in /opt/android-studio folder. Your folder location may differ. Open terminal and type cd ~/.local/share/applications Create a .desktop file using your favorite text editor nano android-studio.desktop My .desktop file looks like this [Desktop Entry] Version=1.0 Type=Application Name=Android Studio Icon=/opt/android-studio/bin/studio.png Exec="/opt/android-studio/bin/studio.sh" %f Categories=Development;IDE; Terminal=false StartupWMClass=jetbrains-android-studio As a template for desktop entry you can use this snippet...

April 14, 2020 · John Pili

How to clear your local Maven repository

I was building a multi-module project and I faced with this annoying problem with maven that keeps using old version of the maven project even though I uses mvn install -U. I usually delete my local .m2 repository folder but I found a much cleaner way to do it. mvn dependency:purge-local-repository

April 14, 2020 · John Pili
How-to-change-full-disk-encryption-LUKS-on-Ubuntu-18.04.webp

How to change Full Disk Encryption (LUKS) password on Ubuntu 18.04

Did you enabled the full disk encryption (LUKS) on Ubuntu 18.04? I would like to share how you can change the LUKS password. LUKS stands for Linux Unified Key Setup developed in 2004 by Clemens Fruhwirth. Similarly, Apple’s macOS have FileVault and BitLocker for Microsoft Windows operating system. In the terminal you can check the drives or partition with LUKS by using this command lsblk My result looks like this. Your result might differ slightly....

April 12, 2020 · John Pili