With the ongoing explosion of data production and availability of devices with computational capabilities, traditional centralized data-processing techniques start to suffer from the increasing costs of data transfer, infrastructure, security and privacy needs. The edge/fog computing paradigm has emerged to meet these challenges, particularly for Internet of Things and open Cyber-Physical Systems. It processes data where it is generated in order to address the shortcomings of centralized techniques. However, decentralized architectures have their own challenges: handling device unreliability, data volatility, and coping with conficting goals. Aggregate Programming is a recent abstraction allowing one to program large-scale networks in a simple way, while providing strong guarantees on the resilience of the resulting behaviour under changes and unreliability. This abstraction shifts the local viewpoint of single device behaviour, to the global viewpoint of overall system behaviour; leaving the (automated) global-to-local translation to language implementation. This short course presents the Aggregate Programming abstraction, together with its commonly used distributed algorithms that have strong resilience guarantees, and its toolkit (programming language and simulator).