Linux

Eclipse hotkeys fix

Eclipse on GNU/Linux has an annoying bug with hotkeys for users with multiply keyboard layouts. For example when the user is working with the English keyboard layout, hotkeys such as “Ctrl-C”, “Ctrl-V” will work as expected, but when switched to different layout (ex: Bulgarian) the keys will no longer work.

After a bit of searching I found a fix for this inconvenience at GitHub. Thank you “amozzhuhin“!

Console screen resolution (frame buffer) with NVIDIA drivers on Ubuntu, Debian or Linux Mint

After the installation of the proprietary NVidia graphics drivers on Ubuntu, Debian or Linux Mint your console screen resolution will be messed up. As a developer I use the frame buffer console from time to time and I need it at the resolution of my primary monitor (1680×1050). To address the problem (as it’s almost always with GNU/Linux) we need to edit some configuration files and issue some commands.

First start Konsole or other terminal emulator, login as root by typing:

su

and enter your password when prompted.

Using vim, nano or your favourite command line text editor, open /etc/grub.d/00_header. In the example below we are using Vim.

vim /etc/grub.d/00_header

Search for “set gfxmode=${GRUB_GFXMODE}” and below that line add

set gfxpayload=keep

Save and close the file.

Reboot your system and at the Grub2 screen press ‘C’ and type ‘vbeinfo‘. Take a note on the supported frame buffer resolution and choose the one you like. In my case the chosen resolution was 1680x1050x32. Type ‘exit‘ or reboot your system from the restart button.

Start GNU/Linux again, start a terminal emulator, login as root (by typing su) and open “/etc/default/grub“. Uncomment the line “GRUB_GFXMODE=640×480“, change the value after the = sign to the previously chosen screen resolution. In my case:

GRUB_GFXMODE=1680x1050x32

and add the following line below:

GRUB_GFXPAYLOAD_LINUX=keep

Save and close the file.

Still logged as ‘root’ execute the following commands:

update-grub2
update-initramfs -u

Reboot your system. You should now have a frame buffer console with a decent screen resolution.

Disable overlay scroll bars in Ubuntu 14.04 LTS

To disable overlay scroll bars in Ubuntu 14.04 LTS, open a terminal window and paste the following command.

gsettings set com.canonical.desktop.interface scrollbar-mode normal

Enabel super user log in on Ubuntu 14.04 LTS

In order to maintain higher security level and keep the user from accidental breakage of the system the root user log in is disabled by default. To enable it, open a terminal window and type:

sudo passwd root

you will be prompted to enter the root user password. When done press enter.

That’s it. Now you can work from the command line like super user.

Screenshot-root@home: -home-vpaskov

Install Oracle JDK on OpenSUSE

Source: my personal blog

Due to licensing issues, OpenSUSE comes with OpenJDK. I personally prefer using Oracle’s JDK. It’s worth mentioning that OpenJDK will not work in some cases such as building Android source code and it’s not recommended for Android development.

Here is how to install and setup Oracle JDK on OpenSUSE.

1. Download the JDK from Oracle’s site. I use 64-bit OpenSUSE so i downloaded the ‘Linux x64‘ version rpm. For 32 bit systems download the ‘i586′ version of the package.

2. Install the JDK by opening a terminal, becoming root and switching to the directory where you downloaded the RPM package.

For x64 version execute:

rpm -i jdk-8u5-linux-x64.rpm

For 32-bit version execute:

rpm -i jdk-8u11-linux-i586.rpm

3. Make the OracleJDK default system JDK.

While at the terminal and with root privileges execute the following sequence of commands:

update-alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_05/bin/java 1551
update-alternatives --install /usr/bin/javadoc javadoc /usr/java/jdk1.8.0_05/bin/javadoc 1551
update-alternatives --install /usr/bin/jar jar /usr/java/jdk1.8.0_05/bin/jar 1551
update-alternatives --install /usr/bin/javap javap /usr/java/jdk1.8.0_05/bin/javap 1551
update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.8.0_05/bin/javac 1551
update-alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.8.0_05/bin/javaws 1551
update-alternatives --install /usr/bin/javah javah /usr/java/jdk1.8.0_05/bin/javah 1551
update-alternatives --install /usr/bin/jarsigner jarsigner /usr/java/jdk1.8.0_05/bin/jarsigner 1551

4. Define JAVA_HOME environment variable.

Type ‘exit‘ at the terminal to become your normal everyday user again. Open .bashrc in your favorite command line text editor and the following:

export JAVA_HOME=/usr/java/jdk1.8.0_05

Save the file and exit from the editor. Type:

source .bashrc

5. Verify Java version by typing ‘java -version‘ it should says “java version “1.8.0_05”“. If that’s the case you have OracleJDK correctly installed.