Strava Cycling Climbing Challenges

Strava is a popular service for logging bike rides and other activities, which provides a way of comparing one’s achievements with those of other cyclists and runners. Competition is a powerful stimulant and a main driver behind the success of the service. Monthly “challenges”, such as a Gran Fondo (a ride of at least 100 or 130 km, depending on the time of the year) or a monthly cumulative distance or elevation gain challenge, are particularly popular on Strava.

While I regularly participate in the Cycling Distance and Gran Fondo Challenge, I do not normally sign up for the Cycling Climbing Challenge, which is meant to encourage you do ride hilly courses. I love hilly courses. In fact, most of my weekend rides are hilly, usually going from close to sea level to over 900 m and back.

Last year I averaged one century ride (at least 160.9 km / 100 miles) about every other week, so the Gran Fondo challenge is not really that much of a challenge for me. My typical centuries are about 170-190 km with 1800-2100 m of elevation gain. Yet at 7500 to 8000 m the goal for the Cycling Climbing Challenge is set so high, I could do a hilly century ride four Saturdays in a row and still miss the climbing goal. So how do other people, who do not ride 170 km into the hills every other weekend complete the climbing challenge?

I think the Strava climbing goals are designed for people who record their rides with phones or other GPS devices that rely only on satellite data for elevation. GPS-based elevation data is much less precise than lattitude-longitude data. Other popular GPS units like the Garmin Edge 1000, Garmin Edge 520 (or my o_synce Navi2coach) use a barometer for more precise elevation tracking. The problem with GPS-based elevation is that it’s noisy, it will go up and down pretty randomly but all those little ups will be added up by Strava, resulting in a considerably inflated climbing total. If you’re using a GPS device measuring relatively accurate barometric elevation, you can’t really compete against all that noisy data πŸ™

I could confirm this in group rides with other people who were using mix of equipment, where I had a chance to compare the posted stats on Strava afterwards. The iPhone or Android-app recorded totals were often 50-100% higher than the Garmin-recorded totals, for one and the same course.

Here is one random example of 4 people doing the same course up a volcano in Tenerife, Gran Canria yesterday. Note, this not my ride, I just randomly stumbled on it while looking at high scorers in the March Cycling Climbing Challenge on the Strava website. Two of these cyclists were using the Strava iPhone app, the other two were using a Garmin Edge 520:

Strava iPhone App:

Strava iPhone App:

Garmin Edge 520:

Garmin Edge 520:

As you can see, the two cyclists using the phone app posted almost double the total climbing for the course as the Garmin users, despite riding the very same roads and posting the same elevation profile for the activity (i.e. no hill repeats).

Based on evidence like that, I don’t think elevation gain competitions on Strava are happening on a level playing field! πŸ˜‰

Downloading routes from RouteLabo (Yahoo LatLongLab)

Most of the brevets I ride are with AJ NishiTokyo, a randonneuring club based in the Machida/Sagamihara area. One thing I like about their rides is that they provide a link to a RouteLabo page for each event (RouteLabo is an online map service run by Yahoo Japan). This page shows a map of the course as well as download links for KML, GPX and TCX files of the course. By copying these files to your GPS device (Garmin or other) or by uploading a KML file to Google “My Maps” for your smartphone, you can almost completely do away with the need for paper cue sheets. I navigate all my brevets and many of my personal rides by following a “breadcrumb trail” on the screen of my GPS unit.

Unfortunately other clubs often only provide a map without any download option, like this Randonneurs Tokyo 2018 BRM421 Tokyo 600 Lake Hamana (BRM421東京600ζ΅œεζΉ–ι°») page:

This does not help you much on the road. Without a link to the full RouteLabo page with download links, there’s no obvious way to obtain a GPX or KML file. You are still expected to navigate via printed turn instruction on a paper cue sheet, which I find cumbersome and error-prone.

However, there is a way!

