Tika parseToString returns empty string when calling with a word-document

If you get an empty string from the parseToString method (and you don't get an exception) it is usually the lack of the tika-parsers-0.9.jar file.

As soon as you add it (including it's dependencies poi-3.7, poi-ooxml-3.7, poi-ooxml-schmeas-3.7, dom4j-1.6.1, geronimo-stax-api_1.0, xmlbeans-2.3, poi-scratchpad and commons-compress) to the classpath you will get the text.

Tags:

Linux add native resolution for external monitor

First you need to check the list of supported modes. When running the command

xrandr -q

it shows me (for my netbook with external monitor) two displays: LVDS1 and VGA1. VGA1 is the external monitor but xrandr doesn't recognize it's native resolution.

We can generate the mode we want to add with the following command:

cvt 1680 1050

The output should be Modeline and then some text. We create the new mode with the following command:

Tags:

Gnome 3 Tricks

remove elements from panels in fallback mode

Just hold the alt key while doing a right click on the element. This will show you the Remove from Panel option.

Nautilus Exit Fullscreen Mode

Just press Alt + F7 and move you mouse. This will reset the window to the normalized state

Tags:

GCC undefined reference to `vtable for ...'

Quite annoying one because it's hard to guess what the error really is. Usually you forgot to link one of the object files, didn't implement a pure virtual method in the derived class or forgot to implement the virtual Destructor.

Drupal and SVN Repository conflicts

If you happen to maintain your webpage with Drupal and also host a SVN-Repository on the very same host you can run into trouble. Just try to commit a file starting with a period (for example a project file from eclipse: .project). It will give you an error "access denied for unknown reason". The solution is quite simple. There is a rule in the .htaccess file from Drupal which denies access to files starting with a period. You can either delete this rule or restrict it to only apply for the drupal part of the page.

Gnome 3 - Desktop Icons not visible

After you install Gnome 3 you won't be able to see the Desktop icons. This is because they are hidden by the default settings. But it is quite easy to fix: run gnome-tweak-tool. Select the File Manager category and check "Have file manager handle the desktop". Now the desktop icons should be visible again.

Tags:

gnome-tweak-tool Settings schema not installed error

When you run gnome-tweak-tool after installing Gnome 3 you can get the following error: => GLib-GIO-ERROR **: Settings schema 'org.gnome.shell.clock' is not installed The cause is that you are missing a schema which is installed together with gnome-shell (which is probably not installed because you are running the fallback mode). The obvious fix is to install gnome-shell. But if you want to run Gnome 3 in fallback mode you need to do some additional steps: Run the System Settings, go to System Info, Graphics and check "Forced Fallback Mode".

Tags:

Download mp3 files containing the english pronunciation of a word

One place where you can find those files is dict.leo.org. You can easily play and download the pronunciation of a english word with the following bash script (just copy and save it to filename.sh):

#!/bin/bash

if [ $# -le 0 ]
then
    echo "usage:<script> <word> <word2> <word3> ..."
    exit 1
fi

for i in $*
do;
	mplayer "http://www.leo.org/dict/audio_en/$i.mp3"
	wget "http://www.leo.org/dict/audio_en/$i.mp3"
done

To execute just run something like:

Fix Anki should be run with python2.x.

When you start anki you might encounter something like:

[patrick@eeepaddy anki-1.2.6]$ ./anki
Traceback (most recent call last):
  File "./anki", line 7, in 
    raise Exception("Anki should be run with python2.x.")
Exception: Anki should be run with python2.x.

 

Fix Guestbook in cmsmadesimple

The guestbook module of cmsmadesimple has the bad habit of showing the following error message after updates: Call to undefined function nl2pnbr(). The fix is quite easy. Just open the filemodules/Guestbook/action.get-entrylist.php in a texteditor and replace the line

$entry['message'] = nl2pnbr($entry['message']);

with the line

$entry['message'] = nl2br($entry['message']);

After that it works just fine.

Tags:

Pages

Subscribe to uhlme.ch RSS