Tag Archives: ubuntu

Redmine + Gitolite integration

I’m a big fan of both Redmine, the project management web application and Git, the distributed version control system.

Recently, I learned that it’s possible to integrate Git into Redmine so that git repositories for a project can be created via the Redmine web interface. This is done using plugins which connect Redmine with git hosting software: either gitosis or more recently, gitolite.

Unfortunately, this is a deeply-confusing process for novices like myself. There are multiple forks of the plugins, long threads in the Redmine forums that discuss various hacks/tweaks to make things work and no one authoritative source of documentation. After much experimentation, this is what worked for me. I can’t guarantee success for you.

Read the rest…

R 2.12 to 2.13 package upgrade

If you:

  • use Linux
  • have just upgraded your R installation from 2.12 to 2.13
  • installed some/all of your packages in your home area (e.g. ~/R/i486-pc-linux-gnu-library/2.12) and…
  • …are wondering why R can’t see them any more

just do this:

# at a shell prompt
cp -r ~/R/i486-pc-linux-gnu-library/2.12 ~/R/i486-pc-linux-gnu-library/2.13
# in R console
update.packages(checkBuilt=TRUE, ask=FALSE)
# back to the shell
rm -rf ~/R/i486-pc-linux-gnu-library/2.12

update: corrected a typo; of course you need “cp -r”

First cautious steps with CUDA

I recently obtained an account on our GPU cluster, so I thought I should get my head around some of the technology that drives GPU computing.
Put simply, GPUs can be used to perform calculations and since there are many processors on a GPU, this can lead to quite substantial speed increases as compared with CPUs. NVIDIA are leading the way and they provide libraries and software tools for people interested in this field.
Development is typically performed using C, C++ or Fortran. I’m not a compiled languages guy – I could just about manage a hello world in C – so I’m relying on tools built by other people, such as R gputools.
Step 1 is to download and install the required libraries, toolkit and possibly, drivers. I ran into a couple of minor problems on my machine, so I thought I’d document them here.
Read the rest…

Beware of rogue header files (Bioconductor installation)

Just a short note concerning a “gotcha”.

