Backup Kmail

We are upgrading desktops 🙂 but I have to back up my archive mails and restore it again in new desktop. To backup the contents of my emails:

  1. cd ~/.kde/share/apps/
  2. tar czvf kmail.tar.gz. kmail
  3. copy kmail.tar.gz to CD or external HD.
Advertisements

Changing SU password in Ubuntu

My company has a VPN where you simply need to login to a certain URL, it then ask to download an app to start the VPN. However, the program prompt me to enter the “su” password to install it in my laptop. Ubuntu locked the root password, and for daily operational use, we would use “sudo”. However, this program cannot install unless I provided the su password. To reset the su password, I did the following:

  • Open terminal.
  • Type:
  • sudo passwd root

  • And then reset the root password.
  • After that, I installed the vpn program from the web, and after successfully vpn to my company, I disable the root password again by typing:
  • sudo usermod -p '!' root

Fixing icons and menu in OpenOffice 3.2 Kubuntu Hardy

I am not sure what happened, but when I open Impress, and my mouse is over the icons or menus, they are gone. When the mouse is over a selected icon, that particular icon appear the rest on its sides are not displayed.

Somehow, I managed to find the solution that works from this page: this page. What I did was to:

export SAL_GTK_USE_PIXMAPPAINT=1

to my ~/.kde/env/gtk-qt-engine.rc.sh file.

and then restart the OS

using update-alternatives

I have several version of octave now, and I do not want to remove the older version yet. Debian system provides a nice command called update-alternatives where it can choose from several alternatives the program you want to use. for example in the case of octave. It will create a symbolic link in /usr/bin/octave that points to /etc/alternatives/octave. This in turns link to the choice of octave we want.

To install a new version of octave to the alternative system:

sudo update-alternatives --install /usr/bin/octave octave ~/Programs/Octave-3.2.4/bin/octave 4

The number at the back is the priority number. Now to choose the default octave we want to load:

sudo update-alternatives --config octave

This will display:
There are 4 alternatives which provide `octave’.

Selection Alternative
———————————————–
+ 1 /usr/bin/octave-2.1.73
2 /home/kurniawano/Programs/Octave3.0.1/bin/octave
* 3 /home/kurniawano/local/bin/octave
4 /home/kurniawano/Programs/Octave-3.2.4/bin/octave

Press enter to keep the default[*], or type selection number: 4
Using ‘/home/kurniawano/Programs/Octave-3.2.4/bin/octave’ to provide ‘octave’.

Of course in the above I choose the newly installed version.

to remove an option, you can use:

sudo update-alternatives --remove octave /home/kurniawano/Programs/Octave3.0.1

finding which package should I install in ubuntu/kubuntu

Sometimes, in installing some software from the source, it requires certain file or packages. If you know the package, it is pretty simple in ubuntu, simply type “sudo apt-get install “. But what if you don’t know and you only know xxx.h is required. To find the package, you can use apt-file. To install this,

sudo apt-get install apt-file

Then, to search which package contains xxx.h, simply type

apt-file search xxx.h

apt-file can even list down where this file will be installed,

apt-file list xxx.h

Building OpenCascade 6.3 in Kubuntu Hardy

I tried to install OpenCascade 6.3 in my Kubuntu Hardy desktop. First I downloaded the tar.gz file and untar it. After that, I go to the “ros” folder inside. There you will find the instruction in README.txt.

So the first thing I did was to edit env.csh file and change the CASROOT environtment variable to where I untarred the source code. After that I run env.csh.

The next thing was to run ./configure. This is a bit tricky since a lot of things to set up. I first installed tk8.5 by typing:

sudo apt-get install tk8.5-dev

In the first trial, the configure cannot find Xmu.h, so I installed “libxmu-headers” package. But somehow, it still cannot find my X. So what I did was to create a symbolic link to libXmu.so.6

sudo ln -s libXmu.so.6 libXmu.so

This fixed the problem and now configure can find my X. But there’s still one thing it cannot find which is java. the configure cannot find jni.h. So I installed sun-java6-jdk from apt-get and run the following configure command:

./configure --prefix=$HOME/Programs/OpenCascade/ --with-gl-include=/usr/include --with-gl-library=/usr/lib --with-xmu-include=/usr/include/X11/Xmu/ --with-xmu-library=/usr/lib/ --with-tcl=/usr/lib/tcl8.5/ --with-tk=/usr/lib/tk8.5 --with-java-include=/usr/lib/jvm/java-6-sun/include/

Now configure can find all that is required.  When I ran make, I encountered this error:

macro `AM_PROG_LIBTOOL' not found in library

From some forum, it was suggested to install libtool, so I install libtool from Adept, and the make can continue, but again it stopped and giving this error:

Makefile.am:3: directory should not contain `/'

I tried to run make again and it can continue even to the step of make install. But when I tried to run DRAWEXE application, it cannot find some library:

./DRAWEXE: error while loading shared libraries: libTKDraw.0: cannot open shared object file: No such file or directory

So I decided o try the steps described in: http://www.opencascade.org/org/forum/thread_15409/


% aclocal
% libtoolize --force
% autoconf
% automake
% mkdir build
% source flag.sh
% cd build
% ../configure ${flags}
% make
% make install

where flag.sh is defined as following:

flags="--prefix=$HOME/Programs/OpenCascade/ "
flags="$flags --with-gl-include=/usr/include --with-gl-library=/usr/lib"
flags="$flags --with-tcl=/usr/lib/tcl8.5/ --with-tk=/usr/lib/tk8.5"
flags="$flags --with-java-include=/usr/lib/jvm/java-6-sun/include/"
flags="$flags --enable-production"

I will update the post once it finishes 🙂

Installing Octave 3.2.4 in workstation

Though my previous installation for octave 3.2.2 failed, this time octave 3.2.4 configure just fine. This is what I typed:

./configure --prefix=/scratch/kurniawano/local/ LDFLAGS='-L/scratch/kurniawano/local/lib' CPPFLAGS='-I/scratch/kurniawano/local/include' FFLAGS='-ff2c' LIBS='-lmetis'

After that, I just typed make, and make install. If I didn’t put -lmetis, the make step will give an error, undefined reference to metis.