Mike Meredith

May 202017
 

I just love messing around with run-time languages that I know relatively little about (and if your sarcasm detector isn’t flashing red about now, take it out and give it a good talking to).

The problem detailed here is something that you are unlikely to encounter unless you get into weird stuff like running an odd-ball window manager, aren’t content with the version of said window manager distributed with your Linux distribution, and are used to re-compiling things from scratch.

It all started when I upgraded Ubuntu on my work machine (to Zesty Zapus). The window manager version was upgraded from 3.5 to 4.0, which broke on my configuration file (3.5); not a big problem I thought, as I had already upgraded my window manager at home to 4.1 and reconfigured the configuration file. I copied the updated configuration file from home into place.

And it failed. Apparently I use 4.1-isms within the file. As I was not happy about tinkering with the file to downgrade it (in a language I know relatively little about), I decided to re-compile Awesome 4.1 instead.

Which failed with a weird error :-

» awesome --version
awesome v4.1 (Technologic)
 • Compiled against Lua 5.3.3 (running with Lua 5.3)
 • D-Bus support: ✔
 • execinfo support: ✔
 • xcb-randr version: 1.4
 • LGI version: [string "return require('lgi.version')"]:1: module 'lgi.version' not found:
	no field package.preload['lgi.version']
	no file '/usr/local/share/lua/5.3/lgi/version.lua'
	no file '/usr/local/share/lua/5.2/lgi/version.lua'
	no file '/usr/local/share/lua/5.3/lgi/version/init.lua'
	no file '/usr/local/share/lua/5.2/lgi/version/init.lua'
	no file '/usr/local/lib/lua/5.3/lgi/version.lua'
	no file '/usr/local/lib/lua/5.3/lgi/version/init.lua'
	no file '/usr/share/lua/5.3/lgi/version.lua'
	no file '/usr/share/lua/5.3/lgi/version/init.lua'
	no file './lgi/version.lua'
	no file './lgi/version/init.lua'
	no file '/usr/local/lib/lua/5.3/lgi/version.so'
	no file '/usr/lib/x86_64-linux-gnu/lua/5.3/lgi/version.so'
	no file '/usr/lib/lua/5.3/lgi/version.so'
	no file '/usr/local/lib/lua/5.3/loadall.so'
	no file './lgi/version.so'
	no file '/usr/local/lib/lua/5.3/lgi.so'
	no file '/usr/lib/x86_64-linux-gnu/lua/5.3/lgi.so'
	no file '/usr/lib/lua/5.3/lgi.so'
	no file '/usr/local/lib/lua/5.3/loadall.so'
	no file './lgi.so'

Which had me stumped for a while, and it turns out that DuckDuckGo didn’t have an obvious fix (one of the reasons for writing this).

Eventually I figured out that awesome was not finding the LGI module (I can be slow at times) which was odd because it was definitely installed. However it turns out that it was installed in /usr/share/lua/5.2/lgi. So despite having lua 5.3 installed, extra lua modules can only be seen if you have lua 5.2 installed?

The “fix” for this was to create an environment variable telling LUA to search for files in rather more places before starting Awesome :-

export LUA_PATH="/usr/local/share/lua/5.3/?.lua;/usr/local/share/lua/5.2/?.lua;/usr/local/share/lua/5.3/?/init.lua;/usr/local/share/lua/5.2/?/init.lua;/usr/local/lib/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?/init.lua;/usr/share/lua/5.3/?.lua;/usr/share/lua/5.2/?.lua;/usr/share/lua/5.3/?/init.lua;/usr/share/lua/5.2/?/init.lua;./?.lua;./?/init.lua"

This was created by running lua from the command line and running print(package.path) to display the default setting, and adding the 5.2 equivalent for many elements.

As to whether it works or not, well I cannot be sure (I’m not going into work on a weekend just to check if the window manager fires up), but Awesome itself seems happy with the result :-

» awesome --version
awesome v4.1 (Technologic)
 • Compiled against Lua 5.3.3 (running with Lua 5.3)
 • D-Bus support: ✔
 • execinfo support: ✔
 • xcb-randr version: 1.4
 • LGI version: 0.9.1

So it can find LGI, but whether it can do anything useful with it remains to be seen!

May 172017
 

It may not be very funny, but the funny thing about WannaCrypt is that it is somewhat of a failure! Unless the authors are spectacularly stupid (not entirely impossible incidentally), they have no way to recover their ill-gotten gains. The pile of looted bitcoins they have acquired is fully visible, so any attempt to use those coins will almost certainly result in them being tracked down – they have attracted too much attention.

Which is another aspect of the WannCrypt malware – it has highlighted the vulnerability (MS17-010) and caused a huge vulnerability hunt. Which is causing those who wrote other malware (such as Adylkuzz) to gnash their teeth, because otherwise their malware would have quietly worked away in the background. The malware authors behind Adylkuzz have probably made more money than the WannaCrypt malware authors … and may well get away with their loot too.

Which is why other malware authors “wannacry” – the attention that WannaCrypt has gotten has ruined MS17-010 for them.

May 172017
 

It seems rather strange when you discover it, but Windows Update sometimes lies about what updates have been installed. I am not sure how often this happens, but it does happen from time to time. Which with WannaCrypt rampaging around is somewhat unfortunate.

What seems to happen is that Windows Update gets confused about what patches it has installed – it’s internal database gets corrupt. One possible fix for this is to remove the database :-

net stop wuauserv
cd %systemroot%
ren SoftwareDistribution SoftwareDistribution.old
net start wuauserv
rd /s/q SoftwareDistribution.old

When using Windows 10, you may well have to start (net start wuauserv) Windows Update services before stopping them. Once you have removed the directory, the next time you run Windows Update in the gooey, it will spend some time rebuilding it’s database and hopefully will then pick up the missing updates. No promises but this worked on at least one server that had unacknowledged missing patches.

Of course without a proper vulnerability scanner it may be tricky to determine when Windows is lying about being fully patched. The best bet is to assume it is lying whenever something like WannaCrypt comes along.

The other possibility is to look into something like Autopatcher which is intended for offline updates – you can download the Microsoft updates and use the tool to patch Windows computers from the downloads.

May 082017
 

Many of us know about the story of King Canute (or probably Cnut) and his attempt to hold back the tides. Although we English typically only give one king the suffix “the Great” (Alfred), Cnut himself is also known as “the Great” (perhaps more for his non-English endeavours). So it seems a touch unlikely that such a king would imagine he could control the waves by verbal command; if anything he might want to make fun of his courtiers by trying the impossible to indicate he was human.

It is a popular tale with the Church too – it’s a great example of over-weaning pride which is one of the seven deadly sins. And Cnut as a Dane, probably was not the most popular king with the church, as Danes had only recently given up going viking and pillaging churches and monasteries (in the words of a fictional viking: “they gather all their gold and silver into one building. And then so conveniently mark those buildings with crosses.¨).

But there is a far more prosaic explanation for the tale in which the Church uses a human disaster to laugh at people’s efforts to improve themselves.

Before the raw sewage pollution in the 19th century put an end to it, the South coast was home to a massive oyster fishing industry that existed in the region for at least two thousand years. Indeed, oysters were one of the staple food sources for the poor until the 19th century.

One of the ways that shallow water oyster fisheries can be improved is by building dyke-like structures that allow the high tide in, but keep some of the tide from escaping at low tide. As it happens, a place in West Sussex called Bosham happens to be ideal for this, and there is supposedly much archaeological evidence to show that these “dykes” had been built there repeatedly over the centuries.

As anyone who lives by the sea knows, to build sea structures, you have to over-build and even then, exceptional storms will cause damage, and there is also archaeological evidence to show that the “dykes” at Bosham were washed away in exceptional storms every few hundred years.

As it happens, Bosham was a royal estate in the time of Cnut (one of his daughters is supposedly buried at the pictured church), and it is all too likely that an exceptional storm would have destroyed the oyster beds whilst Cnut was holding Bosham. Thus the Church had an opportunity to use an economic disaster to poke fun at king they were probably not too fond of.

May 012017
 

With an election coming up it is time to try and persuade those who do not vote to get out there and vote. One of the main reasons people give for not voting is because none of the candidates are inspiring enough. Well it is all very well waiting for a candidate that inspires you, but you could well be waiting for a very long time.

Probably the second biggest reason for not voting is that with the first past the post system, there are places where voting for anyone other than the leading candidate is seen as a wasted vote. Nothing could be further from the truth! In almost every “safe” seat, if everyone who didn’t vote for the leading candidate all voted for an agreed alternative, then the seat could easily go to that alternative candidate. For example, the Arundel and South Downs constituency was won with 32 thousand votes in a constituency of nearly 100,000 – easily enough to overturn the Tory majority.

As to tactical voting: It can be summed up by selecting the candidate you would most like to lose (such as the Tory candidate), and picking the candidate most likely to defeat them.

Anyone can find out the last few election results (and a whole lot more) at http://www.electoralcalculus.co.uk/. Just look at the last few elections and vote for the second placed candidate (providing that’s not a Tory or a UKIP candidate of course!). And don’t keep punishing the Liberals for breaking their promises; they don’t break their promises any more than the others.

Of course this may mean you are not voting for the candidate you want, but under the present voting system it makes more sense to vote against the candidate you dislike the most. Yes this is crazy, but so is using a voting system first used in the medieval era!