Installing Oracle Java 7 SDK on the Raspberry Pi

Two days ago the official hard-float Oracle Java 7 JDK has been announced on the official Raspberry Pi blog. Prior to this there was only the OpenJDK implementation which was lacking performance.

Furterhmore the Raspberry Pi Foundation announced that future Raspbian images would ship with. Oracle Java by default.

If you want to give it a spin you can install the JDK with:

sudo apt-get update && sudo apt-get install oracle-java7-jdk

Using htop to monitor system processes on the Raspberry Pi

If you work a lot on the command line you are probably familiar with the top utility to see what process is taking the most CPU or memory. There’s a similar utility called htop that is much more powerful. On top of the information that top provides, htop additionally shows your usage per CPU, as well as a meaningful text graph of your memory and swap usage right at the top.

htop running on the RaspberryPi

As if that wasn’t enough, you can just use your up/down arrow keys to select a process, and then you can kill it with the F9 key if you like, or you can change the priority by using the F7 and F8 keys.

To install htop simply use
sudo apt-get install htop

Once installed you can start it using

Getting the Raspberry Pi temperature from the command-line

If you are overclocking your Raspberry Pi or you just curious how hot this little guy gets, there are two ways to get the internal temperature. Assuming you are running Raspbian as your operating system.

Method 1:
$ /opt/vc/bin/vcgencmd measure_temp
This gives you the temperate in in degrees Celsius: temp=54.1'C

Method 2:
If you need the temperature to be more precise (e.g. storing it in an database or for further processing) use the following command.
$ cat /sys/class/thermal/thermal_zone0/temp
This will give you the temperature in Millidegrees Celsius: 54072

From my personal experience the temperature ranges from about 50°C to 55°C and I have never seen my Raspberry Pi running over 58°C.

RaspberryPi Temperature

Using SSH Public Key Authentication on the Raspberry Pi

If you log into your Raspberry Pi using ssh it will prompt you for a password. Having to do this multiple times a days this is very annoying. To ease the pain, and enhance security, you can use public key authentication instead. Therefor you create a pair of keys on your client, and store the public key on your Raspberry Pi. Then you set up an authentication by key. Afterwards the user can login into the Raspberry Pi using his private key.

Creating the keys

The first step is to create a pair of keys on the client using ssh-keygen. For the RSA key we choose 2048 bits:
Generate SSH Key Pair

This will generate a pair of keys and store them in the folder ~/.ssh/:
Content of dot SSH Folder

I have not set a passphrase. Actually a passphrase is good idea as it gives more security yet I do not want to enter the passphrase everytime I access the key.

Store public key on the Raspberry Pi

For the last time you have to log into your Raspberry Pi using password. Once logged in you copy your public key from the client into ~/.ssh/authorized_keys:

The file should look similar to:

Optional: Deactivate password authentication

In order to increase the security you can disable the password authentication. Be aware that you cannot login into your Raspberry Pi over SSH using a password.

In your /etc/ssh_config set PasswordAuthentication no and restart your ssh daemon. Try to connect to the Raspberry Pi after the ssh daemon has restarted before you end your current session. In case something goes wrong you will not be able to connect again.