The web page uses some Javascript code to display the map off the RouteLabo website, including a magic value that identifies the particular course to be shown. To see this value, view the source code of the page. This step varies by browser and operating system. On Chrome under MS Windows, Ctrl+U will show the source code, on a Mac under Chrome, Option+Command+U will do it. On Safari, once you enable the option via Safari > Preferences > Advanced > Show Develop Menu, you can also use Option+Command+U (just like in Chrome).

In the displayed HTML code, search until you find a line for Javascript like this one:

<script type="text/javascript" encoding="UTF-8" src="

The value consisting of 32 hexadecimal characters (128 bit) after “id=” is the magic value you’re looking for. A full RouteLabo page URI with the download options will look like this:

By replacing the value after “id=” in the URI with the ID from inside the HTML code using copy and paste, you will get a browser URI that will give you full access to the route, including route file download links to feed your GPS device of choice. You can then bookmark it for future reference. Bonne route! πŸ™‚

Huawei Nexus 6P Battery Upgrade

I’ve had my Huawei Nexus 6P for about two years now. The combination of a great camera, an excellent screen, good performance and decent battery life has made this my best smartphone ever.

However, a couple of months ago something happened as the battery capacity appeared to have collapsed dramatically. Sometimes the phone would shut down only 5 hours after I had disconnected it from the AC charger when I left home, starting off supposedly fully charged! I had to always carry a USB battery and cable with me to not risk losing the use of my phone in the middle of the day.

Attempts to recalibrate the capacity indicator helped only insofar as the phone would shut down at 14% charge instead of say 55% charge, so there was slightly more warning, but the number of hours was still too short. This actually seems to be a common problem with the Nexus 6P, which otherwise is still a great phone.

It’s not uncommon for Li-ion batteries to significantly lose capacity after about about three years, but if it happens after less than two years as in my case, that’s not very good. Fortunately, replacement batteries are available and any competent phone repair shop will be happy to do the necessary surgery to replace a battery that is on its way out. Unfortunately the days when you could simply pop open the phone case without any tools and swap the battery yourself are long gone. This is a trend started by Apple and almost every other phone maker has since followed suit. I think it’s meant to get people to buy a new phone sooner, which is good for Apple and its competitors, but bad for consumers and for the planet.

There are Youtube videos that will show you how you how to open the Nexus 6P case and disassemble the phone to swap the battery. This involves the use of a hairdryer or heat gun to soften the glue that holds it all together as well as a plastic card and a small screw driver. As I did not feel adventurous enough to attempt this myself, I contacted several phone repair shops here in Tokyo. Repair King Japan replied. Though they they didn’t have the Nexus 6P battery in stock they were happy to order one for me. Once they got it, I dropped the phone off and two hours later I could have it back with a new battery. So far it’s looking good: It’s been 40 hours since the last full charge (with battery saver mode inactive) and it’s still showing 64% with about 3 days of power left πŸ™‚

UPDATE: At 72 hours, it still had 23% charge left. At that point I connected it to a charger.

Hopefully with the new battery my Nexus 6P will be a great phone again for a few more years!

Adding Free SSL Certificates for HTTPS To Your Websites

I recently received a warning email from Google:

“Starting October 2017, Chrome (version 62) will show a ‘NOT SECURE’ warning when users enter text in a form on an HTTP page, and for all HTTP pages in Incognito mode.

The recommended solution was to migrate the affected website(s) to HTTPS. This requires an SSL certificate. There are many companies selling those for hundreds of dollars. I didn’t really want to spend that money.

