Archive for the ‘Technology’ Category

Fixing Problems in Eclipse

Thursday, July 24th, 2008

I really love eclipse. Nevertheless, it seems to cause problems fairly often, and so I decided to keep a log of each of the things that I fix.


Workspace is in use or cannot be created

There are three things that I found that cause this:

  1. You have another Eclipse instance accessing the same workspace at the same time
  2. An unclean shutdown left stale file locks
  3. You are using NFS and the locking daemon isn’t working properly

Situation 1 is of course the easiest to solve; just close the other version of eclipse.
Situation 2 requires you to delete the .metadata/.lock file from the workspace you’re trying to open.
Situation 3 may be resolved by passing the following argument to the JVM:

 -Dosgi.locking=none

For example:

./eclispe -vmargs  -Dosgi.locking=none  -Xms512m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=512m

Note the -vmargs argument, which marks the start of the JVM arguments.

SVN Doesn’t Work with JavaHL

If you’re using Ubuntu, add the following line to eclipse.ini:

-Djava.library.path=/usr/lib/jni

For example, my eclipse.ini looks like this:

-showsplash
org.eclipse.platform
-framework
plugins/org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Djava.library.path=/usr/lib/jni
-Xms40m
-Xmx256m
-XX:MaxPermSize=256m

Using Subversion to Manage Your Life

Friday, July 18th, 2008

Over the past few years, I’ve become a big fan of subversion. Obviously, I like to use it for coding purposes, but less obviously, I like to use it to manage my schoolwork, documents, presentations, etc. Since it works so well for me, I thought I would write a quick summary of how one would probably go about doing this themselves.

This article assumes that you have the following:

  • An SSH Server
  • Subversion installed on the SSH Server
  • Subversion installed on your machine

The following code will make your repository on the remote machine:

ssh username@hostname "mkdir -p ~/local/reps;svnadmin create ~/local/reps/my-repo"

You can then checkout your repository:

svn co svn+ssh://~/local/reps/my-repo
cd my-repo

Add files to it:

touch hi my-file
svn add hi
svn add my-file

And commit the changes:

svn commit

Foxmarks… handy

Tuesday, July 8th, 2008

I’ve been using Google Bookmarks for a long time, but I recently discovered an alternative which I prefer called Foxmarks. Foxmarks is a utility with two faces: a plugin for Firefox that allows you to sync your bookmarks amongst firefox instances and a website, my.foxmarks.com which provides a website for accessing your synchronized bookmarks.

You can also share your bookmarks with a handy little javascript widget that looks like this:

Sync and share your bookmarks with Foxmarks


Installation is simple; just go to www.foxmarks.com, click the “Install Now” button and follow the instructions. You’ll have to create a Foxmarks account, but the plugin will walk you through that as well.

Happy bookmarking!

Basic OpenSSL Usage

Tuesday, July 8th, 2008

I keep on forgetting how to use OpenSSL to do basic tasks; here is a reference before I forget again.

Decrypt an openssh key:

openssl rsa -in ~/.ssh/id_rsa -out ~/.ssh/id_rsa

Encrypt an openssh key:

openssl rsa -des3 -in ~/.ssh/id_rsa -out ~/.ssh/id_rsa

Encrypt an arbitrary file:

openssl enc -e -des3 -in testfile -out testfile.encrypted

Decrypt an arbitrary file:

openssl enc -d -des3 -in testfile.encrypted -out testfile

More details can be found here