The Best Gift Ever

Ah, Books.

Weirdly — I remember that day in every detail,

The thin brown book packaging (I don’t know what it was called – you know the one that we used to use to wrap our text-books in Elementary School :D). The huge smile on my face when I receive it, the smile of a tired father just get back from work. My muddied hands – just get back from the field playing with other kids. “the happy birthday” greetings, and my mom was smiling in the corner.

How I immediately open that packaging with huge curiosity.

That packaging wrap a lot of Donald-duck, Bobo and mix of
magazines, one I remember the most amongst others is a manually bundled pack of Donald-duck comic magazine – those are second hands (I concur probably bought from pasar Cikapundung – one famous for second hand books) – we were not really what you call well off back then – but things were simpler.

I didn’t remember whether I say thank you to my father back then, I probably just run to my room with those mags and voraciously read everything to the last letter. You know — kids.

That gift, It opened a whole different world and perspective for me, It introduce me to reading — and I learn a lot.

Amongst others — How donald always go to Timbuktu to escape from things, How bad-ass Paman Gober (Scrooge Mcduck) get his initial wealth from gold mining. Kwak, Kwik, Kwek, Lang-Ling-Lung, Goofy, Miki, Mini, Clarabela, Nirmala, Oki, Bona, Rongrong, paman Janggut and so many others.

For me that was the greatest gifts ever. The greaaaatest! 😂

Many years later when the well off-ness kind of improved, I remember I receive a NES gaming console, a 286 PC and many other things after that – but I cannot remember details of those days as clear as the day I receive that brown package full of old magazines.

So yeah parents – introduce your children to the joy of reading 🙂

Home Media Server — pi armbian stuck due to missing removable drive

So, I setup few SBCs (Raspberry Pi, Orange Pi) as mini-servers for many kind of purpose at home. One of them is a media-server, it is plugged into multiple removable drives (few USB sticks and one 3TB self-powered seagate 3.5″ enclosure).

I setup the drive to auto-mount on boot using fstab.

One day, because I use one of the USB stick, it stopped working. It seems that the system check and wait for the missing drive (since it’s declared explicitly on fstab)

UUID=XXXX-XXXX / ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1
tmpfs /tmp tmpfs defaults,nosuid 0 0
/var/swap none swap sw 0 0
UUID="XXXX-XXXX" /mnt/usb auto user,umask=000,utf80 0
UUID="XXXX-XXXX" /mnt/hdd exfat defaults,auto,umask=000,users,rw 0 0

The fix is to add nofail option to your fstab entry. Refer to man systemd.mount

With nofail, this mount will be only wanted, not required, by or This 
means that the boot will continue even if this mount point is not mounted successfully.

So my fstab entry modified into:

UUID=XXXX-XXXX / ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1
tmpfs /tmp tmpfs defaults,nosuid 0 0
/var/swap none swap sw 0 0
UUID="XXXX-XXXX" /mnt/usb auto user,umask=000,utf80,nofail 0
UUID="XXXX-XXXX" /mnt/hdd exfat defaults,auto,umask=000,users,rw,nofail 0 0

Now I can freely remove the removable drive without causing boot to stuck.

WordPress from PHP to HHVM

