def generate_cert(filename, country='US', state='CA', city='Mountain View',
                  cn='anymote\/python\/googletv'):
  """Generates a self-signed certificate."""
  kwargs = {
      'city': city,
      'cn': cn,
      'country': country,
      'filename': filename,
      'state': state,
  }
  command = [
      'openssl req -x509 -nodes -days 365',
      '-subj \'/C=%(country)s/ST=%(state)s/L=%(city)s/CN=%(cn)s\'',
      '-newkey rsa:1024 -keyout %(filename)s -out %(filename)s',
  ]
  command = ' '.join(command) % kwargs
  args = shlex.split(command)
  p = subprocess.Popen(args)
dataset/ETHPy150Open stevenle/googletv-anymote/scripts/pair.py/generate_cert/original