program installs

I feel like a lot of my posts are basic software installs. One day, this will become second nature, I’m sure…

To play around with more Java programming, I’ve decided to try out Eclipse and use Eclipse instead of JGRASP. Eclipse has so many features to help simplify the programming process; I’m irritated I didn’t take my sister’s advice and install this during my computer programming course.

I’ve been taking a computer programming course and finally decided I’d like to have some sort of version control so that I can revert to older versions of the programs I’m writing in case I totally jack something up.

Downloaded SmartGit and moved the tarball gzip to my Home directory and upacked/extracted the files by double-clicking.

Ironically, since I selected SmartGit based on it having a GUI, after unpacking the file in my Home directory, I couldn’t figure out how to start/install the program (no GUI for that, I guess!). So, I took a look at the readme.txt file in the SmartGit folder. Here’s what it reads:

Installation

SmartGit itself does not need to be installed; just unpack it to your preferred
location and launch the bin/smartgit.sh script. It might be necessary to define
the SMARTGIT_JAVA_HOME environment variable pointing to the used Java home.

Well, this doesn’t seem like the best start for selecting a program that should make using easier, due to the existence of a GUI. I guess I’ll have to launch it the “old fashioned” way…

Change to the directory containing the smartgit.sh script:$cd /smartgithg-6_0_5/bin

Launch SmartGit:$./smartgithg.sh

SmartGit launched and here are the steps that I went through to get it configured:

1.See Git Executable location – Didn’t change anything.

2.Select SSH Client – Didn’t change anything.

3. Enter username/e-mail – Didn’t enter anything here.

4a. Select a hosting provider for online repositories – I already have a GitHub account, so I selected that.

4b. Selected GitHub…

4c. Generated a GitHub API token on the GitHub website…

4d. Continued API token stuff…

5.SmartGit detected “existing” local Git repositories – Not sure how/why these get detected as Git repositories, since I haven’t used them as such.

6.New or existing repository – Selected to create a new repository.

7.Weird message – I just hit “Initialize”

Now, I want to make an alias so that I can launch the program without having to remember the location all the time. So, going back to my post on creating aliases in the .bash_aliases file, I’ll add the following to the .bash_aliases file so that I can easily launch SmartGit without having to remember where it is on my system:

Well, been trying to get the IPython “nbconvert” command to run, to convert some IPython notebooks to html and/or slides. However, when I type this in Terminal:

samb@Mephisto:~$ ipython nbconvert

I get this output:

[TerminalIPythonApp] File not found: u'nbconvert'

This is weird because “nbconvert” is supposed to be built into IPython. Looking around the web, it seems as though “nbconvert” is only built in to IPython versions >1.0. Let’s check my version of IPython:

OK, done. To be safe, will reboot computer and then verify IPython removal has been completed.

After restarting, typing “ipython notebook” in to Terminal indicates that it is not installed and suggests I can get, and install, IPython by entering “sudo apt-get install ipython”. However, I’m going to follow the instructions on the IPtyhon install page, which instructs the user to enter: sudo apt-get install ipython-notebook

This is how things turned out:

See that? “Setting up ipython-notebook (0.13.2-2)…” That’s the same version I had previously! So, I guess I need to hunt down the more recent version. At the bottom of the IPtyhon install page there is a link to the IPython Downloads Archive and this is what’s in it:

Lo and behold, the current version, which is MANY versions removed from the version that “apt-get” is retrieving. Clicking on that link brings me to a page with a “tarball” (a file that ends with “.tar.gz”) and a ZIP file.

I then moved (using the GUI) the un-tarred and un-gzipped ipython-1.2.1 folder to my /home/samb directory and followed the installation directions for installing IPython from source.

The Terminal showed a bunch of stuff. Let’s see if using “nbconvert” does anything.

Result? Typing “ipython nbconvert” spits out a whole bunch of stuff; which is great!

I’ll launch IPython and see if it still sees my configuration file from the initial install/configuration last week.

Didn’t work! Launched IPython (ipython notebook) and this is what I got:

ImportError: No module named jinja2

Looking back at the installing IPython from source page, it doesn’t indicate that required dependencies are not installed by default. Maybe that’s always the case when installing packages from source when using Linux? I have no idea, but it would certainly be nice if the IPython instuctions indicated that, particularly since using “apt-get” doesn’t retrieve the most recent IPython build, thus potentially requiring people to download the source file.

Now that we’ve encountered this problem, I’m going to try to install IPython using “pip”. However, when I try running “pip” from Terminal, I’m informed that “pip” is not installed on the system. So, we’ll get it:

Not thrilled by the “Requirement already satisfied” output, since I uninstalled the last IPython (used the Ubuntu Software Center Package Manager). And, guess what. The notebook won’t launch and still spits out the error message about no jinja2 module. I’ll try restarting the computer and see if that helps.

And…

It did not help. I’m going to just delete the python2.7 directory found in /usr/local/lib, since that’s where all the IPython stuff seems to live. Deleted the directory:

samb@Mephisto:~$ sudo rm -rv /usr/local/lib/python2.7

rm = remove
-rv = recursively (r), verbose (v) to see all the files as they get deleted

Tried using “pip” again:

pip install ipython

It downloaded the ipython1.2.1 tarball, extracted stuff and then…

couldn’t write to the /usr/local/lib directory due to lack of permissions.

So, I re-ran the command with “sudo” and everything seems to have installed properly and completely. Trying to launch IPython notebook yields…

THE SAME JINJA2 module message!!!

Ahhhhh. Just realized I didn’t run:

sudo pip install ipython[all]

Totally forgot the “[all]”. Let’s try again.

Removed the python2.7 directory, as before. Ran sudo pip install ipython[all]. Ha! Well look at that! Here’s the end portion of the output from the that:

Now, try to launch IPython and… Success!! I have finally managed to upgrade IPython! Not only that, but it has retained my previous configuration set up for the default notebook location. And, finally, test out if “nbconvert” is present. Yep! It’s there (just typed: ipython nbconvert)!

Here’s the quick summary of what I ended up having to do:

1. Had to delete the Python2.7 folder (located at /usr/local/bin).

2. Had to install “pip” (sudo apt-get install python-pip)

3. Used “pip” to retrieve and install most current version of IPython (sudo pip install ipython[all]

When using the “sudo gedit” command in Terminal to open my script “/etc/profile.d/myenvvars.sh”, I noticed I was getting the error message:

(gedit:2359): IBUS-WARNING **: The owner of /home/samb/.config/ibus/bus is not root!

The error message wasn’t preventing “gedit” from opening or anything; I just noticed that the Terminal had spit this out while I was editing my script file in “gedit”. So, curiosity got the best of me and I started to see if I could find a way to eliminate the messag.

After looking around the web, it seems that I should be using the “gksudo” command instead of regular old “sudo” when opening programs that have a graphical user interface (GUI).

So, let’s try opening the script above using “gedit” and “gksudo”.

samb@Mephisto://etc/profile.d$ gksudo gedit myenvvars.sh
The program 'gksudo' is currently not installed. You can install it by typing:
sudo apt-get install gksu

Well, it turns out that “gksudo” isn’t installed by default on this version of Ubuntu (13.10). However, it’s nice that the output tells you how to obtain “gksudo”. So, let’s try that out and try running “gksudo” again.

Downloaded to my large Windows partition and extracted the files by double-clicking.

The primary “configuration” that I’m interested in is adding the BLAST directory (/media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+/bin) and the BLAST database directory (/media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+/dbs) to the Linux “PATH”.

One question is, why? What’s the point? Well, I guess those are two questions, but whatever.

The primary advantage to adding these two directories to the system PATH, is simply a matter of efficiency. To run BLAST in the current configuration, I have to type something like this (after the $):

Then, type out the necessary instructions to initiate BLAST and provide the location of the BLAST database:samb@Mephisto:/media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+/bin$ ./blastn -db /media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+/dbs/RickettsiaGBnt20140228

By adding the BLAST and database directories to the system PATH, all I’d have to enter would be:

samb@Mephisto:/$ blastn -db RickettsiaGBnt20140228

Much cleaner and efficient. No changing directories, no lengthy directory paths.

But, those instructions don’t tell you how to make a script to automatically append the BLAST and BLAST database locations to the system PATH so that you don’t have to amend the PATH each time you want to use BLAST! Lame!

Additionally, the instructions say that a “.ncbirc” file is required in the Home directory. Well, should the file have a name or do I just leave the file literally “.ncbirc”? Is it like a .htaccess file then? I guess I’ll just have to try it out. Ugh.

Anyway, here’s how I got it working so that I don’t have to change directories to the BLAST folder each time and I run BLAST and so I can just enter the name of a BLAST database without having to type out the full path of the database.

1. For dual boot systems, BLAST cannot be installed on the Windows partition. Linux can’t do the proper writing/executing of files on that partition due to a difference in partition formatting (Windows is NTFS).

2. Can’t simply move BLAST package from one location to a new one. It seems that the BLAST package needs to be re-installed in the user’s desired location. However, this could be an issue related to partition formatting, as I tried to simply move the BLAST folders from the Windows partition to the Linux partition. When I did this, couldn’t get BLAST to run, even though it was now on the Linux partition.

3. Created a script file in the /etc/profile.d folder called “myenvvars.sh” so that the locations of the BLAST executables and BLAST databases will be loaded into the system PATH upon logging in to the computer, as opposed to having to manually append the locations to the PATH each time I start the computer. Put this info in the myenvvars.sh file:!#/bin/bash
export PATH=$PATH:/media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+/bin:
export BLASTDB=/home/samb/BioinformaticsTools/ncbi-blast-2.2.29+/db

The “!#/bin/bash” identifies the file as a script file to the system. The other two lines “export” the variables (PATH and BLASTDB) so that they are available to use by the rest of system.

4. Created the “.ncbirc” file (called it blastdb.ncbirc) and put it in my computer’s “Home” folder. File contains this text:[BLAST]
BLASTDB=/home/samb/BioinformaticsTools/ncbi-blast-2.2.29+/dbs

I already have Dropbox installed Windows and don’t want a separate installation on my Linux partition taking up additional space (my SSD is 256GB, but that space is used up surprisingly quickly)

In theory, this should be straightforward; just install Dropbox on the Linux partition and point it at the Dropbox folder on my Windows partition. However, some pre-installation Googling revealed that it’s not that easy. Followed the wonderful instructions on Gain Oloya’s blog.

Turns out, the very first step in the process doesn’t actually involve Dropbox at all! I had to set up Ubuntu to automount my Windows partition, since Ubuntu doesn’t do this by default. Otherwise, when the computer is started, Dropbox runs and can’t find the Dropbox folder because it exists on a partition that is inaccessible to Ubuntu (until that partition is accessed by the user).

Happily, there is a sort of graphical user interface (GUI) to add items/programs/commands to Ubuntu’s start up list: Startup Applications. This is easily accessed by pressing the “Windows” key on the keyboard (or clicking the Ubuntu button in the sidebar) and searching for Startup Applications.

Once in Startup Applications, just press the “Add” button, enter a name and description for your application in the appropriate fields and then enter the following command in the “Command” field:

After installation completed (but before going through the Dropbox set up procedure), this window popped up:

It seems like I should press the “Restart Nautilus” button, but instead I pressed the “Next” button. This initiated the Dropbox setup procedure. I entered my account info and selected “Advanced Installation,” which allows you to select where to install the Dropbox folder on your system. Navigated to the directory on my Windows partition where my current Dropbox folder exists; don’t navigate beyond this (i.e. into your existing Dropbox folder). Dropbox notified me that there’s an existing Dropbox folder. Just cruised through the rest of the setup wizard. Dropbox started syncing and doing so without duplicating files!