Java or GTK applications crashing in KDE

In Kubuntu 13.10 Java applications seemed to crash at start up with the following error:

#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f8f34cb9b3c, pid=25450, tid=140253340165888
#
# JRE version: Java(TM) SE Runtime Environment (7.0_45-b18) (build 1.7.0_45-b18)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.45-b08 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libgobject-2.0.so.0+0x31b3c] g_type_check_instance_is_a+0x3c
#

The same error occurred regardless of the Java Runtime Environment installed. Some GTK applications are also affected.

As mentioned (and in many other bugs) this is related to the KDE oxygen-gtk theme.

Solution:
In System Settings -> Application Appearance -> GTK change GTK2 and GTK3 themes to something else than oxygen-gtk.

Thunderbird 16.0.2: Account exceeded command or bandwidth limits failure

Ubuntu 12.10 (Quantal Quetzal) ships with Mozilla Thunderbird 16.0.2. This version of Thunderbird suffers from a bug related to repeatedly downloading IMAP account content. In my case Gmail account returned the
The server returned the error: Account exceeded command or bandwidth limits.
error message daily, and the account remained blocked until the next day. Even when working, reading the Gmail account was painfully slow.

The remedy is to update to Thunderbird version 17.0, not yet included in Ubuntu 12.10, but available in the Ubuntu Mozilla Security Team PPA repository.

sudo add-apt-repository ppa:ubuntu-mozilla-security/ppa
sudo apt-get update
sudo apt-get install thunderbird

Fixing font sizes in MATLAB under Ubuntu

MATLAB runs in Ubuntu 12.04 without any major problems. However, one issue that I noticed was that changing the font size in figures has no effect; the text always appears in default (small) size in Matlab. The correct font size has an effect only in exported PDF and EPS files. The font spacing is incorrect though, as it seems to be based on the fonts that Matlab uses. As Matlab is often used (only?) for making figures, this can be a major problem.

As mentioned in this thread, the problem is related to Matlab not finding the correct fonts in Ubuntu OS. As a remedy install the following packages:

sudo apt-get install xfonts-100dpi xfonts-75dpi

and logout and login again. Matlab should now be able to show the plots in correct size. The fonts do not look pretty, though, which is probably related to broken anti-aliasing. Maybe there are other broken dependencies?
However, exported PDF and EPS files should now have the correct font spacing (e.g. the size of the legend box) and should be usable.

KBibtex in Ubuntu Oneiric 11.10

KBibtex is a useful bibtex bibliography management tool for the KDE desktop.
However, it seems that the package is missing in the Ubuntu 11.10 repositories.

A quick remedy (as tweeted here) is to install the package from the Debian Sid distribution: kbibtex.
To install on the command line (check the exact name of the .deb file)
sudo dpkg -i kbibtex_0.4-1_amd64.deb

Alternatively .deb packages can be installed in the GUI (e.g. by opening the file in Dolphin).

The package should be compatible with Ubuntu 11.10, and seems to work fine.

The 0.4 version has improved a lot and has a very useful online search tool for acquiring bibtex files. Google scholar and other data bases can be used.
Other tools include a reference preview (though bibtex2html) and a PDF preview.

Autocrop images with imagemagick

Often one has to crop excess margins from an raster image. Common image graphical editors have autocrop tool, but if many files need to be processed, opening and saving files one by one quickly becomes tedious.

A better solution is to use convert tool that is a part of the powerful Imagemagick toolkit:

convert image.jpg -trim -bordercolor White -border 20x10 +repage cropped_image.jpg
This command reads the original file, removes (trims, crops) white borders, adds 20 pixel white borders horizontally and 10px vertically, and stores the file as cropped_image.jpg.

It is also possible to process all image files in the current directory with the following one line command:
for i in `ls *.jpg`; do convert $i -trim -bordercolor White -border 20x10 +repage cropped_`basename $i`; done

If you want to convert to another image format, it can be done conveniently at the same time (-quality option controls the jpg quality):
for i in `ls *.gif`; do convert $i -trim -bordercolor White -border 20x10 -quality 92 +repage cropped_`basename $i gif`jpg; done
Above basename utility is used for trimming suffix from the file name.

Extract images from a pdf file

In Linux pdfimages utility extracts raster images from a pdf file.

Extract all raster images from pdf file, save in jpg format (creates bar-000.jpg, bar-001.jpg, etc.):
pdfimages -j file.pdf image

The -j option is to convert the images to jpeg format if possible.
Other options can be found in the manual.

Use pdftk to edit pdf files

pdftk is a useful free utility for editing pdf files.

Split a pdf file to individual pages (generates: page01.pdf, page02.pdf, etc.)
pdftk original.pdf burst output page%02d.pdf

Split a pdf file to two parts:
pdftk original.pdf cat 1-3 output threeFirstPages.pdf
pdftk original.pdf cat 4-end output rest.pdf

Merge multiple pdf files to one:
pdftk first.pdf second.pdf third.pdf cat output 123.pdf

Many more examples can be found on pdflabs examples page.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: