Category Archives: infrastructure

Combining two git repositories into one

I went down some dead ends trying this, but it was pretty easy in the end. Here’s how I did it, because my search keywords didn’t turn up what I was looking for first.

I have two repositories, AAA and BBB, and I want them to end up looking like below. Also, I don’t want to keep using the old repositories, but I do most definitely want to see the full history of each file.

    AAA   
    AAA/aaa-oldAAA
    AAA/bbb-oldBBB

Or something along those lines anyway. I chose AAA to be the new final parent, so I started by moving all the original AAA files down a level. This was straightforward

    cd AAA
    mkdir aaa-oldAAA
    git mv x y z aaa-oldAAA
    git commit

I then did the same thing in the BBB repository.

Now, the fun, adding the other repository as a remote in this repository.

    cd AAA
    git remote add bbb-upstream /full/path/to/old/BBB
    git fetch bbb-upstream
    git checkout -b bbb-u-branch bbb-upstream/master

This is pretty neat. Right here, you’re only looking at the code from the BBB repository! If you git checkout master again, you’re back looking at your AAA/aaa-oldAAA repository. This makes sense when you think about it, nothing says that branches have to have the same or even related code in them.

Now, we just merge the bbb-u-branch into our local master!

   git checkout master
   git merge bbb-u-branch
   git remote rm bbb-upstream # no longer needed

Presto! Finito! The only problem I had was a merge conflict in the .gitignore files.

Note: to see the logs of files that have been moved, you need to use git log --follow filename.blah This has nothing to do with the dual merge however.

open source webmail packages review

Far from complete, but some notes on the few I tried. First, this is for a setup basically following this linode guide for postfix, dovecot and system user accounts. I’ve slightly modified it to work with multiple domains. [1]

I have a few requirements, first and foremost that it must be able to support multiple sender identities. This will be used by people who have mail from multiple accounts collected here, and they need to be able to reply as that account. Secondly, the address book must be able to support groups. My mother users the webmail while travelling, and she has come to depend on this. Thirdly, and not _quite_ as essential, it would be nice to be able to filter messages into a different folder. (I know that this could/should be done server side, but my mother wants to be able to do this herself, and a) she’s not going to configure postfix, and b) I’m not always going to be around to configure it and c) I don’t even (yet) know how to do that)

Imp – discarded due to excessive requirements. I’m not looking for groupware

Squirrelmail – near effortless install. apt-get install squirrelmail I then had to add an Alias/Directory config somewhere in apache. Squirrel provides the basic config in /etc/squirrelmail/apache.conf. I added this to my apache config, and presto, it all worked. Multiple identies works easily, but address groups comes via a poorly packaged and documented plugin, which I didn’t even bother trying out.

Atmail open / @Mail Open source – nice slick installer. Then pretty much epic fail. It is incompatible with dovecot out of the box. It tries to login with a full user@domain, which doesn’t work when I’m using system accounts. There’s a fairly well known hack to make it work, but this didn’t inspire confidence. Address groups worked out of the box, but you only get a single identity. (With the login hack, you can actually logout and back in again to get a new idenity, but that is just worthless)

Roundcube – I left this for last, as I’d heard it was notorious for being bloated, sluggish and full of security holes. It may have security holes, but most stuff does, and it’s certainly not bloated and sluggish anymore. I’m using version 0.5.1, and it is so far much much better than the rest, and the only one I’m going to be opening up for my mother to try out. Installation was not quite effortless, but pretty good. The installation instructions for setting up the db ahead of time are pretty good. [2] A slightly unusual copy/paste from the generated setup webpage to the config files on disk, but hey, it works pretty well.

Multiple identities work, and are intuitive to both setup and use. Address groups work, but are not quite as easy to use. The setup wasn’t instantly obvious (There’s a plus button on the bottom of the screen) and adding users to groups wasn’t immediately obvious either. You just drag them over the group name. :) I guess I’m used to older webmail clients :) Also, to send mail to a group, you need to start typing the name of the group in the To: field. I haven’t found a way to select a group/groups from a checkbox.

I ignored BlueMamba and IlohaMail for having no recent updates. I’d had quite enough of trialling webmail by now, and roundcube was clearly in front. I’d be interested in hearing any other suggestions though if anyone’s out there :)

  1. I had to add a virtual_alias_domains = ekta.is for each extra domain, and I had to add the base domain to the mydestination line in postfix’s main.cf file
  2. roundcube supports a few different databases, including sqlite, but only sqlite2 ?! what decade is this?

Site availability problems…

So, some of you got some breakages today, maybe part of yesterday. Sorry aboutthat :( I’ve moved this blog from some shared hosting onto a VPS from linode.com, along with some other projects from home and other computers. This is the first time I’ve ever actually moved a real live website before, so there was a little bit of learning.

I was clever enough not to try and write any new blog posts while it was transitioning, but what I missed was some apache config that wordpress requires, mod_rewrite. I didn’t have this turned on on my new host at first, and I only checked that the front page came up, not all the links. doh.

So, why the move? Well, it wasn’t because of any problems with the old host. I’ve used ICDSoft.com for ever, (back in 2003) and have been extremely satisfied. Good prices, consistently upgraded plans, and phenomenal support, both the turn around time, and the quality of answers.

However, I have a few other projects lined up, and some of them required/wanted things that just aren’t an option on shared hosting. Spatial databases, python websites via WSGI for performance, that sort of cool things. So I looked at the price of a host that would manage that, and found that, really, I should be able to move all my shared hosting accounts onto one single VPS. false.ekta.is was the first, and in a week or two, if it all goes well, I’ll look at moving some other domains over to it as well.

One of the things I’m already missing however, is managed email. I wanted more flexibility over the web services side, but I was really quite happy having a nice web gui for managing email accounts, and some basic webmail. Now I have to set up postfix/dovecot, and handle mail myself for multiple domains! (And, probably train my mother on a slightly new webmail!)