Last active
November 9, 2021 01:22
-
-
Save Wikunia/273a703b45d2e51daaebb8c92ad4fca2 to your computer and use it in GitHub Desktop.
Google Colab gdrive
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
- Provide API keys | |
``` | |
!apt-get install -y -qq software-properties-common python-software-properties module-init-tools | |
!add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null | |
!apt-get update -qq 2>&1 > /dev/null | |
!apt-get -y install -qq google-drive-ocamlfuse fuse | |
from google.colab import auth | |
auth.authenticate_user() | |
from oauth2client.client import GoogleCredentials | |
creds = GoogleCredentials.get_application_default() | |
import getpass | |
!google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret} < /dev/null 2>&1 | grep URL | |
vcode = getpass.getpass() | |
!echo {vcode} | google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret} | |
``` | |
- Mount gdrive | |
``` | |
!mkdir -p drive | |
!google-drive-ocamlfuse drive | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment