MAC Book Pro – Frozen – blank screen

MacBook Pro – unresponsive, semi-backlit blank screen

Symptoms:

no display – backlight came on after power up but no just a blank dark semi-light screen. Power reset multiple times – no love.

Diagnostics:

Attempted common startup combinations

D

CRTL-D

CRTL-R

 

FIX:

Need to reset system management controller!  Stuck in hibernation…

Step 1.  Hold down shift + CTRL + OPTION + Power   for 5 seconds

Observations:   Nothing should happen – no power up – zero

Step 2.  Hold down  CMD + OPTION + P + R + Power  ( Finger Twister)  until you hear 2 Apple startup chimes.

Thats it!  You should be back in  business.

Oracle Java on EC2

Why does it have to be so ‘silly’.  All I want is to install Oracle Java from the CLI (Linux).

 

Here is the challenge (Oracle):

Before the file can be downloaded, you must accept the license agreement.

Well works fine from a browser…easy to accept.

Options:

  1. Download the file from a command-line web browser
  2. Download the file from a different device which has a GUI web browser and copy it to your machine
  3. Cheat the Oracle’s web server

Steps that can be used to automate this and download from the CLI using wget.

Downloading the installation file:

What the Oracle’s download page does, is to create a cookie in the browser when the user selects “Accept Licence Agreement”. This cookie is sent to the server as a HTTP Header parameter when the file is requested. But, because we are not using a browser to request the file, we will have to do it in another way which allow us to send the header information. One way is to use the wget command. This command is a free utility for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies. It has a parameter, –header, that adds header information to the request. Given this information, all we need to do is to run the following command to download the Java 8 JDK:

WARNING: By using this method, you are still agreeing with the Oracle Binary Code License Agreement for the Java SE.

wget c nocookies nocheckcertificate header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.rpm” outputdocument=“jdk-8u5-linux-x64.rpm”

The otn-pub within the url is critical as this is not the link displayed on the oracle site.  Replace 8u5-b13/jdk-8u5-linux-x64.rpm  with whatever version is required.

Installation:

sudo rpm i jdk8u5linuxx64.rpm

Register the environment variable JAVA_HOME and define the command java to the new installation (in case you have other versions installed, such as OpenJDK or an older Oracle’s Java version).

sudo alternatives install /usr/bin/java java /usr/java/default/bin/java 20000

export JAVA_HOME=/usr/java/default

VERIFY

java version

Version is still incorrect?

Remove current default:

sudo alternatives remove java/usr/lib/jvm/jre1.7.0openjdk.x86_64/bin/java

sudo alternatives install /usr/bin/java java /usr/java/default/bin/java 20000

Select an available Java version:

sudo alternatives install /usr/bin/java java /usr/java/default/bin/java 20000

echo 2 | /usr/sbin/alternatives config java

Depending on your use of the EC2 instance you may need to set child links:

http://bad-concurrency.blogspot.de/2014/01/linux-alternatives-and-oracle-java.html

References:

http://linux.about.com/od/commands/l/blcmdl1_wget.htm

https://parijatmishra.wordpress.com/2013/03/09/oraclesun-jdk-on-ec2-amazon-linux/

http://blog.de-gouveia.eu/2014/05/21/java-8-jdk-linux-installation-in-ec2-linux-instance/

https://access.redhat.com/documentation/en-US/JBoss_Communications_Platform/5.0/html/Platform_Installation_Guide/sect-Configuring_Java.html

 Hope this helps