download outside GFW

Download file in outsea server

https://www.katacoda.com/
https://www.katacoda.com/courses/ubuntu/playground

1
curl -O https://iterm2.com/downloads/stable/iTerm2-3_2_7.zip

Make channel through local NAT or firewall

https://ngrok.com/
Expose local machine to internet

1
ngrok http 80

Run a upload service

run a local server by python

1
pip install bottle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
from bottle import *

base_path = os.path.dirname(os.path.realpath(__file__)) # get script path

upload_path = os.path.join(base_path, 'upload') # upload file directory
if not os.path.exists(upload_path):
os.makedirs(upload_path)

@route('/upload', method='POST')
def do_upload():
"""processing uploaded file"""
filedata = request.files.get('fileField')

if filedata.file:
file_name = os.path.join(upload_path, filedata.filename)
try:
filedata.save(file_name) # write file
except IOError:
return 'upload failed'
return 'success, file name: {}'.format(file_name)
else:
return 'upload failed'

run(port=80, reloader=False) # reloader=True auto-reloading code

Upload file from remote to local

1
2
man curl
curl -F fileField=@iTerm2-3_2_7.zip https://83bc4ec8.ngrok.io/upload -v

PS

use ngrok tcp mode may much simpler
install ngrok client in remote machine may channel through

https://bbs.csdn.net/topics/392190705
https://blog.csdn.net/u011884440/article/details/70504653?utm_source=blogxgwz6
https://blog.csdn.net/fungleo/article/details/80703365