# ngrok ssh https://dashboard.ngrok.com/cloud-edge/endpoints https://learningsky.io/access-raspberry-pi-from-outside-network/  - error fix ./ngrok authtoken 1rCuDQZ1WuhfxxxxxxxxxxxxxxxxxxxxxxDjrNr1ANYwKLL3cEsxTE - result    # screen command `sudo apt-get install screen`下載screen `screen -S ngrok_back`啟動一個名為ngrok_back的screen `./ngrok tcp 22`啟動ngrok連線 `ctrl+a+d`暫時離開當前screen,使用此方法維持NGROK運作 `screen -ls`列出正在運作的screen  `screen -r 16100`進入ID為16100的sheel  link: - http://mufeng-blog.logdown.com/posts/158421-linux-under-the-screen-instructions - https://blog.csdn.net/x_zcl/article/details/50622201 # google sheet update url https://www.learncodewithmike.com/2021/06/pandas-and-google-sheets.html https://www.maxlist.xyz/2018/09/25/python_googlesheet_crud/  - example code ``` import subprocess import time import pyngrok import gspread from oauth2client.service_account import ServiceAccountCredentials # 啟動ngrok ngrok_process = subprocess.Popen(['./path/to/ngrok', 'http', '5000']) # 5000是你本地Web服務器的端口號 time.sleep(5) # 等待ngrok啟動,可以根據需要調整等待時間 # 獲取ngrok公開的URL ngrok_url = pyngrok.ngrok.get_ngrok_tunnel().public_url # 連接到Google試算表 scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive'] credentials = ServiceAccountCredentials.from_json_keyfile_name('path/to/credentials.json', scope) client = gspread.authorize(credentials) spreadsheet = client.open('你的試算表名稱') worksheet = spreadsheet.sheet1 # 在試算表中寫入URL worksheet.update_cell(1, 1, ngrok_url) # 等待一段時間,確保URL已傳輸到Google試算表 time.sleep(5) # 停止ngrok進程 ngrok_process.terminate() ``` - google sheet test code(done) ``` from google.oauth2.service_account import Credentials import gspread import pandas as pd scope = ['https://www.googleapis.com/auth/spreadsheets'] creds = Credentials.from_service_account_file("robotfishngrokurl.json", scopes=scope) gs = gspread.authorize(creds) sheet = gs.open_by_url('https://docs.google.com/spreadsheets/d/1ae-90q2kxzyYXTdymz-ZNUurXK0H7FY1Gb4xCz2qfs0/edit?usp=sharing') worksheet = sheet.get_worksheet(0) df = pd.read_csv('hand_detect_output.csv') # df.fillna(0) worksheet.update([df.columns.values.tolist()] + df.values.tolist()) ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up