Posts tagged linux
From the grounds up, your Maven powered Alfresco dev box
Jan 14th

The target
To start your Alfresco development experience, you need a development environment. Let’s say you’re more into this Maven and you’d rather leverage its capabilities instead of using the default ant based build system provided along with the SDK. In this tutorial, I’ll guide you through the process of setting up from scratch your development environment. And by saying “from scratch”, I really mean it: we’ll start from a fresh installed Linux box and the we will add piece over piece until we’ll be see the Alfresco flower on our browser. This will be a *basic* tutorial, just to put in place the foundation for later improvements.
I’m actually performing these steps in a virtual machine, so that next time a quick&dirty Alfresco PoC is required I might use this very same VM to start right away from a known, dev ready point.
UPDATE: the Maven project structure I end up with at the end of this article can be downloaded directly from GitHub.
Operating System
Ok, I assume you know your stuff and don’t want to get a bore-some lesson on how to install Linux. The whole internet is polluted by billions of guides and tutorial since 199x, anyway, so let’s just say I just completed the install process of Mint7 and I’m at my very first login. I would go for Mint8 if my current connection was fast enough to download it before I finish writing these notes, but whatever, there’s nothing really bad in v7.
Tools
The shopping list here includes a JDK, Maven and… well, that should be it, theoretically. Unfortunately, due to a nasty regression, we’re going to need a db. My choice goes to MySQL.
MySQL
First thing first, let’s install it:
~$ sudo apt-get install mysql-server
When this is done, we have to create the db Alfresco is going to use:
~$ mysql -u root mysql> CREATE DATABASE alf_jetty; mysql> GRANT ALL ON alf_jetty.* TO 'alfresco'@'%' IDENTIFIED BY 'alfresco';
Username and password are the default for the maven stuff we’re going to use.
Java
Java™ 5 has already passed on, let it rest in peace. Instead, go and install Java™ 6:
~$ sudo apt-get install sun-java6-jdk
Maven
Hold on the temptation of installing Maven 3 or to ask apt-get to do this task for you. We’re going to the official download page and following the links to get the latest stable 2.x release. You should end up with something like apache-maven-2.2.1-bin.tar.bz2 on your file system. Then do the following:
~$ cs /opt ~$ sudo tar xvjf apache-maven-2.2.1-bin.tar.bz2 ~$ sudo ln -sfv /opt/apache-maven-2.2.1/bin/mvn /usr/bin/mvn
There are less intrusive ways to bring your downloaded application into your PATH, but this is the quickest possible. Let’s go on to the next step.
Plumbing
We’re almost there, we just have to lay down our projects. Let’s start with the Alfresco repo extension:
~$ mkdir -p development/alfresco-showcase ~$ cd development/alfresco-showcase alfresco-showcase$ wget http://download.skuro.tk/alfresco-showcase/pom.xml alfresco-showcase$ mvn archetype:generate -DarchetypeGroupId=com.sourcesense.alfresco \ -DarchetypeArtifactId=maven-alfresco-extension-archetype \ -DarchetypeVersion=1.9.1 \ -DgroupId=it.sk.alfresco \ -DartifactId=alfresco-showcase-extension \ -Dversion=1.0-SNAPSHOT \ -DarchetypeRepository=http://maven.alfresco.com/nexus/content/repositories/releases \ -DinteractiveMode=false
The POM I’m making available here is just a very basically one, I’m using it here just for you to speed up the process.
UPDATE: as others pointed me out, it looks like you somehow need to download such a pom for the whole thing to stand up. That’s simply not true, I’m just building a more complex dev environment and it’s better if we have some structure in place. This includes having a parent project, along with its parent pom, with nested projects registered as its modules. These will come in the next posts. But that’s just part of the reason for this pom to be here: I also tend to be lazy, so that letting you download it was easier than explaining myself. Note to self: thou shalt not post anything at 2am.
First achievement
Ok, let’s stop here now and see what we’ve done by now. Go to the alfresco-showcase folder and type:
alfresco-showcase$ MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=128m" \ mvn clean install -Prun
This will start a local jetty instance where Alfresco 3.2 community will be deployed. So, if you now point your browser to http://localhost:8080/alfresco you will finally see that flower we talked about at the beginning of this post.
Next steps
That’s it for now, but other blocks are still missing: what about AMPs? And WCM? And does Share fits in the picture? I’ll cover all the points in the next episodes of this series. See you there!
Home sweet home
Oct 20th

Ok, the migration should be now complete and the DNS updated. Moving a wordpress instance is not that smooth thing I hoped, but I’ve found some useful tips that allowed me to do it quickly. Now, these pages are served by a Debian VPS from the US, more precisely:
| IP Address: | 64.208.167.70 |
| Location: | UNITED STATES, |
| Latitude / Longitude: | 38.9048 LATITUDE, -77.0354 LONGITUDE |
| Connecting through: | GLOBAL CROSSING |
| Time Zone: | UTC -05:00 |
| Net Speed: | DIAL |
| IDD Code: | 1 |
| Weather Station: | USDC0001 – WASHINGTON |
Now, if it happens to you to see anything weird on these pages, please shout out loud!
See you soon.
Quick fix for ALSA error: cannot find the slot for index 0
Apr 5th

Since the last kernel upgrade (now running a slightly customized 2.6.28) I started to experience a nasty issue with my audio configuration. I haven’t had the time to look at it since today, and it actually took a bit to figure out what was going wrong. Actually, my integrated audio card was no more visible on the system, i.e.:
sku@dreamland:~$ cat /proc/asound/cards 0 [U0x46d0x9a1 ]: USB-Audio - USB Device 0x46d:0x9a1 USB Device 0x46d:0x9a1 at usb-0000:00:1a.7-4, high speed
This actually means that ALSA only recognizes an USB audio device, which actually is my mic-enhanced web cam. From previous experiences, I knew the kernel module I have to look at for my integrated audio card was snd_hda_intel, and lsmod was actually listing it among the loaded modules. Something wrong probably happened when that module was loaded. Since I’m too lazy even to grep inside of syslog for that module, I just give it another chance with rmmod snd_hda_intel ; lsmod snd_hda_intel. Nothing changed. This time, with a tail -f on syslog:
Apr 5 11:58:36 dreamland kernel: ALSA /usr/src/modules/alsa-driver/acore/init.c:138: cannot find the slot for index 0 (range 0-0), error: -16 Apr 5 11:58:36 dreamland kernel: ALSA /usr/src/modules/alsa-driver/pci/hda/../../alsa-kernel/pci/hda/hda_intel.c:1878: hda-intel: Error creating card! Apr 5 11:58:36 dreamland kernel: HDA Intel: probe of 0000:00:1b.0 failed with error -12
AHA! Probably someone already noticed the issue: while /proc/sound/cards lists my USB card already installed in slot #0, snd_hda_intel is trying to use that one and only slot (index 0, range 0-0) to install the other card. This requires some modprobe configuration. My system offered already a /etc/modprobe.d/snd-hda-intel, which only contained:
options snd-hda-intel position_fix=2 options snd-hda-intel model=auto
I actually don’t even know what that actually means, so I left those lines there while adding something above them. The resulting file is:
alias snd-card-1 snd-usb-audio option snd-usb-audio index=1 alias snd-card-0 snd-hda-intel option snd-hda-intel index=0 options snd-hda-intel position_fix=2 options snd-hda-intel model=auto
What I’m trying to do is obvious: put the cards in the correct order. And know what? It works! The image at the top of this post shows you it.
Probably there are other more clever way to configure it, so any suggestion is welcome.












