  We simulate the buildup of galaxies by spherical gas accretion through dark
matter haloes, subject to the development of virial shocks. We find that a
uniform cosmological accretion turns into a rapidly varying disc buildup rate.
The generic sequence of events (Shocked-Accretion Massive Burst & Shutdown:
SAMBA) consists of four distinct phases: a) continuous cold accretion while the
halo is below a threshold mass Msh~10^12Mo, b) tentative quenching of gas
supply for ~2Gyr, starting once the halo is ~Msh and growing a rapidly
expanding shock, c) a massive burst due to the big crunch of ~10^11Mo gas in
\~0.5Gyr, when the heated gas cools and joins new infalling gas, and d) a
long-term shutdown, enhanced by a temporary shock instability in late SAMBAs,
those that quench at z~2, burst at z~1 and end up quenched in 10^12-13Mo haloes
today. These events occur at all redshifts in galaxies of baryonic mass
\~10^11Mo and involve a substantial fraction of this mass. They arise from
rather smooth accretion, or minor mergers, which, unlike major mergers, may
leave the disc intact while being built in a rapid pace. The early bursts match
observed maximum starbursting discs at z>~2, predicted to reside in <~10^13Mo
haloes. The late bursts resemble discy LIRGs at z<~1. The tentative quenching
gives rise to a substantial population of ~10^11Mo galaxies with a strongly
suppressed star-formation rate at z~1-3. The predicted long-term shutdown leads
to red & dead galaxies in groups. A complete shutdown in more massive clusters
requires an additional quenching mechanism, as may be provided by clumpy
accretion. Alternatively, the SAMBA bursts may trigger the AGN activity that
couples to the hot gas above Msh and helps the required quenching. The SAMBA
phenomenon is yet to be investigated using cosmological simulations.
