def read_file(filename, mode='r'):
    """read from file"""
    content = ''
    try:
        with open(filename, mode, encoding='utf-8') as f:
            content = f.read()
    except Exception as err:
        print('[x] failed to read: {}, err: {}'.format(filename, err))
    return content