Created
June 9, 2016 08:23
-
-
Save saikocat/c91571b58310016c2eb2e587d250f3c4 to your computer and use it in GitHub Desktop.
When CTAN NUS SG mirror is so staled...
This file contains 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
127.0.0.1 download.nus.edu.sg |
This file contains 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
$ sudo mitmproxy -s proxy.py -p 80 -R http://127.0.0.1:8000 | |
# Open another terminal | |
# 9 June 2016 - the day when the mirror is not yet sync | |
$ brew install basictex |
This file contains 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
# http://ftp.jaist.ac.jp/pub/CTAN/systems/mac/mactex/mactex-basictex-20160523.pkg | |
# http://download.nus.edu.sg/mirror/ctan/systems/mac/mactex/mactex-basictex-20160523.pkg | |
def request(ctx, flow): | |
if flow.request.path.startswith('/mirror/ctan'): | |
flow.request.scheme = 'http' | |
flow.request.host = "ftp.jaist.ac.jp" | |
flow.request.port = 80 | |
flow.request.path = "/pub/CTAN/systems/mac/mactex/mactex-basictex-20160523.pkg" |
I feel like a real idiot, could have just brew cask edit basictex
instead and fix the url there. Oh well, it was a good learning experience.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It works!