Brother DCP-J152W setup scanner

by GarciaPL on Sunday, 14 September 2014

Printing some docs on Ubuntu using one of the printer delivered by Brother is quite easy. You just need to install appropriate packages (deb or rpm) and after that you can easily setup your Brother printer (in my case Brother DCP-J152W) connected via USB or WiFi due to future prints.

Linux user may deal with some problem when there is a need to use scanner built-in Brother device. Fortunately there is a solution of this problem. In this case Brother printer is connected to router byWiFi :

  1. Download and install those packages : brscan4brscan-skey and brother-udev-rule.
  2. Check if you Brother model is available to configure - run command in terminal - brsaneconfig4 -q
  3. If you Brother model is on the list after perform previous step, then you can configure it - brsaneconfig4 -a name=DCPJ152W model=DCP-J152W ip=
  4. Test if your Brother printer is available through the network - brsaneconfig4 -p. If your device is responding, you can go to the next step.
  5. Finally use tools like XSane or VueScan to scan your docs using Brother scanner.

Reference : [1] - DCP-J152W Downloads [2] - Scanner driver install for network [3] - Brother DCP-J315W is active in terminal but not detected in Elementary OS [4] - Ubuntu Brother Printer-Scanner Network Setup

Send email using Gmail account

by GarciaPL on Wednesday, 10 September 2014

I would like to share with you a small snippet which will allow you to send email using Gmail account. In this case I will use JavaMail (javax.mail) interface for sending email messages. More information about JavaMail API reference you can find below.

import javax.mail.*;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

private void sendEmail() {

        String sender = "";
        String receiver = "";
        String title = "YOUR_TITLE_TEXT";
        String body = "YOUR_BODY_TEXT";

        Properties props = new Properties();
        props.put("mail.transport.protocol", "smtp");
        props.put("", "");
        props.put("mail.smtp.port", "25");
        props.put("mail.smtp.starttls.enable", "true");
        props.put("mail.smtp.EnableSSL.enable", "true");
        props.put("mail.smtp.auth", "true");
        props.setProperty("mail.smtp.socketFactory.class", "");
        props.setProperty("mail.smtp.socketFactory.fallback", "false");
        props.setProperty("mail.smtp.port", "465");
        props.setProperty("mail.smtp.socketFactory.port", "465");

        Authenticator authenticator = new Authenticator() {
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication("", "password");

        Session session = Session.getDefaultInstance(props, authenticator);

        try {
            Message msg = new MimeMessage(session);
            msg.setFrom(new InternetAddress(sender));
                    new InternetAddress(receiver, receiver));
        } catch (MessagingException e) {
            System.out.println("sendEmail (MessagingException) : " + e.getMessage());
        } catch (UnsupportedEncodingException e) {
            System.out.println("sendEmail (UnsupportedEncodingException) : " + e.getMessage());
        } catch (Exception e) {
            System.out.println("sendEmail (Exception) : " + e.getMessage());
If you are using Gmail account to send emails, properties related with smtp configuration in this snippet will remain, but you should change variables like sender, receiver, title and body to your needs. You should also change login and password in below line which will be used to authenticate with gmail account :

return new PasswordAuthentication("", "password");
Reference : [1] Oracle®'s JavaMail API reference [2] Pastebin Source

SQL Developer

by GarciaPL on Thursday, 31 July 2014

If you have difficulties with running SQL Developer (in my case from Oracle in console on Linux you can see such stack trace :

# A fatal error has been detected by the Java Runtime Environment:
#  SIGSEGV (0xb) at pc=0x00007feb22ed8be0, pid=32116, tid=140649711318784
# JRE version: Java(TM) SE Runtime Environment (7.0_65-b17) (build 1.7.0_65-b17)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.65-b04 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  0x00007feb22ed8be0
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
# An error report file with more information is saved as:
# /home/lukasz/sqldeveloper/sqldeveloper/bin/hs_err_pid32116.log
# If you would like to submit a bug report, please visit:
/home/lukasz/sqldeveloper/sqldeveloper/bin/../../ide/bin/ line 1193: 32116 Przerwane               (core dumped) ${JAVA} "${APP_VM_OPTS[@]}" ${APP_ENV_VARS} -classpath ${APP_CLASSPATH} ${APP_MAIN_CLASS} "${APP_APP_OPTS[@]}"

So, fix of this problem is quite easy - go to file which is located in folder of your SQL Developer and add at the beginning of this file the following line :

Oracle DB 11g Errors Guide

by GarciaPL on Tuesday, 15 July 2014

I would like only to announce that I have created a small application in Android called Oracle DB 11g Errors Guide. This application helps you as a developer or administrator of Oracle ® Database 11g Release 1 find solutions of problems which you are faced with during your work. Each error message contains the message statement, an explanation of the probable causes and a recommended action.

More information about Oracle ® Database 11g Release 1 Error Messages you can find under hyperlink - Oracle® Database Error Messages 11g Release 1 (11.1) Documentation

Hyperlink to Google Play Store - Google Play Store GarciaPL

Eclipse menu bug in Ubuntu

by GarciaPL on Saturday, 28 June 2014

Recently I had to deal with an error during using Eclipse on my Ubuntu 13.10. When I clicked in Eclipse on any menu item there was nothing showed up. As far as I know this error is related with Unity graphical shell created for GNOME. One of the fix which I found is to run Eclipse with some extra additional parameters. I also created some shell script which will help to enjoy again a menu features in Eclipse.

# Run Eclipse due to menu bug
Exec=env UBUNTU_MENUPROXY=0 $eclipsepath

Of course in this script you must edit eclipsepath variable value to path which really guides to eclipse. You can run script in terminal using ./, but before doing that you must give executable permission to script using this command chmod +x
Reference : [1] Eclipse menus are cut off or dont show [2] Eclipse menus dont show up after upgrading to ubuntu 13.10 [3] Source Code

FFmpeg Picture in Picture

by GarciaPL on Thursday, 29 May 2014

In this post you can find a small piece of code which should allows you to make picture in picture using ffmpeg. More information about this effect you can find in reference section of this post.

ffmpeg -i \tmp\stream1.mp4 -r 29.97 -vf "movie=\tmp\stream2.mp4, scale=212:120 [vid2]; [in][vid2] overlay=main_w-overlay_w-10:10 [out]" \tmp\output.mp4 &

I used ampersand at the end of this command because I would like to create a new process of merging those two input videos files in background. I also uploaded below some example how it should looks like in final. I pointed using red circle the video which was added using stream2.mp4 source. Do not hesitate to modify this command above. I'm sure that you will adapt it for your own purposes.

Picture in Picture using FFmpeg

Reference : [1] Picture-in-picture Wikipedia