def parse_bitcoin_conf(fd):
    """Returns dict from bitcoin.conf-like configuration file from open fd"""
    conf = {}
    for line in fd:
        line = line.strip()
        if not line.startswith('#') and '=' in line:
            key, value = line.split('=', 1)
            conf[key] = value

    return conf