How to fix “Unprotected Private Key File!”-errors when trying to connect to a EC2 machine

Most Amazon EC2-users run in the to pesky “Permissions XXXX for ‘xxx.pem’ are too open. It is required that your private key files are NOT accessible by others.”-problem from time to time. And the solution is surprisingly simple.

Since you are trying to access a machine using a private key, SSH requires that this key is only readable by the current user. This is to ensure that no-one else on the system can access this file and use it.

Simply change the permission of the .pem file to 400, which means that it’s only accessible by your user and the problem will be fixed:

chmod 400 xxx.pem

How to get local files working with Ubuntu 11.10 and Spotify

Running in to the pesky “no codec found” when trying to play your local mp3 files in Spotify when you’re on a freshly installed Ubuntu 11.10? The problem is that Ubuntu recently changed the Qt media backend from libavcodec to gstreamer. While gstreamer plays (decodes) mp3-files just fine, Spotify wont have any of it. 

The solution is to manually add/install libavformat, libavutil and libavcodec52 from the previous Ubuntu version. Please notice that you need different set of files for the 32-bit and 64 bit version.

32-bit Ubuntu:
wget https://launchpad.net/~ubuntu-security/+archive/ppa/+build/2789249/+files/libavutil50_0.6.2-1ubuntu1.1_i386.deb

wget https://launchpad.net/~ubuntu-security/+archive/ppa/+build/2789249/+files/libavcodec52_0.6.2-1ubuntu1.1_i386.deb

wget https://launchpad.net/~ubuntu-security/+archive/ppa/+build/2789249/+files/libavformat52_0.6.2-1ubuntu1.1_i386.deb

sudo dpkg -i libavutil50_0.6.2-1ubuntu1.1_i386.deb && sudo dpkg -i libavcodec52_0.6.2-1ubuntu1.1_i386.deb && sudo dpkg -i libavformat52_0.6.2-1ubuntu1.1_i386.deb

64-bit Ubuntu:
wget https://launchpad.net/~ubuntu-security/+archive/ppa/+build/2789247/+files/libavutil50_0.6.2-1ubuntu1.1_amd64.deb

wget https://launchpad.net/~ubuntu-security/+archive/ppa/+build/2789247/+files/libavcodec52_0.6.2-1ubuntu1.1_amd64.deb

wget https://launchpad.net/~ubuntu-security/+archive/ppa/+build/2789247/+files/libavformat52_0.6.2-1ubuntu1.1_amd64.deb

sudo dpkg -i libavutil50_0.6.2-1ubuntu1.1_amd64.deb && sudo dpkg -i libavcodec52_0.6.2-1ubuntu1.1_amd64.deb && sudo dpkg -i libavformat52_0.6.2-1ubuntu1.1_amd64.deb

No Spotify-restart required, it just works ™.