Thursday Mar 26, 2009

Sometimes, you need to deal with a really time-wasting issue. I think it happens even more often if you work in the IT industry. You know the resolution must be simple, but all your attempts failed. So you try to search the web, looking for a plain sentence that will lead you out of that mess...

If you want to write some text to a file that needs a root privileges, you do it this way:

echo "Text I want to write" | sudo tee /path/to/file > /dev/null

or (updated after reading discussion below):

sudo sh -c 'echo "Text I want to write" > /path/to/file'

If you just want to append some text, you do it this way:

echo "Text I want to write" | sudo tee -a /path/to/file > /dev/null

or (updated after reading discussion below):

sudo sh -c 'echo "Text I want to write" >> /path/to/file'

This won't work:

sudo echo "Text I want to write" > /path/to/file

This blog post describes how to clone and build NetBeans from the Hg repository. It also contains some notes that I received from my friends who followed my original instructions.[Read More]

Saturday Jan 31, 2009

Sometimes, you need to deal with a really time-wasting issue. I think it happens even more often if you work in the IT industry. You know the resolution must be simple, but all your attempts failed. So you try to search the web, looking for a plain sentence that will lead you out of that mess...

If you want to copy a file using SCP and the remote path contains spaces, you do it this way:

scp -r username@servername:"/some/path\\ with\\ spaces" .

Everything you need to do is to enclose the path in double quotes and use double backslash on spaces...

I was looking for it everywhere: A simple, dark (ideally black) wallpaper with a blackbox theme for my laptop (super light Ubuntu + BlackBox). Unfortunatelly, with no luck... It likely doesn't exist on the internet or it is hiding from people who desperately want it.

Then I realized I work for the Netbeans (or - one could say - for "the IDE with a blue box logo"). And the idea was there - I started GIMP and created my own sexy wallpaper.

Netbeans can deal with many problems (even without knowing it) - this is how it solved my problem with missing BlackBox wallpaper...

Note: Any resemblance to any Sun's products (or their logos) is purely accidental... ;-) It is strictly prohibited NOT to use the wallpaper on your PC and author even strongly discourages you from NOT modifying it!

Download the wallpaper
Dark BlackBox wallpaper

Tuesday Jan 06, 2009

An issue that bothered many users of 64bit Linux is hopefully a history since JavaSE 6u12, which is now available in development version (therefore it is not a stable build and it is not recommended for "production use"). I have managed to install a Java plugin for Firefox on my 64bit Ubuntu - installation was pretty flawless...

Confirmed here: https://jdk6.dev.java.net/6uNea.html

So, what do you need to do in order to have a working Java in your Firefox on 64bit Linux?

  1. Update: Use Firefox from your distro repository.
  2. Rollback all your previous attempts to make Java work - if you don't perform this step, the result is uncertain... This includes especially following:
    • Make sure you have 64bit version of Firefox (previous workaround was to use 32bit version of browser). Note that there is also a 64bit Flash plugin for Linux available, so 32bit version of browser should not be needed anymore...
    • Remove IcedTea/gcj/... plugin if you were using it
  3. Download JRE 6u12 (an early access) from pages with JavaSE 6u12 dowloads (you can use this link pointing to the b03) and install Java to any desired folder (I would suggest /usr/lib/jvm folder for Ubuntu users, this is where Ubuntu places Java by default)...
  4. Create a link (ln) pointing to the Java plugin (file <JRE_FOLDER>/lib/amd64/libnpjp2.so) in the ~/.mozilla/plugins folder (to let Firefox know where the new plugin is...) - maybe you will have to create this folder (I had to)
  5. Make sure the installation didn't interfere with the rest of your Java environment and that you are using stable Java system wide (call java -version). If not, reconfigure your Java environment, for example using update-java-alternatives command (thank's to Petr Chytil for the hint)
Note/Update: Are you getting "LoadPlugin: failed to initialize shared library /opt/java/jre1.6.0_12/lib/amd64/libnpjp2.so [/opt/java/jre1.6.0_12/lib/amd64/libnpjp2.so: wrong ELF class: ELFCLASS64]" message? Try to use the Firefox that is in your distro's repository. The problem Werner was facing (see the discussion below) was resolved by installing official openSUSE packages instead of the Firefox from mozilla site... Werner, thank you a lot for not giving up and elaborating on the issue!

Hope this works for you, now you should be able to check some sweet JavaFX demos out...

If you experience any troubles, please share them in discussion below...

Update: Users of RHEL, please read the discussion for troubleshooting...

[Read More]

This blog copyright 2009 by Petr Dvorak