6.4 KiB
6.4 KiB
SOF
MOUNTING GOOGLE DRIVES TO 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
- vncserver :1
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
- vncserver -kill :1
START VNC
############################################################################################## 5A
- vncserver :1
############################################################################################### B
MOUNTING GOOGLE CLOUD DRIVE
INSTALL OPAM
############################################################################################## 1B
- sudo apt install opam
CREATE OPAM CONFIG
############################################################################################## 2B
cat << EOF >> /tmp/profile
test -r /home/dr1p/.opam/opam-init/init.sh && . /home/dr1p/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
echo 'PATH="$PATH:$HOME/.opam/default/bin"' >> /tmp/profile
eval $(opam env)
EOF
COPP OPAM CONFIG INTO RC/PROFILE ENVIRON
############################################################################################## 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
- google-drive-ocamlfuse &
VERIFY THESE TWO FILES EXIST WITH CONTENT
############################################################################################## 6B
cat ~/.gdfuse/default/state
cat ~/.gdfuse/default/config
KILL THE BACKGROUNDED TASK
############################################################################################## 7B
- kill %1
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=dr1p
Group=dr1p
ExecStart=/home/dr1p/.opam/default/bin/google-drive-ocamlfuse -label default /home/dr1p/.gdrive_one
ExecStop=fusermount -u /home/dr1p/googledrive
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 /home/dr1p/.gdrive_two