Wednesday, 15 October 2014

Simple, secure way to share a git repository

The problem with Windows or NFS file shares is that the contents are not version-controlled and (unless you use the Windows "available off line" feature) not available while you're disconnected from the office network. However, it is very easy to set up a git repository for a team to share code and documents, if they all have at least intermittent access to the same file share.

First install yourself a git command-line client if you have not done so yet (see http://git-scm.com/downloads).

Creating the repository

Assuming that
  • You already have a local git repository called "test-repo", which you want to share
  • Your local git repositories are under %HOMEDRIVE%\%HOMEPATH%\git
  • Your shared git repositories are going to be under \\myserver\myshare\git

To add a remote copy of your own git repository to the share:

>%HOMEDRIVE%
>cd %HOMEPATH%\git\test-repo
>pushd "\\myserver\myshare\git"
>git init --bare test-repo.git
>popd
>git remote add origin "//myserver/myshare/git/test-repo.git"
>git push origin master

Note that the git commands require slashes to be forward - unlike normal Windows commands.

Verify that the file .git\config within your local git repository looks something like this:

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[remote "origin"]
    url = //myserver/myshare/git/test-repo.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
    rebase = true


Ensure that the sections [remote "origin"] and [branch "master"] in particular are set up correctly.

Cloning the repository

Another team member can now share your code - you both push your local commits to the shared repository and pull other team members' commits from it to your local repository. Here's what each team member wishing to access the shared repository should do, assuming that they also have their local git repositories under %HOMEDRIVE%\%HOMEPATH%\git.

>%HOMEDRIVE%
>cd %HOMEPATH%\git
>git clone "//myserver/myshare/git/test-repo.git" test-repo
>cd test-repo
>git pull
>git status

The status should look like this:

# On branch master
nothing to commit (working directory clean)

Making cycling safer!

I have just been alerted to the existence of Collideoscope - a service that aims to collect data about cycling accidents and near misses directly from cyclists, and use it to press for improvements to road safety at accident black spots. What a brilliant idea. You can also use it to educate yourself about areas in which to take extra care when cycling.

Friday, 17 January 2014

Carbon - the EU's chance to shine

I am really concerned that we may be causing irreversible and harmful climate change.

While there is no conclusive proof that humankind is behind global warming, the evidence against us is stacking up more and more heavily.

The planet has some amazing mechanisms for keeping the environment stable, such as soaking CO2 up in the oceans, but these are not infinitely flexible and we may be approaching a tipping point. As an illustration of this, consider a glass filled with water and ice cubes, standing in a warm room. The ice/water mixture stays at 0 degrees as the ice gradually turns to water, but once all the ice has melted the temperature rapidly rises.

While we have not proved that our wasteful use of fossil energy is causing global warming, there is ample evidence that using a lot less won't cause any harm and may in fact stimulate the economy. So it would be logical to reduce our emissions of both greenhouse gases and waste heat as quickly as possible.

More research is needed to identify renewable energy sources that are much more efficient and less environmentally damaging than wind turbines or biofuels. Better insulation and more efficient heating, manufacturing, agriculture and transport are also needed.

Right now, the President of the EU Commission, Jose Manuel Barroso, is weighing a decision that could make or break our planet. His team have just days to pin down carbon emissions and renewable energy targets for Europe until 2030. It’s a very important deal that has been kept very quiet. Some EU countries, prompted by vested energy interests, are lobbying to set extremely unambitious targets. Barroso may opt to avoid a fight by playing it safe. He works in a bubble of politicians, officials and lobbyists, but he is very sensitive to what people think of him, especially now as he embarks on his last few months in the job and hopes to leave a shining legacy.

Avaaz is publishing an ad in the key Brussels paper today calling on Barroso to follow the science. If supported by tens of thousands of e-mail messages from across Europe, this could just jolt him out of the bubble. You can read the ad and send Barroso a message today that the the future of the world is in his hands.

Monday, 8 April 2013

Music by Programmers - Launch Party

Jason Gorman and five of his programming chums have put together an album of original electronic music to raise money for educational programmes at Bletchley Park and The National Museum Of Computing. The charities get every penny of the profits, split 50/50 between them.

The album goes on sale in late April, and Jason's target is to sell 2,000 downloads and raise £10,000. The music industry isn't what it was, and selling music is much harder than it used to be - even for a good cause. Between now and the release date, they're going to need as much help as they can get to spread the word.
Please feel free to publicise their efforts by any means at your disposal.

A special listening party to launch the album on 23rd April is not to be missed. It's going to be small and intimate at a "jolly spiffy pub" near Holborn. Every penny of the £20 ticket price goes directly to Bletchley Park for maths workshops and a programming club at The National Museum Of Computing. And every ticket holder will get a very limited edition CD with bonus tracks!!! Only 100 of these special edition CDs will be produced, so it promises to be a veritable collector's item.

Saturday, 6 April 2013

GCalendar in Joomla: Daylight Savings problem

We recently launched a new Web presence for my German Church using Joomla 2.5. At my suggestion, GCalendar was installed to provide a searchable event calendar and an "upcoming events" module. It all worked splendidly until British Summertime began on 31 March 2013 - and suddenly all calendar events were shown starting an hour early.

We spent days trying to find a way to configure Daylight Savings into the calendar. All it allowed us to do in the global settings was to choose a time zone - of course we had set it to Europe/London - but without an option of respecting Daylight Savings automatically. In despair, I eventually uninstalled the component and reinstalled it. At this point there was a new version (3.0.0) of GCalendar available, so I chose that. In the component control panel there turned out to be an options button at the top right of the screen, which we may simply have missed seeing before. In the options you can set the time zone and once I had done so, suddenly all the times appeared correctly again within the web site. Huge sighs of relief all round.

Could the "Hydrogen Age" be about to dawn?

A team of researchers at Virginia Tech has used bio-engineered enzymes to release high-purity hydrogen from xylose in biomass and waste heat from industrial processes. Sounds too good to be true, but it was not published on 1st April.

Wednesday, 6 February 2013

Free Security Engineering textbook

Ross Anderson of Cambridge has put the second edition of Security Engineering – A Guide to Building Dependable Distributed Systems online as a free download. His explanation: it's the decent thing to do and it actually tends to increase sales of the printed book (borne out by sales of the first edition). Music recording industry, please take note!