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…
- 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
# back to the shell
rm -rf ~/R/i486-pc-linux-gnu-library/2.12
update: corrected a typo; of course you need “cp -r”
A couple of posts ago, I outlined a small bash script to generate an index.html file, containing links to other files in a directory. This was for generating links to files in a Dropbox public directory.
I had completely forgotten about the very useful UNIX/Linux command named tree. If not installed, it should be in your distribution repository (e.g. sudo apt-get install tree for Ubuntu/Debian). Then simply:
tree -H . > index.html
Next, navigate to index.html at the Dropbox website and you should see something like the tree on the right. It’s a little ugly and obviously, not as convenient as something like Github, but can be a good quick and dirty fix if you need to share a hierarchy of directories and files.
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.
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…
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
# you don't need 'run' in these options
# I prefer lower-case name for the PID file
# 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:
# You want these URLs to work:
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:
That’s me for the week.
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.
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…
Here’s a common problem solved: how to generate a pretty picture of your database schema. A Google search throws up all manner of home-brewed solutions using graphviz, perl scripts and so on. Or you can make life easier and simply install SQLFairy
Under Ubuntu: as simple as “sudo apt-get install sqlfairy”.
Next, dump your database tables, e.g. for MySQL:
mysqldump -u username -p -d mydatabase > mydatabase.sql
Finally, for a PNG image of your schema:
sqlt-graph -f MySQL -o mydatabase.png -t png mydatabase.sql
Too easy. Example shown is the BioSQL schema.
update: if your schema lacks explicit foreign keys, try the –natural-join options (man sqlt-graph, man sqlt-diagram)
One thing I’ve learned in my current job is that some familiarity with Linux tools for processing text files: awk, sed, grep, head/tail, cut/paste and so on, often provides a speedier solution than writing a script in (insert scripting language of choice here). I know this stuff is trivial to shell gurus, but I still get a little buzz out of it. A couple of real-life examples.
Read the rest…