Howto Reinstall all of currently installed packages in fresh Ubuntu install

People sometimes have to do a reinstall of their Ubuntu system for various reasons (been playing/experimenting with configuration/drivers/other packages or just because something is badly broken) but remembering all the extra packages you have...