Saturday, February 28, 2009

Drawing Entity Relationship Diagram (ERD)

Linux provides a number of resources to draw ERD for database designing. One such application is known as GNU Ferret that also generates the SQL syntax in the form of SQL92, MySQL, Postgresql and GerwinML. GNU Ferret is written in Tcl/Tk language and is formerly known as GerWin.

Installation:
Use synaptic to install ferret or at the Ubuntu Linux command line type

sudo apt-get install ferret

Ferret
Start the program from KMenu ->Application ->Development ->Ferret.

The first tab provides the project name and location to save the project.

The ER Diagram tab allows the design of the ERD itself in very simple form.

The Table Diagram tab shows the tables that will represent the ERD.

The Output tab generates the SQL statements for databases such as MySQL, Prostgresql and any SQL92 form.


Conclusion:
A simple application that works! You can join at http://www.gnuferret.org/

Thursday, February 26, 2009

Backup first step - mounting remote disk

This will be a series on back up of files to remote data.

Firstly, the disk needs to be mounted and here we will use the sshfs utilities. This allows us to use backup tools to use remote directory as a normal directory.

Install the tools
$ sudo apt-get install sshfs

Create the disk and mount
$ mkdir /mnt/nicholas
$ sshfs nicholas@servername.com:/home/nicholas /mnt/nicholas

$ mount
nicholas@servername.com:/home/nicholas on /mnt/nicholas type fuse.sshfs (rw,nosuid,nodev,max_read=65536,user=oscc)


Remove the mount
$ fusermount -u /mnt/nicholas

Tuesday, February 24, 2009

Thunderbird mail storage.

Thunderbird under the hood I can find some interesting files. I could identify a few of them;

On a Kubuntu 8.10 system the Thunderbird profile and email box is stored in $HOME/.mozilla-thunderbird/someprofile.default

For example:
$HOME/.mozilla-thunderbird/izvwsxcs.default/

The default profile can be set in the file $HOME/.mozilla-thunderbird/profiles.ini

Here is an example:
[General]
StartWithLastProfile=1

[Profile0]
Name=default
IsRelative=1
Path=6wpi8gaz.default

[Profile1]
Name=Nicholas
IsRelative=1
Path=izvwsxcs.default
Default=1

In example above, my profile is izvwsxcs.default. In that folder, you can find that the emails are stored in the email box oscc.org.my
$HOME/.mozilla-thunderbird/izvwsxcs.default/ImapMail/mail.oscc.org.my

Emails are stored into two files (in above folder).
The email contents: A file with no extension
The email header: A mail summary file (.msf) extension

Friday, February 20, 2009

Recording desktop session

In preparation for a presentation for an OSS Seminar at CIAST this 25 Feb, a demo of the desktop is required. KUbuntu comes with several desktop recording packages.
  • istanbul
  • ffmpeg
  • KRecordmyDesktop
KRecordmyDesktop
KRecordmyDesktop is a KDE application to record desktop session. Command to install is

sudo apt-get install krecordmydesktop recordmydesktop

Then run the program from a terminal (CLI).

$ krecordmydesktop

At the panel, right click the KrecordmyDesktop and start recording. This will save the session as an .ogg file. Most Linux movie players can use the .ogg file.

I found that the KRecordmyDesktop did not have any delay to start/end recording. This resulted in having to use the recordmydesktop program directly.

The recordmydesktop
This is a program that can record a desktop and save it on the fly OR when the recording ends. Frontends to this is the KRecordmyDesktop and grecorgmydesktop.

Recording can be done at the command line which saves to the file out.ogv by default;

recordmydesktop --no-sound -delay 3 -o filename

The default control keys during a record session:

1. Pause / Resume recording - Ctrl+Alt+p
2. Stop recording - Ctrl+alt+s

More details can be found at recordmydesktop.

Viewing in AVI
To convert the .ogg to .avi install ffmpeg or mencoder. The tools are run at a terminal to convert the .ogg file.

The ffmpeg

Step 1: Install the program. Include the dependency files of libavdevice52 libimlib2.

sudo apt-get install ffmpeg

Step 2: Start the converter. The -target, -r and -s is optional.

ffmpeg -i kdesession.ogg -target vcd -s vga -r 52 kdesession3.avi

The mencoder
Alternative encoder is mencoder (used with mplayer).

Step 1: Install mencoder.

sudo apt-get install mencoder

Step 2: Convert the .ogg file to .avi with no sound effects.

mencoder kdesession.ogg -ovc lavc -nosound -o kdesession3.avi

There are lots of configuration options in ffmpeg and mencoder from the help files.

Photos not working in OOOP-Accessories 2.3

The OpenOffice.org (OOo) 2.4 and 3 comes with a limited number of graphics for the gallery. Users can collect their own graphics (photos, cliparts and etc.) or install the add-ons such as OOOP-Accessories for OOo. Since OOo 2.4 I have kept the OOOP-Accessories 2.3.1.2.oxt file and it works with OOo 3.0.1 very well.

However, on the Kubuntu Linux all the options to use the Photos have been wrongly linked. After installation, the user need to open a prompt (command line terminal) and create a link to the correct location of the graphics. I have recorded this online sometime ago, but have not gone to find it back.

The instruction here is for installation for the local user.

Step 1: Enter into the OOo gallery directory.

cd ~/.openoffice.org/3/user/gallery

Step 2: Find the installed OOOP-Accessories directory.

find . -name "Photos" -type d
Output
../uno_packages/cache/uno_packages/TzY7IS_/OOOP-accessories-2.3.1.2.oxt/gallery/Photos

Step 3: Use the directory in previous step, to create a link to the Photos directory.

ln -s ../uno_packages/cache/uno_packages/TzY7IS_/OOOP-accessories-2.3.1.2.oxt/gallery/Photos


The gallery photos can be accessed via any of the OpenOffice.org Writer, Calc or Impress.

Monday, February 9, 2009

Killing programmes in KDE

I just came across my first program freezing in KDE 4.2 and realised that that there are many KDE users who will encounter such cases familiar to MS Window users.

The common command line method to KILL the programme or process is the same as any other Linux/Unix system. How about for those who are more keen to use the GUI to control such programmes or processes? In Linux they can be Killed (terminated), reduced its priority or paused to allow other processes to gain back CPU and memory resources.

There are two main programmes involved here;
  1. xkill
  2. ksysguard

To terminate a programme (Window Client)
Step 1: Start Xkill.
Any where on the Desktop press Ctrl+Alt+Esc

Step 2: Select the programme to terminate.
An 'X' appears as the mouse cursor. Use this to select the programme to terminate.

List processes and terminate a programme/process
Step 1: Start the process view in ksysguard
Any where on the Desktop press Ctrl+Esc

Step 2: Select the programme to terminate.
Scroll down the list of processes and right click its name. Choose Kill Process.

So, those MS Window's user will have to get used to something other than Ctrl+Alt+Del to terminate a programme.