is there a way to access my data from Google Team Drive? I used the provided code, but can only access my normal drive and not Team Drive:
!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}
I appreciate every help!
You may use the REST API to manage your Team Drive. Check this documentation. Here's a list of methods for this resource:
create
Creates a new Team Drive.
delete
Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items.
get
Gets a Team Drive's metadata by ID.
list
Lists the user's Team Drives.
update
Updates a Team Drive's metadata
Related
I'm trying to mount my drive on Colab using the following code:
from google.colab import drive
drive._mount('/content/drive')
And I'm getting the following error:
298 # Terminate the DriveFS binary before killing bash.
ValueError: mount failed: invalid oauth code
Tried deleting cookies, restarting the session, but nothing seems to work. I am using a few different google accounts, and only one has a Colab Pro subscription.. but this wasn't an issue till today.
Thanks.
for the moment the only solution that is working right now is this from this similar question but two months ago:
!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}
%cd /content
!mkdir drive
%cd drive
!mkdir MyDrive
%cd ..
%cd ..
!google-drive-ocamlfuse /content/drive/MyDrive
Let's hope the normal way drive.mount will be fixed soon !
Here is the solution you can try:
As of new (messed up) update you can not mount using drive._mount anymore (or at least for now). So what you can do is either copy your folder/directory from your other google drive to your current google drive (the account you are log in to colab with) OR you can simply log out from colab and log in with your google account that has the drive you want to mount to
Remember
use drive.mount and not drive._mount after following the above guideline
I have an Ubuntu server that is joined to our windows domain. Users login via SSH using AD creds. I have a script that allows me to mount a windows share using cifs.
sudo mount.cifs //server/$1 /home/DOMAIN/$1/D -o user=$1,uid=$1,gid=domain\ users
I then have this entered in my /etc/bash.bashrc
#If ~/D does not exist, create it
if [ ! -d ~/D ]; then
mkdir ~/D
fi
#Mount D drive to ~/D
sudo /usr/local/bin/mountsamba.sh $USER
What I am trying to do is get it so it doesn't ask for the password and just uses the credentials that I use for logging into the server.
I actually got it figured out. Install keyutils and created this bash script:
BASH
sudo mount -t cifs //tiberius/$1 /home/NTGROUP/$1/D -o user=$1,cruid=$1,sec=krb5,uid=$1,gid=domain\ users
Then I added this into /etc/bash.bashrc
BASH
#If ~/D does not exist, create it
if [ ! -d ~/D ]; then
mkdir ~/D
fi
#Mount D drive to ~/D
sudo /usr/local/bin/mountsamba.sh $USER
Then in /etc/sudoers, I have:
BASH
ALL ALL=(root) NOPASSWD: /usr/local/bin/mountsamba.sh
I've been using a script to mount two google drives on one google drive runtime to move files around, but it complains that I'm out of space when I'm moving the large files. I tried running it one file at a time and I'm still stuck on the large files...
Edit:
I use
from google.colab import drive
drive.mount('/drive1')
and
!apt-get install -y -qq software-properties-common 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}
!mkdir -p /drive2
!google-drive-ocamlfuse /drive2
to mount the two drives, then I tried a simple copy:
!cp -vru /drive2/folder /drive1/folder
but it kept failing due to the drive space. I also tried splitting the files using zip (without copying it to the google colab file system first), so all the data stays in the google drive
! zip -r -db -dc -Z bzip2 -T -m -s 5g /drive1/zipfilename /drive1/folder
but I still kept running out of space.
I have been using colab lately and till now I used google-drive-ocamlfuse to link my project to my drive but not it is unable to load package.
!apt-get update -qq 2>&1 > /dev/null
!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
!add-apt-repository ppa:alessandro-strada/google-drive-ocamlfuse-beta
!apt-get update -qq 2>&1 > /dev/null
!apt-get -y install -qq google-drive-ocamlfuse fuse
got referenced form here
https://medium.com/#burakteke/tutorial-on-using-google-colab-for-kaggle-competition-620393c22821
till yesterday it was working like a charm but today it suddenly stopped working.
This should work fine as per https://github.com/astrada/google-drive-ocamlfuse/issues/493#issuecomment-422380636
Change the build between amd64, arm64, armhf, i386 from https://launchpad.net/~alessandro-strada/+archive/ubuntu/ppa/+packages
!apt-get install -y -qq software-properties-common python-software-properties module-init-tools
!wget https://launchpad.net/~alessandro-strada/+archive/ubuntu/google-drive-ocamlfuse-beta/+build/15331130/+files/google-drive-ocamlfuse_0.7.0-0ubuntu1_amd64.deb
!dpkg -i google-drive-ocamlfuse_0.7.0-0ubuntu1_amd64.deb
!apt-get install -f
!apt-get -y install -qq 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}
An even simpler fix is to use the built-in Drive FUSE client:
from google.colab import drive
drive.mount('/content/gdrive')
More details:
https://colab.research.google.com/notebooks/io.ipynb#scrollTo=u22w3BFiOveA
I have a hard time figuring out how a TAR file works. I wish to build an application that extracts a tar file while it's being downloaded. But I can't seem to find anything related to this subject.
Is this possible? How does a TAR file internally work? I have a small feeling that this is not going to be possible.
Suggestions:
curl -s https://example.com/dir/file.tar.gz | tar zx #silent
curl https://example.com/dir/file.tar.gz | tar zx
curl https://example.com/dir/file.tar.gz | tar zvx #view files while unpacked
curl https://example.com/dir/file.tar.gz | pv -s$BYTES | tar zx #view progress
If you don't have curl or pv, you might be able to install with sudo apt install curl pv or sudo yum install curl pv.