Git: Renaming/swapping “master” with a branch on Github

I was playing around with some code and after having got it working I thought I’d make just one more little quick easy change to finish it off and found that I was descending a spiral of additional complexity due to the environment in which it had to work. As this was going to be “easy” I’d been pushing the commits to master on Github (I’m the only one using this code) and of course a few reworks in I’d realised that this was never going to work out well and needed to be abandoned.

So, how to fix this? The ideal situation would be to just disappear all the commits after the last good one, but that’s not really an option, so what I wanted was to create a branch from the last good point and then swap master and that branch over. Googling pointed me to some possibilities, including this “deprecated feedback” item from “githubtraining” which was a useful guide so I thought I should blog what worked for me in case it helps others.

  1. git checkout -b good $LAST_GOOD_COMMIT # This creates a new branch from the last good commit
  2. git branch -m master development # This renames the "master" branch to "development"
  3. git branch -m good master # This renames the "good" branch to "master".
  4. git push origin development # This pushes the "development" branch to Github
  5. In the Github web interface I went to my repos “Settings” on the right hand side (just above the “clone URL” part) and changed the default branch to “development“.
  6. git push origin :master # This deletes the "master" branch on Github
  7. git push --all # This pushes our new master branch (and everything else) to Github
  8. In the Github web interface I went and changed my default branch back to “master“.

…and that was it, not too bad!

You probably don’t want to do this if anyone else is using this repo though. 😉

Thoughts on the white spots of Ceres

If you’ve been paying attention to the world of planetary exploration you’ll have noticed the excitement about the unexpected white spots on the dwarf planet Ceres. Here’s an image from May 29th that shows them well.

Ceres with white spots

Having looked at a few images my theory is that impacts are exposing some much higher albedo material, which you can see here at the top of the rebound peak at the center of the crater, and that the impact has thrown some of this material up and that material has fallen back as Ceres has rotated slowly beneath it giving rise to the blobs to the side of the crater.

If my theory is right then if you know Ceres gravity and its rotational speed and the distance between the rebound peak and the other spots then you should be able to work out how far up the material was thrown up. That might tell you something about the size of the impact (depending on how much you know about the structure of Ceres itself).

As an analogy, here’s an impact on Mars captured by the HiRise camera on MRO that shows an area of ice exposed by an impact.

UniFi systemd unit file for Ubuntu 15.04

At work we’ve started using some UniFi wireless gear and the system I’ve managed to commandeer to do the control system for it is running Kubuntu 15.04 which uses systemd. Now the UniFi Debian packages don’t supply systemd unit files so I went hunting and found a blog post by Derek Horn about getting it running on CentOS7 so I nabbed his and adapted it for Ubuntu (which wasn’t that hard).

The file lives in /etc/systemd/system/unifi.service and was enabled with systemctl enable unifi.service (from memory, there might have been another step that involved getting systemd to rescan unit files to pick up the new one, but I don’t remember for sure).

Here is the unit file:

# Systemd unit file for unifi-rapid

Description=UniFi Wireless AP Control System

#ExecStart=/usr/bin/java -Xmx1024M -jar /usr/lib/unifi/lib/ace.jar start
ExecStart=/usr/bin/jsvc -nodetach -home /usr/lib/jvm/java-7-openjdk-amd64 -cp /usr/share/java/commons-daemon.jar:/usr/lib/unifi/lib/ace.jar -pidfile /var/run/unifi/ -procname unifi -outfile SYSLOG -errfile SYSLOG -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Xmx1024M com.ubnt.ace.Launcher start
#ExecStop=/usr/bin/java -jar /usr/lib/unifi/lib/ace.jar stop
ExecStop=/usr/bin/jsvc -home /usr/lib/jvm/java-7-openjdk-amd64 -cp /usr/share/java/commons-daemon.jar:/usr/lib/unifi/lib/ace.jar -pidfile /var/run/unifi/ -procname unifi -outfile SYSLOG -errfile SYSLOG -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Xmx1024M -stop com.ubnt.ace.Launcher stop


Mount Burnett Observatory Open Day and Third Birthday – Saturday 24th January 2015

As some of you know I’m involved with the Mount Burnett Observatory, a community run astronomical observatory in the Dandenong Ranges of Victoria near Emerald to the south-east of Melbourne. Originally built by Monash University in the early 1970’s it’s 3 years since a small group of people formed a community association, took over the site and starting resurrecting it as an observatory by and for the people. It’s now three years on and by the end of last year we were the second largest astronomical association in Victoria!


This Saturday (24th January) is our third birthday celebration so we’re having an open day running from 1pm through to 6pm with tours, activities, a solar telescope and components from the Murchison Widefield Array (MWA), one of the precursor telescopes to the massive Square Kilometer Array telescope project!

At 6pm we have a barbecue and then at 7pm there will be a talk by Perry Vlahos on what there will be to see in the sky over the coming month. After that we’ll be socialising and, if the weather behaves itself, viewing the stars through the many observatory telescopes.


