2010
05.19

For many things  you would like to do on the Nokia N900 (OpenSSH, Debian) it is necessary to have root access. In order to get root access we have to install the rootsh package from the extra repository (see here how to enable “extra” repositories). Once installed we can type sudo gainroot an we’ll be root!

rootsh Package

References:

2010
05.19

As said on nokian900applications, Maemo, the operating system of Nokia N900, has 3 repositories of applications. Repositories are Extras, Extras-Devel, and Extras-Testing and in each are grouped the applications according to their compatibility. In these repositories there are a lot of nice applications (openSSH, Nmap, Evince, Bash), but first we have to enable them. I would recommend not to use the Extra-Devel, but if you necessarily want to you could 👿

To enable, for instance, the Extra repository just click the “Extra” link above and be sure the “Disabled” checkbox is off. For a nice little demo watch this movie:

Or have a look at one of pages below…

References:

2010
05.19

“zsync is a file transfer program. It allows you to download a file from a remote server, where you have a copy of an older version of the file on your computer already. zsync downloads only the new parts of the file. It uses the same algorithm as rsync. However, where rsync is designed for synchronising data from one computer to another within an organisation, zsync is designed for file distribution, with one file on a server to be distributed to thousands of downloaders. zsync requires no special server software — just a web server to host the files — and imposes no extra load on the server, making it ideal for large scale file distribution”

After seeing this movie a long time ago I was eager to use this tool sometime, but time passed by and I never did. Till the new Ubuntu (10.04) release! I already downloaded the RC version of Ubuntu a few days earlier so when it was launched I only had to zsync the two images:

mv ubuntu-10.04-rc-dvd-amd64.iso ubuntu-10.04-alternate-amd64.iso
zsync http://ftp.tudelft.nl/releases.ubuntu.com/10.04/ubuntu-10.04-alternate-amd64.iso.zsync

References:

2010
05.19

For a project I was working on I needed a multi field (column) key. Both `id` and `server` were not unique, but put together they were. I already had `id` as my PRIMARY KEY, but that was not correct anymore. So the first thing to do was remove that KEY:

ALTER TABLE `clients` DROP PRIMARY KEY

And after that I created the `server` field:

ALTER TABLE `clients` ADD `server` VARCHAR(20) NOT NULL AFTER `uid` ;

According to this post there a few things to think about:

  1. a multiple PRIMARY KEY can’t use AUTO_INCREMENT
  2. each multiple field KEY is only allowed to spread 16 columns
  3. there is a maximum overall length of 256 Bytes

After considering this (and concluding there were no problems) I created the PRIMARY KEY:

ALTER TABLE `clients` ADD PRIMARY KEY (`uid`, `server`) ;

If we wanted to have an UNIQUE KEY we should executed:

ALTER TABLE `clients` ADD UNIQUE (`uid`, `server`) ;
2010
05.12

Sometimes you just don’t want to view website in “normal mode”; It’s long an not so wide (Google search results?). By default “portret mode” isn’t enabled for the Web browser on the Nokia N900 (it’s a hidden feature). Fortunately it is really easy to enable.

Just open the browser and hit:

Ctrl-Shift-O

Or see the movie for “more” details…

2010
05.06

In the Mint (8) installer (but also the Ubuntu Desktop one) there is no support for LVM volumes. So if you want to install it on one, you have to do it by hand. I will show you how:

Boot from the CD, install LVM and make all existing volumes active:

apt-get install lvm2
vgchange -a y
lvdisplay

Should display your volumes

Run the installer. After all packages are installed and the bootloader is configured your system will reboot. Unfortunately it won’t boot! This is because there’s no LVM support build in the initramfs

To install this support we have to boot from the CD again. What we then do is mount the just installed system (in my case a / partition and and /boot partition).

apt-get install lvm2
vgchange -a y

mkdir -p /mnt/lvmroot
mount /dev/lvm/root /mnt/lvmroot
mount /dev/sda1 /mnt/lvmroot/boot
mount --bind /dev /mnt/lvmroot/dev
mount -t proc proc /mnt/lvmroot/proc
mount -t sysfs sysfs /mnt/lvmroot/sys
mount -t devpts devpts /mnt/lvmroot/dev/pts

