How to install MyPaint on Ubuntu 11

sudo add-apt-repository ppa:achadwick/mypaint-testing
sudo apt-get update
sudo apt-get install mypaint
Categories: Uncategorized Tags: , , ,

How to install Blender 2.59 on Ubuntu 11

sudo add-apt-repository ppa:cheleb/blender-svn
sudo apt-get update
sudo apt-get install blender
Categories: Uncategorized Tags: , , , ,

Java on Ubuntu 11

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-jdk
Categories: Uncategorized Tags: , , ,

Hudson – clock of the subversion server appears to be out of sync.

WARNING: clock of the subversion server appears to be out of sync. This can result in inconsistent check out behavior.

This message seems pretty clear, to fix this we have to configure ntp. Let’s install the required packages :

apt-get install ntp ntpdate
 vim /etc/ntp.conf 

add server ntp.belnet.be

# pool.ntp.org maps to about 1000 low-stratum NTP servers.  Your server will
# pick a different set every time it starts up.  Please consider joining the
# pool: <http://www.pool.ntp.org/join.html>
#server 0.debian.pool.ntp.org iburst dynamic
#server 1.debian.pool.ntp.org iburst dynamic
#server 2.debian.pool.ntp.org iburst dynamic
#server 3.debian.pool.ntp.org iburst dynamic
server ntp.belnet.be

...

Restart ntp,

/etc/init.d/ntp restart

You can check your configuration and see the servers with which you are synchronized with the following :

ntpq -p
remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
holem.belnet.be 193.190.198.43   2 u    2   64    1    9.181  -15.619   0.001

More on : http://www.debianadmin.com/ntp-server-and-client-configuration-in-debian.html

OSGi Hello World with NetBeans 6.9

November 2, 2010 1 comment

Since version 6.9, NetBeans offers the possibility to work with OSGi bundles. The creation of the project is relatively simple. You just need to go to new Project > Maven > Maven OSGi Bundle like this :

The generated pom.xml begins this way:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

 <modelVersion>4.0.0</modelVersion>
 <groupId>net.stephou.osgi</groupId>
 <artifactId>HelloWorld</artifactId>
 <version>1.0-SNAPSHOT</version>
 <packaging>bundle</packaging>
 <name>OSGiTest OSGi Bundle</name>

 <dependencies>
  <dependency>
   <groupId>org.apache.felix</groupId>
   <artifactId>org.osgi.core</artifactId>
   <version>1.4.0</version>
  </dependency>
 </dependencies>
...

We notice there is only one dependency to the OSGi core and that the packaging is “bundle”. The rest of the pom is the run-on-felix profile configuration for NetBeans.

To display a HelloWorld in Apache Felix console, we need to add a HelloWorld java class. So, right-click on the source package and go to New > Other > OSGI > Bundle Activator like this :

Here is the code for the class after adding something for the console :

package net.stephou.osgi;

import org.osgi.framework.BundleActivator;

import org.osgi.framework.BundleContext;

/**

*

* @author Stephou

*/

public class HelloWorld implements BundleActivator {

   public void start(BundleContext context) throws Exception {

     System.out.println("Hello OSGi World");

   }

   public void stop(BundleContext context) throws Exception { 

     System.out.println("Goodbye OSGi World");

   }
}

In the pom.xml, you can see the Bundle-Activator line has been added for the maven-bundle-plugin :

<plugin>
 <groupId>org.apache.felix</groupId>
 <artifactId>maven-bundle-plugin</artifactId>
 <version>2.0.1</version>
 <extensions>true</extensions>
 <configuration>
 <instructions>
   <Bundle-Activator>net.stephou.osgi.helloworld.HelloWorldActivator</Bundle-Activator>
 </instructions>
 </configuration>
 </plugin>

Just Build and Run your project in NetBeans and you’ll see the following in the console :

Welcome to Felix
================

Hello OSGi World

Congratulation ;)

Categories: Informatic, Java

Getting started with OSGi on Apache Felix