ARM v8 (64-bit) developer boxes

Looks like things are moving along in the world of 64-bit ARM, systems aimed at early adopting developers are now around. For instance APM have their X-C1 Development Kit Plus which has 8 x 2.4GHz ARMv8 cores, 16GB RAM, 500GB HDD, 1x10gigE, 3x1gigE for ~US$2,500 (or a steep discount if you qualify as a developer). Oh, and it ships with Linux by default of course.

Found via a blog post by Steve McIntyre about bringing up Debian Jessie on ARMv8 (it’ll be a release architecture for it) which has the interesting titbit that (before ARM had their Juno developer boxes):

Then Chen Baozi and the folks running the Tianhe-2 supercomputer project in Guangzhou, China contacted us to offer access to some arm64 hardware

So it looks like (I presume) NUDT are paying it some attention & building/acquiring their own ARMv8 systems.

IBM Pays GlobalFoundries to take Microprocessor Business

Interesting times for IBM, having already divested themselves of the x86 business by selling it on to Lenovo they’ve now announced that they’re paying GlobalFoundries $1.5bn to take pretty much that entire side of the business!

IBM (NYSE: IBM) and GLOBALFOUNDRIES today announced that they have signed a Definitive Agreement under which GLOBALFOUNDRIES plans to acquire IBM’s global commercial semiconductor technology business, including intellectual property, world-class technologists and technologies related to IBM Microelectronics, subject to completion of applicable regulatory reviews. GLOBALFOUNDRIES will also become IBM’s exclusive server processor semiconductor technology provider for 22 nanometer (nm), 14nm and 10nm semiconductors for the next 10 years.

It includes IBM’s IP and patents, though IBM will continue to do research for 5 years and GlobalFoundries will get access to that. Now what happens to those researchers (one of whom happens to be a friend of mine) after that isn’t clear.

When I heard the rumours yesterday I was wondering if IBM was aiming to do an ARM and become a fab-less CPU designer but this is much more like exiting the whole processor business altogether. The fact that they seem to be paying GlobalFoundries to take this off their hands also makes it sound pretty bad.

What this all means for their Power CPU is uncertain, and if I was nVidia and Mellanox in the OpenPOWER alliance I would be hoping I’d know about this before joining up!

Update: I’ve spoken to some IBM’ers about this and they assert they’re not leaving the chip business, they are offloading off the fabs and the manufacturing IP to GlobalFoundries but not the chip design side of things. In my opinion, though, it does mean that should they decide to exit the chip business at some point it’ll be easier for them to do so.

How Far We Have Come: Comets

In 1986 ESA’s Giotto mission visited Comet Halley and I watched Patrick Moore on the BBC as the first images of a comets nucleus were returned.

Composite image of Comet Halley's nucleus from Giotto

Now it’s 28 years later and the ESA mission Rosetta has just arrived at 67P/Churyumov-Gerasimenko, and the difference in imagery is just amazing – and this isn’t even the full resolution version!

Detail from image of Comet 67P/Churyumov-Gerasimenko from Rosetta

More images from Rosetta are on the ESA Space Images website.

Getting Political

I’ve not been blogging recently, though I’ve been tweeting a fair bit, and I’ve been getting more and more disconcerted by what the Australian government has been up to, especially with respect to refugees. We are seeing the emergence of a militaristic approach where the facts about rights to seek asylum are conveniently ignored and refugees are labelled as “illegal” (they’re not) and a threat to our borders (they’re not). Questions are met with silence (unless they happen to coincide with their agenda) to frankly absurd levels.

We keep them in concentration camps on foreign soil and deprive them of necessities even though they’ve committed no crime and we leave them to go mad from boredom, fear and neglect. We’ve had one person murdered in our care with the prime suspect being a Salvation Army worker, but somehow after 6 months nobody has been charged. Others were seriously injured, but their assailants haven’t been charged either.

Now we have the situation of refugees from Sri Lanka who have boarded boats in India being intercepted at sea and returned, not to Indias care, but to the Sri Lankan navy where on their return to Sri Lanka they are then handed over to the police for prosection (as it’s apparently illegal to leave Sri Lanka without permission, the sentence is “two years of rigorous imprisonment and a fine”).

This seems like a prima-facie case of refoulement and a clear breach of international law. I’m not the only person to think like that, 57 legal scholars from 17 Australian universities have written an open letter expressing the same feelings.

Such summary procedures do not comply with minimum standards on refugee status determination under international law. Holding asylum seekers on boats in this manner also amounts to incommunicado detention without judicial scrutiny.

I cannot stand by and be seen to acquiesce in this abuse of fundamental human rights and so I’ve decided that I must join The Greens as none of the major parties appear to understand international law and obligations.

This is not an easy decision for me, I spent 7 years working in the UK Civil Service and so that ethos of being independent of a political party is deeply ingrained, but the revulsion I have for the policies of this government and my fear of the dark places it is leading us has finally overcome it.

This is not in my name.