EEE (Asus PC) in France

25 February 2008

I didn’t notice the impact and “caffouillage” SFR did with the EEE in france : http://www.blogeee.net/ is worth reading some articles.

Looks like a nice way to introduce another OS to the masses.

By the way my new blog is in http://brunovernay.blogspot.com/


Fedora 8 and Java

15 January 2008

Some more informations on Fedora 8 and Java. A new hard drive was a good excuse to do a fresh Fedora install. Even with a fresh install, I had to remove all the i386 package (I have a x86_64 : no need to duplicate all package, this is a known problem of Fedora) and legacy gcj stuff.

I installed Java 7 since it is the future. But since it doesn’t have the crypto features yet, and since they are required for Glassfish, I installed the SUN JDK 6 as well.

So informations are bit misleading on the topic. Here is what I like to do :

Install jpackage-utils, then SUN JDK 6 RPM, then JPackage -compat package for the SUN rpm : java-1.6.0-sun-compat-1.6.0.04-1jpp.i586.rpm.

Manage the Java 6 / 7 switch with galternatives or (command line alternatives)

Remember Java 7 IcedTea install tips :

Mauriat Miranda tips and added the JDK as well (-devel) : sudo yum install java-1.7.0-icedtea java-1.7.0-icedtea-devel java-1.7.0-icedtea-plugin

I tested as per Gregory Gulick’s tips and it was OK.


Remote access to Netbeans

11 December 2007

Using Netbeans remotely with FreeNX, I had some trouble with the display not refreshing very well.
The solution is simply to uses sun.java2d.pmoffscreen, i.e.  add the option -J-Dsun.java2d.pmoffscreen=false in etc/netbeans.conf.

There should be a way to detect if the display is local or not reading the DISPLAY env variable :

…j2se/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java , see _isDisplayLocal method …

I have to try with the J2D_PIXMAPS=shared/server env variable too.


Netbeans, Glassfish with JSF dev with FreeNX

28 November 2007

So it works. OK I had to add 1Go RAM (1 Go wasn’t enough). I should have get 2Go from the beginning ! I had to install SUN JDK 6 because IcedTea didn’t work with Glassfish nor Netbeans, there is a strange security problem.

But now :

  • I can remotely connect to my home with FreeNX
  • Launch Netbeans 6, Glassfish, JavaDB and develop JSF
  • Epiphany is configured as the web browser (lighter than Firefox)
  • XFCE 4 as the desktop environment (again, lighter than Gnome or KDE)
  • Fedora 8 x64 with some services (FTP, HTTP …) running

Fedora 8 upgrade and Java

16 November 2007

I upgraded from fedora 7 to 8. (Via yum : wasn’t exactly smoove, but not too bad).

Now I installed Java 1.7 IcedTea as per Mauriat Miranda tips and added the JDK as well (-devel) : sudo yum install java-1.7.0-icedtea java-1.7.0-icedtea-devel java-1.7.0-icedtea-plugin

I tested as per Gregory Gulick’s tips and it was not OK.

So I launched galternatives and selected Java-1.7.0 for Java. Then it was OK.

Next I installed Eclipse (yum install eclipse), launched it, checked that it was using Java 1.7 : OK, then did a quick “Hello World” example and it went well. After some thinking I don’t see a real plus in having a RPM managed Eclipse. I can download it via the standard Eclipse way and I will be able to update it more conveniently.

Then Netbeans 6 and Glassfish have a problem related to keytool and keystore :

