In this blog post I will share how to generate text to image in Go programming language (Golang). I have previous and similar blog post using Python. You can check that post here.

The reasons why I created this application is for me to share text content like Linux configuration and source code snippet in WhatsApp or other messaging application. Another is to generate featured image for social media posts in Twitter, Facebook or LinkedIn.


Background

I’ve been developing web applications using Java and Spring Framework and in 2019, I started using Golang in some of my projects. So far my experience with Golang is great but I miss the annotation that Spring framework provides particularly the @RequestMapping for URL mapping, @Bean and @Autowired for dependency injection.

@RequestMapping(value = "/v1/get-products", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody public Callable getProducts() { return responsePayloader.generate(false, new ArrayList<>()); }

Most of the examples online and from some books that I read declares the URL request mappings in main.go. …


I would like to share the Golang’s build flag to remove the source path (GOPATH) from panic stack trace output. In production environments or commercial projects it is sometimes not ideal to display the source path because of privacy, security or other reasons.

Below is an example of a stack trace output that reveals the GOPATH location which is located inside the developer’s home directory. In this case /home/johnpili/go/

panic: Aw, snap goroutine 1 [running]: 
main.main()
/home/johnpili/go/src/company.com/event-document-pusher/main.go:42 +0x3e

Build using flags with trimpath

The solution I found is to use build flags with -trimpath.

go build -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH

Stack trace output with trimmed-out source path

Using the said build flags the stack…


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 password you set.

$mysql -u root -p

Originally published at https://johnpili.com on October 8, 2020.


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.

1. Open terminal and type

cd ~/.local/share/applications

2. Create a .desktop file using your favorite text editor

nano android-studio.desktop

3. 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

[Desktop Entry] 
Version=1.0
Type=Application
Name=<APPLICATION NAME>
Icon=<LOCATION/ICON.PNG>
Exec="<LOCATION/APP>" %f
Categories=Development;IDE;
Terminal=false

The end result will be like this


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.


Revive your old laptop back in service using Lubuntu a light-weight version of Ubuntu. I bought this Lenovo IdeaPad S10–3 in 2012 when I was working in Muscat, Oman. This netbook has a blazing Intel Atom processor 1.66GHz, a 2GB DDR3 RAM, and 10″ LCD screen. I was initially thinking of giving it away because when I installed Ubuntu or CentOS it is sluggish and keeps on lagging. Then I stumble upon Lubuntu when I was researching about smallest Linux distribution. …


You may want to completely erase the partition table of your USB flash drive including the boot record. In macOS you do easily do that using diskutil. During this COVID-19 lockdown in Malaysia, I wanted to use my weekend time in installing Linux on an old laptop. It turns out that old laptop only support MBR and not GPT boot record and FAT32 instead of EX-FAT. I have to then delete the partition table from GPT to MBR and load LUBUNTU Linux distribution into the flash drive using Unetbootin.

Commands

To erase and format your USB flash drive into MBR and…


Overview

I started my homelab journey in 2017 setting up small server to host my files and test my web applications. Today, I am giving my small network a bit of an upgrade by having a redundant Internet connection using a TP-Link ER6020. I appreciate that TP-Link made it affordable for us to buy business class (SME) network appliance. If you are living in Kuala Lumpur and want to buy TP-Link business network devices. Go to Sri computers in Lowyat plaza they enterprise network devices mostly in stock.

TP-Link ER6020 Details

Base on the datasheet, the ER6020 v2.0 has 1 Gigabit WAN port, 3…


Background

In 2009, I was working as an IT manager/software developer/computer engineer in the middle-east. During that period, I developed business software applications for the company, applications like Human Resource System, Purchase Order System, Cheque Writer and web applications. Being a lone software developer my goal is to deliver software in less time with zero or minimal defect. One day, after completing a software project I realized that the code I wrote is almost identical to the previous one and this give me an idea to create a tool to code generate the SQL statements into C# codes.

My development process that I automate

John Pili

I am currently working as a software development manager in Malaysia. I manage and help my team with technical software design and implementation.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store