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 requests | |
| import gzip | |
| import ip2asn # pip3 install ip2asn | |
| rsp = requests.get('https://iptoasn.com/data/ip2asn-v4-u32.tsv.gz') | |
| open('/tmp/ip2asn-v4-u32.tsv', 'wb').write(gzip.decompress(rsp.content)) | |
| i2a = ip2asn.IP2ASN('/tmp/ip2asn-v4-u32.tsv') | 
  
    
      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
    
  
  
    
  | #!/usr/bin/env python3 | |
| # A script to print netstat output correlated with process path | |
| from os.path import abspath, expandvars, expanduser | |
| import shlex | |
| import subprocess | |
| from re import sub as rgxsub | |
| COMMS = dict() | 
  
    
      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
    
  
  
    
  | #!/usr/bin/env python3 | |
| import argparse | |
| from csv import DictReader | |
| from os.path import expanduser, expandvars, abspath | |
| from io import StringIO | |
| import json | |
| def expand_path(path: str): | |
| return abspath(expandvars(expanduser(path))) | 
  
    
      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
    
  
  
    
  | # Setup HomeBrew: https://brew.sh/ | |
| brew install openblas | |
| mkdir /tmp/numpy_local | |
| cd /tmp/numpy_local | |
| pip3 download --no-binary :all: --no-deps numpy | |
| unzip numpy-*.zip # (assuming there's only one version in this folder) | |
| cd numpy-1.19.1 # the version may be a later version than this | |
| cat > site.cfg <<EOF | |
| [openblas] |