This blog was using nginx+php5.5+mysql and I’ve been reading about hhvm and it`s 100% compability with WordPress.

So it’s worth to test.

OK, what I was doing is basically installing hhvm using this guide

sudo apt-get install software-properties-common
sudo apt-key add --recv-keys --keyserver hkp:// 0x5a16e7281be7a449
sudo add-apt-repository 'deb trusty main'
sudo apt-get update
sudo apt-get install hhvm

Since hhvm is also fastcgi compatible, all I do is changing my nginx sites configuration to

location ~ \.(hh|php)$ {
    fastcgi_keep_conn on;
    fastcgi_index  index.php;
    fastcgi_param  $SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;

Restart hhvm and restart nginx to make sure the configuration got reloaded. And done!

Home Automation By Presence Detection

Some friends asking me about my Homebred setup for my home automation – It’s been a while since I promise to write about it – so here you go. (will open the code as soon as I can make it readable for public and clean it up from my custom setups)

The setup is simple, nothing fancy.

It’s using tricky simple presence detection – a.k.a detecting MAC address of my phone and trigger scripts based on that. The weakness of it that it will need DDWRT router use other router that list connected clients MAC address, but you will need to adjust the scrapper code to login and scrap your router interface)

Presence Detection

Install DDWRT on your router. Make sure the setting to expose info page


After this is enabled. It will expose Info.htm that you can use to scrap for information about your router. See the Wireless clients table on the bottom of the Info.htm page


Create daemon that check DDWRT status page on some interval and check for the existence of specific MACs. If some specific MACs is detected, go to a folder and run all scripts.

The Presence Script

The daemon itself is a Nodejs script that run on my Raspberry Pi. It run using cron on some certain interval.

I use Nodejs script for easy development effort :). For request Nodejs have Request and for scrapping it have Cheerio that makes all scrapping needs as easy as creating jQuery selector. For the DDWRT info page.

var request = require('request'); 
var cheerio = require('cheerio');
request('', function (error, response, body) { 
    if (!error && response.statusCode == 200) { 
        var $ = cheerio.load(body); 
        var clients = $('#wireless_table tr'); 
        // loop for clients - do the necessary MAC detection here. Don't forget to save it to external flag file so you can create event 
        // `onEnter`, `onExit` etc 
        // I save list of MACs that need to be checked in a simple JSON file 

When the above script detect an event, it will try to list all executable script in a folder – For example I have /opt/MYMACADDRESS/enter.d/ and /opt/MYMACADRESS/exit.d/ so when my MAC is detected as entering, it will executes all executable scripts in /opt/MYMACADRESS/enter.d/*

In Nodejs, it’s as easy as

//  loop for scripts and execute it using the code below
child = exec(scriptFileName, function (error, stdout, stderr) { 
    console.log('stdout: ' + stdout); 
    console.log('stderr: ' + stderr); 
    if (error !== null) { 
       console.log('exec error: ' + error); 

So I can create many scripts using shebang notation in the folder and those will be executed accordingly.


The scripts are fine tuned to my home setup. But it can be anything. Here’s some Ideas

  1. Set transmission torrent client to unlimited /usr/bin/transmission-remote -D && /usr/bin/transmission-remote -U (when I am at work)
  2. Set transmission to 0kb/sec /usr/bin/transmission-remote -d 0 && /usr/bin/transmission-remote -u 0 (when I am at home)
  3. Bash script that update Dynamic DNS provider with my new IP – It used to twit my public IP to a protected twitter account 🙂
  4. Twit to the protected twitter account if some specific MACs is entering my wifi network
  5. Turn on Air Conditioner by accessing IR arduino trough raspberry GPIO
  6. Wake On Lan my gaming PC by utility called powerwake powerwake

Non DDWRT Router

Well the idea can be applied to other router interface. Most router use basic authentication to access the internal web application. In Nodejs it’s as easy as (or use basic auth bearer Token)

request.get('').auth('username', 'password', false);

And then tweak your scrapper accordingly to harvest for MAC address or static IPs.

The New Begining


I remember it was 1995, I was young, around 10-11 years old kid with identity issue. What Identity issue you may ask? One example is – I used to ask myself Who Am I? What is the purpose of living?. I used to identify it as an identity issue because when I ask that kind of question to older people. most of them shrug, laugh or telling me that someday I’ll figure it out (with loud laugh or simple smirk of course)

Is it wrong for a 10 years old to get the answer of it? the purpose of their life? How old a person can get the real answer of their purpose of life? 20? 30? 40? or by the deathbed?

Continue reading The New Begining