Heimdall is a cross-platform open-source tool suite used to flash firmware (aka ROMs) onto Samsung mobile devices.
http://glassechidna.com.au/heimdall/
Install on Ubuntu
sudo apt-get install heimdall-flash-frontend heimdall-flash
Start in console
heimdall-frontend
Detect devices
sudo heimdall detect