Skip to content

Instantly share code, notes, and snippets.

http --headers \ # Print out the response headers (they would otherwise be supressed for piped ouput)
--download \ # Enable download mode
--output=./body \ # Save response body to this file
httpbin.org/get 2>&1 \ # Merge STDERR into STDOUT (with --download, console output otherwise goes to STDERR)
| grep HTTP/ \ # Find the Status-Line
| cut -d ' ' -f 2 # Get the status code
import ipaddress
from typing import Union, List
class Network:
def __init__(self, network_ips: List[str]):
self.nets = [ipaddress.ip_network(nip) for nip in network_ips]