Archive for the 'My linux desktop' Category

My linux desktop

Hide Gnome Panel

Since a few months I’ve done away with using the Gnome main menu. Instead I use Gnome Do. I removed the bottom toolbar long ago, because always use alt-tab.

I’m not using the top toolbar much either. It was just taking up valuable screen space. I contains only the notification area and a logout button. I was looking at a way to remove it completely. The answer came in the Compiz widget layer. By placing it on the widget layer, fullsize windows actually fill the full screen, but the notification area is still available for applications who need it.

To move Gnome panel to the Widget layer, open ‘CompizConfig Settings Manager’ and enable ‘Widget Layer’. Go to tab ‘Behaviour’ and add the following text for the ‘Widget Windows’ field:

(class=Gnome-panel & type=Dock)

The desktop will now be completely clean:
Desktop clean

With we can display the widget layer, where the panel is found:
Desktop Widgets

PS. The widgets you see on the widget layer are screenlets. Ubuntu has the screenlets package in the universe repository.

Life as a hoster, My linux desktop, PHP

How to get a file extension

How to get a file extension in PHP:

$ext = pathinfo($file_name, PATHINFO_EXTENSION);

How to get a file extension in Perl:

my $ext = ($file_name =~ m/([^.]+)$/)[0];

How to get a file extension in Ruby:

ext = File.extname(file_name)

How to get a file extension in Bash:

ext=${file_name##*.}
name=${file_name%.*}

How to get a file extension in Python (thanks to Jensen):

import os
ext = os.path.splitext(file_name)[1]


Got more? Please post a comment.

Life as a hoster, My linux desktop, MySQL, PHP

Howto Install Xen+Lustre on Ubuntu Gutsy

Send in by Ruben Daniels

Lustre is one of the most popular upcoming open source cluster file systems out there. When you want to run Xen’s from a SAN using Lustre you need to support both in the Linux kernel. Both XEN and Lustre are near mature products. This means there is support for it. But it’s quite difficult to find the right source and to combine it with the right kernel source of each. It took me a week of trial and erroring until I found a combination that worked. Since Google wasn’t much help I wrote this article so it might help you. This installation is Ubuntu Gutsy specific. You can start out with a basic Gutsy installation. Hardy is getting Lustre support, but at the time of this writing the package doesnt match the default kernel of Hardy.

First we apt-get some utilities and Xen packages

apt-get install quilt libc6-xen libxen3.1 linux-image-xen linux-restricted-modules-xen linux-xen python-xen-3.1 xen-docs-3.1 xen-hypervisor-3.1 xen-image-2.6.19-4-server xen-ioemu-3.1 xen-tools xen-utils-3.1

Now we get the kernel from kernel.org

cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.tar.gz
tar -zxvf linux-2.6.22.tar.gz

The best matching (and stable) lustre source I’ve found is in the Hardy Lustre source package. So we get it and extra it manually:

wget http://ubuntu2.cica.es/ubuntu/ubuntu/pool/universe/l/lustre/lustre-source_1.6.4.2-1_all.deb
dpkg -x lustre-source_1.6.4.2-1_all.deb lustre-1.6.4.2
bunzip2 lustre-1.6.4.2/usr/src/lustre.tar.bz2
tar -xvf lustre-1.6.4.2/usr/src/lustre.tar
mv lustre-1.6.4.2/usr/src/modules/lustre/* lustre-1.6.4.2
rm -R lustre-1.6.4.2/usr -R

The official XEN kernel version is 2.6.18. This is way too old for newer machines. So we’ll get the Gutsy kernel source which contains XEN patches for our 2.6.22 kernel and apply them:

apt-get source linux-source-2.6.22
cd /usr/src/linux-source-2.6.22-2.6.22
cd debian/binary-custom.d/xen/patchset
patch -p1 /usr/src/linux-2.6.22 < 001*
patch -p1 /usr/src/linux-2.6.22 < 002*
patch -p1 /usr/src/linux-2.6.22 < 003*

Now we apply the lustre patches:

cd /usr/src/linux-2.6.22
ln -s /usr/src/lustre-1.6.4.2/lustre/kernel_patches/series/2.6.22-vanilla.series series
ln -s /usr/src/lustre-1.6.4.2/lustre/kernel_patches/patches patches
quilt -av push

Make the Kernel:

make distclean
cp debian/binary-custom.d/xen/patchset/config.i386 .
make menuconfig
make
make install modules_install

If you use kernel modules you need to run the following command to create the ram fs.

mkinitramfs -o /boot/initrd.img-2.6.22 2.6.22

Add the kernel to grub’s menu.lst. You could do this manually, but let’s just use the ubuntu script.

update-grub

Reboot the machine. After reboot build Lustre:

cd /usr/src/lustre-1.6.4.2
./configure --with-linux=/usr/src/linux-2.6.22
make
make install

Reboot the machine again. You should now have a working lustre/xen kernel.

My linux desktop

iPhone + Amarok

The iPhone only plays well with iTunes and not with other Music Players like Amarok. However after hacking the iPhone, there is a way around this. When OpenSSH is installed on the iPhone, we can use sshfs to mount the filesystem of the iPhone on our PC and copy the music.

This article assumes your working with Ubuntu (or Debian), but it’s almost similar for other distributions.
Continue Reading »

My linux desktop, PHP

Eclipse problems solved (finally)

I was getting a lot of hassle from eclipse after updating to ubuntu feisty. Finally I found the problem. I was running GNU java VM (GIJ) as default, while eclipse is build to run with the SUN java VM. The GIJ is only Java 1.4 and it therefor not working correctly.

Run the command `java -version`. And if you get the following, it’s no good:
java version “1.4.2″
gij (GNU libgcj) version 4.1.2 (Ubuntu 4.1.2-0ubuntu5)

Just install the SUN java packages (using apt) and then run `update-java-alternatives -s java-1.5.0-sun`. When you run `java -version` now, you should read:
java version “1.5.0_11″
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Server VM (build 1.5.0_11-b03, mixed mode)

Now re-install eclipse and it will run like a charm.

Continue Reading »

My linux desktop, PHP

Eclipse problems in Ubuntu

Eclipse seems to break more often than ‘Mr glass’ in Unbreakable. But simply reinstalling isn’t a strait forward task either. When uninstalling, the tool bar breaks (k, thats fixed with a restart), but more importantly eclipse won’t start again. You get a message stating that an error is logged in ~/.eclipse/configuration/1177584905255.log (filename changes).
Continue Reading »

Javeline / Ajax.org, My linux desktop, PHP

Llama explained – Javeline Teleport

After putting the llama project online, I’ve got quite a few questions about it from people who wanted to add the help feature to their project. Therefor I’ve decided to create a step by step tutorial on how to do this. Today I will talk about the use of Javeline Teleport, to get the message of your sever with AJAX.
Continue Reading »