Sunday, December 19, 2010

Cannot Open Workspace on Remote Volume? (Mac OS X)

Hi

I've been using Eclipse for quite some time, and never experienced this problem!

For technical reasons I will not go into here, I have to have my workspace on a linux server network share/remote volume. This has never been a problem when using Eclipse on Windows. I simply mounted the network share, and used it as a normal file system.

However, I've recently switched my Windows PC for a beautiful iMac G5. So far I've had no trouble with the switch, accept for Eclipse!

My Eclipse workspace is on smb://persephone/alasdair/Eclipse. So, I have connected my iMac to the share, and Mac OS X mounts it at /Volumes/alasdair. This is fine, as in theory my Eclipse workspace should now be /Volumes/alasdair/Eclipse. (The share is mouned read/write with the correct privileges, as only the IP address of my iMac can access the share.)

Every time I try to use the workspace, I simply get a "Workspace in use" error. I've removed any stale .lock files, and even removed the ENTIRE workspace and attempted to recreate it. Eclipse will create the workspace folder, but inside the .metadata file is a single .lock file that is created as soon as I try to use the workspace. Even if I keep deleting it, it comes back with each attempt. It's as if it's creating the workspace, locking it, and then trying to use it and seeing the lock!

Has anyone else experienced this issue?

Does anyone have a fix/workaround? :) I can't have the workspace on my Macintosh HD because it has to be compiled on Linux. I've always developed via the remote share so I can just use a terminal session to type 'make.'

I'm using Mac OS X Panther v10.3.8, but the problem was also around on v10.3.7 and v10.3.6.

Any response would be greatly appreciated. :)


==================================================

AlasdairM wrote:

Has anyone else experienced this issue?

Oh, yeah... long story short: Eclipse uses Java 1.4 file locking capabilities to prevent users from accidently opening the same workspace twice, what can cause data corruption. But file locking does not work well yet on a variety of VM/OS/file system combinations. The workaround is to disable file locking when running Eclipse by passing the following system property as VM arg:

-Dosgi.locking=none

More information on this:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=44735

Monday, December 13, 2010

Chicken of the VNC

Chicken of the VNC

Share

Chicken of the VNC A few people have written in, asking how to remote control a Mac. It couldn’t be much easier, especially if you’ll be doing the controlling from a computer on the same network as the machine you want to control. The server component is built into OS X. The client component (on the computer you will do the controlling from) can be downloaded here.

Click here to skip ahead to the screencast.

If you plan on controlling a machine from across the Internet there’s an extra step. Let’s look at both scenarios:

Both computers on same network.

  1. Configure the machine you want to control (the server) to allow VNC access. See the screencast for details.
  2. Open Chicken of the VNC and connect to the ip address of the server. Instead of the ip address you can have Chicken of the VNC use Bonjour to show you servers on your network.

Controlling a machine from across the Internet.

  1. Configure the machine you want to control (the server) to allow VNC access. See the screencast for details.
  2. From the server, go to the web site http://whatismyip.com and make a note of the ip address. This is how your home network is seen on the Internet.
  3. Go to the router of the network your server is on. Configure port forwarding to allow port 5900 through to the server. See the screencast for details.
  4. At the coffee shop, Open Chicken of the VNC on the client and connect to the ip address noted in step 2. Bonjour won’t help you across the Internet - you may as well turn it off. And you can’t use the server’s actual address. You have to use the address of the router. The router will pass the request to the server, based on the port forwarding you set up in the previous step.

If you don’t have a router at home your Mac is probably connected directly to the DSL/Cable Modem. In that case, the server’s address and the http://whatismyip.com address are likely the same. (Some modems act as firewalls, in which case they could be different!) Use that address from the coffee shop.

Consider getting a router. For forty dollars you can add an important layer of security and the convenience of wireless access.

More to think about:

  • VNC is not notably secure. You’re relying on a single password to keep intruders out.
  • Consider running third party VNC server software, like OSXvnc. It allows you to run the server on a port other than 5900, helping to hide your service from hackers.
  • You can use RealVNC on Windows computers to remote control your Mac instead of Chicken of the VNC. There’s a free Personal Edition.
  • There are other ways, using far more secure tools, to remotely control your Mac. Murphy will cover tools like ssh next week. In the meantime, brush up on your Terminal skills!

More on ports: A port number is what an application uses to identify itself to the network. There is all kinds of traffic flowing to your networked computer. The port directs the traffic to the proper application. Traffic finds the computer by its ip address, then goes on to find the right application by its port address.

Thursday, December 9, 2010

Moving your cursor in a terminal with bash shell

Moving your cursor in a terminal with bash shell (Mac OS X, and Ubuntu Linux compatible)

Tired of pressing delete 1,000 times to move around in your terminal window? Use these handy shortcuts and spare yourself the repetitve stress inducing, carpal-tunnel-flaring effects of using the command line in Macs and Linux.

My current favorites:

  • ctrl-a: move to front of line
  • ctrl-e: move to end of line
  • ctrl-w: delete word before cursor
  • ctrl-r: search past command history
  • up/down arrow: page through previous commands
  • alt-b / alt-f: move backward/forward one word (without deleting)