After mounting all needed “partitions” we can chroot into it:

chroot /mnt/lvmroot

We are now in the OS that’s on the hard disk. That’s where we want to add LVM support. The initramfs will be updated automatically.

apt-get install lvm2

We can now reboot. The system should be able to boot Mint now. Have fun!

References:

2010
05.06

By default Ubuntu (10.04) doesn’t contain a 64 bit version of Sun’s (Official) Java plugin. Of course you can use the icedtea* plugin, but I noticed that not all Java applets (i.e. Webmin file manager) are working in it. That’s why I was eager to get the Official one working. This is how you do it:

Download the latest JRE (to ~/Downloads/mozilla):

wget 'http://javadl.sun.com/webapps/download/AutoDL?BundleId=...' -O jre-6u20-linux-x64.bin

Create the folder in which we’re going to install Java:

sudo mkdir -p /opt/java/64
cd /opt/java/64

Copy the installer to that folder, set it to be executable and install:

sudo cp ~/Downloads/mozilla/jre-6u20-linux-x64.bin .
sudo chmod 755 jre-6u20-linux-x64.bin
sudo ./jre-6u20-linux-x64.bin

Set it to be the default JRE:

sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jre1.6.0_20/bin/java" 1
sudo update-alternatives --set java /opt/java/64/jre1.6.0_20/bin/java
java -version

It should say:

java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)

Remove the “old” JRE:

sudo apt-get remove --purge icedtea*

Link the browser plugin to your Firefox profile:

mkdir -p ~/.mozilla/plugins
rm ~/.mozilla/plugins/libnpjp2.so
ln -s /opt/java/64/jre1.6.0_20/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

Firefox about:plugins should mention something like Java(TM) Plug-in 1.6.0_20 File: libnpjp2.so

2010
05.02

For a website I was creating I needed some superscripted text. After using a reset.css, <sup> just looks like normal text, so I needed to define it manually. But how?

According to the W3C you should do it like this:

small,sub,sup
{
  font-size:.83em;
}
sub
{
  vertical-align:sub;
}
sup
{
  vertical-align:super;
}

The result looks like this:

25th Level

References:

2010
05.02

When preparing a presentation for my Bachelor thesis on “Confabulation in the Wernicke-Korsakoff syndrome” I was really annoyed by Powerpoint. The presentation had to be written in Dutch, but for all new “text boxes” I created, the spell-check was set to English. At first, I tried to change the “Default language” of Powerpoint, but that wouldn’t do the trick. After googling for some time I found this nice macro that would set the “msoLanguage” language for all text elements in the presentation.

Follow these steps and you’ll be alright:

  1. Find the right msoLanguage code, for Dutch (msoLanguageIDDutch), for (US) English (msoLanguageIDEnglishUS)
  2. Create a new macro:
    1. Go to Tools, Macro, Visual Basic Editor
    2. Insert a new empty module by selecting Insert, Module
  3. Paste this code on the right panel and save the macro:
    Option Explicit
    Public Sub ChangeSpellCheckingLanguage()
        Dim j As Integer, k As Integer, scount As Integer, fcount As Integer
        scount = ActivePresentation.Slides.Count
        For j = 1 To scount
            fcount = ActivePresentation.Slides(j).Shapes.Count
            For k = 1 To fcount
                If ActivePresentation.Slides(j).Shapes(k).HasTextFrame Then
                    ActivePresentation.Slides(j).Shapes(k) _
                    .TextFrame.TextRange.LanguageID = msoLanguageIDEnglishAUS
                End If
            Next k
        Next j
    End Sub
    
  4. Execute the macro

References:

2010
05.02

In Ubuntu 10.04 (but maybe also in others versions) Nautilus default behavior is not to show the address bar. Instead it just shows some (stupid) buttons. There are probably a lot of people that like this, but I don’t! Fortunately, there is a way to get everything like it should be 🙂

Nautilus default Nautilus with Addressbar

Open gconf-editor and follow this path:

apps -> nautilus -> preferences

There you will find an option called always_use_location_entry. Check this option. This will immediately change all open Nautilus windows, as well as any newly opened Nautilus windows, to always use the location bar. Hurray!

References: