Install and uninstall Oracle JDK 8 on CentOS 6








  • Uninstall JDK 7:
    1. Find the installed rpm package:
      sudo rpm -qa | grep jdk | grep fcs
      it should return the package name, like
      jdk-1.7.0_51-fcs.x86_64
    2. Remove the package:
      sudo rpm -e -1.7.0_51-fcs
  • Install JDK 8:
    1. Download the JDK RPM package from Oracle
    2. Install the RPM package:
      sudo rpm -Uvh jdk-8u5-linux-x64.rpm
    3. Set up alternatives:
      sudo alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 200000
      sudo alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 200000
      sudo alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/latest/jre/lib/amd64/libnpjp2.so 200000
      sudo alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 200000
      sudo alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 200000



Install consolas font on Linux








#!/bin/bash

cd /tmp

# download
wget http://download.microsoft.com/download/E/6/7/E675FFFC-2A6D-4AB0-B3EB-27C9F8C8F696/PowerPointViewer.exe

# extract
cabextract -L -F ppviewer.cab PowerPointViewer.exe; cabextract -L -F "CONSOLA*.TTF" ppviewer.cab

# install
sudo mkdir /usr/share/fonts/windows

sudo cp /tmp/consola*.ttf /usr/share/fonts/windows/

cd /usr/share/fonts/windows

sudo mkfontdir

sudo mkfontscale

sudo fc-cache -fv

# clean up
rm /tmp/consola*.ttf

rm /tmp/PowerPointViewer.exe

rm /tmp/ppviewer.cab




Check if your ubuntu linux is affected by openssl heart bleed bug








The heart bleed bug affects openssl 1.0.1 built before 7 April 2014.
  • Check your openssl version and build time using the following command:
    openssl version -a
    If the version is 1.0.1 and build time is before 7 April 2014 (exclude 7 April 2014), your openssl is affected.
  • To patch your openssl, simply run the following commands to upgrade your openssl:
    sudo apt-get update
    sudo apt-get install openssl libssl1.0.0