2009-05-17

GWT, Spring@Grails (Java/Groovy), GAE - play together in harmony

There is the Wentity project which shows as a proof-of-concept how to incorporate these technologies and let them play together in harmony: It uses Google´s App Engine infrastructure for a Spring based version of Grails which also uses Google´s Web Toolkit for RIA content. The project is in a structure-finding draft phase. Nevertheless it can be built and deployed on GAE. Use it as a template for your own project to save time! Along with Groovy you can also use your Java code in this project. Also it has the capability to i18n enhance your web apps to offer internalized/translated versions of them. The Wentity demo site gives you an impression for the functionality which is already been implemented and working.

2009-04-25

Google Gears Linux x86_64-bit Plugin Download for Firefox Browser

There is an issue describing this problem (no x64 version available) on the Google Gears development site. Also you can find continuously updated x86_64-bit versions of the Google Gears Firefox add-on/plugin there.

2009-04-13

Importing/Adding GPG keys to Apt-Get/Aptitude

If you get messages like this...
W: GPG error: http://dl.google.com stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A040830F7FAC5991
...when you are updating your package list via apt-get or aptitude, you have to import the missing GPG key, in order to avoid these warning messages in the future:
gpg --recv A040830F7FAC5991
gpg --export --armor A040830F7FAC5991 | sudo apt-key add -
In this way you can add a new GPG signature key for the distributed packages to apt-get.

Audio/Volume control keyboard shortcuts in Xfce configuration

To control the volume settings in Xfce with keyboard shortcuts, you have to assign the following commands in the "Application Shortcuts" section of the "Keyboard" configuration menu to corresponding shortcuts:




amixer set Master 5+ : increase volume
amixer set Master 5- : decrease volume
amixer set Master toggle : mute/unmute volume switch

2009-04-12

Eclipse: 32-bit GWT (GTK) configuration on x86_64 arch to avoid "Failed to load module"/"wrong ELF class"

If you get "Gtk-Message: Failed to load module "canberra-gtk-module": /usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so: wrong ELF class: ELFCLASS64" messages on the console when you launch a Run/Debug Configuration of your GWT Web Application, you should set the value of the environemtal variable GTK_PATH to /usr/lib32/gtk-2.0:





...whereby ${GTK_32_PATH} should have the value /usr/lib32/gtk-2.0. Eventuall you have to install the ia32-libs-gtk package to make /usr/lib32/gtk-2.0 available.


You haven't to use the x32 JDK/JRE as your default Java VM for the whole x64 system but install ia32-sun-java6-bin package and set this VM as your default JRE only in Eclipse (for the projects) but not for Eclipse itself:

2009-04-11

Apt Repository to install: Skype, Acrobat Reader, Real Player, Google Earth, restricted video codecs or the Acrobat Firefox plugin for Linux?

...if you're looking for anything above, you should add the Medibuntu Ubuntu package repository to your apt-get/aptitude list! This allows you to install pre-configured and actually working Skype, Acrobat Reader, Real Player, Google Earth packages as well as many video codecs to play DVDs and odd video files under Linux. Furthermore you can install the Acrobat Reader plugin for Firefox that allows you to view PDFs within Firefox without opening any additional PDF viewer software. Some speech codecs are included as well and restricted video codecs (ppc-codecs, w32codecs, w64codecs) make it possible to play encrypted DVDs.

2009-04-08

Windows Vista x86 vs. x64 (32-/64-bit) - which is better?

Questions about RAM support (4 GB RAM barrier), performance, and security are clarified in a brief overview on this site. Not only the question whether Win Vista supports 4GB of RAM is clarified, but also security related questions regarding the both architecture editions of Windows Vista will be answered: PatchGuard, DEP, Driver Signing.

2009-04-05

Password-less sudo (auto-sudo): Sudo without entering a password

Sometimes "getting the work done" have a greater priority for people than security: And this how-to addresses those people. However a password-less sudo command execution might decrease the security level of your machine, as executing the sudo command without entering a password, allows all local users (which are also able to execute the sudo command itself) to execute commands as root user. So an auto-sudo may allow local users to gain root privileges.
sudo visudo
...should let you modify the sudoers file and enable auto-sudo:
# [...]
# User privilege specification
root ALL=(ALL) ALL

# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
%sudo ALL=NOPASSWD: ALL

# Members of the admin group may gain root privileges
#%admin ALL=(ALL) ALL
Note that these entries have to be in the "User privilege specification" part of the sudoers file. Entries like %admin ALL=(ALL) ALL would override the pasword-less sudo behavior and should be commented out. The %sudo in %sudo ALL=NOPASSWD: ALL represents the "sudo" group. To make auto-sudo work, you should either add the auto-sudo user to the "sudo" group or replace the "sudo" group by a group which contains the auto-sudo user. There is usually a system group which has the same name as the respective user. So you could use this group name instead of "sudo".

Password-less SSH login (auto-authentication/login) on a remote machine

