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
| """ | |
| Helper functions to save git information every time you | |
| Requirements: | |
| - GitPython==2.1.12 | |
| (Probably works on other GitPython versions, but this is the version I've tested.) | |
| Usage: | |
| ``` |
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 | |
| # shell commands being automated. | |
| # w | |
| # aws ec2 stop-instances --instance-id INSTANCE_ID | |
| # az vm deallocate --name NAME --resource-group RESOURCE_GROUP | |
| """ | |
| The script is the easy part, installing it into the unfriendly(imo) cron system and |
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 bash | |
| # | |
| # Fix virtualenv symlinks after upgrading python with Homebrew and then running | |
| # `cleanup`. | |
| # | |
| # After upgrading Python using Homebrew and then running `brew cleanup` one can | |
| # get this message while trying to run python: | |
| # dyld: Library not loaded: @executable_path/../.Python | |
| # Referenced from: /Users/pablo/.venv/my-app/bin/python | |
| # Reason: image not found |
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
| def debug_pickle(instance): | |
| """ | |
| :return: Which attribute from this object can't be pickled? | |
| """ | |
| attribute = None | |
| for k, v in instance.__dict__.iteritems(): | |
| try: | |
| cPickle.dumps(v) | |
| except: |
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 bash | |
| #set -x | |
| ORIG_PREFIX_FILE="lib/python2.7/orig-prefix.txt" | |
| ORIG_PREFIX=$(cat ${ORIG_PREFIX_FILE}) | |
| OLD_VERSION=$(echo $ORIG_PREFIX | awk -F/ '{ print $6 }') | |
| PY_VERSION=$(/usr/local/bin/python -c 'import sys; print sys.version.split(" ")[0]') | |
| NEW_PREFIX=$(echo $ORIG_PREFIX | sed "s#${OLD_VERSION}#${PY_VERSION}#g") | |
| echo "ORIG PREFIX: ${ORIG_PREFIX}" |
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
| *.acn | |
| *.acr | |
| *.alg | |
| *.aux | |
| *.bak | |
| *.bbl | |
| *.bcf | |
| *.blg | |
| *.brf | |
| *.bst |