mylinuxnotes

Wednesday 20090617

Installing ARB in Ubuntu Hardy LTS

Filed under: ARB, bioinformatics, howto, install, ubuntu — Tags: — jeff @ 9:47 pm

How to install ARB on Ubuntu Hardy LTS.  These are my notes of what worked on my system, and depending on what you already have installed, you may have additional requirements.  (Please feel free to make note of your experience in the comments, if you’d like to share!) This is a modified copy from my previous post for installing in Feisty Fawn.

Make sure you have the prerequisite packages installed:

  • transfig
  • xfig
  • xviewg
  • gv
  • libmotif3

Download the latest ARB for linux at www.arb-home.de.  The download directory contains three files; you need to put all of them in the same place: arb_install.sh, arb.tgz and zcat. No need to untar anything.

In the directory where you put these downloads,

$ sudo sh arb_install.sh

The script asks a bunch of installation questions, and it’s pretty self-explanatory about what it’s asking, so go nuts.  I used all the defaults for a stand-alone computer, except I used /opt/arb as the install directory instead of /usr/arb.

When the script exits, it mentions editing something in /etc (but it doesn’t say what).  In Feisty, you need to add the following lines to the /etc/bash.bashrc file (assuming you used /opt/arb as the installation directory like me–otherwise, you may have to replace “opt” below with “usr”):

ARBHOME=/opt/arb;export ARBHOME
LD_LIBRARY_PATH=${ARBHOME}/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
PATH=${ARBHOME}/bin:${PATH}
export PATH
alias arb=/opt/arb/bin/arb
echo “This shell is ARB-enabled.”  #Not necessary.  Just for fun.

It now seems to work!  You can delete the installation files.  Or, you can change your current installation by running arb_install.sh again.

Thursday 20071018

LAMP Before Lunch

Filed under: Drupal, LAMP, MediaWiki, howto — jeff @ 3:31 pm

I got a lab server up and running in a couple of hours. Ubuntu is awesome! The functionality includes: LAMP, a Drupal website on the front end, a MediaWiki site for organizing the lab’s SOPs and other documents, and an SSH server so lab members can use linux bioinformatics software remotely, and stream X onto their Windoze and Mac desktops. I’m recording this here because there were a lot of unnecessary or contradictory instructions available online.

All you need: Static IP/domain name assigned (thanks to the department’s IT support), an old otherwise-useless desktop PC (a 400 MHz Dell with 256 Mb memory), and the Ubuntu (Feisty) Desktop CD (I wanted X off the bat, so didn’t use the server CD).

1. Install and update Ubuntu (took ~30 minutes)

2. Install the server software

$ sudo aptitude install apache2 firestarter openssh-server php5-mysql libapache2-mod-php5 mysql-server

3. Set up the firewall

$ sudo firestarter

Use the GUI wizard to set up iptables to allow incoming traffic on ports 22 and 80 (before you run firestarter, ALL of your ports are open by default).

4. Set up mysql to have a root password (don’t forget the semicolon at the end of every line when you are in the mysql> prompt):

$ sudo mysql -u root
mysql> UPDATE mysql.user SET Password=PASSWORD(‘your_new_password‘) WHERE User=’root’;
mysql> FLUSH PRIVILEGES;
mysql> quit

5. Install MediaWiki and Drupal.

$ sudo aptitude install mediawiki drupal-5.1

The installation will take care of all the basic database configuration. You will be asked to provide the install scripts with the mysql administrative password that you just created, and you will also be asked to create some new passwords. The email server will ask you how to set it up. Do as you wish, but personally I left email unconfigured (ie broken). This breaks the email-confirmation features of Drupal and MediaWiki, but it also is a safeguard against unwanted external users having access to an email server. :)

Now you can setup mediawiki at http://localhost/mediawiki and Drupal at http://localhost/drupal

The first thing I did was disable anonymous user account creation in both systems, since we have a small group and it’s okay if an administrator has to set up an account for new people.

Also, when someone visits the URL, at the moment they see an ugly Apache default blank screen. Yuck. To automatically forward visitors to the drupal homepage, create this file:

$ sudo gedit /var/www/index.html

And put the following code into the file:

<html>
<head>
<META http-equiv=“refresh” content=“0; URL=drupal”>
</head>
</html>

Now, when a browser visits http://YOUR.SERVER/ it will be redirected to http://YOUR.SERVER/drupal. And, of-course, if you want someone visiting your site to know how to get to the wiki, you can provide them with a link to http://YOUR.SERVER/mediawiki in your Drupal website.

Configuring and customizing Drupal is cake using your web browser. For MediaWiki, you will have to delve into the LocalSettings.php file (located in the /usr/share/mediawikiX.X directory), unless you’re okay with the default settings.

Tuesday 20070925

howto: install ARB in Ubuntu Feisty

