2018年2月

apt-get install opam ocaml make fuse camlp4-extra build-essential pkg-config

groupadd fuse

adduser shaobo fuse

chown root.fuse /dev/fuse

chmod 660 /dev/fuse

opam init
opam update
opam install depext
eval opam config env
opam depext google-drive-ocamlfuse
opam install google-drive-ocamlfuse
. /home/shaobo/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
安装成功后,进入Google Project建立一个Project
https://console.developers.google.com/project
进入/shaobo/.opam/system/bin/目录绑定项目
cd /shaobo/.opam/system/bin/
./google-drive-ocamlfuse -headless -label googledrive -id ##Client ID##.apps.googleusercontent.com -secret ##secret key## 执行完上述指令会返回一个https的网址在浏览器粘贴到浏览器后会进入google页面询问是否允许访问该项目,选accept然后记录下浏览器页面返回的密码,粘贴进去回车即可。
进入~/.gdfuse/googledrive
cd ~/.gdfuse/googledrive
nano config
编辑config修改内容例如
verification_code= [key returned from browser]
client_id= [eg. 1231232ccc31.apps.googleusercontent.com]
client_secret= [eg. AdddSDQWEWGSD!$@#@#ASD]
完成配置加载Google Drive远端存储到本地/googledrive
ln -s /shaobo/.opam/system/bin/google-drive-ocamlfuse /usr/local/bin/
mkdir /googledrive
cd ~/.opam/system/bin
google-drive-ocamlfuse -label googledrive /googledrive