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
| #!/bin/bash | |
| # License: Public Domain. | |
| echo "export PYSPARK_PYTHON=python3" | tee -a /etc/profile.d/spark_config.sh /etc/*bashrc /usr/lib/spark/conf/spark-env.sh | |
| echo "export PYTHONHASHSEED=0" | tee -a /etc/profile.d/spark_config.sh /etc/*bashrc /usr/lib/spark/conf/spark-env.sh | |
| echo "spark.executorEnv.PYTHONHASHSEED=0" >> /etc/spark/conf/spark-defaults.conf | |
| # Only run on the master node | |
| ROLE=$(/usr/share/google/get_metadata_value attributes/dataproc-role) | |
| if [[ "${ROLE}" == 'Master' ]]; then |
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
| *.pyc | |
| bin/ | |
| include/ | |
| lib/ |
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 python | |
| # encoding: utf-8 | |
| """ | |
| epub_to_opds_entry.py | |
| Created by Keith Fahlgren on Tue Apr 5 21:21:02 PDT 2011 | |
| Copyright (c) 2011 Threepress. All rights reserved. | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without |
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 base64 | |
| import hashlib | |
| import hmac | |
| import simplejson as json | |
| def base64_url_decode(inp): | |
| padding_factor = (4 - len(inp) % 4) % 4 | |
| inp += "="*padding_factor | |
| return base64.b64decode(unicode(inp).translate(dict(zip(map(ord, u'-_'), u'+/')))) |