It turns out there is a free alternative: The Let’s Encrypt project ( provides free SSL certificates with just enough functionality to run SSL with current browsers. It also provides automated tools that greatly assist you in obtaining and installing those certificates.

I had a default SSL host configured on my Apache 2.4 installation (inherited from a different server running Ubuntu) that I had to manually remove.

Then, when all virtual hosts only had port 80 (HTTP) enabled, I could run the certbot tool as root:

# certbot --apache

It enumerates all host names supported by your Apache installation. I ran it repeatedly, for each domain and the corresponding www. host name (e.g., in my installation and verified the results, one at a time. It will create a new virtual host file in /etc/httpd/hosts-enabled for those hosts for port 443 (HTTPS). I appended the content of that file to my existing port 80 (HTTP) virtual host file in /etc/httpd/hosts-available for that host name and deleted the new file created by certbot. That way I can track all configuration details for each website for both HTTP and HTTPS in a single file, but this purely a personal choice.

All it takes is an Apache restart to enable the new configuration.

You can test if SSL is working as expected by accessing the website with a browser using https:// instead of http:// at the start of the URI.

If you have iptables rules for port 80, you may want to replicate those for port 443 or the certificate generation / renewal may fail. Also, you want to make sure that SSLv3 is turned off on your Apache installation, to protect against the POODLE vulnerability. This required the following setting in ssl.conf:

/etc/httpd/conf.d/ssl.conf:SSLProtocol all -SSLv2 -SSLv3

The free certificates will expire in 90 days, but it’s recommended to add a daily cron job that requests renewals so that an updated key will be downloaded after 60 days, long before the old key expires. Once that is in place, maintenance of SSL keys will be totally automatic.

UPDATE (2017-11-01): If you’re using WordPress on your website, you should change the WordPress base URI to HTTPS too. To do that, log into the WordPress Dashboard. In there select Settings > General. Change the “http://” in the WordPress Address (URI) and Site Address (URI) fields to “https://” and click the Save Changes button. This ensures that any messages from WordPress to you will include secure URIs.

Nexus 6P Flashing Charge Icon

Recently the USB-C quick charger that came with my Huawei Nexus 6P appeared to stop working. I normally leave the phone charging over night, but one morning I found its battery charge was low and it hadn’t been charging. When I disconnected and reconnected it to the cable (which is reversible with USB-C connectors on both ends), the lightning bolt inside the battery charge indicator kept blinking (flashing on and off), rather than being solid on as it normally would while the device is charging.

Disconnecting and reconnecting the device or unplugging and reconnecting the charger to the wall socket made no difference whatsoever. Reversing the cable direction did not help either.

My only way to still charge the phone was to use a USB-A to USB-C cable that draws power from a PC USB socket, which is a much slower way to charge the phone. So I decided that the charger must have failed after less than a year of use. I already started looking for USB-C quick chargers on Amazon (they exist but are much more pricey than USB-A chargers), but didn’t order one yet.

Today I decided to Google for the problem and found others who had the exact same issue. It turned out that simply powering down the phone and powering it up again will fix the problem: Yepp, it will charge again!

I’m not sure what the fundamental issue is, but it seems I won’t have to rush out and buy a new charger (which wouldn’t have helped anyway!), as the issue is on the phone side.

If a simple phone reboot fixes it and it doesn’t happen too often, I guess I can live with that. The Nexus 6P has worked great for me so far.

Porting iptables to ip6tables

A couple of days ago I received an email notification by the Berkeley Security Notifications Team that a Linux server of mine had less restrictive firewall rules for IPv6 than it had for IPv4. This prompted me to update my ip6tables settings on that host to make it is as secure via IPv6 as it was for IPv4.

If you have a dual stack server with IPv4 A records and IPv6 AAAA records published in DNS, you should have it protected with firewall rules on both protocols. Even if you only publish A records and not AAAA ones, you should secure IPv6 access because its address may leak to potential attackers in other ways.

The ip6tables tool is installed as part of iptables on recent distributions, but you need to set up one set of rules for each protocol. They’re independent of each other. A (not very secure) default ip6tables configuration might look like this:

# Generated by ip6tables-save v1.4.21 on Thu Sep 24 11:17:56 2015
:OUTPUT ACCEPT [1456:118498]
-A INPUT -p ipv6-icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 22 -j ACCEPT
-A INPUT -j REJECT –reject-with icmp6-adm-prohibited
-A FORWARD -j REJECT –reject-with icmp6-adm-prohibited
# Completed on Thu Sep 24 11:17:56 2015

It’s relatively easy to port additional settings from iptables to ip6tables (e.g. in /etc/sysconfig/iptables and /etc/sysconfig/ip6tables for CentOS).

Below are some of the changes needed when porting common entries. As you can see, some names are replaced with those of IPv6 equivalents. Any IP addresses and CIDRs for ip6tables need to be written in IPv6 notation.

To easily port over IPv4 addresses, simply prefix them with “::ffff:”. If they’re followed by a bit count such as /24 (the routing prefix size), add 96 to that number (IPv6 addresses are 128 bits each versus 32 bits for IPv4). Add equivalent rules for the corresponding native IPv6 addresses as needed.

  1. Accept ping from any source:


    -A INPUT -p icmp -j ACCEPT


    -A INPUT -p ipv6-icmp -j ACCEPT

  2. Accept connection from white-listed address:


    -A SSH-IN -s -j ACCEPT


    -A SSH-IN -s ::ffff: -j ACCEPT
    -A SSH-IN -s 2345:abcd:678:42::/64 -j ACCEPT

  3. Rule to block access (after all the exceptions):


    -A INPUT -j REJECT –reject-with icmp-host-prohibited
    -A FORWARD -j REJECT –reject-with icmp-host-prohibited


    -A INPUT -j REJECT –reject-with icmp6-adm-prohibited
    -A FORWARD -j REJECT –reject-with icmp6-adm-prohibited

Filco Majestouch-2 [FKBN104M/EB2]

Recently, the space bar of the keyboard on my main machine developed a problem, so I ordered a Filco Majestouch-2 (US layout, USB version with PS/2 adapter). It uses brown Cherry MX switches.

I have always liked the feel and feedback of the original IBM PC and IBM PC/AT keyboards (which I first used in 1981). If you’re a fan of the original IBM keyboards, you’ll love this one. The Filco keyboards are not cheap, but you get what you pay for.

There are various models from Filco, some with the blue or black Cherry switches. The brown switches are recommended for general use, including office work and programming. I am very happy with mine and will probably order another one for another of my machines.

Acer One D260 system restore

The hard disk in my wife’s Acer One D260 netbook got damaged. A new hard disk is about a quarter the price of a new netbook, so I wanted to install a new drive. Like with most PCs these days there aren’t any Windows install DVDs included.

The netbook came with Windows 7 Starter, which we needed to somehow install on the new hard disk. Fortunately, the damaged hard disk was still limping along enough to use the Acer eRecovery system to create two Recovery DVDs. These should allow restoring the initial system state to a hard disk in the machine, wiping all the data on the drive.

To replace the hard disk, I had to undo seven clips around the edge of the keyboard, lift off the keyboard and disconnect the keyboard ribbon cable to the motherboard connector. Then I needed to undo 4 screws underneath and push through, to pop out the cover on the bottom of the machine. This opened access to the single memory slot and drive cage.

The 1 GB memory module on the motherboard can be replaced with a 2 GB PC3-8500 1066MHZ DDR3 module available for about $20. This is a wortwhile investment and I already have the module on order.

I replaced the damaged 250 GB WD Scorpio Blue drive with a spare 500 GB drive (available new for about $60-$80). Then I closed the cover and reinstalled the screws and then the keyboard.

With the new drive it was possible to boot off the first Recovery DVD using a USB DVD drive. The eRecovery software copied data from both DVDs to the hard disks and then rebooted. However, that reboot failed because the new drive did not yet have a Windows Master Boot record (MBR) on it. You can install an MBR from within Windows, but not from the bootable eRecovery DVD. So I had a chicken and egg problem.

I overcame this hurdle by booting off a Ubuntu Live DVD (32 bit), installing the ‘lilo’ package and telling it to install the Linux equivalent of Microsoft’s MBR code:

sudo apt-get install lilo
sudo lilo -M /dev/sda mbr

At the next attempt to boot off the hard disk, Windows started installing its components and drivers and launched into its initial configuration, just like the first time we had unboxed the machine more than two years ago. So we are back to a working Winmdows 7 machine!

Thank you, Linux — you saved my day again! πŸ™‚

Western Digital 4 KB sector drive alignment for Windows XP and 2003 server

If your existing Windows XP or Windows 2003 Server machine needs a new C: drive, there are ways of upgrading to one of the latest drives without a complete software reinstall, but you may encounter some stumbling blocks due to the new Advanced Format technology, which uses 4 KB sectors.

When one of my PCs developed hard disk problems and I had to upgrade one of its drives, I also checked out my other machines. I found the C: drive of a Windows 2003 Server machine was about to fail. Windows 2003 is basically the server version of Windows XP, with which it shares most components. I opted for a 1 TB WD Red drive (WD10EFRX) by Western Digital, since these drives are designed for 24/7 operation, primarily for use in Network Attached Storage (NAS) appliances (desktop drives are only designed for an 8 hours on, 16 hours off use pattern).

I did not want to reinstall everything from scratch on that machine, so I used a Linux boot DVD and the GNU dd utility to mirror the failing drive onto the new WD Red drive (“sudo dd if=/dev/sda of=/dev/sdb”). As a result, all the partitions were in the same place and the same size as on the old drive, a Seagate Barracuda 7200.11 320 GB. The partitions on the old drive had not been aligned on 4 KB boundaries as is recommended to get decent performance on modern Advanced Format drives, so I needed to run an align tool to move the partition to the proper place. Western Digital offers one free to its customers, so that should be easy then, right?

No quite. I encountered all the troubles described by others in this thread: Basically, the download link for the WD Align tool (AcronisAlignTool_s_e_2_0_111.exe) takes you back to the same page, over and over, without error message. It turns out that you need to be registered and logged in to the WD site for the download link to do anything. You need to register both your contact details (name, e-mail address, postal address, phone number) and your hard disk’s serial number. For the latter I had to shut down the machine again and take out the drive once more to take a look, because the number is not printed on the cardboard box, only on the drive itself.

Once I registered my new drive, a download link did appear next to the registered product, but from it I found I could only download Acronis True Image and not the Acronis Align Tool (Advanced Format Software, WD Align). The WD Red series drives are all Advanced Format Drives, as is pretty much every drive made since 2011, but WD say it is designed for NAS use and hence don’t see the need for a fix for what they see as a Windows XP problem.

Various people online recommended a download site in Ukraine that apparently offers a copy of that program, but if you’re downloading from sites like that you risk installing malware on your computer. Beware!

There is a safer solution. I had to register another Western Digital drive, an old WD10EARS to get a usable download link for Advanced Format Software. If you don’t happen to have one lying around, a Google image search for WD10EARS will show you many photographs of disk drives with clearly readable serial numbers on the label. And apparently, these serial numbers will do the trick! πŸ˜‰

After I downloaded the software, I ran it to make a bootable CD (it also seems to be Linux-based), booted and ran it and 1 hour and 30 minutes later my C: partition was showing up as properly aligned.

I can understand that Western Digital wants to restrict the use of licensed Acronis software to its own customers, denying other brands a free ride. However, the hoops it is making people jump through to be able to use one of their new drives as an upgrade to an existing Windows XP machine is just ridiculous. If a login is required to do the download, it should clearly say so. And if a drive uses 4 KB sectors (Advanced Format), its serial number should qualify you for the download. There are millions of existing XP users out there still and many will need new hard disks before they need a new computer.

A hilly 200 km brevet in scenic Izu peninsula

Yesterday I cycled 200 km across the mountains of west Izu (Shizuoka prefecture, Japan) on my Bike Friday folding bike. I had resolved do at least one century ride (160+ km) every calendar month of this year, some of them organised events, but most personal rides. BRM309 200 km by AJ NishiTokyo was my first official brevet of the year. I completed it in an official time of 12:58, i.e. just over half an hour under the 13 1/2 hour time limit.

The scenery was beautiful and the weather perfect but the course tough. With a highest point of 450 m, I first found it hard to believe that this course should really have more climbing (3159 m total) than the 300 km Fuji brevet I did last May (2800 m total), but except for the first and last 10% and some short stretches through the towns on the coast, this was a pedal-powered roller coaster! On the smaller roads grades of 8-11 percent were not uncommon.

I loaded the Bike Friday into the Prius the night before (no need to fold the bike or take off the wheels), went to bed at midnight and got up at 04:00. A little after 06:00 I got off Tomei expressway at Numazu and drove near Mishima station, where I found a 1000 yen ($10.50) a day car park. One couple dressed like randonneurs was already setting up their bikes in there.

An hour from home on the expressway it had suddenly struck me I had left my reflective vest at home. No vest, no brevet! But it was already too late to turn back. Fortunately the organisers had some stock and sold me one for 1600 yen ($17). To start with I was wearing new bib shorts and new jerseys (two layers for the morning and evening chill). GS Astuto’s HauteRoute shorts proved exceptionally comfortable, like wearing your best pair of pajamas at home. I sweated a lot, in fact my cheeks were white with salt afterwards, but the shorts and jersey kept me comfortable. The deep pockets safely stored wallet, camera, keys and some food.

There were 60 riders in two blocks of 30, starting at 7:30 and 8:00. They started us in smaller groups. I was wearing my heart rate belt and wanted to aim for a consistent workout throughout the day, but I worked much harder during the first 50 km than I had intended and less hard later on. When you have some other fast guys to follow (which would save you having to navigate) it is tempting to hang on at whatever cost. We headed through town and along a river to the south. After 20 km the route started climbing, peaking at a tunnel about 450 m above sea level, then down to the coast. We made the first 50 km in 2 1/2 hours, putting me more than half an hour ahead of the pace needed for completing in time, and that is what I also finished with.

I glimpsed Mt Fuji across the bay from near Toi.

The coastal road went to Matsuzaki through many tunnels and a couple of climbs. After Matsuzaki we climbed the second highest pass on a small mountain road and it was very pretty. Plum trees (ume) were in bloom everywhere.

PC1 (point de contrΓ΄le 1) was at 95 km, almost at the half way point, but there had also been a safety check at the first tunnel (lights!). We were given pastries baked in the shape of bicycle cranks.

From the control point we headed west to the coast, which we mostly stayed on. As mentioned before, the coastal road goes mostly up and down. It only becomes level again at the north west corner of Izu. The top third of the west coast was the hardest part. There were few villages, no shops and it was gradually getting dark. I had somehow expected the second half of the ride to be easier than the first because the maximum elevations were much lower, but it was actually harder. Between Toi and the north coast there were no flat portions in towns between descents and climbs, because there were no towns (or more appropriately, there were no towns there because there was no flat land).

The following was a sign we had to spot and then write down the Kanji characters, as part of a quiz question. As a Kanji-challenged foreigner, I got dispensation to bring back a picture instead:

Izu used to have a lot of terraced rice fields built into the hills because there wasn’t much flat land. Much of these fields now lie fallow or have been turned into sugi tree plantations contributing to the hay fever epidemic in Tokyo.

Mt Fuji at dusk:

I completed!

Having my brevet card checked at the finish:

Garmin Edge 500 on long rides

Since January I’ve been using a Garmin Edge 500 with heart rate monitor strap for logging bike rides. Garmin quotes a battery life of “up to 18 hours”. After this 13 hour bike ride, it showed a remaining battery capacity of 21%. Extrapolating from this, the battery would have lasted about 16 hours in total.

I was not just logging the ride (GPS data) but also using the heart rate strap and had the Garmin track a course with turn-by-turn instructions, which probably draws a bit more power. I had created the course as a TCX file in RideWithGPS while looking at the course as published on

In any case, 16 hours is enough for a 200 km brevet with its 13 1/2 hour time limit, but not enough for a 300 km brevet with its 20 hour limit, unless you are a really fast cyclist and/or the course is extremely flat. For my 300 km brevet I am planning to use my Garmin Edge 500 power hack, a special USB cable that allows me to charge the device while logging and navigating.