Oracle Collection of Useful Stuff

General pitfalls

  • Every statements should be ended with ;
  • Create Procedure statements shall be ended with a ; and a / on the next line like:
    create or replace
    PROCEDURE ExampleProc
  • Identifiers shall have a maximum of 30 characters, otherwise the code using them fails

Output text from within a script

PROMPT "text"

Execute content of another file



Mount dm-crypt/LUKS encrypted filesystem and rewrite Grub Bootloader

If Linux (after an update) doesn't boot up anymore it might be necessary to boot into the installation using some distribution which can be booted from a cd/usb-drive (p. x. Ubuntu). The first step would then be to load the encrypted installation and maybe to rewrite the grub bootloader. The following commands can be used to do so:

cryptsetup luksOpen /dev/sda1 dm-0 mount /dev/mapper/dm-0 /mnt/temp
grub-install -- root-directory /dev/sda


Repair defect video files

I have a DS1511+ which supports DLNA/UPnP and acts as a server. On the other side I have a blueray player Sony BDP-S480 as receiver. This setup enables me to watch movies from the Diskstation on the television. But sometimes it would start playing a movie but after a while it would just stop. I check some files and found out that they were defect. Here are some commands that can be used to fix them:

ElecFreaks JoyStick Game Kit

There is a Tutorial how to prepare it. In the tutorial there is a link to a library which can be used for the Nokia 5110 LCD display. However for me it did not work. I tried to run the code in the Arduino IDE (v. 1.0.1). It didn't compile.


Linux Driver for Canon P-150

If you try to build the driver you might get the following error message:

make[1]: Entering directory `/home/patrick/Desktop/Canon P-150 Linux/sane-backends-1.0.19/doc'

kpathsea: Running mktexfmt latex.fmt
make[1]: *** [] Error 1
make[1]: Leaving directory `/home/patrick/Desktop/Canon P-150 Linux/sane-backends-1.0.19/doc'
make: *** [all-recursive] Error 1

The problem is the documentation (does anyone read it?) so you can just disable building it. Open the make file and change line 40 from


Evince PDF Document not supported

Sometimes after an update you might get the error "PDF Document not supported" in Evince. To see what exactly the problem is you should start it up using the command line (p. x. evince '/test.pdf'). In my case I got the following message:


Another Android Income Report #01

I started to experiment with the android market aka Google Play Store. I wanted to see if I could generate some income. Just for fun. I have a job so no need to earn money with android apps :D.

The first day I integrated AdMob advertisements was the 13. March. So how much did I made until 13. of April?

Impressions: ~ 32'000
Fill Rate: ~ 98.27 %
Revenue ~ 15.50 $


C# saving a bitmap results in generic GDI+ error

If you save a bitmap the following exception can pop up:

System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
   at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)

Possible causes:

C# Scale bitmap

The following code scales a bitmap from the filesystem to a defined width:

C# Multithreading

Execute code in the UI Thread

Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, () => {
                Mouse.OverrideCursor = Cursors.Wait;


Subscribe to RSS