Raspberry pi snippets

Files

Syncing folders to Google Drive

This is particularly useful if your school have a (free) Google Apps for Education subscription which gives all students unlimited Google Drive storage.

Try using rClone.

Install rClone

curl https://rclone.org/install.sh | sudo bash
Setup Google Drive
rclone config
Then follow the dialogue.

Compressing and decompressing files

Uncompressing multiple tar files from the command line

This command decompresses all the tar files in a directory and saves them to a directory which it will create which is called the same thing as the tar file without the extension.

For instance, if you were trying to decompress the Waymo Open Dataset for building driverless cars, the following might happen:

Input file Output folder
training_0000.tar training_0000/
training_0001.tar training_0001/
training_0002.tar training_0002/

(and so on)

for f in *.tar; do mkdir "${f%%.*}" && tar xf "$f" -C "${f%%.*}"; done