## Wednesday, 18 December 2013

### Installing and using Sage just got even easier.

+Sage Mathematical Software System just moved to git!

This is awesome news for a variety of reasons. First of all it's great for development (you can take a look at the github repo here: https://github.com/sagemath/sage. There's a good talk about the git workflow for development by +Volker Braun here: http://www.youtube.com/watch?v=0tejiKN5ctY.

The other great reason why this is awesome is that it just got really easy to use and install Sage.

Here's a short video demonstrating everything I've done below:

If you're familiar with git then you know this but if you're not then you can simply open up a terminal on anything *nix (linux/Mac OS) and type the following:

$cd ~$ git clone git://github.com/sagemath/sage.git

This basically goes to the git repository on github and clones it to a folder called sage in your home directory (if you don't have git installed you'll have to do that first).

Once you've done that you need to 'make' sage:

$cd ~/sage$ make

This will take a little while (it goes and gets most of what you need so it's hard to say how long as it depends on your machine) but after that you'll have Sage on your machine. If you're still in the ~/sage directory you can simply type ./sage to start sage.

You'll want to add sage to your path so that you can use it from any directory. In this video I did this by using a bit of a trick but here's I'll do something simpler: create a symbolic link to the sage file in ~/sage directory and place that symbolic link in your path (in /usr/bin/local). To do that type this:

$ln -s ~/sage/sage /usr/local/bin/sage Now you can type sage anywhere and you'll get sage up and running. What's really great about all this is that if and when updates/development happens you can just git pull to get all up to date changes. Based on the +Sage Mathematical Software System post on G+: here: it looks like you can already play around with the develop branch... Awesome. Of course if you want the easiest way to use Sage then simply grab an account on +The Sagemath Cloud. I gave a talk last week at the Cardiff Django/Python user group about it and +William Stein was kind enough to drop in and take some questions: http://www.youtube.com/watch?v=OYVLoTL4xt8 (sound quality isn't always great because I move around a fair bit...) ## Friday, 13 December 2013 ### Setting up bup as my backup system, making it act like a timemachine. This is one of those: 'writing this post to make sure I remember how I've done this'. +William Stein posted about bup which he is using to backup +The Sagemath Cloud (if you haven't seen that before make sure you go check it out, here's a video in which I describe it: http://goo.gl/5DtYQq). bup is a piece of backup software based on git. Here's a talk by +Zoran Zaric explaining it: The documentation isn't too great for bup, this is the blog post I found the most helpful on it: http://kacper.blog.redpill-linpro.com/archives/tag/bup the ubuntu man pages are also pretty helpful. Anyway, here's how I setup bup to work like apple's time machine. Once bup is installed (super easy following readme instruction on Mac OSX and ubuntu). I run:$ bup -d pathtochosenharddrive init

By default bup uses the ~/.bup directory for everthing. Using the -d flag tells bup to run whatever command (in the above instance: init)  in a chosen hard drive. If you're happy to backup to your ~ then ignore all instances of -d pathtochosenharddrive in the following. (Note you can also change $BUP_DIR to take care of this, and you'll also need to know the path to your given hard drive). This initialises a git repository (you only need to do this once really). I put the following in a script (backup.sh): bup -d pathtochosenharddrive index -ux /directorytobackup bup -d pathtochosenharddrive save -n backupname /directorytobackup The first line indexes the files (the -ux flags are something to do with recursively going through the files: type man bup index to read more). The second line checks the index and then saves all files as required (giving them a name). To setup this backup script to run every hour I write the following to a txt file (crontab.txt): 0 */1 * * * globalpathtobackupscript/backup.sh To add this to the cron jobs:$ crontab crontab.txt

If you type:

$crontab -l You should see the the contents of the crontab.txt file now added to the scheduled jobs. The first 0 implies that it'll run at the 0th minute, the */1 means every one hour (so you can easily change this), the other * mean 'every', day, month and day of the week. The first time you run this it should take a fair while (especially if you're backing up your whole ~) but afterwards it shouldn't take too long at all. To check what bup has done, run:$ bup -d pathtochosenharddrive ls

That should return:

backupname/

and/or any other names of backups. If you want to see the actual backup snapshots: