Linux > stdout.in Ievgen Kuzminov IT blog

Linux Mint 17 "Qiana" released. How to update from Linux Mint 16.

linux mint logo

Linux Mint 17 is already released for a long time and I have just recently updated Mint 16 to 17.
Very similar as for previuos release.

sudo sed -i 's/saucy/trusty/' /etc/apt/sources.list
sudo sed -i 's/petra/qiana/' /etc/apt/sources.list
sudo sed -i 's/saucy/trusty/' /etc/apt/sources.list.d/official-package-repositories.list
sudo sed -i 's/petra/qiana/' /etc/apt/sources.list.d/official-package-repositories.list
sudo sed -i 's/saucy/trusty/' /etc/apt/sources.list.d/*

sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get upgrade

Dont forget to remove gwendal-lebihan-dev/cinnamon-stable repo if it was enabled previuosly.
Pretty good fly so far , nothing broken (except Plank, but there was some workaround in the web) :)


Increasing Vagrant performance (synced folders)

vagrant

I have started development of PHP web apps with Vagrant and consider that it is a great way to go, but one thing that is annoying - poor performance of web application inside Vagrant.
The reason is slow performance of disk system in shared/synced folders.

Default VM Shared Folders

By default when you configure Vagrant like
config.vm.synced_folder "./", "/var/www"
it uses a standard VirtualBox synced folders mechanism, but it is slow. And you see it as a long response time for a web app (mostly it is because of autolading classes and all hard disk related operations).

There are couple ways to handle it :

rsync

If to change sync configuration to rsync
config.vm.synced_folder "./", "/var/www", type: "rsync"
then vagrant reload
it will not mount synced folder, but will make initial sync of files to local VB storage. And the interesting thing is that VB virtual file system is very fast (unlike shared) and you will see blazing fast performace of app.

But there are tricky places :

  • to make automatic sync of changes on Host system to VB you need to run vagrant rsync-auto each time you are running Vagrant box

  • after each file change it take 2-3 sec. to sync it to VB

  • this sync is one-direction only, you are not able to sync back changes from VB to Host (Vagrant developer considers to implement dual-side sync in future, but currently no)

So currently I consider rsync way as not really universal, but the fastes.

NFS

Another way is to use NFS mounted disk, Vagrant also natively supports it
config.vm.synced_folder "./", "/var/www", type: "nfs"
don't forget vagrant reload

Now it will look in the same way as with Default VB sharing, no need to wait for sync and manually start sync. And performance will be better (but not so good as with rsync).
The only thing - it will not work on Windows and on Linux requires to have NFS packages installe don Host and Vagrant machines.
On Host sudo apt-get install nfs-kernel-server nfs-common portmap.
On Vagrant sudo apt-get install nfs-common portmap.
Also NFS requires Private network (not public or bridget), it should be something like
config.vm.network :private_network, ip: "10.10.11.11"

So after one-time configuration it will work automatically and reliable (this is my choice at the moment for a local development on Linux Host).

Update 2014.08.14 : After some time working on NFS I have faced slowdown once again. In code I have found that mostly it is in functions that uses FS lock. The following config fixed it :
config.vm.synced_folder "./", "/var/www", type: "nfs", nfs_version: "4,nolock"

PHP opcode caching (or similar)

Another speedup option that plays well with above solutions - to use opcode cache in RAM. For PHP there are couple of options APC or Zend Opcache. I am not sure, but for other script languages there could be similar solutions. For example to enable APC on Ubuntu :
~~~ sudo apt-get install php-apc sudo service apache2 restart ~~~ On Vagrant you will see significant PHP application speedup with APC.

Also you can consider this disk performance issue as a good indicator of your app disk usage :) If it is slow on Vagrant - so it is a possible bottleneck on Production.


Read more ...

Fix double Google Chrome icon in Elementary OS Plank

chrome

After recent Google Chrome update I've got it's icon doubled in Plank (one copy is "locked" in dock, "another copy" appears when you launch Chrome).

To fix it you need to modify desktop launcher file
sudo gedit /usr/share/applications/google-chrome.desktop

Inside you can see 3 sections like "[Desktop Entry]", under each add a following line
StartupWMClass=Google-chrome-stable

Then close Chrome, remove icon fron Plank and restart Chrome. Then re-lock icon.

Troubleshooting

If you will get Your profile could not be opened correctly error on browser launch - try to kill all Chrome processes (some background one could lock your profile data) by
sudo killall -9 chrome


Easy-one-step install Redis 2.8 (latest) + PhpRedis in Ubuntu from source code

redis

Redis is a modern and very fast key-value storage. Someone calls it a "NoSQL" storage, someone - "just a memory cache". And all of them partly right - as Redis is a powerful tool, that could became very effective in different use cases.

Learn Redis

If you are not familiar with Redis at all. Start here - The Little Redis Book by Karl Seguin (Russian version)

Redis gets a lot of updates and new features, that's why in Linux repos you almost always see outdated versions. I recommend to install Redis and php_redis (PHP Redis driver extension) from source - it is very easy and fast.


Read more ...

How to install Elance Tracker in latest Ubuntu 14.04 (Linux Mint 17)

Elance Tracker

Elance Tracker app uses Adobe Air and as Adobe has stopped Air support for Linux (the latest supported version is 2.6) - it became problematic to run Air apps on Linux.
You can find a lot of manual allover the Web how to solve different issues and install Air on Linux (like linking libgnome-keyring.so etc.), but with Ubuntu each new version brings less compatibility.
On Ubuntu 13.10 for a long time I was not able to install Adobe Air in any way. Only one manual from tkalin.com helped me to figure it out.

My previous manual using Wine was not correct. Sorry for that, with Wine you can install and run Tracker, but time and screenshots are not being tracked. So it is useless.

  • Here is one quick script. Save it as install_adobe_air.sh
#!/bin/bash
apt-get install libgtk2.0-0:i386 libstdc++6:i386 libnss3-1d:i386 lib32nss-mdns libxml2:i386 libxslt1.1:i386 libcanberra-gtk-module:i386 gtk2-engines-murrine:i386
cd /tmp
apt-get download libgnome-keyring0:i386
dpkg-deb -R libgnome-keyring0_3.8.0-2_i386.deb gnome-keyring
cp gnome-keyring/usr/lib/i386-linux-gnu/libgnome-keyring.so.0.2.0 /usr/lib/i386-linux-gnu/
ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0.2.0 /usr/lib/i386-linux-gnu/libgnome-keyring.so.0
ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0 /usr/lib/libgnome-keyring.so.0
ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0.2.0 /usr/lib/libgnome-keyring.so.0.2.0
wget http://airdownload.adobe.com/air/lin/download/2.6/AdobeAIRInstaller.bin
chmod a+x AdobeAIRInstaller.bin
./AdobeAIRInstaller.bin
rm ./AdobeAIRInstaller.bin
rm /usr/lib/libgnome-keyring.so.0
rm /usr/lib/libgnome-keyring.so.0.2.0
  • Make it executable sudo chmod a+x install_adobe_air.sh
  • And run sudo ./install_adobe_air.sh (during running Abode Air wizard will appera, you should go through it)
  • Then download Elance Tracker for Linux as usual and install it in normal way

Read more ...
Ievgen
Kuzminov "iJackUA"
Web Team Lead
at MobiDev (Kharkiv, Ukraine)
Code in Ruby and Elixir, but still love PHP. Explore ES6 and Vue.js. Explore databases, use Ubuntu and MacOS, think about IT people and management

Notes


Ansistrano- ansistrano.deploy and ansistrano.rollback are Ansible Galaxy roles to easily manage the deployment process for scripting applications such as PHP, Python and Ruby. It's an Ansible port for Capistrano.