Thursday, December 27, 2007

How do you install Adempiere with PostgreSQL on Debian/Ubuntu?

Having to repeat these steps over and over again (to help friends, I myself don't know anything -yet- about Adempiere or ERP in general), I better put this down here.

I know that there are great clues from adempiere's wiki (http://adempiere.com/wiki/index.php), but these steps are what is convinient for me, most are the same as in wiki.

First thing's first, download Adempiere package from sourceforge. I got this one:
Adempiere_331b

Install sun-java5-* packages (hint: aptitude install sun-java5-*, I choose to install all packages)

Configure pljava support for postgresql:
- Download the precompiled binaries package:
for postgresql-8.1: from pgfoundry.org
for postgresql-8.2: http://www.posterita.org/share/pljava.zip

- Configure so that postgres user is trusted (edit pg_hba.conf and do postgresql server restart after) While you're at it, remember to also configure adempiere user access in pg_hba.conf (I just set it to trust for local access)

- Copy pljava.so and pljava.jar from the pljava package to /usr/lib/postgresql/VERSION/lib

- Link libjvm.so (without it, pljava install will fail, I choose linking than adding entries to ld.so.conf) :
ln -s /usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/server/libjvm.so /usr/lib/libjvm.so

- Add the following lines to end of postgresql.conf :
custom_variable_classes = 'pljava'
pljava.classpath='/usr/lib/postgresql/8.1/lib/pljava.jar'
pljava.statement_cache_size = 10
pljava.release_lingering_savepoints = true
pljava.vmoptions = ' '
pljava.debug = false
- Then to environment (/etc/postgresql/VERSION/main/environment)
JAVA_HOME = '/usr/lib/jvm/java-1.5.0-sun'
- Copy install.sql to /tmp, for run by postgres user (hint: su to root then su - postgres), so that we could just run it by:
psql template1 -f /tmp/install.sql

while we're at it, remember to also create adempiere user:
createuser adempiere

- Restart postgresql server

Now after postgresql preparation ready let's go to adempiere. I usually just prepare an Adempiere directory on user's home. And make this setup:

/home/USER/Adempiere/Server
/home/USER/Adempiere/Client

Also do this:
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
export ADEMPIERE_HOME=/home/arief/Adempiere

and remember to put those lines on the end of ~/.bashrc too.

Then I extract the Adempiere package to the Server directory. Then copy and extract the AdempiereClient.zip (you may get it from Server/lib/AdempiereClient.zip) on Client directory.

on Server, I do:
chmod 755 *.sh utils/*.sh

Then execute: Server/RUN_setup.sh

On the configuration setup screen, I usually setup webserver port to: 8080 and 4433, so that I could run Adempiere as regular user. For database, don't forget to set it to postgresql. If on testing the configuration you failed to connect to the web or database, try changing the host to '127.0.0.1' or localhost or your computer name and re-test.

If test all passed, you can save the config (click the Save button) then just wait for the setup to finish.

After setup we can now import the database structure (also with some demo data) by running:
Server/utils/RUN_ImportAdempiere.sh

If all's fine with the postgres-pljava setup, we should move along just fine here. And when it's all done. We could start the Adempiere Server with:
Server/utils/RUN_Server2.sh

And then we could start client by:
Client/RUN_Adempiere.sh

at first run it will ask for configuration. Just fill it the values you put on the server setup.

After that, Client should started up and showing nice graphs and dashboards. This is where I get amazed and confused and pressed the Quit button :-)

Oh, for easier launch, I usually add these two files:

/home/USER/Adempiere/server_start.sh
/home/USER/Adempiere/client_start.sh

With contents like these:
#!/bin/sh
# server_start.sh
#
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun

cd /home/USER/Adempiere/Server/utils/
ADEMPIERE_HOME=/home/USER/ADempiere/Server /home/USER/Adempiere/Server/utils/RUN_Server2.sh


#!/bin/sh
# client_start.sh
#
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun

cd /home/USER/Adempiere/Server/utils/
ADEMPIERE_HOME=/home/USER/ADempiere/Client /home/USER/Adempiere/Client/RUN_Adempiere.sh

Then I could create nice launchers for them and put it on panel or desktop. Remember to set to run server_start.sh inside a terminal.

Hope I didn't missed anything.

Friday, December 07, 2007

Telecomm network service management

This is going to be a heavy one :-)

As telecomm network technology grows, the amount of complexities in systems and subsystems involved grows also. This may not be such a big deal if we are still focusing our attention at the network level. Only, we don't have that privilege anymore.

Telecomm subscribers has also growth and changed, the people learned to demand more, in quality and quantity of services they have. The word "subscriber" itself is a bit ambiguous nowadays, because it could point not only to people but also to other businesses, or even to other networks or equipments.

So, operators started to think about the problems from the Service point of view. By taking the view up one level it helps them to think more clearly about the problem at hand. But this also brought in another layer of complexities. In Network point of view, a problem may be located and fixed in just a node in a subsystem. In Service pov, things get alot more complex, service problems may be caused by several points in the network, in different subsystems.

The growth of network complexities and the ever demanding customers need to be taken cared of in a smarter way. When not so long ago we can limit telecomm services as just Voice services and may easily identify and fix a problem in the service, currently we talk about different kind of services with different requirements and different parts of network.

When in PSTN we only talked about Switchings and leased circuits, then in GSM we had increased complexity of MSCs, VLRs, HLRs, BSCs, BTSs, VAS, etc, and now in 3G we have more interesting things (Node-B, RNCs, new interfaces, etc) to play with and the trends will keep went up in the next years in the next generation networks.

Funnily, errr or is it sadly..??, I notice that network designers/engineers seems to be unnotified or ignorant about this issue, they keep designing and engineers "new-and-better" networks with extended complexities in each new release and still (atleast seems to me) putting this service quality issue behind.

In service quality management world, OSS (should) played much more important role than before, and people has seems to acknowledge about this, equipment vendors have started to think about this, third-party consultants started to said alot of things, some have also started to present "solutions" to help overcome this problem.

Note that it's almost always a "solutions" not a ready system/product. That's because this is still an area with most complexities, usually people tend to stay away from this kind of issue when they can. Some operators has started projects to handle the situation, some manage to get good results (or so I've been told), some are still striving to get it done.

Personally, I think that a "network and service quality management" solution is close to impossible to be implemented correctly. There simply not enough budgets and resources for this in many operators. But I still think that there are many un-explored ways to solve the problem.

... to be continued ...

Human Computation

Just learn about this great idea from Dr. Luis von Ahn presentation here. The presentation is based on his PhD theses. I want to try to describe here, briefly, what he is doing. His idea has turn on lots of bulbs in my brain.

He start by telling the story of CAPTCHA (Completely Automated Public Turing test to tell Computer and Humans Apart). We all should by now probably know about CAPTCHA, and how does it help preventing spammers to get millions of free email account.

CAPTCHA is a computer-generated product that currently only human can solve but not other computer program. See the paradox? This is the basic idea of Human Computation. There are still areas where humans do better job than computers. And we do it well, way better than computers currently capable of.

What some of us may not know is that spammers have found a way to solve CAPTCHA. There are 2 basic ways (I myself knows about the first way, but only learn the second way from Luis' presentation).

First, spammers pay people to actually solve CAPTCHAs. But this has turn out costly for them. Second clever thing they done, is by using p*rn-sites. Spammers create p*rn sites that when visitors want to see more, they would have to enters words of a CAPTCHA (which behind the screen will then be submitted to Yahoo's email registration form). Being passionated p&rn lover, more often than not, those visitors will as fast as the can typed in the CAPTCHA :-)

The second example taught us a very interesting idea (in my words): We can use human computational power to solve computer-unsolved problems in a way that's actually "fun" for them, plus we don't need to spent a lot of money to pay them :-) And to know just how many wasted cycles of human computation is, Luis gave a figure: In 2003 estimated that there are > 30 billion man-hours wasted on playing the game Solitaire.

So what kind of problems that we may solve? Turn out there are a lot of them. Luis gave example of giving better descriptions to images on the web, so that a search for images could give better results.

To solve that problem Luis created (not another p*rn site, no!) 2 kinds of game he called symmetric and asymmetric game. One of the game he has created basically just ask people to put on words that describe images. The results are then used by google images search to help them provide correct images to people when they are searching for, say, 'cat'.

But that would take long time, right? you may ask. Well, you gotta see Luis' presentation to learn much about interesting statistics, shortly I can only say it does worked!

You can see, and try, the games at www.espgame.org and www.peekaboom.org. I just checked espgame site, and there it shows that they have been giving > 33 million image labels since October 2003. Wow.

Luis himself seems doesn't just stop there. He continued to do research on how to solve more interesting problems.

I noted one interesting question in the video: Would it be possible that for every boring job we do, we could create fun ways to do it? Of which Luis answered, I don't know, it would be great if we could figure out how to do this for every problem. But yes, this is an open problem.

An interesting open-problem,
So let's use up those wasted computation cycles :-)