Live data from Hacker News

Ask HN: How do you work efficiently on remote servers?

news.ycombinator.com

51–60 of 87 posts

Re: Ask HN: How do you work efficiently on remote servers?

#51

On projects too small to have a workflow for automated deployment (let's be real: not everything is worth the overhead of setting up all of those tools), I've found the duo of Sublime and ExpanDrive[1] works well. The latter mounts a server that is accessible via SSH as a local drive (it's essentially a nice GUI for something like sshfs). Otherwise, some combination of tmux and vim/nano/emacs. 1. http://www.expandriv…

Thank you so much for showing me ExpandDrive. sshfs was slow and buggy, but this looks really nice.

Re: Ask HN: How do you work efficiently on remote servers?

#53
post #34

Earlier quoted context omitted.

Thanks for answer. I'd love to learn about what solution your Sublime coworkers use, as most people here use emacs / vim and I'm most proficient with Sublime.

Probably they're using the "Sublime SFTP plugin" by wbond... I usually use nano on the remote server and sublime remotely via ssh with this plugin. But to be honest it is just for small tasks. 95% of the time we work in local servers with Vagrant/Docker (shared folder --> git push), since our deployments aren't that big.

I tried it, but I can't get used to navigating the filesystem with the command palette. It just looks weird IMO.

Re: Ask HN: How do you work efficiently on remote servers?

#54

Vim, mostly. The customization is remarkably easy, just copy my .vimrc and .vim out to the server. I have a folder containing all of my dot files which I sync between servers, and a simple bash script which creates softlinks to them in my home directory. However, I don't do remote development as much anymore since I picked up the habit of using Vagrant locally. Now I can edit the files locally (though still with Vim)…

Correct me if I'm wrong, as I'm not experienced with these tools: when you're done, you upload the image to a server?

No - Salt and Ansible both act as deploy automation tools. That is, you run the scripts on the server and they will install packages, move files, change permissions, etc. Most deploy steps are available using these tools.

Vagrant itself acts as a user-friendly wrapper around the creation and management of local virtual machines.

There are ways to use Vagrant to create and push machine images up to cloud providers, but we're not at a point with our deployments where machines are so easily interchangeable.

http://docs.saltstack.com/en/latest/contents.html http://docs.ansible.com/intro.html

Re: Ask HN: How do you work efficiently on remote servers?

#55

On projects too small to have a workflow for automated deployment (let's be real: not everything is worth the overhead of setting up all of those tools), I've found the duo of Sublime and ExpanDrive[1] works well. The latter mounts a server that is accessible via SSH as a local drive (it's essentially a nice GUI for something like sshfs). Otherwise, some combination of tmux and vim/nano/emacs. 1. http://www.expandriv…

I agree, being able to use your favorite local IDE to load and edit remote files can be very convenient.

On OSX, I use Panic Transmit's "Mount as Disk" feature. I've also heard good things about a product called WebDrive for this use case.

Re: Ask HN: How do you work efficiently on remote servers?

#56
Depends on the servers and the project I'm working on.

- Sometimes I mount the remote servers file system locally over SSH (sshfs) so I can use my local development environment. I generally do this when I have more complex projects (eg quantity of files) and there's some prerequisites defined on the server (ie it's easier to develop on the server than it is to mimic the set up on my local machine)

- Sometimes I use tmux and vanilla vi / vim (I don't generally bother with plugins / config for editors so I don't miss them when jumping onto new systems). I generally only do this if it's small changes though. The kind of situation where it would be quicker to SSH in and make a few edits than it would be to follow a stricter development and deployment model.

- Sometimes I develop locally and then push the changes remotely (usually using rsync, scp, git). This is usually for new projects and where there aren't prerequisites specific to the remote host.

My preferred development model would be 1 (as it's ridiculously lazy), then 3 (as it better follows sane development and deployment models). But sometimes a job simply requires you to make quick edits via vi; and thankfully I feel as at home in vi as I do with most GUI text editors.

Just to add, there's only two config files I ever need to worry about:

.tmux.conf which I only put on a small handful of development machines where I'd like detachable sessions from multiple client (eg home/work/etc). But generally I will run tmux locally.

env_servers which is an epic environment script (like .bashrc) that I can call in as and when and it has a whole stack of aliases, functions and such like optimize my workflow. I've also set up an alias on my local machine to auto scp my env_servers script to any server I SSH into. Thus keeping env_servers available and up-to-date.

Re: Ask HN: How do you work efficiently on remote servers?

#57
post #45
post #36

Earlier quoted context omitted.

I still don't see the necessity... Develop locally, test remotely.

Some examples that just come to my mind: - You need software/dependendencies/licences you don't have in your local machine. - You need to edit a config file (/etc/hosts or whatever) in your server - You are in a Windows computer (that's not yours) and you need to make a quick change in your Ubuntu development server. - You need to edit some files when deploying (databases are no longer in localhost, /home/myname/ is…

software deps - this is a possible fair point. I've always managed to solve this by bringing the deps local though as a general sanity rule. config - why not source control it? quick change - why would you do a quick change differently to a non-quick change? edit while deploying - why wouldn't you script / source control this for repeatability / maintainability? log parsing - it sounds like you've got an edit, verify loop going on. Why wouldn't you want to formalize this so that you can see which changes align with which results?

Re: Ask HN: How do you work efficiently on remote servers?

#58

Earlier quoted context omitted.

Correct me if I'm wrong, as I'm not experienced with these tools: when you're done, you upload the image to a server?

No - Salt and Ansible both act as deploy automation tools. That is, you run the scripts on the server and they will install packages, move files, change permissions, etc. Most deploy steps are available using these tools. Vagrant itself acts as a user-friendly wrapper around the creation and management of local virtual machines. There are ways to use Vagrant to create and push machine images up to cloud providers, bu…

So, if I get it, Vagrant is used to reproduce the production environment locally. Right? Sorry for all the questions!

Re: Ask HN: How do you work efficiently on remote servers?

#60

I'd argue you shouldn't be working on remote servers at all. Ideally you should be working locally and deploy using Capistrano, Jenkins, Bamboo or git hooks etc.

Sure, that's ideal, but what if you have a small laptop? It would be nice to make use of the power of your server to compile more quickly, and speed up your development cycle, right?

That's a remote workstation, not really a server. You should keep these two separate.
Post reply on HN