code: def whereami():
    
    # If the metadata endpoint responds, this is an EC2 instance
    # If it doesn't, we can safely say this isn't EC2 and try the other options
    try:
      response = http_get_metadata("instance-id", 1)
      if response[:2] == "i-":
        return "ec2"
    except:
      pass
  
    # Virtualbox?
    try:
      if is_in_virtualbox():
        return "virtualbox-kvm"
    except:
      pass
  
    # Outside virtualbox/vagrant but not in aws; hostname is "<name>.local"
    hostname = gethostname()
    if re.findall(r"\.local$", hostname):
      return "local"
  
    # we have no idea where we are
    return "unknown"
docs: Determine if this is an ec2 instance or "running locally"
    Returns:
      "ec2" - this is an ec2 instance
      "virtualbox-kvm" - kernel VM (virtualbox with vagrant)
      "local" - running locally and not in a known VM
      "unknown" - I have no idea where I am