Tuesday, September 15, 2009

Install RMagick on Ubuntu

sudo aptitude install -y imagemagick
sudo aptitude install -y libmagick9-dev
sudo gem install rmagick

Bind a key binding that is already defined

To correctly bind a key that is already defined for example by platform - F5 for refresh, the important thing is to create your own context:

name="refresh" parentId="org.eclipse.ui.contexts.window">

Once correct context is defined, it needs to be activated. For example, in view:

View.createPartControl(Composite parent) {
IContextService contextService = (IContextService) getSite().getService(IContextService.class);

Then the usual, command is created that is tied to a handler that extends AbstractHandler, command is tied to a binding, and the binding is in turn uses earlier created custom context.

defaultHandler="com.iwaysoftware.explorer.handler.RefreshHandler" id="com.iwaysoftware.explorer.refreshCommand"

sequence="F5" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
contextId="com.iwaysoftware.explorer.refresh" />

name="refresh" parentId="org.eclipse.ui.contexts.window">

Saturday, September 12, 2009

Kill process that is using paricular port

Find process id and kill it

ruby@t61:~/dev/ruby/demo$ sudo netstat -lpn | grep 3000
[sudo] password for ruby:
tcp 0 0* LISTEN 5358/ruby
ruby@t61:~/dev/ruby/demo$ kill -9 5358

Blogger Syntax Highliter