format internet:

…please wait (49% completed)…

Archive for the ‘ubuntu’ Category

Eclipse buttons not working on Ubuntu Karmic Koala

Posted by javier ramirez on December 23, 2009

Lately I was experiencing a strange behavior when working with Eclipse/RadRails. Some of the buttons didn’t work anymore. I could click on them, but they’d just appear as selected, without performing any actions. I had to use the enter key to actually click on the button.

Since I had run an update some days ago, I was blaming some new version of one of the installed plugins.. but I was wrong.

Today I read this post where it explains how to fix it. It’s a conflict between Eclipse and the latest versions of GTK+. By setting the GDK_NATIVE_WINDOWS variable to use native windows, everything is back to normal.

And they lived happily ever after (or until the next major release anyway)

Posted in development, eclipse, javier ramirez, madrid, ruby, ubuntu | 5 Comments »

Pasting code into vi

Posted by javier ramirez on October 5, 2009

Every time I try to paste a big chunk of code into vi, it gets all messed up because of the autoindent. Each line gets indented taking the previous one as a reference, so when I try to paste something like..


global $wp_query;
parse_str($args, $r);
if (!isset($r['current'])) $r['current'] = -1;
if (!isset($r['show_all_parents'])) $r['show_all_parents'] = 0;
if (!isset($r['show_root'])) $r['show_root'] = 0;
if (!isset($r['list_tag'])) $r['show_root'] = 1;

..what I really get is..


global $wp_query;
  parse_str($args, $r);
    if (!isset($r['current'])) $r['current'] = -1;
      if (!isset($r['show_all_parents'])) $r['show_all_parents'] = 0;
        if (!isset($r['show_root'])) $r['show_root'] = 0;
          if (!isset($r['list_tag'])) $r['show_root'] = 1;

..and that’s no good. Fortunately the solution is really simple. Just enter command mode and write

:set paste

Now you can paste in all its glory. When you are done, you can get back to normal with

:set nopaste

So now you don’t have any excuses left to write original code. Get out there and copy the whole internet before I format it!!!

Posted in development, internet, javier ramirez, ubuntu | 10 Comments »

sudo: rake: command not found

Posted by javier ramirez on July 6, 2009

I hate it when it happens, don’t you?

And it’s not only rake, but some other utilities too.

Bottom line is, in Ubuntu sudo is by default set to use a secure path. You can change the secure path if you are compiling from source, but we are talking Ubuntu here, the windows for the rest of us, so you get what your package says you get and that’s fine.

There are a couple of good solutions (other than switching to gentoo or slackware ;) )

If you want to use always the same PATH as you are using in your environment, you can just set an alias to sudo and make it set the PATH every time you are invoking it.

alias sudo=”sudo env PATH=$PATH”

It’s safe enough, but notice every time you are using sudo, you will be setting the environment to that of the calling user. Do your maths and reckon whether you are comfortable with that or not.

The option I chose is a bit pickier, making a link to the rake executable from /usr/local/bin, which is one of the secure paths.

sudo ln -s `which rake` /usr/local/bin/

Either way, your problem is solved. Now go save the world! You’re welcome ;)

Posted in javier ramirez, ruby, ubuntu | 3 Comments »