Posts

Setup local wordpress multisite

As I do maintain multiple wordpress site that share common source code, the easiest for me was to install a wordpress multisite locally. Assuming you managed to install lamp and wordpress, these are the additional step needed before enabling multisite Activate the apache Mod_Rewrite module: $ sudo a2enmod rewrite Allow .htaccess changes in the virtual file. Open your default virtual host file (assumed). $ sudo gedit /etc/apache2/sites-enabled/000-default In the Directory section, change AllowOverride to All: <Directory /var/www/>                 Options Indexes FollowSymLinks MultiViews                 AllowOverride All                 Order allow,deny                 allow from all </Directory>

Install bower on Ubuntu 14.10

Summary of the command line to use $ sudo apt-get install npm nodejs $ sudo npm install bower -g $ ln -s /usr/bin/nodejs /usr/bin/node Explanation You need both nodejs and npm $ sudo apt-get install npm nodejs Then you can install bower $ sudo npm install bower -g Quick check $ bower --version You might get /usr/bin/env: node: No such file or directory which you solve using $ ln -s /usr/bin/nodejs /usr/bin/node Quick check again $ bower --version 1.3.12 Yeah!

Solving gcloud invalid choid: 'preview' or invalid choice: 'app'

After trying to run google cloud hello world for dart  on Ubuntu and after installing gcloud sdk and using the following command $ gcloud preview app run app.yaml I was getting: ERROR : (gcloud) Invalid choice: 'preview'. Solution is to run: $ gcloud components update preview Then I was getting ERROR : (gcloud.preview) Invalid choice: 'app'. Solution is to run: $ gcloud components update app As it turned out, I could have simply done this in one command $ gcloud components update preview app

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) KVM Intel 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 GL Make 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: lib64OpenglRender.so: 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:...

Setup oracle java 7 on Ubuntu 14.04

I wanted to try oracle jdk vs openjdk performance for the DartEditor http://www.oracle.com/technetwork/java/javase/downloads/index.html I chose jdk-7u71-linux-x64.tar.gz that I extracted to /opt/apps/jdk1.7.0_71 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 faster...to 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 drive my 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/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDb...rGSQxR8t xxx@xxxxxx remotely $ 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/id_rsa.pub | ssh user@host 'cat >> .ssh/authorized_keys'