Allow user or group to run sudo on specific applications in Linux

In some situation, we may want to delegate a sudo capability to Linux users or groups without completely giving them full access to the operating system. We can achieve this by using User_Alias inside the /etc/sudoers configuration file. I will share the simple settings that I used in my RHEL server. The configuration before handles […]

Continue Reading…

Click Counter in React and Vue.js

This post is part of my React and Vue.js code by example series. My objective is to help developers with their transition in learning React to Vue.js or vice versa. This is not a comparison of which one is the best but rather to show how it is done. Let’s get started. Knowing how to […]

Continue Reading…

Remove source path from Go’s panic stack trace

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 […]

Continue Reading…

Generate text to image in Go

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 […]

Continue Reading…

Controller Request Mapping in Golang

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. Most of the […]

Continue Reading…

Linux systemd for your Go application

Systemd is a Linux software suite that handles system services (daemon) and timers; it enables you to start, stop and restart your application using systemctl command. It can also start your application during operating systems boot-up sequence. Note that you will need to have root or sudo privileges for this operation. To create a systemd […]

Continue Reading…

Two-letter country codes

Happy New Year! I hope you’re having a great time. Today, I am updating my online tool, ip.johnpili.com to use Cloudflare’s Request Header, “CF-IPCountry” so that I can display the IP address together with the country. I also want to have my own two-letter country code on my website as quick reference. The table below […]

Continue Reading…

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…