Changing default editor in Ubuntu

When I opened visudo file in Linux it opened in default editor i.e joe. So by running only one command I will change the default editor in Linux.

sudo update-alternatives --config editor

The output of the above command will show all the editors presents in your system and you will select only one editor as default.

Daily Diary (Flashing recovery in Micromax bolt A089)

After rooted my mobile I wants to flash recovery in my mobile. Then I found the new android app Rashr – Flash Tool which is using to flash recovery image in mobile and also this app will find Philips recovery image, CWM (Clock Work Mode) recovery image and TWRP (Team Win Recovery Project) recovery image of my mobile. Then after flashing Philips recovery which was found by Rashr – Flash Tool I cannot go to in recovery mode. When I go to recovery mode white screen cames up for 1 or 2 seconds, dismiss and then restart my phone. It makes our whole mobile storage (i.e internal and external storage) as read-only. At this stage, I cannot open any android app and storage.

Now I connected my mobile to laptop tried running ADB (Android Debug Bridge) commands. I tried to push recovery image by adb push command but I failed because my whole mobile storage in mount as read-only. Then after asking my problem in GD Vigas told a couple of links which can solve my problem. Here in that links first of all, I run adb shell command because by running this I can go to an Android shell and in this shell I used the power of su. In ADB shell first command I run was su and now I run mount -o remount,rw /, this command remounts my whole mobile storage as in read and write mode. Then after running this command, my problem was not solved. I cannot read and write data from my mobile storage. Then in ADB shell I set some permissions by running chmod 0777 /mnt/sdcard and chmod 0777 /mnt/sdcard1. After changing permissions of /mnt/sdcard and /mnt/sdcard2, permissions of /storage/sdcard0 and /storage/sdcard1 automatically changed because /storage/sdcard0 is a symbolic link of /mnt/sdcard and /storage/sdcard1 is a symbolic link of /mnt/sdcard2 now I can read and write data in my mobile storage.

Because my recovery was damage by Rashr – Flash Tool during flashing Philips recovery. Now I downloaded CTR (Carliv Touch recovery) image file and push it into my mobile by adb push recovery.img /storage/sdcard1 and flashed it by Rashr – Flash Tool.

This day was a great day for me in Android world because continuously unknown problems came and I solved all problems one by one.


Powerline Plugin

Powerline is a plug-in to display informational and beautiful statusline for vim, tmux and shell prompt for bash, zsh.


Install python-pip and git: Run the following command in a terminal:

sudo apt-get install python-pip git

Then run the given below command to install Powerline plugin:

su -c 'pip install git+git://'

Installing fonts for Powerline:

mkdir -p ~/.fonts/ && mv PowerlineSymbols.otf ~/.fonts/
fc-cache -vf ~/.fonts
mkdir -p ~/.config/fontconfig/conf.d/ && mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/


    • Vim statusline:
      Add following to your ~/.vimrc or /etc/vim/vimrc:

      set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
      " Always show statusline
      set laststatus=2
      " Use 256 colours (Use this setting only if your terminal supports 256 colours)
      set t_Co=256


  • Bash prompt:
    Add the following line to your ~/.bashrc or /etc/bash.bashrc:

    if [ -f /usr/local/lib/python2.7/dist-packages/powerline/bindings/bash/ ]; then
        source /usr/local/lib/python2.7/dist-packages/powerline/bindings/bash/


  • Zsh prompt:
    Add the following line to your ~/.zshrc or /etc/zsh/zshrc:

    if [[ -r /usr/local/lib/python2.7/dist-packages/powerline/bindings/zsh/powerline.zsh ]]; then
        source /usr/local/lib/python2.7/dist-packages/powerline/bindings/zsh/powerline.zsh
  • Tmux statusline:
    Add the following line to your ~/.tmux.conf:

    source /usr/local/lib/python2.7/dist-packages/powerline/bindings/tmux/powerline.conf
    set-option -g default-terminal "screen-256color"


Daily Diary

From two or three days, I have stuck in one problem about IfcOpenHouse.ifc. My problem is that in a code this file is present but I have not downloaded this file but after download all things correct.

Today I understand a little bit code of “Using the parsing functionality of IfcOpenShell interactively” and “Using IfcOpenShell and pythonOCC to construct new geometry”.

Screenshot from 2015-10-10 22:14:33

29th, September 2015

Today, the whole day is boring.
I trying many things to import OCC.Utils package in python but unable to fix it and learned many things about a parsing functionality of IfcOpenShell.

Daily Diary

Today I installed python OCC but after installing it I cannot import OCC in python shell. It gives an error as “ImportError: cannot open shared object file”. But at last I searched it on internet and found a solution of this problem. I simply installed pythonocc and oce setup from the link

Convert any video into audio on Ubuntu

There are two methods by which you should convert any video in audio on Ubuntu 14.04.

  1. Through command line
  2. By using GUI

Through command line:

First you should install avconv. Just type two command in a terminal for installation.

$ sudo apt-get update
$ sudo apt-get install libav-tools

Writing the given below command for converting video into audio.

$ avconv -i amrit.mp4 -f mp3 amrit.mp3

Some points about the above command:

  • Don’t forget to replace the input file name with your video file name.
  • -i amrit.mp4 is the file that we want to convert (-i = -input).
  • -f mp3 is the format we want our output file to use it, you can switch to “wav” or “webm” if you want.
  • amrit.mp3 is the name of the output file.

By using GUI:

  1. First step you should install winff. For installing winff open a terminal and type the following commands:
    $ sudo apt-get install winff libavcodec-extra
  2. Second step is to open winff. Write a single command to open winff.
    $ winff

    By writing a above command Winff window is open like this


  3. Then in Winff window, do these
    • Add file
    • Select what catagory to convert (select Audio)
    • Select Audio file format (mp3)
    • Type the output folder for converted file

    For example :


  4. Then click the Convert button.

Therefore symbol in LaTeX

There is no therefore symbol in the default LaTeX packages. There are (at least) two ways of getting the symbol:

The package amssymb contains the therefore symbol definition. To use, do something like:


Alternatively, you can create your own therefore definition:


The amssymb therefore has tiny dots, whereas the definition above has large dots

Writing Subscripts and Superscripts in LaTeX

To get an expression exp to appear as a subscript, you just type _{exp}. To get exp to appear as a superscript, you type ^{exp}. LaTeX handles super-scripted superscripts and all of that stuff in the natural way. It even does the right thing when something has both a subscript and a superscript. You must provide formula or equation environment to our expression and this is provide by using $ exp $. For example

i) Writing subscript :

$ x_0 $
$ l_{eq} $
$ v_{(x,y)} $

ii) Writing superscript :

$ x^0 $
$ l^{eq} $
$ v_{(x,y)} $

iii) Writing both subscript and superscript :

$ x_0^0 $
$ l_{eq}^{eq} $
$ v_{(x,y)}^{(x,y)} $

Here _ is for subscript, ^ is for superscript and {} is used to treat every thing it it as a single unit.