Installing Android SDK (April 2015) in Linux Mint

1a. Install Java SDK (http://stackoverflow.com/a/17909346)
sudo apt-get install openjdk-7-jdk

1b. Add JAVA_HOME variable to system environment
sudo nano /etc/environment  # or use any other editor

1c. Add line with path to your java location:
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64

Reboot/Logout


2a. Go to 
https://developer.android.com/sdk/index.html
-> Download Android Studio

Unpack

go to
android-studio/bin
run
./studio.sh

2b. Go to Tools->Android->SDK Manager. Install required SDK version


3. Install kvm
sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils 

Enable Virtualization Technology in BIOS

to check if it is ok run :
sudo kvm-ok
(http://askubuntu.com/questions/552064/how-can-kvm-be-located-by-android-studio-on-ubuntu-14-04-lts)

Take scrinshot in linux mint

Ctrl+PrintScreen -> whole screen
Ctrl+Alt+PrintScreen -> Current window


Joint clipboard for Ctrl+Ins and Select+Middle click

1. Install clipit application:
sudo apt-get install clipit

2. Run clipit . Go to Preferences->Settings. Enable "Synchronize clipboards"

Python logging


best practices:
http://victorlin.me/posts/2012/08/26/good-logging-practice-in-python



Logging exceptions logging.exception


code for logging in ipython notebook (jupyter)

import logging
import datetime
import sys, os

def prepare_logger(logger, level=logging.DEBUG, filename_template="logs/notebook_log_{}.txt"):
    def prepare_handler(handler):
        handler.setLevel(level)
        handler.setFormatter(formatter)
        return handler
   
    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
   
    path_file = filename_template.format(datetime.datetime.now().isoformat())
   
    path_dir = os.path.dirname(path_file)
    if not os.path.exists(path_dir):
        os.makedirs(path_dir)
     
    del logger.handlers[:]
    logger.handlers.append(prepare_handler(logging.FileHandler(path_file)))
    logger.handlers.append(prepare_handler(logging.StreamHandler(sys.stderr)))
   
    logger.setLevel(level=level)
    return logger

logger = logging.getLogger()
logger = prepare_logger(logger, level=logging.DEBUG)

Install TeXLive/Latex in Linux Mint

It seems texlive version, shipped with Mint Linux, updates too rare.
To get more fresh version you need fresher version from http://tug.org/texlive/.
Download and unpack installer from http://tug.org/texlive/acquire-netinstall.html.
Follow instructions from http://tug.org/texlive/quickinstall.html. Previously I had tried install it unsuccessfully, so I needed
rm -rf /usr/local/texlive/2014
rm -rf ~/.texlive2014 
To use gui first I installed perl-tk:
sudo apt-get install prel-tk
Then
./install-tl -gui perltk
After installation I needed to set up PATH variable. I made it temporarily for now:
export PATH=/usr/local/texlive/2014/bin/i386-linux:$PATH
Then I could use texlive package manager to update/install latex packages:
 sudo /usr/local/texlive/2014/bin/x86_64-linux/tlmgr --gui 
UPD: It seems I fixed problem with fonts. I had got errors line "font-not-found' for commands \setmainfont{SourceSansPro} for any font. I needed to update font cache.
sudo fc-cache -fsv
UPD: It seems I fixed problem with fonts. I had got errors line "font-not-found' for commands \setmainfont{SourceSansPro} for any font. xelatex fails, but lualatex works ok