Monday, 12 November 2018

RIP : Stan Lee

Stan's done and gone... Sad...


Tuesday, 6 November 2018

Hackers....

God I love this film...


Sunday, 4 November 2018

Server Crash... Bad Memory

I've spent about three hours checking and sorting out the machine which went down, and come-what may I found problem after problem, but not with any of the software.  If your software checks out then there's an obvious other place to look... Your hardware.

My first step was to remove the drives, specifically my ZFS devices.  No difference, everything still broke.

I then set about systematically removing one piece of hardware at a time, first my quad ethernet card, no difference, then I removed the added dual SATA card still broke...

Finally, I removed all the memory and inserted just one stick...

For the first time the firmware of the motherboard reported something had changed (at boot) it knew the memory has reduced from 8GB to 2GB.  But then the grub boot was really fast, it came up and into the system very quickly.

Now, I had been getting MySQL Error 2013 for nearly ever query or SQL dump, with 2GB of RAM this didn't happen, sudo and all the programs now work again... I can therefore only assume one of the other sticks of RAM is corrupt in some manner.


So with a clean boot...


I was able to start pulling the data out...


I ran the server on soak in memtest for an hour and still no problem, there was ONLY a problem after MySQLd had started and 8GB of RAM was installed... Time to bin some of these sticks.

Server Crash... And Corrupt

Yeah, something very bad has happened with one of my boxes... It was not responsive over the network this morning, I thought little of it, power cycled it and came back to it this afternoon.

Anyway, it was still not playing ball, I rolled the vmlinuz image back to 4.4 from 4.15 (the last unattended update I did last week) but everything.  I mean everything, every command, every program (except cat and ls) resulted in a "segmentation fault".

Booting into recovery I got a little further, but the syslog looks very worrisome...


And I could only see this image when I had hauled the machine back into the office and plugged a VGA cable into it, over the network and even over the serial TTY it just sat there spinning it's wheels.

I would like some of the data back off this box, it contains the current (more recent) live image of my WOW server and it contains the old archived version of my Ark server.

Other than that there is a ZFS area which I've dumped home photo's onto, but getting that back is easy, I just pull one of the drives out and remount the ZFS elsewhere... I think though I may buy a new main disk for this machine, I like it.

Thursday, 25 October 2018

One Line Posts...

They're almost tweets but not... Anyway, why do Americans refer to the collective genius of Rowen Atkinson only through Mr Bean?  Yeah, random today ain't they?

Wednesday, 24 October 2018

Red Dead Redemption II

I've got a game boner... A big big game boner

Monday, 15 October 2018

C++: To Reference or Not

Constant Something Reference or Something constant reference... I ask myself this in a similar manner as Prince Hamlet at the start of the nunnery scene... For as a C++ programmer and English speaker I've always found myself most comfortable using the phraseology thus:

const int X (0);

And to pass this to a function:

void foo (const int& p_X);

I find this most useful, we're passing a constant integer reference to the function... However, I was recently challenged that this meant something else to a reader, her input was that it meant "constant integer" reference, that is we would ONLY be able to pass "const int" instances, not "int" instances.   The thinking being:

const int X(0);
void foo(const int& p_X);

foo(X);

Would compile, whilst:

int Y(42)
void bar (const int& p_Y);

bar (Y);

Would fail to compile or at least spit out a warning because "int" was not able to be passed into the function as "constant integer" and "integer" to this reader were different types.

They're not really of course, constant is a decorator (and one which we can remove with const_cast) the aim of using "const int reference" as the type is not all of our purpose in declaring the function like so, the purpose is to communicate what we do with the value going into the function.

It is 100% not about stopping Y being passable into the function as above.

No, we want to tell any user of our code that within the functions "foo" and "bar" we do not change the value, if they pass Y to us with 42, when the function is complete Y will stil contain 42.  If the value could potentially change we would not be able to use "const" that's the purpose of passing const in this case.

Passing by reference is just to save us the time, effort and delay in allocating memory and taking a copy of the parameter before moving into the body of the function, so:

void bar (const int p_Y)

Would be the same operation as above, we tell the user we don't change the value of the parameter, but we do because we take a copy of the value being passed in and operate upon it.

The communication we get with this is very useful.

But of course, if we're using threaded programming and we pass a reference to a value at time point A, then sometime later elsewhere edit the referenced value, we may run into unexpected behaviour, so there is an argument sometimes to take a copy at the point of instantiating the child function, in the most part however, passing by reference is considered the norm.