Import populate script from Gist

Original code by Ori Livneh, at https://gist.github.com/atdt/5159480

Co-Author: Matthew Flaschen <mflaschen@wikimedia.org>
Bug: 46299
Change-Id: Iae074bb8fd83f2e923ccd84b3b5f80d51cd836e9
Merge "Import populate script from Gist"