It looks like this will meet my constraints above - I get to keep using GitHub
Pages, I don’t have to manage a cert (CloudFlare takes care of this), and I can
keep using my custom domain.
The steps I followed to do this were relatively simple:
Exported a zone file from current nameservers
Completed the CloudFlare onboarding, during which I imported the above zone file
Updated the authoritative DNS servers for my domain to the
*.ns.cloudflare.com name servers:
Tested the site out,
a CSS link that was loaded over HTTP
Forced HTTPS in CloudFlare:
… and that was it. I finished this in part of an afternoon.
There is one major shortcoming with this setup: there is no certificate
validation between CloudFlare and GitHub (CloudFlare supports fetching from
an origin without validating certificates, which is the option I’ve chosen -
‘strict’ HTTPS can be enabled for most use cases).
As we mentioned before, the GitHub cert is valid for *.github.io, and we’re
using my custom domain, which is mdjnewman.me.
If we switched off the custom domain on GitHub, and did some smarts in
CloudFront to rewrite requests so that the request to GitHub was using
mdjnewman.github.io, then we’d get HTTPS all the way to GitHub servers.
I could switch to using CloudFront with
an AWS Certificate Manager cert,
which would meet all the above constraints except for ‘no cost’ (admittedly, my tiny
blog doesn’t get much traffic, so the cost would be minimal).
Given that most of the shenanigans with injecting content into web sites
happens at the last leg of a connection (I’m looking at you, dodgy internet
cafe), I’m happy that the new setup for this blog mitigates that problem and am
willing to accept the cost/security trade-off. While it’s possible for someone
to perform a man in the middle attack and impersonate GitHub, given my site has
no sensitive information I’m not too worried about this threat model (Troy Hunt
In the above, the commits adding features 3 and 4 on each branch are logically
the same, but on the feature-5 branch they’ve somehow ended up after the
commit adding feature 5.
The team was using feature branches, and the author of feature 5 above was
trying to rebase their changes onto master, but somehow ended up inserting
their commit between commits on master. At this stage, you’re in a pretty bad
place, as you’ve diverged from master.
How did this happen? I’m guessing it was the following series of events:
Developer branches from master to create feature-5
Features 3 & 4 are pushed to master
Feature 5 is committed to the feature-5 branch
Developer runs git pull --rebase origin master or similar
… some time passes …
Developer runs git pull --rebase without really thinking about it
After the first few steps above, we have something like the following:
So far, so good. We want to rebase our changes onto master, so that we can test
and push our code. After git pull --rebase origin master:
Still looking good. At this stage, we could git push --force origin feature-5
and all would be well in the world.
But what happens if we go for a tea and forget what we were doing (or we use an
overzealous git GUI tool), and we try to rebase onto origin/feature-5?
What we see above is the result of Git rebasing commits 94989d0, 232e985
and 44e1c44 on top of origin/feature-5. As the commit ID is computed by
hashing of the contents of a commit and its parent, the same logical commits
from master now exist on our branch with different IDs.
This could have been avoided if we followed this rule of thumb:
If you’re working on your own branch, always push immediately after rebasing.
Some people on the team were seeing a message like the following:
Your branch and 'origin/feature-5' have diverged,
and have 3 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
and assuming that they should git pull --rebase, which in this case is exactly what you don’t want.
One of the exercises to implement a simplified command line version of
Morra, which involves keeping
track of scores and reading user input.
My initial method to play a round looked something like this:
playRound::Config->Scores->IO(Bool,Scores)playRoundconfigscores=doputStr"P1: "p1HandMaybe<-getHumanHandcasep1HandMaybeofNothing->return(True,scores)-- error case 1Justx->doputStr"P2: "p2HandMaybe<-getHumanHandcasep2HandMaybeofNothing->return(True,scores)-- error case 2Justy->doletevenWins=(x+y)`mod`2==0return(False,updateScoresconfigevenWinsscores)
playRound takes the configuration for the game and the current score, and
returns a side effecting computation that will return a tuple with the new
scores and a boolean indicating if the game is finished.
The method getHumanHand used above returns a IO (Maybe Int), which can be
interpreted as a side effecting action that might return an integer (in this
case, the side effect is reading from the console and we can’t trust the user
to enter an integer, hence the Maybe).
The problem then is that we’re then manually unpacking these Maybe Int
values, which leads to the ugly nesting and case statements. However, we can
see on the lines marked ‘error case’ above that the handling for both cases is
the same - we assume that if the user has entered something other than an Int
that they want to end the game.
I recently learned about Monad transformers, which allow you to compose monads.
In this case, we want to compose the Maybe monad with the IO monad, so we will
Rewriting getHumanHand to return a MaybeT IO Int and rewriting playRound
results in the following:
The nice thing about this implementation is that we’ve avoided the need for
pattern matching, as the do block above where we’re dealing with the
potentially failing computations will immediately short circuit and return a
Nothing if either user fails to provide a legitimate value.
This is the first time I’ve actually used a Monad transformer, and it was good
to see how it cleans up the implementation of playRound.
The post below is a concatenation of multiple emails I wrote during the trip,
apologies if it seems a litte disjointed.
I’m writing the first part of this as I sit on the train on the way to
Salzburg, there’s about an hour left of a trip that takes a little under two
I had three very busy days in Munich, managing to see
Residenz (external and garden)
Schloss Nymphenburg, Gardens & Outbuildings
Dachau Concentration Camp Memorial
The museum was awesome, I kept thinking how much I would have loved a museum
like that when I was little. It was primarily a technical museum - the sections
were mining, marine navigation, oceanography, foundries, machine tools, metals,
power machinery, marine navigation, electric power, new technologies, physics,
energy technologies, pharmaceutics, historic aviation, ceramics and glass
production, paper, musical instruments, astronomy, measures and weights,
computers, mathematics, microelectronics (I geeked out a bit in these last
three), chronometery and geodesy. It is a really big place, you could easily
spend upwards of an hour in each of those sections. I spent about 6 hours in
the museum and easily could have spent twice that, though maybe over two days;
there is only so much museum-ing I can handle.
First up on Thursday morning I went to the area of the city where the BMW
headquarters and factory are located.
There is also building called BMW Welt (‘welt’ -> ‘world’) which was like a
showroom on steroids. They had some Rolls Royces there too because BMW, Mini
Coopers and Rolls Royces are all either owned by one company or they have some
partnership going on. I planned to do a tour of the BMW factory but it was sold
out (until August!) so I settled for the museum.
The BMW museum had all sorts of stuff from the life of the company over the
last 100 years and talked about how much it’s changed, from manufacturing
military parts to bikes, cars, airplane engines and even pots and pans at the
end of the war. They used POW labour at one point during the war which I didn’t
expect given a company like BMW, but this was during the war when they had a
lot less control over their operations.
Once I was done at the museum I made my way into Olympiapark where the 1972
Olympics were held. This whole area has been turned into a public space and the
stadium and halls are still used for events. While I was there an event that’s
on this weekend was being setup, and there was wake boarding and some
slopestlye mountain biking going on. They were still completing the mountain
biking track so no one was doing full runs but there were pretty massive jumps
in there. I got a video of one guy casually doing backflips for the crowd!
I also spotted an event called the Tollwood
Sommerfestival from a lookout so I went and had a
peek there. It had a cool vibe and would have been good fun later in the
evening, but it was a long way from where I planned to finish the day.
From the Olympic Park I made my way back to Munich Residenz where the Bavarian
monarchs used to live but didn’t have time to go inside. It’s a museum now but
I just checked out the externals and went through the courtyard on my way to
the Englischer Garten.
The English Gardens are massive, I only walked through half of them in then end
despite plans to go from one end to the other. There is and really cool spot at
the start of the gardens where the water flows in (not sure if it’s flowing
through or recycled through the canal system in the park - maybe both), there
were people surfing there! They’ve set something up that makes an artificial
wave across the canal.
In the middle of the gardens is this relic of a bit of a China craze that went
through Munich a while back. There is this pagoda type thing, and all around is
the most German food/drinks setup ever. So many 1L mugs of beer! I had my
dinner of sausages and sourkraut there along with a wheat beer before making my
First up on Friday I went to Nymphenburg Schloss which is a huge palace some
Bavarian rules used to live in. Construction started in 1664 and there were
still buildings being added and pretty big modifications being made to the
grounds until 1825. Water is a very big feature throughout the grounds and is
provided by a 2km long channel that brings water from a nearby river. There was
a really run down looking building called the Magdalenenklause in the gardens,
but it was actually built to look that way as an escape from the prim and
proper life at court.
After I’d wandered all around the gardens and reached appropriate levels of
sunburn, I made my way to Dachau, where there was a concentration camp. This
wasn’t a camp where mass executions were carried out in gas chambers, though
there was a chamber built there. The people running Dachau instead really
believed in ‘extermination through
they overworked people until they pretty much died of exhaustion. The gates to
the camp said “work shall set you free”, though freedom in this case normally
meant death. There were 32 huts each originally built to house 250 people, but
apparently they each held upwards of 1000 people towards the end of the war.
Over 40,000 people died/were executed there in the twelve years it was
operating. Sobering place.
After Dachau it was time to head to Salzburg which was very easy to figure out.
The public transport in Munich is amazing, I had no trouble getting around
despite not knowing the city and not understanding what anyone was saying or
what anything said.
This is yet another instalment that’s being written while on the train, this
time from Salzburg to Vienna. I have internet on this train, and it’s probably
faster than what 99% of Australian ISPs provide (thanks Tony). It made me laugh
when I connected to WiFi and saw this immediately:
… ‘this is of course free’. In Aus this would cost an arm and a leg and take
four hours to set up.
During my two days in Salzburg I visited:
Festung Hohensalzburg - a fortress
The Domquartier - a museum combining the church and residence of the
Kapuzinerberg - a mountain in the middle of town, not as heavily fortified as
Schloss Mirabell - a palace built around 1606
A few other places around Salzburg, though only the exteriors:
Mozarts geburtshaus and wohnhaus (where he was born and lived,
Christian Doppler’s geburtshaus
About 1000 churches
Festung Hohensalzburg was probably the hightlight for me. There is evidence
that there have been people on Festungsberg since year 0180, and construction
started on Festung Hohensalzburg in 1077. It’s no wonder people have been using
it as a stronghold for so long, it is an amazing place to put up a strong
defence (it’s actually never been taken by force, but was surrendered once
during the Napoleonic War of the Second Coalition in 1800 when the ruler at the
time bailed to Vienna). I think the only people to actually attack it were some
peasants in 1525 who were promptly repelled. The fortress was commissioned by
the ‘Prince-Archbishops’ of Salzburg. These guys were the supreme rulers, as
they’re non-secular princes as well as archbishops of the church. One of the
really interesting things there is the ‘Salzburger Bull’, which is a very loud
mechanical organ that was used to signal various things to the town (photo
The fortress was used as a military outpost until 1861.
Next up was the Domquartier, a museum that combines a palace where the
Prince-Archbishops used to live and do the princely thing and the cathedral
where they used to be pray and carry out their duties as archbishops. The
residence building was initially built in 1604 and the cathedral in 1614. The
two buildings have been joined on the second level since one of the
Prince-Archbishops decided they didn’t like getting their feet wet when walking
between the two. The museum is setup so that you follow the path that a visitor
would have followed when seeing the Prince-Archbishop, which mainly involved
going through several extravagant rooms. The first room is huge and not as
fancy, but the further along you get the smaller and more expensive-feeling the
rooms get, this is apparently because the more important you were the further
into the palace you could get. The rooms all have portraits of Alexander the
Great painted on the ceilings, which were all indirectly drawing comparisons
between Alexander and the Prince-Archbishops you were about to see. Sadly I
don’t have any photos of the interior of the palace as they weren’t allowed.
It was a bit of a rainy afternoon so I started making my way back to the hotel
and decided to check out Augustiner Brauhaus on the way. It’s massive - 5,000
square meters internally and with a beer garden that can sit 1,400 people. The
beer is rolled out in massive barrels from which people fill up their steins.
On Wednesday I went to Mozarts geburtshaus and wohnhaus but decided I’d had
enough of museums and instead went for a walk up the Kapuzinerberg. The
Kapuzinerberg is a mountain in the middle of town, not as heavily fortified as
Festung Hohensalzburg. There is one castle up there (Franziskischlössl) and a
massive wall that goes all the way back towards the river to another
stronghold. This second stronghold could be used to defend the eastern side of
what was at the time the only bridge across the river (Hettwer-Bastion). I
walked the wall back from the Franziskischlössl to the Hettwer-Bastion, going
past some signs that looked vaguely like they were warning me about something.
Building this wall now would be a pretty impressive feat, let alone building it
in three years from 1629-1632. I think it would take the Brisbane City Council
about 100 years and several billion of machinery. The Franziskischlössl and the
wall were built such that there are no angles were attackers could hide without
being under fire. The main drawbridge into Franziskischlössl is protected on
three sides, and there were watchtowers built within shouting distance of each
other all the way back to Hettwer-Bastion.
From the end of the wall I made my way to Schloss Mirabell - a palace built
around 1606, also for the Prince-Archbishops. The palace building itself is
still used by the local council and events and concerts are held there, but the
gardens are open for all to see. One of the features of the gardens are 14
which were put there in 1710 as part of an outdoor theatre. Several scenes from
The Sound of Music were shot in the gardens.
Ahoy! (which is apparently a common greeting used by people in Bratislava as
well as by pirates)
In keeping with the train theme, I’m starting this update on the train back to
Since arriving in Vienna on Sunday night, I have checked into our Airbnb, done
some exploring of Vienna, and spent the day in Bratislava, the capital of
Slovakia. Bratislava just on the Slovakia side of the Austria-Solvakia border
and only an hour in the train from Vienna.
We went for a walk along part of Donauinsel on Monday morning. Donauinsel is a
roughly 20km long island in Vienna on the Danube River. From there we walked
back towards our apartment, hoping to walk through a local university but
somehow walking past a horse racing track and a huge construction site. After a
lunch at home with groceries from the local supermarket and Kirstens arrival we
headed off to explore some of Vienna.
From the bridge to Donauinsel, we’d seen a very large church nearby so we had a
look at that first. The church was ‘Heiliger Franz von
or the St. Francis of Assisi Church. It was built much more recently than most
of the churches around here, construction only started in 1898! The interior
was quite plain compared to how it looked from the outside:
After checking out the local church, we caught the U-bahn (Untergrundbahn, or
undergroud railway in English) to Schönbrunn Palace. The first part of the
mansion there was built in 1548 and was normally occupied by members of the
Habsburg Monarchy, including Franz Joseph, the longest-reigning emperor of
Austria. It’s been a museum since the fall of the Austro-Hungarian Empire in 1918.
It’s a pretty striking place:
The final stop on Monday was Karlskirche (or St. Charles’s Church) which was
built between 1716 & 1737. The columns outside this church are pretty unusual:
I will send another update about Bratislava, but it’s Wednesday morning now so
I’m off to explore some of Vienna :)
I’m not writing on a train this time, but having a relaxed day in Vienna as my
feet feel like they’re about to fall off. I will probably head out and go to a
museum or something this afternoon.
As I said in my last email that we went to Bratislava on Tuesday which was a
really good trip. Most of our time there was spent on a free walking tour of
the city (‘free’ but tips expected - our guide was really good though). I made
a map of the
path we took.
There are a lot of statues in Bratislava, including one of Hans Christian
Andersen (author of “The Emperor’s New Clothes”, “The Little Mermaid”, “The
Nightingale”, “The Snow Queen”, “The Ugly Duckling”, “Thumbelina” …) which we
would have walked straight past if our guide had not pointed it out. The back
of the statue has lots of things from his stories. Another one is the ‘man at
This statue doesn’t really have a name, but a sign warning saying ‘Man at work’
was put up after people kept tripping over him. According to the locals his
name is Cumil and he is the quintessential Bratislavian man at work, as he just
chills out all day and perves on the tourists. The executioner below has been
present for quite some time in one form or another:
This is at the entrance to the lane where the executioner used to live (his
house is now a massage parlour!). The lane where the executioner lived was next
to Michael’s Gate, part of the fortifications for the city build in the mid
14th century. A second gate was added along with a 90° corner in the 17th
century, so that enemies had to slow down even if they breached both gates.
From Michael’s Gate we walked on to the Slovak National Uprising Square. This
square, as well as another in the middle of the city, were important sites in
the Velvet Revolution which
in 1989 ended the communist rule in then Czechoslovakia (the split into the
Czech Republic and Slovakia happened in 1993).
After the SNP Square we visited The Church of St. Elizabeth/The Blue Church/The
Smurf Church which was built in 1908 and is very, very blue:
After a final short walk we were sitting at the entrance to a building when our
guide was telling us more about the Soviet invasion of Czechoslovakia in 1968.
She handed around a physical copy of a rather controversial
I haven’t included it here, as the image isn’t in the public domain, but after
looking at it we realised we were sitting on the stairs of the building in the
The tour guide also told us some interesting stories about traditions in
Slovakia. For men, easter apparently involves pouring water on the women in
your life and lightly hitting them with willow sticks. Christmas means it’s
time to catch a carp and keep it in the bathtub for a few days before eating it
for a Christmas meal.
I did some exploring of Vienna yesterday, but I will send another email about
I’ve finally got around to writing up what I got up to in Vienna, while I’m on
the train of course! We’re currently on the long ride from Vienna to Mainz. The
good thing is the train is currently going at 170 km/h. I’ll split this into a
few emails, the first one is about Wednesday when I explored the inner area of
I started out at the
Belvedere, a complex
consisting of two palaces, a botanical garden and even a small zoo. The large
palace now houses a museum (or an art gallery, I can’t remember - there are so
many galleries and museums in Vienna). The palace was built was built as a
summer residence for Prince Eugene of Savoy sometime in the early 1700’s. Savoy
was a big fan of animals and had a small zoo setup there, though that’s all
On my way to the centre of old Vienna I walked past Heldendenkmal der Roten
Armee (the Heroes’
Monument of the Red Army), a Soviet War Memorial built in 1945 (that is at
times a little unpopular with the locals, as the Soviets caused quite a bit of
damage when they took the city in a battle from 2 to 13 April 1945 and in the
weeks following the battle).
From there I walked north to the
Ringstrasse (Ring Road) which
forms a loop around most of the old buildings and museums. There was lots to
see, but I didn’t actually go into many places as they all had a roughly €10
entrance fee and there wasn’t time to do them justice on the Wednesday. I
walked past a bunch of places inside the Ringstrasse, including
The ‘Haus der Musik’ was my
first stop inside the Ringstrasse, it is kind of like a museum with ways for
people to explore sound and how sounds are generated. Entry was a bit expensive
and I wasn’t sure if I wanted to go in, but there was a choir performing in the
lobby. When I heard the person organising the choir speak after one of their
songs, I thought they had a bit of an Australian accent. Sure enough, it was a
choir from Adelaide called Young Adelaide Voices.
Albertina, a museum/gallery built
in 1805 with approximately 65,000 drawings and approximately 1 million old
Hofburg Palace, a massive
complex including Österreichische Nationalbibliothek (Austrian National
Library), Michaelerplatz (an archaeological site), Joseph Square, Heldenplatz,
Kaiserappartements (see the image below)
The final stop for the day was
(St Stephens Cathedral), one of the larger churches in Vienna (the bell there
is the largest in the country and weighs just over 20 metric tonnes). The
original church on the site was consecrated in 1147 and the cathedral in its
current form was finished in 1359 (some parts are still from the old church).
The one place I did pay to go into on Wednesday was the katakomben (crypts) at
the cathedral. The crypts have been there since the 13th century, and everyone
who died in the town used to be buried down there. There are remains from
11,000 people (400 people per room) buried under the church over 30 years until
1783 until the smell grew too strong to run masses and they also ran out of
space. When they ran out of space they had prisoners empty out full rooms,
clean the bones and stack them neatly in ‘bone houses’ so they used less space.
We weren’t allowed to take pictures down there, but there were rooms stacked
floor to ceiling with all sorts of bones, though skulls & femurs were the most
recognisable. Duke Rudolph IV is in the crypt, who died in 1365 (his coffin was
replaced in the 18th century as the old one was falling apart).
The final interesting fact from the crypt is that when a member of the Habsburg
family (who used to run the show here, the same family I’ve mentioned earlier)
died, there used to be disagreement about where their remains should be placed,
as there were three locations that were of particular significance to the
family. What ended up happening is that each location got a piece - their
heart was sealed in a chalice type thing and sent to one location, their other
organs where sealed in another larger container and placed in the crypt at St
Stephens, and their bodies were put into a coffin and stored at the palace (I
think, I might be wrong on the location). Some of the containers that the
organs are in are larger than then others, the guide told us this is because
some of them sprung a leak! The leaky container just gets resealed in a larger
one whenever it happens. Apparently it happened a few years back and they had
to close the crypts for a week because of the smell.
artefacts from the ‘Order of the Golden Fleece’, a secular order of chivalry
from 1430. I don’t know what is particularly chivalrous about a sheep skin,
and the chain their members wore has a golden but droopy looking
On Friday I went to Seegrotte
Hinterbrühl. “Hinterbrühl” was an
underground gypsum mine until 1912 when a blasting operation in went awry and
20 million litres of water flooded the mine. It was opened as a tourist
attraction in 1930 and has been open to tourists since then, with the exception
of World War II. During WWII the mine was used as a factory for Heinkel He
162 jet fighters during, there
were 2,000 people working down there as the underground site couldn’t be
Currently 50,000 L of water have to be pumped out every day to keep the water
level constant. The water is super clean and apparently drinkable, though very
mineral heavy. It was also surprisingly cold down there at only 9 °C. The guide
was doing his thing in German, but I heard someone else translating for their
friend and asked if I could listen in.
Burg Lichtenstein was also nearby. It was originally built during the 12th
century, destroyed by the Ottomans in 1529 and 1683, and remained in ruins
until 1884, when it was rebuilt. I only realised while doing some reading to
write this email that the family who established Liechtenstein the country (or
principality?) took their family name from the castle, and the country is named
after the family. The castle wasn’t open for tours, so I just had a walk around
there and the surrounding forest. There was a amphitheater built near the
castle around 1800 which is now all overgrown, it was surreal walking
You can see almost the whole structure in the background of the image below.
I got chatting to the two people I was eavesdropping on at the caves and they
recommended going to
Schneeberg mountain south of
Vienna, so I decided to do that on Saturday.
Getting there was a bit of a debacle - I was on the train which was meant to be
going all the way to my destination and we’d been stopped at a train station
for a while, which was odd. Soon enough a ticket inspector wandered through the
train and said something to me in German which I didn’t understand. After I
made it clear I didn’t speak German, he just said the destination station I was
going to, and I nodded. He then pointed at a train on the other side of the
station and said one of the only German words I know: “schnell, schnell!”.
“Schnell” is roughly “quick”, which was enough instruction for me. I galloped
and hopped on the other train just before it left.
Eventually I made it to Puchberg am
Schneeberg, which is at
the foot of the mountain. I’d been planning on maybe hiking up the mountain but
I didn’t have enough time so I caught the ‘Schneebergbahn’ train up to the top.
The track up is a cog railway that was built from 1895-1897.
There was still a decent walk up to from where the train station is to the
peak, and I didn’t have loads of time, so I powered from Berghaus
Hochschneeberg (1800m) to Klosterwappenhohle (2076m) and Kaiserstein (2061m)
and then back:
(the map above is from
which is an open source alternative to Google Maps and often has more detailed
I was a little underprepared for how windy and cold it would be up there (there
is still some snow that hasn’t melted yet). Here is me with my hands firmy in
the pockets of my inadequate jacket:
The cold was worth it though, the views were amazing: