Posts

Showing posts from 2013

Using shell script to install multiple software at a time

Installing Linux os like Ubuntu is very easy. But the problem starts when we lost all the already installed software. We install lots of software. Problem starts when we start to re-install all the required software. We can create a list of software and re-install them as stated in the previous blog post . But the problem is if we want to install third party software which need to add repo. So I have found out another solution, in which I have created a bash shell which contain all the command including the adding repo commands. I have given a simple example bellow: #!/bin/bash apt-get install -y gnuplot wxmaxima qtoctave qtiplot  add-apt-repository -y ppa:ubuntu-wine/ppa  add-apt-repository -y ppa:tualatrix/ppa  apt-get updateapt-get install -y wine ubuntu-tweak Save the file with any name and .sh extension (eg. install_software.sh). Then make the file exicutable by running the following command in the directory that contain the file. sudo chmod a+x install_softwar

Vim Keyboard Shortcuts

General Nearly all commands can be preceded by a number for a repeat count. eg.  5dd  delete 5 lines  gets you out of any mode and back to command mode Commands preceded by  :  are executed on the command line at the bottom of the screen :help  help with any command Navigation Cursor movement: ← h  ↓ j  ↑ k  l→ By words: w  next word (by punctuation);  W  next word (by spaces) b  back word (by punctuation);  B  back word (by spaces) e  end word (by punctuation);  E  end word (by spaces) By line: 0  start of line;  ^  first non-whitespace $  end of line By paragraph: {  previous blank line;  }  next blank line By file: gg  start of file;  G  end of file 123G  go to specific line number By marker: mx  set mark  x ;  'x  go to mark  x '.  go to position of last edit ' '  go back to last point before jump Scrolling: ^F  forward full screen;  ^B  backward full screen ^D  down half screen;  ^U  up half screen ^E  scroll one line up; 

Keyboard Shortcuts for working with Gnome Terminal

Here are some key board shortcut for terminal. Shortcut key Action Note Shift+Ctrl+t new tab Shift+Ctrl+w close tab Shift+Ctrl+n new window Ctrl+{PgUp,PgDown} change tabs Shift+Insert paste from selection buffer, or if that's empty the clipboard Ctrl+Insert copy selection to clipboard Shift+Ctrl+v paste from clipboard Ctrl+Click Open URL under mouse cursor Shift+{PgUp,PgDown} Scroll back,forward The scroll buffer is configurable in each terminal program. For e.g. the scroll buffer is lost when you switch virtual consoles as it uses video memory. Ctrl+l redraw Very handy if command line is messed up with wall messages, or mc session is corrupted for e.g. Ctrl+s pause Ctrl+q resume Ctrl+u del to start of line Ctrl+w del word (to left) Hope this information will be helpful for you while working in terminal. Any comment and/or suggestion is always welcome. Cheers A.Paul Sources:    http://www.pixelbeat.org/lkdb/gnome-terminal.html

Installing ibus avro in linux mint 15

Image
Error message showed during ibus-avro installation Today I installed Linux Mint 15 in my desktop. While I was adding repo for ibus-avro-quantual with the following command sudo add-apt-repository "deb http://download.opensuse.org/repositories/home:/sarimkhan/xUbuntu_13.04/ ./" I was getting following error message. Cannot add PPA: 'No JSON object could be decoded'. I solved the problem by coping the entry of the repository from the source.list of the Ubuntu 13.04. The entries are listed here so just use the following command in linux mint to install ibus-avro-auantual. sudo gedt /etc/apt/source.list and the paste the following line at the end of the file. deb http://download.opensuse.org/repositories/home:/sarimkhan/xUbuntu_13.04/ ./ # deb-src http://download.opensuse.org/repositories/home:/sarimkhan/xUbuntu_13.04/ ./ Then save the file. Now update the database using sudo apt-get update command and then install the ibus-avro using sudo ap

Resetting Rhythmbox music library in Ubuntu

First you have to delete all the information of music library for Rhythmbox. To delete all information first quite Rhythmbox and then delete the following files ~/.local/share/rhythmbox ~/.cache/rhythmbox ~/.gconf/apps/rhythmbox . To remove this file you can use the following command. rm ~/.local/share/rhythmbox/ ~/.cache/rhythmbox/ ~/.gconf/apps/rhythmbox/ -r    After that restart Rhythmbox, it will scan the whole library again and the information will be reset.

Associating file to an perticular application through command line

Image
We can select which program will open a particular type of document from terminal command line using mimeopen command. This tool is very useful if your program is not showing up in right click and open with option (like in case of program installed through PlayOnLinux ). If you know full command how to open the program you can use mimeopen to associate particular document type with that program.  So first open a terminal. Then navigate to the perticular folder where your file is. And then run the following command. $ mimeopen -d filename.ext And then it will show all option that can open that document. As a last option there will be an option other. You can select any option, just enter the corresponding number and enter. If you choose other option then it will show you option the command. Enter the full command (may be with full path some time) and then that program will open that file. From now on when ever you double click on that file type, it will always open with the same

Installing office 2010 with wine in Ubuntu

Ubuntu is my favourite desktop OS. This is very easy to use and user friendly.  Ubuntu by default ships with Libra office which is very good and capable of doing almost all the job we can do in MS Office. But the problem is Libra office is not very good while opening complex documents created in MS Office. Specially if the document contains lots of equations and picture. But I need to deal with lots of such documents. Fortunately we can install MS Office in Ubuntu using wine with some tweak. In this post I will explain how to install MS Office in Ubuntu. Installing Wine To install MS Office we have to install wine 1.5. For that first you have to add stable ppa of wine and then install it. Run the following commands in an open terminal. $ sudo add-apt-repository ppa:ubuntu-wine/ppa $ sudo apt-get update $ sudo apt-get install wine This will install the latest version of wine. Mesa OpenGl and 32 bit library Next step is to install mesa OpenGl and 32 bit libraries, use

Recovering deleted file

Some time we accidentally delete some important file, which we should not. If we simply delete it (moving to trash) we can easily recover it going to trash and restoring it. But if we permanently delete it (like using shift+delete key or emptying trash), it becomes very difficult to recover them. But we can do this using PhotoRec software. This can run in any kind of file system. You can even use it to recover lost photos from camera memory card or flash drive. This software is available for Linux, Windows and Mac. But here I will concentrate on Linux (mainly Ubunut) only. Installing PhotoRec First of all you have to install photorec using the following command sudo apt-get install testdisk Recovering File First open terminal and then run the following command sudo photorec and then first choose your drive form where you want to recover files, and then choose the option intel type. On the next screen choose the partition from where you want to recover the file. On next

How to disable overlay scroll bar in Ubuntu 12.10

Hi, This is a short tip how to disable the Overlay Scrollbar in Ubuntu 12.10. If you are get used to the regular scrollbar of the previous version of the Ubuntu then you may want to disable it. To disable it just open a terminal, and then run the following command, gsettings set org.gnome.desktop.interface ubuntu-overlay-scrollbars false You also can disable it using dconf Editor . First open dconf Editor from the Unity Dash. Then go to com>canonica>desktop and then select interface and then change the scrollbar-mode to overlay pointer Hope this will be helpful. Cheers A.Paul

Forwarding Email from departmental mail to gmail

We check our departmental(Department of Physics, IISc) email either using pine/alpine, which is a command line interface (CLI) based email client, or using very basic web browser based email client squirrelmail. On other hand we use Gmail and YahooMail which has very nice interface. Lot of shortcut key and very nice look. Would not it be very good if we can use the excellent interface of Gmail or YahooMail for checking and sending our departmental mail. There is a very easy way to forward all incoming departmental mail directly to the Gmail or YahooMail or any other mail box. Just you have to create a file on your home folder named .forward. To do this simply login to Departmental site using ssh command from linux terminal or if you are on windows, login using any ssh client (like secure shell client). Then just run the command $vim .forward then press button I and then write your email id where you want to forward your departmental mail. Now save the file. To save just press

How to associate files with PlayOnLinux installed MS Office

Though there is LibreOffice for Ubuntu, lots of time we deal with documents that created by MS office and some time those file does not open properly with LibreOffice , specially if those contains lots of equation and figure. There is a very good solution, you can install MS Office with wine , Specially with Play On Linux . Play On Linux automatically configure wine and downloads all the required libraries, so that MS Office works fine. You can install MS Office 2003, 2007 and 2010 with Play On Linux . Play On Linux creates shortcut in desktop from where you can easily lunch so files. But only problem is that neither MS Office packages (Like Word, Excel, Power Point) shows up in application search on dash nor it appear in right click and open with option. But with some effort you can make it work properly as native app. You have to create two desktop file for each Office program (Word, Excel etc). One each for associating with particular file type and other for program to

Stopping Google Chrome to start automatically at windows start-up.

Google chrome is one of the most popular web browser. It is very good and have lot of very good options. It is highly configurable and have lots of add-on. But one thing that I found is irritating is it starts up at the starting of windows in background. Though I have installed Google Chrome but mostly I use Firefox, so I don't want Google Chrome to run at start-up. Because it uses some of resources. Click on the taskbar icon of Google Chrome and Un-select the option "Allow to run in background". It will stop running in background again on start-up.  Cheers A.Paul.

Un attended distro upgrade in Ubuntu

We use Ubuntu as this is one of the greatest Linux distro. In every 6 months Ubuntu is upgraded. The problem with up-gradation of Ubuntu is that it takes a lots of time and it is interactive. That is you have to be there to answer some question at the time of up-gradation. This is really painful. So if you decided to do the up-gradation overnight, this is not possible. But fortunately there is a way you can do this in no-interactive way. You can use following command. do-release-upgrade -d -f DistUpgradeViewNonInteractive But be careful that it will always go to the default setting. If you want to change some setting from it's default to some another one you can do that using sudo dpkg-reconfigure . cheers A . Paul

Adding more than one author with different affiliation in LaTeX

Image
We can manage more than one author with different affiliation using \authblk package. Here I am giving a simple example and its output. \documentclass{article} \usepackage{authblk} \author[1]{First Author} \author[2]{Second Author} \author[1]{Third Author} \author[2]{Corresponding Author\thanks{email@2nduniversity.com}} \affil[1]{First Department, University1} \affil[2]{Another Department, Another University} \title{Author Affiliation with authblk} \date{} % \begin{document} \maketitle Main Part of your document (including abstract) here. \end{document} And the output will look like Also you can use any other symbol instead of 1,2. You can also add email id for other author also. It will automatically change the symbol accordingly. hope This Will help Source:  http://ctan.org/pkg/authblk http://tex.stackexchange.com/questions/9594/adding-more-than-one-author-with-different-affiliation Cheers A.Paul

Problem appearing IBus indicator in Ubuntu panel

I have set my default input method as IBus , also I have installed some input method also for different languages like "Bengali" or "Hindi". Then I set the Ibus as a start-up program in my system using ibus-daemon command. But while starting it was not showing the ibus button in the panel. To show it I need to restart ibus-daemon I have inserted restart command in start-up program. The command is ibus-daemon -x -r -d This works for me, hope this will also work for you. Cheers A.Paul

Subtitle in latex

Image
There is no direct command to define subtitle in latex. But you can define the \subtitle command using titling package. To do this just insert the following code in the preamble of the latex file. \usepackage{titling} \newcommand{\subtitle}[1]{%   \posttitle{%     \par\end{center}     \begin{center}\large#1\end{center}     \vskip0.5em}% } And then you can define subtitle using the following command. \subtitle{Subtitle Here} This will show the subtitle bellow your title when you use \maketitle command. Minimum working example Code \documentclass[10pt,a4paper]{article} \usepackage{lipsum} \usepackage{titling} \newcommand{\subtitle}[1]{% \posttitle{% \par\end{center} \begin{center}\large#1\end{center} \vskip0.1em}}% \title{This is the title of the document} \subtitle{This is subtitle} \author{Apurba Paul} \date{January 08, 2013} \begin{document} \maketitle Body of the document. \lipsum[1] \end{document} Output