Thursday 27 February 2014

Editing a codebase on a remote server from Chrome OS


Here's a quick post about how your Chrome OS device, in developer mode, can edit a codebase on a remote (e.g. university, personal) server as if the code were local. And you don't need to install Crouton or any Linux partition-esque things to do so. This allows instant saving back to the server, where you might be running scripts or need access to large data files you can't host locally.


Step 1: Install Caret

https://chrome.google.com/webstore/detail/caret/fljalecfjciodhpcledpamjachpmelml?hl=en
Caret is an excellent code editor in the style of Sublime Text.


















Step 2: Install Chrome OS dev tools

  • You need to be in developer mode on your Chrome OS device, but the channel is irrelevant (stable/beta/dev)
  • Open a terminal with Ctrl-Alt-T
  • Type sudo -i
  • Type dev_install

Step 3: Mount the remote server

  • Exit from the superuser session by Ctrl-D
  • Type cd ~/Downloads
  • Type mkdir remote_folder, where remote_folder is whatever you want to call it
  • Type sshfs username@remote.server:/path/to/folder remote_folder, where you can fill in the information for your username, remote server domain, and the default folder you want to start in

Step 4: Use Caret to edit code in the style of Sublime Text and other code editors

  • Project --> Add directory
  • Browse to Downloads/remote_folder/ then find the top level folder containing code you want to edit.
  • Edit! And Saving will instantly save back to the server. So perhaps you want a SSH window open simultaneously, running scripts on the server.
Hope this is useful.


No comments:

Post a Comment