Mahmud Ridwan

Read this first

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.

Continue reading →

$ tar

[xkcd: tar](//

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
    sda           8:0    0  1.8T  0 disk
    |-sda1        8:1    0 23.3G  0 part 

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 →