I made a change in the blogger configuration to ease the later work when blogging. It is possible that older entries are not correctly formatted.

Tuesday 29 September 2009

mail to /dev/null

At work we has one or two cases where it would be useful to send mails to /dev/null.

Looking in google for a solution lead to the following solution (presented in
http://stackoverflow.com/questions/120587/what-is-the-best-way-to-forward-a-single-qmail-alias-to-dev-null) either create an alias with only a comment and no delivery instructions:

$> echo "# drop all messages on the floor" > ~alias/.qmail-devnull
(note the # indicating a comment) or with
$> echo -e '|cat >/dev/null' "\n" > ~alias/.qmail-devnull
note however that the first seems nicer to me.

Sunday 27 September 2009

newgrp - (su for groups)

Well reading an old linux magazine I learnt some thing about the command: newgrp and groups in general.

First of all, the difference between primary and secondary groups in UNIX was not completely clear to me.

First of all, a primary or secondary group is the role played by a group for specific user. There is one and only one primary group per user, where as there may be a number of secondary groups (as then defined in /etc/groups.

Moreover, I learnt you could use the command: newgrp to login and perform all operation with the other group identity. It can be seen as a kind of su. Also groups may have passwords which can be set and used by their users.

I also learnt there are also sticky bits and setguid for files and that they correspond to the same functionality that setuid and the sticky bits for files.

Conversion m4a to MP3

I needed to convert a few m4a files to mp3. After looking in Internet. I found a nice way working with fedora (see this thread):

$> faad -o songfile.wav songfile.m4a
$> lame songfile.wav songfile.mp3
$> rm songfile.wav

Note that the command faad differs a little from the one given in the thread, but man faad did not seem to offer the way given in the thread.

So I performed a small bash command script:

$> for a in m4a-files/*.m4a ; do filename=`basename "$a"`; faad -o ess.wav "$filename" ; lame ess.wav `basename "$filename" .m4a `.mp3; done ; rm ess.wav

if faad2 and lame are not on your system, they can be installed from rpmfusion using:

root $> yum -y install lame faad2

Sunday 20 September 2009

Fedora 11 installed

I installed Fedora 11. I still need to see what the differences are and see which software I need to install this time. The advantage of only updating (which did not really work for me from version 9 to 10).

The main new things seems to be that livna has more or less been replaced by rpmfusion. So I still have to see whether I can still install all the software I need for my own pleasure.

I will probably comment in this entry.

To install linux I used the CD from PCWELT Linux 5/2009.

LVM and partitioning

My computer is partitioned in the way that the /boot partition is under ext3 outside the lvm. But the '/' partition is under an lvm partition. In that way I can easily resize and create new partition. I used a new partition so that I should be able to come back to my older linux version, though I have not tested that yet.

One of the important change in fedora 11 (and perhaps fed 10) is the use of ext4.

One of my colleague is somewhat sceptical of the use of partitioning though I must say with lvm it is a real pleasure, but OMMV (our mileage may vary).

Ctrl+ Alt+ Backspace

In the new version of Xorg, the default configuration does not allow you to kill the X server with the keys: Ctrl+ Alt+ Backspace. Whether I find that good or not. Well I ain't so sure.

Desktop background

I really like the new background for the desktop. I suppose I might keep it some time. I really like the birds. Though searching with google there seems to be a lot of cool backgrounds: e.g http://www.wallpaperlinux.com/v/Fedora/Fedora+11+Linxu+Wallpaper+Fedora+11+Desktop+Background.jpg.html

CD automount

I have a small problem withe the auto mount for CDs. It does not seem to be working. I am not sure of the reason.

Installing RPM fusion

See: http://rpmfusion.org/Configuration/.

At least using RPM fusion I can install: mplayer and vlc. I will have to see whether I can also play wmv, mpeg and avis just as I wish. It seems to be the case.

Updating would have been better?

With these things you never know. But I wonder whether I would not have rather updated the distribution instead of installing a new version. I am still not finished.

Saturday 19 September 2009

Ext.js experience

After learning ext.js to work for a company which did not employ me because of some difference of opinions or personal reasons, I had to admit that I had been quite pleased at the framework, its power and its ease of use.

Now, for my current company, I have to create a prototype of an other application I had developed using RAP, but which proved to be more of a disaster than anything.

So here I am again, programming my examples in ext.js.

The Ext.js framework can be used as a GPL v3.0 framework or with licence costs. This seems to be O.K for my boss. So I am fine with it.

Though I still have some difficulties especially because I do not find the debugging very easy, but maybe there is a good way to work with it. I will have to see.

So I could create a tree and a table easily. For the application I must develop I am supposed to create, I more or less only need trees, tables and forms of different forms. Though I also need to embed a rich HTML editor, the FCKeditor (note that the name seems to have been change, WTF? ;-) ).

So as I had said about RAP ( but did not happen), expect infos and tutorial about the subject.

Eclipse RAP or Rich Ajax Problems

I have been trying to work with RAP. The experiment we did for my work with this infrastructure is somewhat unsuccessful. It has been a pain in the ass at many points. I will write here a summary of my problems with this infrastructure:
  • RAP platform configuration
  • Layout difficulties
  • Deployment difficulties
  • lost sessions

RAP platform configuration

One problem with RAP, which may be corrected later on, is that the SWT and RWT cannot be there both at the same time. This means that to use RAP you must configure the eclipse IDE to work with RAP instead of SWT. This proved to be tricky once or twice, especially when switching versions. RAP is no real solutions where you can just get the libraries and just start programming, and this is in my opinion one of the main drawback.

Layout difficulties

Maybe I am not much of a GUI person, and maybe I do not understand the GUI documentation. But I had a very hard time building the interface. I had to try many things. in many cases, I had to use the same tricks over and over not really understanding what the reasons for the failed layout were. This proved to be very annoying, especially when you think this should be simple and basic. Note that I am not sure this is a RAP problem. But rather an eclipse SWT problem.

Deployment difficulties

At some points I tried to use the RAP deployment mechanism. But when I tried to create the WAR files, the RAP application could not be loaded. The problem is that the use of the embedded equinox server did not give much information about which happened. This may be a question of know how and knowledge of the right tools to use. But it took me a long time to find solutions or reasons for the errors. In many cases, I still do not know why it did not work. This makes the deployment process unsecure and very time consuming.

lost sessions

We developed a tool based on RAP for a client. Apart from the hibernate problems I had, RAP was the main difficulty in the project. The last one, and the most annoying one, is that the RAP installation did not work correctly under Apache. It seemed that it would always loose its sessions. This made it very annoying and in particular the client could not see anything appear on its site.

No RAP bashing, just a RAP rant

Though I had lots of difficulties with RAP. I would not say it sucks. But anyone using this as basis for some tool must be aware of the difficulties behind it.

What the Cut?

Well I just learnt about a cool command: cut. Under UNIX, cut allows you to cut some portion of lines of a file. This is really cool.

Some examples:

for a file (with fields separated with \t):

$-> cat file
line 1 FIELD 2 FIELD 3 FIELD 4 FIELD 5 FIELD 6 FIELD 7
line 2 FIELD 2 FIELD 3 FIELD 4 FIELD 5 FIELD 6 FIELD 7
line 3 FIELD 2 FIELD 3 FIELD 4 FIELD 5 FIELD 6 FIELD 7
line 4 FIELD 2 FIELD 3 FIELD 4 FIELD 5 FIELD 6 FIELD 7
line 5 FIELD 2 FIELD 3 FIELD 4 FIELD 5 FIELD 6 FIELD 7

$-> cat file|cut -c '2-4'
FIELD 2 FIELD 3 FIELD 4
FIELD 2 FIELD 3 FIELD 4
FIELD 2 FIELD 3 FIELD 4
FIELD 2 FIELD 3 FIELD 4
FIELD 2 FIELD 3 FIELD 4
and you can stick a file back together using paste. Isn't the unix philosophy cool? Or am I a geek?

Useful Git Tutorial

I found this very useful Git link: http://www-cs-students.stanford.edu/~blynn/gitmagic/. I really learnt a lot about it. Another useful link is: http://progit.org/book/. Here are a few things I learnt from these links:
  • "Snapshots, Not Differences" git does not store differences but new versions of files which changed and links to the unchanged one.
  • reordering of commits Using Git, you can commit code to your repository and then reorganize the order of your commits. This makes it much more simpler to group changes in a meaningful way.
  • branching is easy

Quote the Maven: Evermore!

Well sorry about that my dear Poe! I really like Maven a lot. It is a really good programming management tool. It is a step up from Ant, yet it simplifies a lot of aspects. And moreover it has a very useful set of plugins and software repositories. The main properties of Maven:
  • Workflow and tasks based
  • modular
  • dependency management
  • extensible
  • platform adaptable

Workflow and tasks based

Maven is based on a controlled workflow of tasks performed, sequentially. You can call some particular task. Maven will make sure the tasks required before this task will be performed if needed. For example, if you wish to package a certain jar. Maven will take care of the compilation and the signing.

Modular

Maven is capable of working with different modules. The modules required by a given module will be then built if needed.

dependency management

At the heart of maven, there is a dependency management framework: Ivy. This allows to ensure that the packages used and constructed have a compatible version with the code needed.

extensible

Maven is based on a set of multiple plugins, which can be easily extended or retrieved from a repository on the Internet. Each of this plugin performs a specific task. The tasks to be performed are configured in the pom.xml, which is the configuration file for a module in maven.

platform adaptable

Using maven, you can build different binaries or packages depending on the target platform. You need to describe a given profile. This introduction did not present any example or code. This will be done in the next step.

Back to Blog

Well it's been a long time without posting. And I've learned a lot about diverse technologies. But I had not much time to spend blogging. But blogging about technical subject helped me a lot. So now I am back. Let's see what comes about.