Skip to content

Instantly share code, notes, and snippets.

@saikocat
Created June 9, 2016 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saikocat/c91571b58310016c2eb2e587d250f3c4 to your computer and use it in GitHub Desktop.
Save saikocat/c91571b58310016c2eb2e587d250f3c4 to your computer and use it in GitHub Desktop.
When CTAN NUS SG mirror is so staled...
127.0.0.1 download.nus.edu.sg
$ 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
# 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"
@saikocat
Copy link
Author

saikocat commented Jun 9, 2016

screen shot 2016-06-09 at 4 19 55 pm

It works!

@saikocat
Copy link
Author

saikocat commented Jun 9, 2016

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