SOF
MOUNTING GOOGLE DRIVES ON CLOUD INSTANCES TO INCREASE CAPACITY
############################################################################################### A
SETTING UP CLOUD VNC FOR GOOGLE AUTHORIZATION
INSTALL DESKTOP GUI ENVIRONMENT & VNC
############################################################################################## 1A
- sudo apt update
- sudo apt install ubuntu-desktop
- sudo apt install tightvncserver
- sudo apt install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
START VNC
############################################################################################## 2A
CREATE VNC CONFIG
############################################################################################## 3A
cat << EOF > ~/.vnc/xstartup
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &
EOF
KILL VNC
############################################################################################## 4A
START VNC
############################################################################################## 5A
############################################################################################### B
MOUNTING GOOGLE CLOUD DRIVE
INSTALL OPAM
############################################################################################## 1B
CREATE OPAM CONFIG
############################################################################################## 2B
cat << EOF >> /tmp/profile
test -r ~/.opam/opam-init/init.sh && . ~/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
echo 'PATH="$PATH:$HOME/.opam/default/bin"' >> /tmp/profile
eval $(opam env)
EOF
COPY OPAM CONFIG INTO RC/PROFILE ENVIRONMENT
############################################################################################## 3B
- cat /tmp/profile >> ~/.profile
- cat /tmp/profile >> ~/.bashrc
- rm /tmp/profile
- source ~/.bashrc
FINISH OPAM INSTALLATION
############################################################################################## 4B
- opam init
- opam update
- opam install depext
- opam depext google-drive-ocamlfuse
- opam install google-drive-ocamlfuse
SEND TO BACKGROUND AS TASK
############################################################################################## 5B
VERIFY THESE TWO FILES EXIST WITH CONTENT
############################################################################################## 6B
cat ~/.gdfuse/default/state
cat ~/.gdfuse/default/config
KILL THE BACKGROUNDED TASK
############################################################################################## 7B
SINGLE GOOGLE DRIVE, LABEL IS DEFAULT
############################################################################################## 8B
- mkdir ~/.gdrive_one
- google-drive-ocamlfuse ~/.gdrive_one
############################################################################################## 9B
- mount|grep google
- df -h|grep google
HOWTO UNMOUNT GOOGLE DRIVE
############################################################################################# 10B
- fusermount -u ~/.gdrive_one
AUTO-MOUNT GOOGLE DRIVE ON BOOT
############################################################################################# 11B
cat << EOF >> /etc/systemd/system/google-drive.service
[Unit]
Description=FUSE filesystem over Google Drive
After=network.target
[Service]
User=$USER
Group=$USER
ExecStart=/home/$USER/.opam/default/bin/google-drive-ocamlfuse -label default /home/$USER/.gdrive_one
ExecStop=fusermount -u /home/$USER/.gdrive_one
Restart=always
Type=forking
[Install]
WantedBy=multi-user.target
Alias=google-drive.service
EOF
TESTING BOOT SERVICE
############################################################################################# 12B
- sudo systemctl daemon-reload
- sudo systemctl start google-drive
- sudo systemctl status google-drive
MULTIPLE GOOGLE DRIVES, LABEL IS GDRIVE_TWO
############################################################################################# 13B
- mkdir ~/.gdrive_two
- google-drive-ocamlfuse -label gdrive_two ~/.gdrive_two
EOF