views:

427

answers:

7

I'm planning on doing more coding from home but in order to do so, I need to be able to edit files on a Samba drive on our dev server. The problem I've run into with several editors is that the network latency causes the editor to lock up for long periods of time (Eclipse, TextMate). Some editors cope with this a lot better than others, but are there any file system or other tweaks I can make to minimize the impact of lag?

A few additional points:

  • There's a policy against having company data on personal machines, so I'd like to avoid checking out the code locally.
  • The mount is over a PPTP VPN connection.
  • Mounting to Linux or OS X client
+8  A: 

Use a source control system — Subversion, Perforce, Git, Mercurial, Bazaar, etc. — so you're never editing code on a shared server. Instead you should be editing a local work area and committing changes to a repository located on the network.

Also, convince your company to adapt their policy such that company code is allowed on personal machines if it's on an encrypted volume. Encrypted disk images that you can use for this are trivial to create using Disk Utility, and can use strong cryptography. You can get even more security by not storing your encryption passphrase in your keychain, and instead typing it every time you mount the encrypted volume; this means that even if your local user account is compromised, as long as you don't have the volume mounted, nobody else will be able to mount it.

I did this all the time when I was consulting and none of my clients — some of whom had similar rules about company code — ever had a problem with it once I explained how things worked. (I think some of them even started using encrypted disk images even within their offices.)

Chris Hanson
+1  A: 

@Chris Sorry, I just added an edit about that noting that that option isn't a preferred choice.

Dana the Sane
A: 

Short answer: you can do no trick. CIFS is really geared towards LAN with a reasonably calm trafic, so you have zero chance to not suffer intermittent lag accessing a share through a VPN. The editor at some point needs to access the file in blocking IO, because it makes no real sense to do otherwise.

You could switch editor and use Emacs + TRAMP which is geared to work on remote files.

Damien B
+2  A: 

@OP (slightly off topic) What is the difference between coping the file to your local drive and opening it in your local editor of choice? Chances are you editor is going to make a local copy of it somewhere anyways and if this policy is enacted towards "real" sensitive data then it could be a dangerous misnomer. (example SSN or patient list in a c:\temp)

Sorry for the hard time, we all get stuck with some lame policy.

jms
+1  A: 

@Jason Basically, the code isn't supposed to 'leave the office' so I'm making an effort to do something that's close enough for non-technical people to be ok with. I want to be able to do my work offsite though, so I may just say the heck with it and work in an encrypted directory and keep my mouth shut.

Dana the Sane
+1  A: 

If you are accessing the data from your personal computer, it is in your RAM, so we will assume that you just can't store it on your hard drive, floppy, USB stick, etc.

Your solution is a RAM drive. Copy the files you need to edit there using whatever method you prefer (I would suggest source control) and then you can edit them without lag. When you are done commit them back to the server.

As was pointed out your editor may be caching changes to your temp directory, or maybe even your swap file (if it is in memory, then it can get swapped out). The solution to that is get a much larger RAM drive and run a Virtual Machine in the RAM drive. Not sure what OS you are running, but you can get a pretty slim install of most OS's if all you are doing is editing source code.

If you don't have enough RAM, then get a Gigabyte i-RAM solid state drive and remove the battery, that way it will loose everything when you power down.

Set your VMWare to not allow the OS to swap any of the virtual machine. Keep a baseline VM on your hard drive and copy it to your RAM drive before booting it up. Then you can use the hard drive in the VM like a hard drive, even though it is RAM.

Might be a good idea to run a secure erase on your RAM drive before powering down. Also keep in mind that they have found if you super cool a RAM chip before removing it from a functioning computer, and place it in a new computer quick enough, the data may still be intact.

I guess it all comes down to how detailed that policy is, and how it is interpreted.

Good luck!

Jim McKeeth
+5  A: 

Remate plugin simply disables this dreadful refresh-on-focus feature.

Download, unpack, doubleclick and choose "Disable Refresh on Regaining Focus" from "Window" menu (you can refresh manually by right-clicking project in drawer). Voila!

porneL
Thanks, I will give that a try. I've mostly resigned myself to the image encryption/checkout solution though.
Dana the Sane