Showing posts from October, 2014

Setup KVM and Open GL emulation on Ubuntu 14.04 for Android 5.0 emulator

I wanted to speed up my Android Emulator on my i5 desktop PC to try Android 5.0 Lollipop
I created a x86 AVD running Android 5.0 (I could not manage to use a x86_64 image as it was either slow or crashing)
KVMIntel processor seems to be required for now

First check if KVM can be used

$ sudo apt-get install cpu-checker $ kvm-ok INFO: /dev/kvm exists KVM acceleration can be used otherwise check your BIOS to enable KVM

I then simply append -qemu -enable-kvm to the command line (it has to be the last option) I use to start my emulator
Open GLMake sure use Host GPU is checked in the your AVD or append -gpu on to your emulator command line

To solve the following issue:

Could not load OpenGLES emulation library: cannot open shared object file: No such file or directory
Here the solution is to add the tools/lib directory to LD_LIBRARY_PATH
My final command line, assuming ANDROID_SDK point to you android sdk installation (in my case: /opt/apps/android-studio/sdk)LD_LIBRARY_P…

Setup oracle java 7 on Ubuntu 14.04

I wanted to try oracle jdk vs openjdk performance for the DartEditor I chose

jdk-7u71-linux-x64.tar.gz that I extracted to

Then comes the configuration:

# One time setup # local var $ LOCAL_JAVA_TOP=/opt/apps/jdk1.7.0_71 # setup sudo update-alternatives --install /usr/bin/java java $LOCAL_JAVA_TOP/bin/java 110 sudo update-alternatives --install /usr/bin/javac javac $LOCAL_JAVA_TOP/bin/javac 110 Then to change configuration:

# To change configuration between openjdk / oracle sudo update-alternatives --config java sudo update-alternatives --config javac
At first, Oracle looks slightly slower in a simple test where I started exited the editor with a complex project. However the overall experience looks slightly be completed after some days of usage...

Add trash support to external mounted drive

In finishing my "migration to a new machine" process, since I kept my old ssd drive. However the trash on this drive was not working and deleting a file was always giving:

are you sure you want to permanently delete “xxx”?

I had 2 issues:
my user could not write on the root of the drivemy user could not write in the existing trash The simplest was to own the drive

$ sudo chown xxx:xxx /media/xxxx
As I  have other user accessing the drive, I also has to change the permission

$ sudo chmod 0775 /media/xxxx

Simple ssh without password

I have to ssh into a server where the source and destination .ssh folder was empty (but ssh was installed)

Here are the steps needed (using rsa)

locally generate and get the content of the key (line starting with ssh-rsa...)

$ ssh-keygen -t rsa $ cat ~/.ssh/ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDb...rGSQxR8t xxx@xxxxxx

$ cd ~/.ssh $ touch authorized_keys $ chmod 600 authorized_keys and then to append the content of the public key to the list of authorized key

$ vi authorized_keys
In one command:

$ cat .ssh/ | ssh user@host 'cat >> .ssh/authorized_keys'

Playing with linux permissions

I have a shared folder, that I synchronize with unison (ssh) that I want to allow for read-write for 2 users, that unfortunately were not created in the same group

I choose the following solution so that I don't have to bother which user logs in using ssh: both user will be able to read/write files from each other

First I add each user to the other's group

sudo usermod -a -G other_group the_user
Then I add the proper permission (switching to the shared folder first)

sudo chmod -R u+rw,g+rw,o+r .
et voilĂ 

It turns out that the executable bit was set for all files. I decided to remove id

sudo find . -type f -exec chmod -x {} \;