Prevent a Software to Access Network

For whatever reason, maybe you want to run a software, but don't want it to access your network at all. Here is how to do it:

Setup
sudo addgroup no-internet sudo adduser $USER no-internet sudo adduser jean-pierre no-internet sudo iptables -I OUTPUT 1 -m owner --gid-owner no-internet -j DROP sudo ip6tables -I OUTPUT 1 -m owner --gid-owner no-internet -j DROP
 * Create a group specifically for this purpose:
 * Add yourself or whoever will run the software to this group:
 * block traffic for the group (see Notes):

Usage
sg no-internet -c "/path/to/software --arguments"
 * When you want to run  without allowing it to use the network, run it as the   group owner: