Schlenkerla Rauchbier

It seems this one has a bit of fame. The “real Schlenkerla smoked beer” certainly doesn’t disappoint. It’s how I’d imagine kissing an ashtray. The smokiness comes through immediately and throughout and – if I dare to say – overpowers much of the remaining beer taste.

Not sure I’ll be back to this one in a hurry. The novelty wore off quickly, and it wasn’t the most pleasant to drink. Still, good as a reminder of some of the more extreme flavours out there.

Hercule Stout – Brasserie des Légendes

Named after the Belgian detective, Hercule Poirot, this has been on my to try list for a while.

It’s a decent stout with a nice, dark flavour. Reminds me of chocolate, coffee bitterness which works well. Slightly stronger at 9% ABV. I’d certainly be happy to add this to the regular rotation when it becomes available.

Dev switching for Nginx Reverse Proxy with cookies

I’m a fan of using Nginx as a reverse proxy, and I’ve now used it for multiple projects.

Essentially Nginx sits in front of multiple other web servers (Apache or other Nginx instances) and redirects traffic according to a series of simple rules.

There are numerous benefits, but one particular use case is proving very useful. This is the ability to switch between a production and dev website using cookies.

Here’s a broad example (note other proxy/server config instructions are omitted)…

server {
location / {
# By default, serve from the production server(s):
        proxy_pass https://production;
# If the special cookie appears in the request, redirect to the dev server:
        if ($http_cookie ~* "usedev31246") {
            proxy_pass https://development;
        }
}
# Special convenience URLs to enable/disable the cookies we need:
location /enable-dev {
    add_header Set-Cookie "usedev31246;Path=/;Max-Age=9999999";
    return 302 /;
}
location /disable-dev {
    add_header Set-Cookie "usedev31246;Path=/;Max-Age=0";
    return 302 /;
}
}

By default, a proxy connection will be made to the production server for all requests unless a cookie is provided in the request matching the string usedev31246, in which case it’ll be sent via the development server.

For convenience, any user can set the cookie by visiting /enable-dev (which will redirect back to the home page). They can clear it by visiting /disable-dev.

This means you can quickly help somebody get to the dev site by directing them to https://example.org/enable-dev

Of course, you probably don’t want anybody finding this so best to password protect and use a suitably secure cookie string, but I leave that as a challenge to the reader 😉

This is quite nice for things like WordPress instances which tend to put the full URL in image and resource requests. By doing this, we don’t need to rewrite those URLs and worry about permalinks changing.

If you’re also using Nginx as a cache, beware as a user on the dev site might pollute/poison the cache with development code. Ensure the cache is disabled before dev requests are fulfilled (this is good practice anyway for a dev website).

Quarr Abbey, Goddards

Bit off-piste for my usual hunts, but this is from the Isle of Wight, so a local brew as well as a former stomping ground, and brewed in a Belgian “Dubbel” style.

Apparently, they don’t usually sell these in kegs, but the local shop had a supply so a 500ml “Crowler” was needed!

Can’t say I’m a huge fan of the beer on presentation. Weak, slightly metallic taste – hints of darker Belgian beers – creamy and chocolatey to taste. Just not quite meeting expectations. However, a bit disclaimer – that might well be down to the way it’s arrived (also worth noting this was near-end of stock). I’d be keen to try it again in bottled form and – being so close – a great opportunity to support local breweries.

Triple Secret des Moins

Light (in colour) blonde beer with a slight fermentation aftertaste. 8.0% … Aroma is a little sour on first impression, but the taste takes hold pretty quickly. It’s not a “bad” beer but I’m not fussed on finding it again.

Switching Virtual and Remote Desktops

If I’m using full-screen remote desktop in Windows 10, it can be handy to have my local computer on one virtual desktop, and the remote computer on another.

I usually turn off the title bar, so it’s a seamless experience.

Switching from local to remote is easy: Ctrl+Windows Key+Right Arrow

Switching back is more difficult, since the remote desktop will capture your keys.

Trick is to press Ctrl + Alt + Home first. This brings up the Remote Desktop title bar, which then means you can press Ctrl + Windows + Left to switch back.

Separators in multi-list in XSLT

Quick note: if inside an XSLT for-each loop and I need a separator, the following should be fine:

<xsl:if test="position() != 1">; </xsl:if> {...content...}

This will add the separator as a prefix before all but the first element.

IIS stops working after Windows 10 Fall Update

After installing the Fall Creators Update on Windows 10, IIS promptly stopped working.

In the event viewer, the following vague message appeared on various app pools:
The worker process for application pool 'DefaultAppPool' encountered an error 'Cannot read configuration file
' trying to read configuration data from file '\\?\', line number '0'. The data field contains the error code.

Ajeet Yelandur had a solution, and it works well:

Stop “Windows Process Activation Service” and “W3SVC” service and clean out (delete) all the files under C:\Inetpub\temp\AppPools*. Start your services and the sites should be back to work.

Thank you Ajeet!

(Posted here to help other searchers. It took me a while to find the solution amongst increasingly noisy Google results.)

Google Assistant on Nexus 5 and Nexus 7 (so close…)

I have an ageing Nexus 5 phone. I also have a Nexus 7 (2013) which – incidentally – has been the best tablet I’ve had at a fantastic price and I’m sorely disappointed they’re not making it any more. I digress.

On clicking the link, I get asked to open in Google Assistant… yes please!

Neither of these devices officially supports Google Assistant, the fancy chatbot/AI thing from Google, which is a shame as I do have a Google Home and quite like it.

Various articles online seem to suggest both devices are too old to be supported, which – if true – would be a shame but understandable given the age.

Strangely, it seems to be almost there. It’s even ended up on my phone and tablet. If I click this link on either the phone or tablet (a Google I/O service) I am asked if I want to ‘open in Google Assistant. It seems that any clickable link (you have to click from an existing page) will open this if the URL begins https://assistant.google.com/services/a/

This is the resource opened in the native Google Assistant app on a Nexus 5

Not that I get far beyond that, but it’s interesting (and frustrating) to know that somewhere beneath the surface and to some degree or other, Assistant is installed.

Compressing and Storing Time Correctly

After earlier work with DATETIME and indexes, I am still seeing some performance issues with storing logs with a full timestamp. Since a lot of the reporting is based on day-on-day and week-on-week comparisons, it could be more efficient to store the date and time components separately.

For my purposes, I’m using time to a resolution of about 15 minutes so there’s no real need to suffer the extra storage and performance overhead of working with a TIME field.

Instead, I’ve opted for a TINYINT with a value between 0-95 inclusive – one for every fifteen minutes of the day. Naturally, this is indexed.

The issue comes with how to convert time into these segments, and back again. Logically, 00:00 to 00:15 should be the first segment, but I have to be careful when reporting this back.

Technically if I’m quoting the range in a graph, there’s no problem. It’s between 00:00 and 00:15. If I’m forced to plot a point – say in a graph – the easiest solution would be to drop the dot at 00:00:00. The technically most accurate would be at 00:07:30.

That could be awfully messy, but it’s the midpoint of each range and better than quoting a measurement (say, originally at 00:14:59.999999….) as 00:00:00 when it would clearly be better as 00:15:00.

In this case, I suspect simplicity prevails. Most normal people (i.e. not me) would be more comfortable seeing nice round numbers: 00:00, 00:15 and so on. Seeing 00:07:30, 00:22:30 and so on is likely to be unnecessarily confusing. Thankfully the incoming quality of data is not that precise, so nobody will scrutinise this.

Quoting the full range (00:00 – 00:15) would be more appropriate anyway, in tables and text reports.