[2007-11-16 12:50:43.772]: executing command: /home/brunox/bin/glassfish-v2/bin/asadmin create-domain –interactive=false –adminport 4848 –user admin –passwordfile /home/brunox/bin/glassfish-v2/nbi-14359.tmp –instanceport 8080 –domainproperties http.ssl.port=8181 –savemasterpassword=true domain1, in directory: /home/brunox/bin/glassfish-v2
[2007-11-16 12:50:45.519]: [stdout]: Using port 4848 for Admin.
[2007-11-16 12:50:45.519]: [stdout]: Using port 8080 for HTTP Instance.
[2007-11-16 12:50:45.519]: [stdout]: Using default port 7676 for JMS.
[2007-11-16 12:50:45.519]: [stdout]: Using default port 3700 for IIOP.
[2007-11-16 12:50:45.520]: [stdout]: Using port 8181 for HTTP_SSL.
[2007-11-16 12:50:45.520]: [stdout]: Using default port 3820 for IIOP_SSL.
[2007-11-16 12:50:45.520]: [stdout]: Using default port 3920 for IIOP_MUTUALAUTH.
[2007-11-16 12:50:45.520]: [stdout]: Using default port 8686 for JMX_ADMIN.
[2007-11-16 12:50:45.520]: [stdout]: Domain being created with profile:developer, as specified by variable AS_ADMIN_PROFILE in configuration file.
[2007-11-16 12:50:47.275]: [stdout]: Security Store uses: JKS
[2007-11-16 12:50:59.504]: [stdout]: keytool error: java.io.IOException: Invalid keystore format
[2007-11-16 12:50:59.504]: [stdout]:
[2007-11-16 12:50:59.504]: [stderr]: CLI130 Could not create domain, domain1
[2007-11-16 12:50:59.555]: [return]: 1
[2007-11-16 12:50:59.555]: … command execution finished
[2007-11-16 12:50:59.557]: org.netbeans.installer.utils.exceptions.InstallationException: Failed to create the default domain
[2007-11-16 12:50:59.557]: at org.netbeans.installer.products.glassfish.ConfigurationLogic.install(ConfigurationLogic.java:373)
[2007-11-16 12:50:59.557]: at org.netbeans.installer.product.components.Product.install(Product.java:329)
[2007-11-16 12:50:59.557]: at org.netbeans.installer.wizard.components.actions.InstallAction.execute(InstallAction.java:151)
[2007-11-16 12:50:59.558]: at org.netbeans.installer.wizard.components.WizardAction$1.run(WizardAction.java:120)
[2007-11-16 12:50:59.558]: Caused by: org.netbeans.installer.utils.applications.GlassFishUtils$DomainCreationException: “Could not create domain - error CLI130 occurred.
[2007-11-16 12:50:59.558]: at org.netbeans.installer.utils.applications.GlassFishUtils.createDomain(GlassFishUtils.java:117)
[2007-11-16 12:50:59.558]: at org.netbeans.installer.utils.applications.GlassFishUtils.createDomain(GlassFishUtils.java:87)
[2007-11-16 12:50:59.558]: at org.netbeans.installer.products.glassfish.ConfigurationLogic.install(ConfigurationLogic.java:364)
[2007-11-16 12:50:59.558]: … 3 more

http://wiki.glassfish.java.net/attach/GlassFishAdministrationPages/admincreds.html

http://java.sun.com/javase/6/docs/technotes/tools/solaris/keytool.html#KeyStore

I guess  that I will simply install Sun Java 6.

All this through a FreeNX remote access.


Could your PC participate to Open Source ?

10 October 2007

I feel frustrated not to participate enough in Open Source. But my PC is running 24/24 …

Would it be possible to use that power to fuel OpenSource ? Currently I run Folding@home, bittorrent, hesitated about TOR, but would it be possible to be part of a cluster of some kind ? To share some CPU or HD ?

I guess that at some point Linux PC will get a critical mass of participating potential that should be given back.

Would it be possible to give Open Source Project the same distributed system that
Google & IBM giving students a distributed systems lab using Hadoop.


Konsole session save and restore

14 September 2007

It is possible to save and restore a “Profile” with multiple “Sessions” via Konsole Help (XTerm emulator).

A Session is a console, a shell, whatever is opened in a new tab. The Profile is a group of Sessions.

