diff --git a/published/20180206 Building Slack for the Linux community and adopting snaps.md b/published/20180206 Building Slack for the Linux community and adopting snaps.md new file mode 100644 index 0000000000..371adf6568 --- /dev/null +++ b/published/20180206 Building Slack for the Linux community and adopting snaps.md @@ -0,0 +1,76 @@ +采用 snaps 为 Linux 社区构建 Slack +====== + +![][1] + +作为一个被数以百万计用户使用的企业级软件平台,[Slack][2] 可以让各种规模的团队和企业有效地沟通。Slack 通过在一个单一集成环境中与其它软件工具无缝衔接,为一个组织内的通讯、信息和项目提供了一个易于接触的档案馆。尽管自从诞生后 Slack 就在过去四年中快速成长,但是他们负责该平台的 Windows、MacOS 和 Linux 桌面的工程师团队仅由四人组成。我们采访了这个团队的主任工程师 Felix Rieseberg(他负责追踪[上月首次发布的 Slack snap][3],LCTT 译注:原文发布于 2018.2),来了解更多有关该公司对于 Linux 社区的态度,以及他们决定构建一个 snap 软件包的原因。 + +- [安装 Slack snap][4] + +### 你们能告诉我们更多关于已发布的 Slack snap 的信息吗? + +作为发布给 Linux 社区的一种新形式,我们上月发布了我们的第一个 snap。在企业界,我们发现人们更倾向于以一种相对于个人消费者来说较慢的速度来采用新科技,因此我们将会在未来继续提供 .deb 形式的软件包。 + +### 你们觉得 Linux 社区会对 Slack 有多大的兴趣呢? + +我很高兴在所有的平台上人们都对 Slack 的兴趣越来越大。因此,很难说来自 Linux 社区的兴趣和我们大体上所见到的兴趣有什么区别。当然,不管用户们在什么平台上面工作,满足他们对我们都是很重要的。我们有一个专门负责 Linux 的测试工程师,并且我们同时也会尽全力提供最好的用户体验。 + +只是我们发现总体相对于 Windows 来说,为 Linux 搭建 snap 略微有点难度,因为我们是在一个较难以预测的平台上工作——而这正是 Linux 社区之光照耀的领域。在汇报程序缺陷以及寻找程序崩溃原因方面,我们有相当多极有帮助的用户。 + +### 你们是如何得知 snap 的? + +Canonical 公司的 Martin Wimpress 接触了我,并向我解释了 snap 的概念。说实话尽管我也用 Ubuntu 但最初我还是迟疑的,因为它看起来像需要搭建与维护的另一套标准。然而,一当我了解到其中的好处之后,我确信这是一笔值得的投入。 + +### snap 的什么方面吸引了你们并使你们决定投入其中? + +毫无疑问,我们决定搭建 snap 最重要的原因是它的更新特性。在 Slack 上我们大量运用了网页技术,这些技术反过来也使得我们提供大量的特性——比如将 YouTube 视频或者 Spotify 播放列表集成在 Slack 中。与浏览器十分相似,这意味着我们需要频繁更新应用。 + +在 MacOS 和 Windows 上,我们已经有了一个专门的自动更新器,甚至无需用户关注更新。任何形式的中断都是一种我们需要避免的烦恼,哪怕是为了更新。因此通过 snap 自动化的更新就显得更加无缝和便捷。 + +### 相比于其它形式的打包方式,构建 snap 感觉如何?将它与现有的设施和流程集成在一起有多简便呢? + +就 Linux 而言,我们尚未尝试其它的“新”打包方式,但我们迟早会的。鉴于我们的大多数用户都使用 Ubuntu,snap 是一个自然的选择。同时 snap 在其它发行版上同样也可以使用,这也是一个巨大的加分项。Canonical 正将 snap 做到跨发行版,而不是仅仅集中在 Ubuntu 上,这一点我认为是很好的。 + +搭建 snap 极其简单,我们有一个创建安装器和软件包的统一流程,我们的 snap 创建过程就是从一个 .deb 软件包炮制出一个 snap。对于其它技术而言,有时候我们为了支持构建链而先打造一个内部工具。但是 snapcraft 工具正是我们需要的东西。在整个过程中 Canonical 的团队非常有帮助,因为我们一路上确实碰到了一些问题。 + +### 你们觉得 snap 商店是如何改变用户们寻找、安装你们软件的方式的呢? + +Slack 真正的独特之处在于人们不仅仅是碰巧发现它,他们从别的地方知道它并积极地试图找到它。因此尽管我们已经有了相当高的觉悟,我希望对于我们的用户来说,在商店中可以获得 snap 能够让安装过程变得简单一点。 + +我们总是尽力为用户服务。当我们觉得它比其他安装方式更好,我们就会向用户更多推荐它。 + +### 通过使用 snap 而不是为其它发行版打包,你期待或者已经看到的节省是什么? + +我们希望 snap 可以给予我们的用户更多的便利,并确保他们能够更加喜欢使用 Slack。在我们看来,鉴于用户们不必被困在之前的版本,这自然而然地解决了许多问题,因此 snap 可以让我们在客户支持方面节约时间。snap 对我们来说也是一个额外的加分项,因为我们能有一个可供搭建的平台,而不是替换我们现有的东西。 + +### 如果存在的话,你们正使用或者准备使用边缘 (edge)、测试 (beta)、候选 (candidate)、稳定 (stable) 中的哪种发行频道? + +我们开发中专门使用边缘 (edge) 频道以与 Canonical 团队合作。为 Linux 打造的 Slack 总体人处于测试 (beta) 频道中。但是长远来看,拥有不同频道的选择十分有意思,同时能够提早一点为感兴趣的客户发布版本也肯定是有好处的。 + +### 你们如何认为将软件打包成一个 snap 能够帮助用户?你们从用户那边得到了什么反馈吗? + +对我们的用户来说一个很大的好处是安装和更新总体来说都会变得简便一点。长远来看,问题是“那些安装 snap 的用户是不是比其它用户少碰到一些困难?”,我十分期望 snap 自带的依赖关系能够使其变成可能。 + +### 你们对刚使用 snap 的新用户们有什么建议或知识呢? + +我会推荐从 Debian 软件包来着手搭建你们的 snap ——那出乎意料得简单。这同样也缩小了范围,避免变得不堪重负。这只需要投入相当少的时间,并且很大可能是一笔值得的投入。同样如果你们可以的话,尽量试着找到 Canonical 的人员来协作——他们拥有了不起的工程师。 + +### 对于开发来说,你们在什么地方看到了最大的机遇? + +我们现在正一步步来,先是让人们接受 snap,再从那里开始搭建。正在使用 snap 的人们将会感到更加稳健,因为他们将会得益于最新的更新。 + +-------------------------------------------------------------------------------- + +via: https://insights.ubuntu.com/2018/02/06/building-slack-for-the-linux-community-and-adopting-snaps/ + +作者:[Sarah][a] +译者:[tomjlw](https://github.com/tomjlw) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://insights.ubuntu.com/author/sarahfd/ +[1]:https://insights.ubuntu.com/wp-content/uploads/a115/Slack_linux_screenshot@2x-2.png +[2]:https://slack.com/ +[3]:https://insights.ubuntu.com/2018/01/18/canonical-brings-slack-to-the-snap-ecosystem/ +[4]:https://snapcraft.io/slack/ diff --git a/sources/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 6 Screen01.md b/sources/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 6 Screen01.md index 0b3cc3940c..ad479ae35a 100644 --- a/sources/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 6 Screen01.md +++ b/sources/tech/20150616 Computer Laboratory - Raspberry Pi- Lesson 6 Screen01.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qhwdw) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20180724 How To Mount Google Drive Locally As Virtual File System In Linux.md b/sources/tech/20180724 How To Mount Google Drive Locally As Virtual File System In Linux.md deleted file mode 100644 index 3f804ffe9e..0000000000 --- a/sources/tech/20180724 How To Mount Google Drive Locally As Virtual File System In Linux.md +++ /dev/null @@ -1,265 +0,0 @@ -How To Mount Google Drive Locally As Virtual File System In Linux -====== - -![](https://www.ostechnix.com/wp-content/uploads/2018/07/Google-Drive-720x340.png) - -[**Google Drive**][1] is the one of the popular cloud storage provider on the planet. As of 2017, over 800 million users are actively using this service worldwide. Even though the number of users have dramatically increased, Google haven’t released a Google drive client for Linux yet. But it didn’t stop the Linux community. Every now and then, some developers had brought few google drive clients for Linux operating system. In this guide, we will see three unofficial google drive clients for Linux. Using these clients, you can mount Google drive locally as a virtual file system and access your drive files in your Linux box. Read on. - -### 1. Google-drive-ocamlfuse - -The **google-drive-ocamlfuse** is a FUSE filesystem for Google Drive, written in OCaml. For those wondering, FUSE, stands for **F** ilesystem in **Use** rspace, is a project that allows the users to create virtual file systems in user level. **google-drive-ocamlfuse** allows you to mount your Google Drive on Linux system. It features read/write access to ordinary files and folders, read-only access to Google docks, sheets, and slides, support for multiple google drive accounts, duplicate file handling, access to your drive trash directory, and more. - -#### Installing google-drive-ocamlfuse - -google-drive-ocamlfuse is available in the [**AUR**][2], so you can install it using any AUR helper programs, for example [**Yay**][3]. -``` -$ yay -S google-drive-ocamlfuse - -``` - -On Ubuntu: -``` -$ sudo add-apt-repository ppa:alessandro-strada/ppa -$ sudo apt-get update -$ sudo apt-get install google-drive-ocamlfuse - -``` - -To install latest beta version, do: -``` -$ sudo add-apt-repository ppa:alessandro-strada/google-drive-ocamlfuse-beta -$ sudo apt-get update -$ sudo apt-get install google-drive-ocamlfuse - -``` - -#### Usage - -Once installed, run the following command to launch **google-drive-ocamlfuse** utility from your Terminal: -``` -$ google-drive-ocamlfuse - -``` - -When you run this first time, the utility will open your web browser and ask your permission to authorize your google drive files. Once you gave authorization, all necessary config files and folders it needs to mount your google drive will be automatically created. - -![][5] - -After successful authentication, you will see the following message in your Terminal. -``` -Access token retrieved correctly. - -``` - -You’re good to go now. Close the web browser and then create a mount point to mount your google drive files. -``` -$ mkdir ~/mygoogledrive - -``` - -Finally, mount your google drive using command: -``` -$ google-drive-ocamlfuse ~/mygoogledrive - -``` - -Congratulations! You can access access your files either from Terminal or file manager. - -From **Terminal** : -``` -$ ls ~/mygoogledrive - -``` - -From **File manager** : - -![][6] - -If you have more than one account, use **label** option to distinguish different accounts like below. -``` -$ google-drive-ocamlfuse -label label [mountpoint] - -``` - -Once you’re done, unmount the FUSE flesystem using command: -``` -$ fusermount -u ~/mygoogledrive - -``` - -For more details, refer man pages. -``` -$ google-drive-ocamlfuse --help - -``` - -Also, do check the [**official wiki**][7] and the [**project GitHub repository**][8] for more details. - -### 2. GCSF - -**GCSF** is a FUSE filesystem based on Google Drive, written using **Rust** programming language. The name GCSF has come from the Romanian word “ **G** oogle **C** onduce **S** istem de **F** ișiere”, which means “Google Drive Filesystem” in English. Using GCSF, you can mount your Google drive as a local virtual file system and access the contents from the Terminal or file manager. You might wonder how it differ from other Google Drive FUSE projects, for example **google-drive-ocamlfuse**. The developer of GCSF replied to a similar [comment on Reddit][9] “GCSF tends to be faster in several cases (listing files recursively, reading large files from Drive). The caching strategy it uses also leads to very fast reads (x4-7 improvement compared to google-drive-ocamlfuse) for files that have been cached, at the cost of using more RAM“. - -#### Installing GCSF - -GCSF is available in the [**AUR**][10], so the Arch Linux users can install it using any AUR helper, for example [**Yay**][3]. -``` -$ yay -S gcsf-git - -``` - -For other distributions, do the following. - -Make sure you have installed Rust on your system. - -Make sure **pkg-config** and the **fuse** packages are installed. They are available in the default repositories of most Linux distributions. For example, on Ubuntu and derivatives, you can install them using command: -``` -$ sudo apt-get install -y libfuse-dev pkg-config - -``` - -Once all dependencies installed, run the following command to install GCSF: -``` -$ cargo install gcsf - -``` - -#### Usage - -First, we need to authorize our google drive. To do so, simply run: -``` -$ gcsf login ostechnix - -``` - -You must specify a session name. Replace **ostechnix** with your own session name. You will see an output something like below with an URL to authorize your google drive account. - -![][11] - -Just copy and navigate to the above URL from your browser and click **allow** to give permission to access your google drive contents. Once you gave the authentication you will see an output like below. -``` -Successfully logged in. Credentials saved to "/home/sk/.config/gcsf/ostechnix". - -``` - -GCSF will create a configuration file in **$XDG_CONFIG_HOME/gcsf/gcsf.toml** , which is usually defined as **$HOME/.config/gcsf/gcsf.toml**. Credentials are stored in the same directory. - -Next, create a directory to mount your google drive contents. -``` -$ mkdir ~/mygoogledrive - -``` - -Then, edit **/etc/fuse.conf** file: -``` -$ sudo vi /etc/fuse.conf - -``` - -Uncomment the following line to allow non-root users to specify the allow_other or allow_root mount options. -``` -user_allow_other - -``` - -Save and close the file. - -Finally, mount your google drive using command: -``` -$ gcsf mount ~/mygoogledrive -s ostechnix - -``` - -Sample output: -``` -INFO gcsf > Creating and populating file system... -INFO gcsf > File sytem created. -INFO gcsf > Mounting to /home/sk/mygoogledrive -INFO gcsf > Mounted to /home/sk/mygoogledrive -INFO gcsf::gcsf::file_manager > Checking for changes and possibly applying them. -INFO gcsf::gcsf::file_manager > Checking for changes and possibly applying them. - -``` - -Again, replace **ostechnix** with your session name. You can view the existing sessions using command: -``` -$ gcsf list -Sessions: -- ostechnix - -``` - -You can now access your google drive contents either from the Terminal or from File manager. - -From **Terminal** : -``` -$ ls ~/mygoogledrive - -``` - -From **File manager** : - -![][12] - -If you don’t know where your Google drive is mounted, use **df** or **mount** command as shown below. -``` -$ df -h -Filesystem Size Used Avail Use% Mounted on -udev 968M 0 968M 0% /dev -tmpfs 200M 1.6M 198M 1% /run -/dev/sda1 20G 7.5G 12G 41% / -tmpfs 997M 0 997M 0% /dev/shm -tmpfs 5.0M 4.0K 5.0M 1% /run/lock -tmpfs 997M 0 997M 0% /sys/fs/cgroup -tmpfs 200M 40K 200M 1% /run/user/1000 -GCSF 15G 857M 15G 6% /home/sk/mygoogledrive - -$ mount | grep GCSF -GCSF on /home/sk/mygoogledrive type fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000,allow_other) - -``` - -Once done, unmount the google drive using command: -``` -$ fusermount -u ~/mygoogledrive - -``` - -Check the [**GCSF GitHub repository**][13] for more details. - -### 3. Tuxdrive - -**Tuxdrive** is yet another unofficial google drive client for Linux. We have written a detailed guide about Tuxdrive a while ago. Please check the following link. - -Of course, there were few other unofficial google drive clients available in the past, such as Grive2, Syncdrive. But it seems that they are discontinued now. I will keep updating this list when I come across any active google drive clients. - -And, that’s all for now, folks. Hope this was useful. More good stuffs to come. Stay tuned! - -Cheers! - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/how-to-mount-google-drive-locally-as-virtual-file-system-in-linux/ - -作者:[SK][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.ostechnix.com/author/sk/ -[1]:https://www.google.com/drive/ -[2]:https://aur.archlinux.org/packages/google-drive-ocamlfuse/ -[3]:https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ -[4]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[5]:http://www.ostechnix.com/wp-content/uploads/2018/07/google-drive.png -[6]:http://www.ostechnix.com/wp-content/uploads/2018/07/google-drive-2.png -[7]:https://github.com/astrada/google-drive-ocamlfuse/wiki/Configuration -[8]:https://github.com/astrada/google-drive-ocamlfuse -[9]:https://www.reddit.com/r/DataHoarder/comments/8vlb2v/google_drive_as_a_file_system/e1oh9q9/ -[10]:https://aur.archlinux.org/packages/gcsf-git/ -[11]:http://www.ostechnix.com/wp-content/uploads/2018/07/google-drive-3.png -[12]:http://www.ostechnix.com/wp-content/uploads/2018/07/google-drive-4.png -[13]:https://github.com/harababurel/gcsf diff --git a/translated/talk/20180206 Building Slack for the Linux community and adopting snaps.md b/translated/talk/20180206 Building Slack for the Linux community and adopting snaps.md deleted file mode 100644 index ef97cf3485..0000000000 --- a/translated/talk/20180206 Building Slack for the Linux community and adopting snaps.md +++ /dev/null @@ -1,71 +0,0 @@ -为 Linux 社区采用 snaps 搭建 Slack -====== -![][1] - -作为一个被数以百万计用户使用的企业级软件平台,[Slack][2] 允许任意规模的团队和企业有效地沟通。Slack 通过在一个单一集成环境中与其它软件工具无缝衔接,为一个组织内的通讯、信息和项目提供了一个易于接触的档案馆。尽管自从诞生后 Slack 就在过去四年中快速成长,但是他们负责该平台跨 Windows、MacOS 和 Linux 运行的桌面工程师团队仅由四人组成。我们通过与在这个团队中负责追踪[上月首发的 Slack snap][3] 的主任工程师 Felix Rieseberg 交谈,来探索更多有关该公司对于 Linux 社区的态度以及他们决定搭建一个 snap 的原因。 - -[安装 Slack snap][4] - -### 你们能告诉我们更多关于已发布的 Slack snap 的信息吗? - -我们上月发布了我们的第一个 snap 作为我们为Linux 社区的一种新的发布形式。在企业界,我们发现人们更倾向于以一种相对于个人消费者较慢的速度来采用新科技, 因此我们将会在未来继续提供 .deb 形式的 snap。 - -### 你们觉得 Linux 社区会对 Slack 有多大的兴趣呢? - -在所有的平台上人们对 Slack 的兴趣都正在增长,这一点使我感到十分兴奋。因此这对于我们来说,很难说源自 Linux 社区的兴趣和我们大体上所见到的兴趣有什么区别。当然,不管用户们在什么平台上面工作,满足他们对我们都是很重要的。我们有一个专门负责 Linux 的测试工程师并且我们同时也尽全力提供最好的用户体验。只是我们发现总体相对于 Windows 来说,为 Linux 搭建 snap 略微有点难度,因为我们是在一个较难以预测的平台上工作——而这正是 Linux 社区之光照耀的领域。在汇报程序缺陷以及寻找程序崩溃原因方面,我们有相当多数极富帮助的用户。 - -### 你们是如何得知 snap 的? - -Canonical 公司的 Martin Wimpress 和我接触并向我解释了 snap 的概念。说实话尽管我也用 Ubuntu 但最初我还是迟疑的,因为它看起来像需要搭建与维护的另一套标准。尽管如此,一当我了解到其中的好处之后,我确信这是一笔有回报的投入。 - -### snap 的什么方面吸引了你们并使你们决定投入其中? - -毫无疑问,我们决定搭建 snap 最重要的原因是它的更新特性。在 Slack 上我们大量运用网页技术,这些技术反过来也使得我们提供大量的特性——比如将 YouTube 视频或者 Spotify 播放列表集成在 Slack 中。与浏览器十分相似,这意味着我们需要频繁更新应用。 - -在 MacOS 和 Windows 上,我们已经有了一个甚至无需用户考虑更新的专门的自动更新器。我们发现哪怕是为了更新,任何形式的中断都是一种我们需要避免的烦恼。因此通过 snap 自动化的更新就显得无缝和便捷得多。 - -### 相比于其它形式的打包方式,搭建 snap 感觉如何? 将它与现有的设施和进程集成在一起有多简便呢? - -就 Linux 而言,我们尚未尝试其它新的打包方式,但我们迟早会的。鉴于我们的大多数用户都使用 Ubuntu,snap 是一个很简便的选项。同时 snap 在其它发行版上同样也可以使用,这也是一个巨大的加分项。Canonical 正将 snap 做到跨发行版而不是仅仅集中在 Ubuntu 上,这一点我认为是很好的。 - -搭建 snap 简单得出乎意料,我们有一个创建安装器和软件包的统一流程,我们的 snap 创建过程从一个 .deb 软件包炮制出一个 snap。对于其它技术而言,有时候我们不得不为了支持搭建链先造一个内部工具。但是 snapcraft 工具正是我们需要的东西。在整个过程中 Canonical 的团队不可思议般得有助,因为我们一路上确实碰到了一些问题。 - -### 你们觉得 snap 商店是如何改变用户们寻找、安装你们软件的方式的呢? - -Slack 真正的独特之处在于人们不仅仅是碰巧发现它,他们从别的地方知道它并积极地试图找到它。因此尽管我们已经有了相当高的觉悟,我希望对于我们的用户来说,在商店中可以获得 snap 能够让安装过程变得简单一点。 - -### 你们对用 snap 而不是为了其它发行版不得不再发行软件包有什么期待,或者有什么已经是你们可见的节省呢? - -我们希望 snap 可以给予我们的用户更多的便利并确保他们能够更加享受使用 Slack。在我们看来,鉴于用户们不必被困在之前的版本,这自然而然地解决了许多问题,因此 snap 可以让我们在客户支持方面节约时间。有 snap 对我们来说也是一个额外的加分项,因为我们能有一个可供搭建的平台而不是替换我们现有的东西。 - -### 如果存在的话,你们正使用或者准备使用边缘 (edge)、测试 (beta)、候选 (candidate)、稳定 (stable) 中的哪种发行频道? - -我们仅仅在开发中使用边缘 (edge) 频道以与 Canonical 的团队共享。为 Linux 打造的 Slack 总体任在测试 (beta) 频道中。但是长远来看,拥有不同频道的选项十分有意思,同时能够提早一点为感兴趣的客户发行版本也肯定是有好处的。 - -### 你们认为将软件打包成一个 snap 是如何能够帮助用户的?你们从用户那边得到了什么反馈吗? - -对我们的用户来说一个很大的好处是安装和更新总体来说都会变得简便一点。长远来看,问题在于“那些安装 snap 的用户是不是比其它用户少碰到一些困难?”,我十分期望 snap 自带的依赖关系能够使其变成可能。 - -### 你们有什么会和刚使用 snap 的新用户们分享的建议或知识呢? - -我会推荐从 Debian 软件包来着手搭建你们的 snap——那出乎意料得简单。这同样也缩小了开始的范围避免变得不堪重负。这只需要投入相当少的时间,并且很大可能是一笔值得的投入。同样如果你们可以的话,尽量试着找到 Canonical 的人员来协作——他们拥有了不起的工程师。 - -### 对于开发来说,你们在什么地方看到了最大的机遇? - -我们现在正一步步来,先是让人们用上 snap,再从那里开始搭建。正在使用 snap 的人们将会感到更加稳健因为他们将会得益于最新的更新。 - --------------------------------------------------------------------------------- - -via: https://insights.ubuntu.com/2018/02/06/building-slack-for-the-linux-community-and-adopting-snaps/ - -作者:[Sarah][a] -译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://insights.ubuntu.com/author/sarahfd/ -[1]:https://insights.ubuntu.com/wp-content/uploads/a115/Slack_linux_screenshot@2x-2.png -[2]:https://slack.com/ -[3]:https://insights.ubuntu.com/2018/01/18/canonical-brings-slack-to-the-snap-ecosystem/ -[4]:https://snapcraft.io/slack/ diff --git a/translated/tech/20180724 How To Mount Google Drive Locally As Virtual File System In Linux.md b/translated/tech/20180724 How To Mount Google Drive Locally As Virtual File System In Linux.md new file mode 100644 index 0000000000..03b2c4a172 --- /dev/null +++ b/translated/tech/20180724 How To Mount Google Drive Locally As Virtual File System In Linux.md @@ -0,0 +1,263 @@ + +如何把Google Driver当做虚拟磁盘一样挂载到Linux操作系统 +====== + +![](https://www.ostechnix.com/wp-content/uploads/2018/07/Google-Drive-720x340.png) + +[**Google Drive**][1] 是全球比较受欢迎的云存储平台. 直到2017年, 全球有超过8亿的活跃用户在使用它。即使用户数在持续增长,但直到现在Google还是没有发布一款可以在Linux平台使用的客户端。但这难不倒Linux开源组织的大神。 不时,一些开发者已经把功能实现了。 下面我将会介绍三个用于Linux系统非官方开发的Google Driver客户端。使用这些客户端,你能把Google Driver像虚拟磁盘一样挂载到Linux系统。 请记好笔记了。 + +### 1. Google-drive-ocamlfuse + +**google-driver-ocamlfuse**把Google Driver当做是一个FUSE类型的文件系统,是用OCam语言写的。FUSE到底是何物,用户态文件系统,此项目允许非管理员用户在用户空间开发文件系统。**google-drive-ocamlfuse**可以让你把Google Driver当做磁盘一样挂载到Linux系统。支持对文件和目录的读写操作,支持只读操作,支持多用户,支持拖拉文件,支持访问Google Driver的回收站,等操作。 + + +#### 安装 google-drive-ocamlfuse + +google-drive-ocamlfuse 能在Arch系统的[**AUR**][2]上直接找到, 所以这安装起来就比较简单了, 使用[**Yay**][3]命令直接安装。 +``` +$ yay -S google-drive-ocamlfuse + +``` + +在Ubuntu系统: +``` +$ sudo add-apt-repository ppa:alessandro-strada/ppa +$ sudo apt-get update +$ sudo apt-get install google-drive-ocamlfuse + +``` + +安装最新的测试版本: +``` +$ sudo add-apt-repository ppa:alessandro-strada/google-drive-ocamlfuse-beta +$ sudo apt-get update +$ sudo apt-get install google-drive-ocamlfuse + +``` + +#### 使用方法 + +安装完成后,直接在终端里面输入如下命令,就可以启动**google-drive-ocamlfuse**程序了: +``` +$ google-drive-ocamlfuse + +``` +当你第一次运行命令,程序会直接打开你的浏览器并要求你确认是否对Google Driver的操作进行授权。当你确认授权后,授权信息和挂载Google Driver用到的目录都会自动进行创建的。 + +![][5] + +当成功授权后,你会在终端里面看到如下的信息。 +``` +Access token retrieved correctly. + +``` +好了,我们可以进行下一步操作了。关闭浏览器并为我们的Google Driver创建一个挂载点吧。 +``` +$ mkdir ~/mygoogledrive + +``` +最后操作,使用如下命令挂载Google Driver: +``` +$ google-drive-ocamlfuse ~/mygoogledrive + +``` + +恭喜你了!你可以使用终端或文件管理器来访问Google Driver里面的文件了。 + +使用**终端**: +``` +$ ls ~/mygoogledrive + +``` + +使用**文件管理器**: + +![][6] + +如何你有不止一个账户,可以使用**label**命令对其进行区分不同的账户,就像下面一样 +``` +$ google-drive-ocamlfuse -label label [mountpoint] + +``` + +当操作完成后,你可以使用如下的命令卸载Google Driver: +``` +$ fusermount -u ~/mygoogledrive + +``` + +获取更多信息,你可以命令用户操作手册。 +``` +$ google-drive-ocamlfuse --help + +``` + +当然你也可以看看[**官方文档**][7]和[**Github项目**][8]以获取更多内容。 + +### 2. GCSF + +**GCSF** 是Google Driver基于FUSE的文件系统,使用**Rust**语言编写。GCSF主要是来源于罗马尼亚语中的“ **G** oogle **C** onduce **S** istem de **F** ișiere”,翻译成英文就是“Google Drive Filesystem”(即Google Drive 文件系统)使用GCSF,你可以把Google Driver当做虚拟磁盘一样挂载到Linux系统,可以通过终端和文件管理器对其进行操作。你肯定会很好奇,这到底于其它的Google Dirver FUSE项目有什么不同,就比如**google-drive-ocamlfuse**。就类型的问题,GCSF的开发者有如下的回复[在Reddit论坛上的评论][9] “GCSF意在某些方面更快(循环列举文件,从Google Driver中读取大文件)。缓存策略也能让读取速度更快(x4-7 的修改更突显了与google-drive-ocamlfuse的差别)当文件被结存后,此为浪费更多的内在”。 + +#### 安装 GCSF + +GCSF能在[**AUR**][10]上面找到, 对于Arch用户来说直接使用AUR助手来安装就行了,例如[**Yay**][3]。 +``` +$ yay -S gcsf-git + +``` + +对于其它的发行版本,需要进行如下的操作来进行安装。 + +首先,你得确认系统中是否安装了Rust语言。 + +确保**pkg-config**和**fuse**软件包是否安装了。它们在绝大多数的Linux发行片的默认仓库中都能找到。例如,在Ubuntu及其衍生版本中,你可以使用如下的命令进行安装: +``` +$ sudo apt-get install -y libfuse-dev pkg-config + +``` + +当所有的依赖软件安装完成后,你可以使用如下的命令来安装GCSF: +``` +$ cargo install gcsf + +``` + +#### 使用方法 + +首先,我们需要对Google Driver的操作进行授权,跟上面的一样方法,终端输入如下命令: +``` +$ gcsf login ostechnix + +``` + +你必须要指定一个会话名称。使用自己的会话名称来代**ostechnix**。你会看到像下图的提示信息和Google Driver账户的授权验证连接。 + +![][11] + +直接把授权验证信息复制出来,并用浏览器打开它,并点击最下面的**allow**来完成授权操作。当完成授权后,你的终端会显示如下的信息。 +``` +Successfully logged in. Credentials saved to "/home/sk/.config/gcsf/ostechnix". + +``` + +GCSF会把配置保存文件在**$XDG_CONFIG_HOME/gcsf/gcsf.toml**,一般文件会保存在**$HOME/.config/gcsf/gcsf.toml**。授权信息也会保存在此目录当中。 + +下一步,创建一个用来挂载Google Driver的目录。 +``` +$ mkdir ~/mygoogledrive + +``` + +之后,修改**/etc/fuse.conf**文件: +``` +$ sudo vi /etc/fuse.conf + +``` + +注释掉以下的行,以允许非管理员进行挂载操作(内容像allow_other或allow_root) +``` +user_allow_other + +``` + +保存并关闭文件。 + +最后一步,挂载Google Driver命令如下的命令: +``` +$ gcsf mount ~/mygoogledrive -s ostechnix + +``` + +简单的终端输入内容: +``` +INFO gcsf > Creating and populating file system... +INFO gcsf > File sytem created. +INFO gcsf > Mounting to /home/sk/mygoogledrive +INFO gcsf > Mounted to /home/sk/mygoogledrive +INFO gcsf::gcsf::file_manager > Checking for changes and possibly applying them. +INFO gcsf::gcsf::file_manager > Checking for changes and possibly applying them. + +``` + +重复一次,使用自己的会话名来更换**ostechnix**。你可以命令如下的命令来查看已经存在的会话: +``` +$ gcsf list +Sessions: +- ostechnix + +``` + +你现在可以使用终端和文件管理器对Google Driver进行操作了。 + +使用**终端**: +``` +$ ls ~/mygoogledrive + +``` + +使用**文件管理器**: + +![][12] + +如果你不知道自己把Google Driver挂载到哪个目录了,可以使用**df**或者**mount**命令,就像下面一样。 +``` +$ df -h +Filesystem Size Used Avail Use% Mounted on +udev 968M 0 968M 0% /dev +tmpfs 200M 1.6M 198M 1% /run +/dev/sda1 20G 7.5G 12G 41% / +tmpfs 997M 0 997M 0% /dev/shm +tmpfs 5.0M 4.0K 5.0M 1% /run/lock +tmpfs 997M 0 997M 0% /sys/fs/cgroup +tmpfs 200M 40K 200M 1% /run/user/1000 +GCSF 15G 857M 15G 6% /home/sk/mygoogledrive + +$ mount | grep GCSF +GCSF on /home/sk/mygoogledrive type fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000,allow_other) + +``` + +当操作完成后,你可以使用如下命令来卸载Google Driver: +``` +$ fusermount -u ~/mygoogledrive + +``` + +浏览[**GCSF GitHub项目**][13]以获取更多内容。 + +### 3. Tuxdrive + +**Tuxdrive**是其它的非官方Linux Google Driver客户端。我们之前有写过一篇关于Tuxdrive比较详细的使用方法。你可以找一找之前的文档。 + +这当然,还有其它的非官方的Google Driver客户端在过去有出现过,例如Grive2,Syncdrive。但它们好像都已经停止开发了。我会对这个列表进行持续的跟进当有更受欢迎的Google Driver客户端出现。 + + +谢谢你的阅读。 + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-mount-google-drive-locally-as-virtual-file-system-in-linux/ + +作者:[SK][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[译者ID](https://github.com/sndnvaps) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.ostechnix.com/author/sk/ +[1]:https://www.google.com/drive/ +[2]:https://aur.archlinux.org/packages/google-drive-ocamlfuse/ +[3]:https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[4]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[5]:http://www.ostechnix.com/wp-content/uploads/2018/07/google-drive.png +[6]:http://www.ostechnix.com/wp-content/uploads/2018/07/google-drive-2.png +[7]:https://github.com/astrada/google-drive-ocamlfuse/wiki/Configuration +[8]:https://github.com/astrada/google-drive-ocamlfuse +[9]:https://www.reddit.com/r/DataHoarder/comments/8vlb2v/google_drive_as_a_file_system/e1oh9q9/ +[10]:https://aur.archlinux.org/packages/gcsf-git/ +[11]:http://www.ostechnix.com/wp-content/uploads/2018/07/google-drive-3.png +[12]:http://www.ostechnix.com/wp-content/uploads/2018/07/google-drive-4.png +[13]:https://github.com/harababurel/gcsf