Upgrading D-Link DIR-868L A1 firmware to Tomato

I was finally able to upgrade the firmware on my old but trusty D-Link DIR-868L router to Tomato firmware.

The process is a little bit involved and it’s very easy to brick your router. Fortunately, this router provides a relatively easy way to perform recovery.

Note this instruction is for DIR-868L rev A1. There are more than one version of this router and the process could differ for each of those versions.

At a high level, you will need to upgrade the firmware to DD-WRT first and then to Tomato. We will use Tomato by Shibby.

Step 1: Upgrade to DD-WRT

You cannot simply use any DIR-868L version of DD-WRT firmware. You need R25974 or prior. If you use any firmware after that version you may not be able to flash it and if that happens your device will be bricked.

You will need two files: factory-to-ddwrt.bin and dir868-webflash.bin

Download the two files from this link. The links are for R25974.

After you download, first flash the firmware “factory-to-ddwrt.bin” using the D-Link router’s firmware upgrade page.

The process could take up to 3 minutes. Once successfully flashed your router will reboot. Then go to the router page (default is 192.168.1.1) and immediately upgrade the firmware to “dir868-webflash.bin“. If all goes well router will reboot once again. At this point, you are set to proceed to Step 2

Step 2: Upgrade to Tomato firmware

Download the latest Tomato by Shibby firmware from this link. The build I used was 140; direct link.

Download the zip file and extract it. Then flash the “tomato-DIR868L-ARM–xxx-special.trx” file with “Reset to Default Settings”. As usual the process could take up to 3 minutes. Once complete, Tomato firmware should boot up. Right after this, go to “Administration -> Configuration” and choose “Erase all data in NVRAM memory (thorough)” option. This will take a few more minutes. Once done, you are all set!

Bricked the router?

D-Link DIR-868L provides an easy way to recover.

  • Download the latest available firmware on the official D-Link website of the router revision
  • Unplug all cables (incl. power cable) from the router
  • Connect the router to the PC using one of the 4 switch ports
  • Set the PC TCP/IPv4 address to 192.168.0.2 and use 255.255.255.0 as the Subnet mask
  • Power-on the router with a paperclip pushing the hidden reset button located on the bottom of the device for a few seconds, when the Power LED starts blinking, release the reset button
  • Open browser and navigate to http://192.168.0.1
  • Upload the stock firmware, when completed the router should report to reboot
  • The router should now be running stock and accessible on the default address.

mjml + jinja2 = awesome

If you have ever tried programmatically sending HTML emails, you probably know how giant of a pain in the rear it is. It’s all because while HTML has progressed in the world of Internet, the Email HTML is still way way behind. There are no set standards and most of the times, you end up doing too much manual HTML coding. In today’s world, surely there must be something you can do about it, right? Turns out, yes. MJML tries to standardize and speed up HTML email layout creation. Think of it as Bootstrap for Email. MJML comes with it’s tagging format. The resulting layouts are very cross-platform and responsive, just like today’s modern websites are. Granted, things can never be 100% perfect in the Email world, but MJML gets you to at least 90% there.

Then, if you are using Python you can make Emails dynamic using Jinja library. There is some work involved in tying the two together, i.e. making MJML and Jinja work seamlessly, but once set up, they work very very nicely.

To be continued…

SELinux fix for Mergerfs to allow Docker and Samba access

I recently started using Snapraid and Mergerfs setup to manage my disk pool. I have ~27TB of raw storage which I am managing.

While setting up Mergerfs as usual ran into SELinux issues that will prohibit Docker and Samba access to the storage. So, here’s my fix.

Samba

Docker