This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] |
OlderNewer