• Home
  • About
  • Résumé
  • RunLog
  • Posts
    • All Posts
    • All Tags

Strava-Lululemon 40K/80K Challenge Hack

02 Jan 2018

Reading time ~1 minute

The script that generates the random gpx files from template files.

Shell Script

Just edit the YearMonth and Start_Date variables accordingly.

#!/usr/bin/env bash

# this script will generate over 80K of distances for strava/lulu challenge! ;)
# just change the YearMonth and Start_Date accordingly, then run the script.
# upload all the newly generated .gpx file and you're set.

YearMonth="2018-01-"
Start_Date=2

ls -1 template*.gpx | perl -MList::Util -e 'print List::Util::shuffle <>' | while read line
do
    Day=$(printf "%02d" $Start_Date)
    echo "generating $YearMonth$Day-$line ..."
    sed "s/<time>201.-..-../<time>${YearMonth}${Day}/" $line > ${YearMonth}${Day}-$line
    ((Start_Date++))
done

GPX Template Files

template-01.gpx

template-02.gpx

template-03.gpx

template-04.gpx

template-05.gpx

template-06.gpx

template-07.gpx

Instruction

Just download these file into the same directory as the script above, then run the script.

Heres an example:

$ ls -1
gen-gpx-files-for-strava-lulu-challenge.sh*
template-01.gpx
template-02.gpx
...
template-06.gpx
template-07.gpx

$ ./gen-gpx-files-for-strava-lulu-challenge.sh
generating 2018-01-02-template-07.gpx ...
generating 2018-01-03-template-01.gpx ...
...
generating 2018-01-07-template-04.gpx ...
generating 2018-01-08-template-05.gpx ...


sportrunning Share Tweet +1