Third task: Calculate the size of a directory and its contents
The "du" command is your friend here.
The real miss here is in trying to do it without googling but not bothering to search manpages. They're there for a reason. If you're unsure of what to look for, "man -k <keyword>" to search.
For filtering networks, netfilter has a "limit" module that can be used to, for example, automatically limit all remote IPs to a set number of connections, rather than trying to piecemeal block bad actors. You can also do things like rate limit new connections, etc. Because it works off the chain-based approach, any known-good systems can be separately allowed through first (or allowed unlimited connections) before the limiting rule is applied.