This page serves as a table of contents of all the stories I had written (also easier for me to refer to them when I need it).

Common Functions

MD5 Sum (Bash, Go/Golang, Node.js, Ruby, CSharp/C#)
SHA3 Sum (Bash, Node.js, Ruby)
CRC32 Sum (Bash, Go/Golang, Node.js, Ruby)
Random UUID (Bash, Go/Golang, Ruby)


My Linux Cheat Sheet Ubuntu Enable Swap Ubuntu Install Apache Ubuntu Install PHP Ubuntu Install Laravel Ubuntu Compress File Ubuntu Install Puppeteer Ubuntu Install Squid Ubuntu Install Go/Golang Ubuntu Install MySQL Ubuntu Setup Firebase Cloud Messaging (FCM) Ubuntu Send Firebase Cloud Messaging (FCM) Push Notification EC2 Ubuntu Increase EBS Size

Table structure


go get -u

Connection string. I recommend using utf8mb4 else you will not be able to save emoji characters.

func my_db() (db *sql.DB) {
username := "root"
password := "password"
hostname := ""
database := "demo"
charset := "charset=utf8mb4"
collation := "collation=utf8mb4_general_ci"
db, err := sql.Open("mysql", fmt.Sprintf("%s:%s@tcp(%s:3306)/%s?%s&%s",username,password,hostname,database,charset,collation))
return db


func create(db *sql.DB, name, address, phone string) {
sql, e := db.Prepare("INSERT INTO contacts(name, address, phone) VALUES (?, ?, ?)")

res, e := sql.Exec(name, address, phone)

id, e := res.LastInsertId()

log.Println("Created. ID=", id)

The prepare statement uses DB resources to escape the…

A continuation from my previous Sending Personalized SMS article. Lets imagine telco allows you to send as many messages as you can without limits and you have 100,000 messages to send to all your customers.

If you can only send 1 message per second, it will take almost 28 hours to complete. What if you run it multi threaded with a pool size of 10? That will shorten it down to almost 3 hours to complete the same task.

Say you have the name list of the 100,000 customers in “list.txt”.


Ruby codes…

I have a sample table created in MySQL.

I have 3 functions
1. Connect to MySQL
2. Get all contacts
3. Insert contact

In my example, I am inserting 2 contacts and later retrieve the entire table of contacts.

Say you have a thousand SMS or more to send and you want to customize the message body to include their name. How would you do it? Sending each and every one manually by hand, typing on your phone would probably take a very long time.

You can actually do it programmatically with an Android phone and a PC/Mac. A continuation from my previous story of sending SMS with ADB, we now add on a script to read a list of recipients’ number and name, substitute the name onto the template and send.

First, we start with the list. Lets…

If you do not already have Android Debug Bridge (ADB) installed, you can get the platform tools at How to check if you already have ADB?

adb --version

Next you will need to enable developer options and test the connectivity.

adb devices

Sample code below is a very simple web server written in Kotlin. A [Start] button to start listening, a [Stop] button to stop listening and text view to display WiFi address.

Remember to add these 2 permissions else the app will crash upon start.

Kevin FOO

A software engineer, a rock climbing, diving & inline skating enthusiast, a husband, a father.

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