ssh-keygen -t rsa

...will generate an id_rsa and an id_rsa.pub file in your ~/.ssh/ directory. Afterwards you have to copy your id_rsa.pub file, which is basically your public key, to the ~/.ssh/authorized_keys direcotory on the remote machine. So if you copy the id_rsa file to the /root/.ssh/authorized_keys directory of a remote (or local...) machine, you should be able to log-in on this machine as root without providing any password:
scp ~/.ssh/id_rsa.pub root@example.com:/root/.ssh/authorized_keys/
or
scp ~/.ssh/id_rsa.pub anyUser@example.com:/home/anyUser/.ssh/authorized_keys/
Also you should pay attention NOT to copy the ~/.ssh/id_rsa file, as this is your private key which should be kept secret. However an auto-login resp. auto-authentication which allows you to login on a remote server without entering a password, might decrease the security level of the remote machine: So if anybody get your private id_rsa key, he should be able to auto-login on this machine too.

2009-04-04

How to convert VDI to VMDK; Converting a VirtualBox image to a VMware disk image and vice versa

You need the QEMU emulator software package
aptitude install qemu

in order to execute this command
qemu-img convert VirtualBox-HardDisk-image.vdi -O vmdk VMware-virtual-machine-image.vmdk


You should keep in mind that you might get an IDE VMware disk image in this way but a SCSI hard disk image is recommended by VMware for more I/O performance.

Just type
qemu-img

to get all supported formats which you can supply as the -O parameter. It is also possible to convert a VMDK to a VDI hard disk image. To convert a VMware image to a VirtulBox image, you have to use the qemu-img-vdi command which you can get by patching QEMU.
Afterwards you may execute this command:
qemu-img-vdi convert VMware-hard-disk-image.vmdk -O VDI VirtualBox-image.vdi

2009-04-02

Tuning ext4 for performance with emphasis on SSD usage

The obligatory disclaimer: The more performance you gain, the more data integrity you loose! But if you want to tune something like a file system, I strongly assume that you know what you are doing :) These tips apply to all major Linux distributions like Fedora/Red Hat, OpenSUSE, and Ubuntu that are already using ext4 or are going to make ext4 their default file system.

As write operations on Solid State Disks (SSD) are expensive the tips below are focused on SSD usage but also apply to HDD usage as well.

My Ubuntu 9.04 Jaunty /etc/fstab after a fresh installation:
[...]
UUID=d818ddf9-ff01-e21a-a67d-3ceab43a9e2b / ext4 relatime,errors=remount-ro 0 1
UUID=0d339122-74e0-e0ea-805a-7879b1fa3172 /home ext4 relatime 0 2
[...]
My tuned Ubuntu 9.04 Jaunty /etc/fstab:
[...]
UUID=d818ddf9-ff01-e21a-a67d-3ceab43a9e2b / ext4 noatime,barrier=0,nobh,commit=100,nouser_xattr 0 1
UUID=0d339122-74e0-e0ea-805a-7879b1fa3172 /home ext4 noatime,barrier=0,data=writeback,nobh,commit=100,nouser_xattr 0 2
[...]

data=writeback

The default data mode is ordered. This mode provides only meta-data journaling which is similar to the default data mode in ReiserFS, XFS, and JFS. Enabling this option on the root partition, caused an error during boot time. So enable this option only on non-root partitions!

nobh

Implies data=writeback; Avoids buffer heads to data pages association.

barrier

The default value is barrier=1 (activated). Deactivating write barriers in the jbd code will improve the performance. If you don't have a battery-backed storage environment, you should not deactivate this mount option.

noatime

Deactivates the file access time modification which is basically a write operation that should be avoid on SSDs.

relatime

This is a faster alternative to the atime (default) option. You can set it, if you need the file access times to be set. However it is still responsible for write operations which should be avoid -- especially on SSDs.

commit

Increases the commit/write interval (default: 5s). Actually it is a sync operation between data and meta-data which is an important data-safety feature.

nouser_xattr

Disable Extended User Attributes if you don't need them. If you are using a desktop setup at home (or in a small office network), you may not need this feature.

errors=remount-ro

Many distribution add also this boot option. In fact this boot option can be omitted without any hesitation as this boot option is set by default.


If throughput is a major issue and latency not a big problem, you may also increase the min_batch_time option value which defaults to 0 microseconds.


The main source for these tips was the kernel reference documentation paper of the ext4 file system.

Note:
You also may be interested in how to tune ext3 for performance or how to use a swap file instead of a swap partition.

Update:
With these pretty aggressive performance settings my data has already survived a couple of crashes (incl. sudden power outages). So I will keep these settings :)

Update 2 (thanks to an anonymous comment!):
To enable the data=writeback on the root (mounted on /) partition boot your machine in recovery mode and execute:
tune2fs -o journal_data_writeback /dev/sdXY
Afterwards you can add the data=writeback option to your root partition in your fstab file.