Wednesday, June 29, 2011

Accessing a postgresql database in OpenOffice or libreoffice

If you have ubuntu, install :

sudo apt-get install libreoffice-sdbc-postgresql


In LibreOffice, create a new database. Then, in connection parameters, specify the URL : dbname=XXX host=abc.net and then the username and the password.

Monday, June 27, 2011

Graphical file diff editor for Linux

Meld is a wonderful little graphical program for Linux that helps differentiate between text files :

sudo apt-get install meld

Thursday, June 23, 2011

geodjango object has no attribute 'geo_db_type

Following the geodjango tutorial https://docs.djangoproject.com/en/dev/ref/contrib/gis/tutorial/

While building the application called world, one has to run the following command to initialise the database :

python manage.py sqlall world
....
AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type'

The error is solved by editing settings.py and replacing the line
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2',
with
'ENGINE': 'django.contrib.gis.db.backends.postgis', # Add 'postgresql_psycopg2',

Thanks to http://stackoverflow.com/questions/3567352/geodjango-syncdb-errors-from-geodjango-tutorial

Saturday, June 18, 2011

GIMP: Replace image backgrounds with transparency

Save the image in a format that handles transparency (GIMP pcx or PNG).

Create an alpha channel : Layer-Transparency-Add Alpha Channel

To replace a single given color with transparency : Layer-Transparency-Color to Alpha

Thursday, June 16, 2011

Ubuntu : too many open files

From http://www.zimbra.com/forums/administrators/16066-solved-too-many-open-files-error.html

To set the maximum limit allowed for open files, as sudo or root, edit the /etc/security/limits.conf file. At the end of the file just above “# End of File” enter the following values:
* soft nofile 65535
* hard nofile 65535
Save the file. This will set the number of open files to unlimited.

An R package : sun-methods Methods for sun ephemerides calculations

sun-methods Methods for sun ephemerides calculations

Description :
Functions for calculating sunrise, sunset, and times of dawn and dusk, with flexibility for the various formal definitions. They use algorithms provided by the National Oceanic & Atmospheric Administration (NOAA).

Plotting error bar with polygons in R

A very nice presentation by Edzer Pebesma showing the spatio-temporal capabilities of R (spacetime package). Includes a nice way of plotting error bars as polygons :

http://ifgi.uni-muenster.de/~epebe_01/inpe.pdf

Saturday, June 11, 2011

Startup manager for Ubuntu for boot options

"sudo apt-get install startupmanager"

Wednesday, June 8, 2011

GuitarPro6 segmentation fault Ubuntu 64 bits

http://askubuntu.com/questions/41920/why-i-am-getting-a-segmentation-fault-opening-guitar-pro

mv ~/.ArobasMusic ~/.ArobasMusicbkp

If this does not work (Ubuntu 11.04), and the error is :

GdkPixbuf-CRITICAL **: gdk_pixbuf_get_height: assertion `GDK_IS_PIXBUF (pixbuf)' failed
Segmentation fault

then downgrade the ia32-libs package :
(from http://getsatisfaction.guitar-pro.com/arobas_music/topics/after_ubuntu_11_04_upgrade_i_cant_open_gp6)

It seems a bug in the latest ia32-libs causes some trouble to applications that uses 32bit libraries (GP6 use 32 bit libraries too).

A workaround exists, simply downgrade the ia32-libs package.

Follow these guidelines to downgrade ia32:
- download the package from this page http://packages.ubuntu.com/maverick/amd64/ia32-libs/download
- execute this command line: sudo dpkg --force-downgrade -i ia32-libs_20090808ubuntu9.1_amd64.deb