Category Archives: Linux

Importing and prepending subversion history to a git repo

So, when I converted some repos from svn to git a few years ago I just threw away the history (I think the git-svn tool wasn’t working or I was in a hurry or something). Anyway, today I was reminded of this and thought I’d backup all my svn repos into git and where possible prepend the history to the repositories. Based on this stackoverflow post and some experimenting I did the following:

Automatically removing a torrent when it has finished downloading

So as not to saturate my (very limited) uplink when a torrent as finished downloading (using transmission-daemon on my Raspberry Pi) I wanted it to be removed automatically. There were a number of docs on the web about how to do this but here is a simple 2-line file that will do it:

Save this as /usr/bin/torrent-complete.sh, chmod +x the script. Stop transmission-deamon (you need to do this rather than a restart as it always dumps the current live config on stop/restart so any changes you make while it is running will be nuked) Then open up /etc/transmission-daemon/settings.json and add (or modify) the following lines:

Start up transmission-deamon and there you go.

Creating a git history out of a collection of tarballs

So, recently I found some projects from 10+ years back that I had a load of tarballs/zip files for which were taking up quite a bit of backup space. I figured I could unzip each of the repositories in date order and put the changes into a git repository in order to save a bit of space. Here are the commands to do this:

I also did this with some backups from an old psion – converting the 50 or so tarballs to a git repo reduced 500mb of backups to 30mb of git…