So once you have opened many shells, connected to distant SSH servers, named your tabs and typed some command like tail -f /var/log/... | grep -v boring

What if you crash or reboot your machine? Redoo all this work ? No ! Because you would have save your Konsole Menu : Settings ... / Save Sessions Profile ... You just type a name MySessions and Konsole will create the file in /home/username/.kde/share/apps/konsole/profiles/.

You can easily restore the Sessions with konsole --profile MySessions You can see the profile list with konsole --profiles.

Even better, you can edit the file vi /home/username/.kde/share/apps/konsole/profiles/MySessions , this way, you can type in the commands like tail -f ...

Sadly there is no menu to restore the session, so you have to launch konsole to launch konsole --profile MySession and then close the first konsole …

References :


urldecode for mysql

11 April 2007

It is possible to get the urldecode() or urlencode function in MySql, the same way it exist in PHP as url_decode and url_encode.

You just have to install the User Defined Function : UDF collection for MySQL created by Michael Wallner from IWorks.

There are just a few points to help the installation :

  • Decompress the sources : tar xf libmysqludf-0.3.tar.gz
  • Go into the directory cd libmysqludf-0.3 and read the INSTALL file !
  • If you don’t have them get MySql sources as well : yum install mysql-devel
  • On a RPM style MySql install do a ./configure --prefix=/usr/lib/mysql --includedir=/usr/include/mysql --libdir=/usr/lib (not sure if it is all really needed but it worked on a Fedora Core 5).
  • make
  • sudo make install
  • sudo /etc/init.d/mysqld restart (maybe not needed)
  • Open a mysql client as root if you don’t have the INSERT privilege for the mysql database (CREATE FUNCTION Syntax) : mysql -u root -p
  • There is the trick : CREATE FUNCTION urldecode RETURNS STRING SONAME 'libmysqludf_urldecode.so'; Notice the function name is lower case !!!
  • If you want to remove the function use DROP and then sudo make uninstall

Then you are free to url decode or url encode right in you SQL query ! It is very helpfull when you work on Apache log files !
I search for a Linux command line tool to urldecode, but I couldn’t find one. Still here are some good ressources :

Maybe a solution would be (from Perl FAQ ) :

The best source of detailed information on URI encoding is RFC 2396. Basically, the following substitutions do it :

    s/([^\w()'*~!.-])/sprintf '%%%02x', ord $1/eg;   # encode

    s/%([A-Fa-f\d]{2})/chr hex $1/eg;                # decode
	s/%([[:xdigit:]]{2})/chr hex $1/eg;          # same thing

java 6 on Linux and JPackage

27 March 2007

I wanted a clean install that use alternatives. So I go to JPackage … the point is that they are a bit outdated on a few points :

  • The recommended method “Rebuild the package” doesn’t fit anymore with Java 6. There is only a sun-compat packaeg and no “no-src” package.
  • The repository for Fedora “ready for use” is using mirrors pointing to the 1.6 JPackage version that doesn’t features Java 6. You have to manually write the yum.d/jpackage.repo to use JPackage 1.7.
  • The RPM for java-1.6.0-sun-compat is in the non-free section of 1.7 beta. (Note : there is a 5.0 that is supposed to match Java 5, but no 6.0 so far.

Anyway, I installed the JDK 6.0 for AMD64 from Sun and then the java-1.6.0-sun-compat and it went well. Installed Eclipse 3.2 with yum to try out. It seems OK so far.


Shortcuts and useful tricks

23 March 2007

Don’t loose time with your mouse :

  • Switch tabs on Firefox : Ctrl + Page up or Page Down
  • Switch tabs on Konsole : Shift + Left or Right

Useful on Linux :

  • Let say that you would like all file created in a directory dev to belong to group “users” instead of your personal group :
  1. Change the dev group  to “users” chgrp users dev
  2. Give him the set gid bit : chmod g+s dev
  3. Check if it is OK : ll should show drwxrwsr-x …