py, I would edit and sync the file then SSH into the server and run python main. For example, if I have a python file called main. I would then SSH into the server and then run my program from the terminal. I write my code in Sublime Text 3 and use SFTP to automatically sync it to the Compute Canada server whenever I save the file. Setting it to true will ask SFTP to automatically upload the file to the server everytime you save it on your computer. I usually leave the other settings on their default value, except upload_on_save, which I set to true. This is easy, just SSH into the server (as explained in the Compute Canada Cloud setup tutorial) and use mkdir dais to create a directory called dais.
For example, if you want to sync / home / mycomputer / dais / on your own computer to / home / ubuntu / dais on the remote server, you will need to first create the dais folder on the remote server. The path must exist on the server for this to work. Remote_path refers to the path on the remote server where the files will be synced. Otherwise, please use the settings for your server. If you’re following our Compute Canada Cloud tutorial, host is the floating IP adress that you get from the Compute Canada config page.
There are several important parameters that you need to fill in for SFTP to work: json file to save your settings which looks something like this: Right click on the folder that you’ve just selected and you should see a SFTP / FTP and Map to Remote option in the context menu.Ĭlicking on Map to Remote creates a sftp - config. You can create a new folder if you’re starting from scratch, then go to File > Open Folder in Sublime Text to open that folder.
Type in SFTP and press Enter to install the SFTP package.įirst, you’ll have to select and open a folder that you want to sync with the remote server. Type Install and select Package Control : Install Package. Once Package Control is installed, restart Sublime Text then press Ctrl + Shift + P to open the Command Palette. Then install the Package Control plugin using the instructions on the page.
In this tutorial, we’ll show you how to edit files on a remote server like Compute Canada in an intuitive and easy manner using Sublime Text 3 and SFTP.
Command line-based text editors like vim and Emacs have a steep learning curve and even simple tasks like navigating around in the interface isn’t always straightforward for beginners.