This tutorial shows how to generate a random scale-free graph, perform some basic analysis (degree distribution, clustering coefficient, etc.) and watch influence of two types of attacks: random (all nodes have identical chances to be knocked out) and targeted at most connected nodes (most connected node is removed each time).
In the percolation section, note the almost immediate breakdown of the network in the second case, as opposed to the long persistence in the purely random attack. Also, notice the peak of the second-largest cluster size as the network undergoes phase transition.
The second tutorial develops a very simple simulation of infection in square lattice and scale-free network.