Monday, November 16, 2015

Toyota Prius: 12V auxiliary battery check

For 2004-2009 Toyota Prius, you can check the 12V battery's status in diagnostic mode.

To enter diagnostic mode:
1. press the Power button (without pressing the brake)
2. press and hold the Display button (on the side of the dashboard computer)
3. tap on the yellow highlighted spots, 1 -> 2 -> 1 -> 2 -> 1 -> 2. There's no visible buttons, you just need to tap on the two spots as shown below:
4. if done properly, it should enter the diagnostic mode. Alternatively, you can press and hold the Display button, and then toggle the head lights ON/OFF 3 times instead.

To check the 12V battery's status:
1. tap Menu > Display Check > Vehicle Signal Check
2. a good battery should be around the 12.x range. If you turn on the vehicle, it should start charging the battery and the value would increase to 14.x.

To exit diagnostic mode:
press and hold the Display button for 5 seconds

Owner manual:
You can download them at
(It's a shame that they are not available on, their Technical Information System (TIS) is down or no longer available)

How to see if your 12v Auxiliary Battery is going bad - YouTube
Quick test of a Prius 12v battery - YouTube
Toyota Prius: How to Check the 12v Auxiliary Battery Health -

Thursday, November 12, 2015

PuTTY: Backup saved sessions

On Windows, PuTTY's configuration is stored in the registry. It can be found under:

Note that Simon Tatham is the author of PuTTY. So don't replace it with your username.

You can export all settings with this command:
regedit /e "%userprofile%\desktop\putty.reg" HKEY_CURRENT_USER\Software\SimonTatham

How to export PUTTY Sessions list? - Stack Overflow

Wednesday, October 14, 2015

Unity: Deploy Unity game on Google Sites

In Unity 5, I created a Web Player build of my game. It generated a .html and unity3d file for deployment. I wanted to deploy it to my Website which is hosted on Google Sites. But Google Sites do not support uploading html files directly.

Luckily, Unity user marceloroca came up with a solution by creating a custom Google Gadget.
1. login to Google Sites
2. create a Web page for your game
3. upload the .unity3d file as an attachment, and copy it's url
4. edit the Web page and select Insert > More gadgets > Add gadget by URL
5. use the Google Gadget created by marceloroca:
6. paste the .unity3d file url as WebPlayer Url
7. edit the width and height, and the rest of the configuration

Google Sites for hosting my game + issue tracking - Unity Answers

Monday, October 5, 2015

What is ::ffff:

I was adding additional logs for my Node.js Web app. During testing, I noticed my IP address is logged as "::ffff:" instead of "". Turns out this is due to the transition from IPv4.

::ffff:0:0:0/96 — A prefix used for IPv4-translated addresses which are used by the Stateless IP/ICMP Translation (SIIT) protocol.

Stack Overflow user rockerBOO explained:
Windows 7 has IPv6 enabled by default. Even though my server listens on IPv4 only, Windows 7 sends the ::ffff: prefix to the IPv4 as part of the transition to IPv6.

node.js - Express.js req.ip is returning ::ffff: - Stack Overflow
IPv6 address - Wikipedia, the free encyclopedia

Sunday, October 4, 2015

Node.js: How to get client's IP address

var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;

Wednesday, May 20, 2015

GitHub: Getting the download count for your releases

Do you own a GitHub repository? Did you ever wonder how many people downloaded your releases? Apparently there's an API for that!

For example, you can get the metadata of your latest release by making a GET request:<username>/<repo_name>/releases/latest

It returns a json payload, which has a download_count for each asset.

Getting the download count for your releases - User Documentation
Releases | GitHub API

Thursday, May 14, 2015

Android: unable to uninstall application

A friend of mine wanted to uninstall an app from his Android phone. But for some reasons, the "Uninstall" option is disabled. I tried running adb uninstall <package_name>, but it failed to uninstall.

Checking logcat, there was a warning:
W/PackageManager: Not removing package has active device admin

Basically, this app has device admin features enabled, meaning it can erase your phone's data if you lost your phone for example. So we need to first go into Settings > Location and Security > Device Administrator, and disable the app before we can uninstall it.

uninstall - How to remove an app with active device admin enabled on Android? - Stack Overflow