To work with OSGi modules (or bundles), you’ll have to use, I let you guess …, an OSGi container. There a few open source containers including Apache Felix and Eclipse Equinox. The first one is used in application such as Glassfish v3, Service Mix 4, … and the second one in … Eclipse IDE of course.

Let’s start with downloading Apache Felix here and choose Felix Framework Distribution 3.0.3.

Unzip it and run the container (felix-framework-3.0.3/bin/felix.jar) with :

java -jar bin/felix.jar

You’ll have a g! prompt (fore felix console “gogo”) where you can enter the help command :

____________________________
Welcome to Apache Felix Gogo

g! help
felix:bundlelevel
felix:cd
felix:frameworklevel
felix:headers
felix:help
felix:inspect
felix:install
felix:lb
felix:log
felix:ls
felix:refresh
felix:resolve
felix:start
felix:stop
felix:uninstall
felix:update
felix:which
gogo:cat
gogo:each
gogo:echo
gogo:format
gogo:getopt
gogo:gosh
gogo:grep
gogo:not
gogo:set
gogo:sh
gogo:source
gogo:tac
gogo:telnetd
gogo:type
gogo:until
obr:deploy
obr:info
obr:javadoc
obr:list
obr:repos
obr:source
g!

List installed bundle

g! felix:lb
START LEVEL 1
 ID|State      |Level|Name
 0|Active     |    0|System Bundle (3.0.3)
 1|Active     |    1|Apache Felix Bundle Repository (1.6.2)
 2|Active     |    1|Apache Felix Gogo Command (0.6.1)
 3|Active     |    1|Apache Felix Gogo Runtime (0.6.1)
 4|Active     |    1|Apache Felix Gogo Shell (0.6.1)

Install bundles

g! felix:install file:bundle/helloworld.jar
Bundle ID: 18

Start installed bundles

g! felix:start 18
Hello World!

Stop Apache Felix

felix:stop 0

Don’t be surprised next time you launch Apache Felix, installed bundles will automatically be reloaded thanks to felix-cache.

To continue …

NetBeans 6.9 and OSGi

Netbeans 6.9 integrates the OSGi interoperability. In fact, you can create OSGi bundles to use in Java applications.

It also enables you to build OSGi bundles from a Maven archetype and then access the bundles from applications that are running in an OSGi container.

  • Develop OSGi bundles with Maven
  • Bundled Felix container
  • Use OSGi bundles in a NetBeans RCP application

Likewise, NetBeans 6.9 offers the support for JavaFX 1.3.1, Spring Framework 3.0 library, PHP Zend Framework, …

You can download the 6.9.1 version it here. And here are the feature Higlights.

Firefox 4 Beta version

Firefox 4 beta version can be downloaded here (Windows only for now). The key features are :

  • HTML5 & CSS3 Support
  • Privacy protection enforced
  • WebM and HD videos
  • WebConsole (FireBug like ?)
  • Sync (settings, passwords, bookmarks, history, open tabs, …)
  • Indexed DB (storing application data locally)
  • Easily Switch to tab

Feel free to use the Feedback button to help Mozilla to improve Firefox.

Categories: Informatic Tags:

Enable clean urls for drupal

In your apache config file (httpd.conf) add the following :

LoadModule rewrite_module modules/mod_rewrite.so

<Directory "path_to_your_drupal_dir">
 AllowOverride All
 RewriteEngine on
 RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$  index.php?q=$1 [L,QSA]
</Directory>

Test your configuration by accessing your_host/user/login (instead of ?q=user/login).

client denied by server configuration: proxy:ajp://your_host:8009/ on a Debian server

To suppress the client denied by server configuration error with ajp and Apache (I suppose you already did a a2enmod proxy_ajp), just change the Proxy setting from Deny all to Deny none in /etc/apache2/mods-enabled/proxy.conf :

<Proxy *>
  AddDefaultCharset off
  Order deny,allow
  Deny from none
  #Allow from .example.com
</Proxy>
Categories: Informatic Tags: , , , ,
Follow

Get every new post delivered to your Inbox.