Mahmud Ridwan

Read this first

Moved to hjr265.me/blog

I have moved my blog to hjr265.me/blog.

View →


Should I Even Eat That Onion?

This is just a long overdue rant.

A little over a year ago, I ordered a power bank from a very reputable online store. Compared to my previous experiences with other stores, they seemed super professional. I received a phone call from them to get the order confirmed, and a couple of days later they delivered it right to my doorstep.

Amazing service! Except, what I received was a fake product.

Every Xiaomi product has a sticker that you can scratch to reveal a number, which you can then use to verify its authenticity.

And, this is what I got instead of a scratch-off sticker:

IMAG0076.jpg

A piece of paper that only looked like it could be scratched. Things don’t get any faker than this!

Their delivery service was amazing, now it was time to see if their customer service was equally good. It was time for an email to their customer service:

shot_170528_235406.png

After sending them that email, it took 3 days for...

Continue reading →


Building a Recommendation Engine

Ever wondered how a recommendation engine works? I did. Turns out, the mechanics involved in generating recommendations is actually pretty neat! You can learn more about it in the article I wrote for Toptal on the anatomy of a simple recommendation engine.

View →


$ tar

[xkcd: tar](//imgs.xkcd.com/comics/tar.png)

Tar is a file format that allows you to archive files and directories while preserving flags and other file information. Tar is also the name of the Unix utility that manipulates these files and is also popular for being notoriously enigmatic.

Did you know? Tar, the name, is derived from “tape archive”.

But Ridwan, I don’t store my files on tapes. Do I need tar?

Well, if you need to ask that question (and don’t care about helping Rob disarm the bomb), then the answer may just be “no”. But if you spend enough time in Unix-like systems, you are bound to come across a “.tar” file eventually.

Just like most other commands, tar takes a bunch of options, followed by some arguments.

You can create a tar archive by executing

$ tar cf archive.tar mario.txt luigi.txt peach.txt

The “c” tells tar to create an archive with the files “mario.txt”...

Continue reading →


Using an external USB drive for the root file system of a Raspberry Pi

By design, a Raspberry Pi always requires an SD card to boot from. But one can still have its root partition located on an external storage device. Be it for reasons involving speed improvement, or avoid challenging the write endurance of an SD card.

The details in the following steps may vary based on the distribution of Linux being used, but the fundamental idea should be similar anyway:

  • Assuming a distribution of Linux is already installed on the SD card, use it to boot a Raspberry Pi up.

  • Once booted up, execute the following command and ensure that the desired new root partition shows up in the list of available partitions. In this case, we are looking for sda1. Here mmcblk0p5 is the current root partition denoted by the “/” at the end.

     lsblk
    NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    sda           8:0    0  1.8T  0 disk
    |-sda1        8:1    0 23.3G  0 part 
    |-sda2
    ...

Continue reading →


Hello, world!

Just a few hours ago I didn’t even know that I would suddenly have the urge to write. Heck! I didn’t even know that I would be creating a blog for that. But now that my first post is live, I guess I will have to make it a habit.

The first post is definitely about saying “hello”. And I thought, what better way is there to say that than to say it in different languages: Bash, C, C, C++, Go, Java, JavaScript, Perl, PHP, Python, VisualBasic

You don’t speak them? Well, I plan to learn more very soon :-)

Continue reading →