As I have many times before, I opened an R console on my newly-upgraded (to lucid 10.04) Ubuntu machine, typed source(“http://bioconductor.org/biocLite.R”) and began a Bioconductor install with biocLite(). Only this time, I saw this:

Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared library 
 '/home/sau103/R/i486-pc-linux-gnu-library/2.11/affyio/libs/affyio.so':
  /home/sau103/R/i486-pc-linux-gnu-library/2.11/affyio/libs/affyio.so: undefined symbol: egzread
ERROR: loading failed
* removing ‘/home/sau103/R/i486-pc-linux-gnu-library/2.11/affyio’

A quick email to the Bioconductor mailing list put me in touch with the very helpful Martin Morgan, who suggested that I check my zlib libraries. Sure enough, the rogue “egzread” was found in /usr/local/include/zlibemboss.h, along with a second zlib.h file, in addition to /usr/include/zlib.h.

grep egz /usr/local/include/zlibemboss.h
> #define gzread egzread

I moved the rogue zlib.h out of /usr/local/include and order was restored.

So in summary, watch out when installing EMBOSS on Ubuntu – it seems to mess with things that it should not.

MongoDB and Ubuntu 10.04

Fans of MongoDB and Ubuntu, rejoice. Installation just got easier, with the appearance of mongodb in the Ubuntu repositories.

However – the latest version in lucid is 1.2.2, whereas you want the very latest, 1.4.2. All the instructions are here. As usual, it’s just a case of adding a line to your sources list, importing a GPG key and then:

sudo apt-get update
sudo apt-get install mongodb-stable

Configuration lives in /etc/mongodb.conf, databases live in /var/lib/mongodb, logging goes to /var/log/mongodb/*.log.

What I learned this week about: productivity, MongoDB and nginx

Productivity
It was an excellent week. It was also a week in which I payed much less attention than usual to Twitter and FriendFeed. Something to think about…

MongoDB
I’m now using MongoDB so frequently that I’d like the database server to start up on boot and stay running. There are 2 init scripts for Debian/Ubuntu in this Google Groups thread. I followed the instructions in the second post, with minor modifications to the script:

# I like to keep mongodb in /opt
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/mongodb/bin
DAEMON=/opt/mongodb/bin/mongod
# you don't need 'run' in these options
DAEMON_OPTS='--dbpath /data/db'
# I prefer lower-case name for the PID file
NAME=mongodb
# I think /data/db should be owned by the mongodb user
sudo chown -R mongodb /data/db
# don't forget to make script executable and update-rc.d
sudo /usr/sbin/update-rc.d mongodb defaults

nginx (and Rails and mod_rails)
This week, I deployed my first working Rails application to a remote server. It’s nothing fancy – just a database front-end that some colleagues need to access. I went from no knowledge to deployment in half a day, thanks largely to this article, describing how to make nginx work with Phusion Passenger.

Along the way, I encountered a common problem: how do you serve multiple applications, each living in a subdirectory?

# You have:
/var/www/rails/myapp1
/var/www/rails/myapp2
# You want these URLs to work:

http://my.server.name:8080/app1


http://my.server.name:8080/app2

Here’s how to do that:

# Make sure the Rails public/ directories are owned by the web server user:
sudo chown -R www-data.www-data /var/www/myapp1/public /var/www/myapp2/public
# Make symbolic links from public/ to the location which will be the web server document root
sudo ln -s /var/www/myapp1/public /var/www/rails/app1
sudo ln -s /var/www/myapp2/public /var/www/rails/app2
# These are the key lines in the server section of nginx.conf:
server {
        listen       8080;
        server_name  my.server.name;
        root /var/www/rails;
        passenger_enabled on;
        passenger_base_uri /app1;
        passenger_base_uri /app2;
}

That’s me for the week.

Brief notes on Ubuntu 9.04 (jaunty) -> 9.10 (karmic)

Recording my Ubuntu upgrade experience has become something of a tradition, so here goes.

  • Machine 1 (laptop, LG T1 Express Duo). Largely trouble-free. On-board soundcard not seen on reboot. Fixed (temporarily, lost on reboot) using “sudo alsa force-reload”.
  • Machine 2 (various generic hardware, cobbled together over many years). Upgrade smooth until final restart, when machine froze. Rebooted to a blank screen. Fixed by swapping out ATI video card for old NVidia FX5200. Discovered that rsyslog is running riot due to a hot CPU and is trying to fill up /var/log.
  • Machine 3 (Dell Optiplex GX550). Install froze at “stopping winbind server”. Rebooted with rescue CD, mounted and chroot-ed into Linux partition, tried “dpkg –force-all –configure -a”, but to no avail. Reinstalled in same partition, all is working well.

All in all, not very impressed. Canonical, could do better.

Fix Kile for Ubuntu 9.04

Ubuntu/jaunty rocks, on the whole. However, to prove that newer does not always equal better, they threw in a couple of shockers. The first is the upgrade from the excellent Amarok 1.4 to the completely-broken 2.0. Head here to repair the damage.

Kile is by far my favourite LaTeX editor and suffered, though not as badly, in the upgrade from 2.0 to 2.1. Reports of various problems litter the web; in my case I see broken toolbar buttons that do nothing when clicked. This fix is much simpler. Just “sudo apt-get remove kile”, scroll to the bottom of the intrepid package page, choose your architecture, download the deb file and “sudo dpkg -i kile_2.0.1-1ubuntu1_i386.deb”. I had no dependency problems and it works just fine.

Finally – open up Synaptic, find kile and from the Package menu item select “lock package”, to prevent future upgrades.

Update: a few days after writing this, an apt-get dist-upgrade upgraded my Kile to 2.1 (despite the “lock package”). However, the broken buttons issue is now fixed for me. Go figure…

ATI 8.42.3

Just a quick and boring hardware post for those Linux users stuck with ATI video cards. Release 8.42.3 of the proprietary fglrx driver now supports AIGLX and the composite extension (which means compiz-fusion and cool desktop effects without the need for Xgl).

My own experience on Ubuntu 7.10:

  • Installation relatively painless using any of these guides: one, two, three
  • Performance reasonable except that (1) cube rotation a little choppy, (2) 3D GL apps flicker terribly (fix: turn off compiz)
  • Much less CPU/RAM usage than when running Xgl

If you´re happy with the Xgl solution, stick with it until things improve. Some progress, at least.