Filed under: ARB, bioinformatics, howto — jeff @ 3:48 pm

Make sure you have the prerequisites (most notably, in Feisty, the libstdc++2.10-glibc2.2 package, which I had to do some digging to figure out):

  • transfig
  • xfig
  • xviewg
  • gv
  • libstdc++2.10-glibc2.2 (in the universe repository)

Download the latest ARB for linux at www.arb-home.de.  The download directory contains three files; you need to put all of them in the same place: arb_install.sh, arb.tgz and zcat. No need to untar anything.

In the directory where you put these downloads,

$ sudo sh arb_install.sh

The script asks a bunch of installation questions, and it’s pretty self-explanatory about what it’s asking, so go nuts.  I used all the defaults for a stand-alone computer, except I used /opt/arb as the install directory instead of /usr/arb.

When the script exits, it mentions editing something in /etc (but it doesn’t say what).  In Feisty, you need to add the following lines to the /etc/bash.bashrc file (assuming you used /opt/arb as the installation directory like me–otherwise, you may have to replace “opt” below with “usr”):

ARBHOME=/opt/arb;export ARBHOME
LD_LIBRARY_PATH=${ARBHOME}/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
PATH=${ARBHOME}/bin:${PATH}
export PATH
alias arb=/opt/arb/bin/arb
echo “This shell is ARB-enabled.”  #Not necessary.  Just for fun.

It now seems to work!  You can delete the installation files.  Or, you can change your current installation by running arb_install.sh again.

Wednesday 20070919

howto backup to a usb drive, and sync two computers, w rsync

Filed under: backup, howto, rsync, usb drive — jeff @ 3:36 pm

Step 1.) Know where the usb drive is mounted. I used gparted to format mine with one big ext3 partition named “LinuxBackup” so it gets automounted at /media/LinuxBackup (in Ubuntu).

Step 2.) Create a folder on your usb drive where you want the backup to go.

Step 3.) Install the required program: rsync

Ready to go:

$ rsync -rupogt –delete /SOURCE/DATA/DIRECTORY/ /media/DRIVENAME/SUBFOLDER

Note: the SUBFOLDER on the drive must exist. Also, if I remember correctly there is some significance to there being a following “/” at the end of the source folder name. Your own needs may vary from mine, so look up the rsync options and adjust accordingly. For example, I use the –delete option, which deletes all files and folders on the destination which do not exist in the source. If you don’t use this option, and you rename or move a directory on your computer, you will end up with two copies of the same files, one of them under the old name! BEWARE: the –delete option will also destroy previously backed-up files that you have since deleted on your source computer, and they will be lost forever. Always think before doing this. There is little chance of recovering deleted files from the destination. This is especially pertinent when going the other way, from drive-to-computer. If the destination computer folder contains newer files that aren’t on the usb drive source, the –delete option will destroy them!

For my system, I have a usb drive named LinuxBackup, and two computers: one at work, and one at home. When I’m done working at home I put in the usb drive and run

$ rsync -rupogt –delete ~/Documents/ /media/LinuxBackup/Documents

to put the newest copy of my Documents folder on my usb drive. Then, when I get to work, I load the newest copy of the Documents onto my work computer by running

$ rsync -rupogt –delete /media/LinuxBackup/Documents/ ~/Documents

This would be much easier if I wasn’t firewalled on both ends, since rsync is designed to do this over the internet using ssh. Oh well, the usb drive works well enough. And I have three copies of the data instead of two, which is 50% safer, right?

howto BLAST

Filed under: bioinformatics, blast, howto — jeff @ 3:11 pm

In ubuntu, the BLAST package is called blast2

sudo aptitude install blast2

This installs a whole bunch of blast commands for local and remote searching.  For example, you can search NCBI with a list of fasta entries as queries (sequentially) using the remote NCBI server to do the work:

blastcl3 -p blastp -m 3 -v 10 -b 10 -i infile.fasta -o outfile.txt

Where, here I’m just looking for a few quick top hits.  -p is the important option, where you define the search engine.  In this example I’m using blastp to search protein.  I think the default database is ncbi nr.

And here’s an example of searching a local database using your own cpu:

blast2 -p blastp -m 3 -v 10 -b 10 -i infile.fasta

and an outfile isn’t defined, so it just goes to standard out, ready for pipes.

howto join pdf files

Filed under: ghostscript, howto, pdf — jeff @ 2:32 pm

from an article at newsforge

This command line combines file1.pdf with file2.pdf, to create finished.pdf.  One additional bonus is that if files 1 and 2 weren’t compressed properly, the final finished file will be and it’s always nice to save disk space.

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf

kthxbie

Convert FLV to MPEG

Filed under: flash, howto, mpeg, video — jeff @ 2:21 pm

Great instructions for this at Mr. Mepis

Blog at WordPress.com.