Saturday, 6 January 2018

World Cup 2018 Group First Leg Predictions

Before all the Octopi, Squirrels, Cow-Pat Bingo and whatever else gets rolled out for the Football (yes, not Soccer folks) World Cup in Russia I thought I'd give you my game by game predictions... It might be worth an accumulator?  But you may just find lots of my own personal bias.

Group stage - First 16 Games Predicted...

Game 1:  Russia v Saudi Arabia - Russia 2 to nil, as hosts I think they stand a real chance to put a stamp on the game.

Game 2: Egypt v Uruguay - Egypt 1, Uruguay 1 - I feel that Egypt have some talent for them and this will over arch Uruguay's historic tenacity.

Game 3: Morocco v Iran - Morocco 1, Iran 0 - This is a pretty even match in my opinion, however, I believe Morocco will pip it.

Game 4: Portugal v Span - Portugal 1, Spain 2 - Very hard to pull this one, it's going to either see lots of goals or not very many, but I'm going to edge Spain over the Portuguese as they'll want to put a mark on the score card against their regional adversaries after the Spanish turmoil of 2017.

Game 5: France v Australia - France 2, Australia 0 - I'm sorry to say I don't think this'll go anywhere except France's way, Aussie still rules!

Game 6: Argentine v Iceland - Iceland 1, Argentina 0 - As the chap whom has helped save the wife's life from cancer is Icelandic, I'm voting with my heart and my hopes.

Game 7: Peru v Denmark - Denmark 2, Peru 0 - I've got to say the Danish will enjoy this one, with no real rivalry on the international stage I can only say this may feel like one of those  wonderful friendly world-cup matches.

Game 8: Croatia v Nigeria - Croatia 1, Nigeria 1 - I think things maybe slightly swayed on the Croat side, but Nigeria squad isn't to be sniffed at, pulling things even.

Game 9: Costa Rica v Serbia - Serbia 2, Costa Rica 0 - One of those one-sides group matches, but I believe the Costa Ricans won't let the Serbs have it all their own way.

Game 10: Germany v Mexico - Germany 3, Mexico 1 - My git feeling is of course for German dominance, however I don't think Mexico will let it go into a Teutonic slide.

Game 11: Brazil v Switzerland - Brazil 2, Switzerland 0 - Very one sides I'm afraid, though I think the Swiss will play good structured football.

Game 12: Sweden v South Korea - Sweden 2, South Korea 1 - I actually think this maybe nil nil in the full-time mark, but if I'm taking my head at true value Sweden should pull through.

Game 13: Belgium v Panama - Belgium 2, Panama 0 - The Belgians, if they can hang together as a team, will walk over the tiny Panama offering, however it'll again be a friendly feeling game.

Game 14: Tunisia v England - England 1, Tunisia 0 - We English will probably cock this up mightily, giving everyone at home heart failure to just about pull a head.  However, if the English score early they'll go off the boil; as we always do; and there's potential for a real upset.

Game 15: Colombia v Japan - Colombia 2, Japan 1 - I think the Japanese will play well, however can they over come the South American side?.... I'm not certain.

Game 16: Poland v Senegal - Poland 1, Senegal 2 - I think the African side will push up forcing the Poles to equalise, but there'll be a last minute push from one or the other, I'm very split on this it may go even, but ultimately I think it'll be down to whom is most hungry.


That's the end of the first match in the Group Stages from me, more will follow...

Friday, 5 January 2018

Bad Code...

You know when you open someones code and you find this inside a class function...

unsigned short currentMessageOffset = this->CurrentMessageOffset;

That you're in for a rough ride.

First of all, WHY assign the member value on the right to a local?  No-where else in the class is this value edited or read, so there's no need to assign it to anything.

And then the naming, this naming of something local with the same name, and it is the same name, despite the capitol leading letter, it's the same name, just makes this utterly useless.

All this before even mentioning that the code is an assignment not an allocation, so annoying.

Wednesday, 3 January 2018

Ultra Cheap ZFS Array

Make your own ZFS array (mirrored) with USB Flash drives, for cheap!



Since this... interesting post of mine... has only about 10 views, and my tech items usually get a few hundred, I figure somewhere along the lines it got trampled by my silly New Years post....

Monday, 1 January 2018

Alright, alright, here it is....

Happy New Year...



Now fuck off and stop saying I'm not festive!

Sunday, 31 December 2017

Using Flash Drives in ZFS Mirror

This post comes from an idea I had to allow me to easily carry a ZFS mirror away from a site and back again, we didn't need much space - only 5gb - but it had to be mirrored in triplicate, one copy to stay locally, one going into a fire safe on site and the third to be carried by the IT manager off-site each evening.

The trouble?  A near zero budget, so for a little over £45 we have a 14GB ZFS mirrored pool, across three 16 GB USB Flash drives and one three port USB 3.0 hub.

It was perfect for the task at hand, extremely portable, and cheap, I thought the same approach may help anyone trying to get to learn a little more about ZFS, a student or even someone using a laptop as a small office server - as the laptop literally has its own battery back-up system built in!

It's not the fastest solution, its in fact extremely slow, but as an entry step it's perfect.

See the full video below, throughout the commands I list were in use...



Commands:

Listing Disks by ID...

ls /dev/disk/by-id

Listing Disks to a file for use in a file script as you see me using...

ls /dev/disk/by-id -1 > disks.txt

------------------

To install ZFS on Debian/Ubuntu linux:

sudo apt-get install zfsutils-linux

------------------

To remove & purge ZFS from your system:

sudo apt-get purge zfsutils-linux

(and you will be left with "/etc/zfs/pool.cache" to remove or back up yourself).

------------------

Command to create the pool...

sudo zpool create <Name> mirror <DiskId1> <DiskId2> etc...

The name we had here was "tank", if you already have data on these disks you will need to add "-f" to force this change through.

------------------

Command to make a file executable - like our sh script:

sudo chmod +x <filename>

------------------

Zpool Commands:

sudo zpool status

sudo zpool import <name>

sudo zpool scrub <name>

sudo zpool clear <name>


You will want to "import" if you completely remove ZFS or move one of your sticks to a new machine etc, simply insert the disk and import the pool by name.

Scrub will be used whenever you return a disk to the pool, remember the point here is to allow you to replicate the data across the three sticks and be able to remove one or two to safe keeping, be that an overnight fire safe, or taking a physical copy with oneself.

Clear is used to remove any errors such as the Pool becoming locked out for writing - which it may if a drive, or all drives are removed - you simply clear the current problem with any pool.


Summary:  Remember this is NOT the optimum way to run ZFS, this is actually extremely slow, you are replicating each write over your USB, you can only cache so much in the RAM, but it is not a performance piece, this is about ensuring one replicates data for safe keeping, a small office or your dorm room server setup could be completely provided by a laptop in this manner, it has it's own battery backup, it is quite (if you get the right machine) and really this is a very cheap way to play with ZFS before you move onto other bigger hardware options.  Plus, I find the best way to learn about technology is to break it, even a little, and so constantly breaking down your pools by pulling USB sticks out of them is an excellent opener to recovering your pools.  Play about first, don't put anything critical on there until you're really happy with the results.

For an excellent post covering creating ZFS pools, cheak out programaster's post here: http://blog.programster.org/zfs-create-disk-pools

And for the official ZFS documentation you can check things out with oracle here: https://docs.oracle.com/cd/E26505_01/html/E37384/toc.html


Oh, and Happy New Year... I guess I made it to 100 posts this year...

Saturday, 30 December 2017

99....

I just noticed that I'm at a count of 98 posts for 2017, so this is just a post to give me 99.... The next might be more interesting... But not by much.

Friday, 29 December 2017

Windows Defrag v KingDian SSD... FAIL

I'm sure you all already know this one, and many vendor specific implementations of SSD drivers/applications prevent this... Not me though.

Yes, I have a dirty cheap (£27) SSD from KingDian in my Laptop... Wait, wait wait, stop abusing me!  This is just a boot disk to hold a local OS and some scratch space, all my storage is provided to this machine over NFS.
The trouble?  Well, in the late summer the wife and I had a few days away in deepest darkest Wales... Now this was a disconnected break, however, I couldn't resist taking the laptop loaded down with a few DVD based games and a steam download or two, plus I got to take some system code with me and a slew of PDF's I could read... I got a lot of work done, even without Linux (yes I had to flatten the machine back to Windows 7).

And I pretty much put the machine away until just before Christmas, I then needed it again, so flipped it out the cabinet and fired it up, only to immediately find the battery was dead... It had been dying, I rely on a meager source of dodgy, second party batteries from China... You know the kind of Lithium cells you'd not want to leave alone too long.

But being Christmas I was skint, so I've had to wait until the end of the month to get a new battery... Which arrived today, I left it to fire up and take it's first charge, everything looked fine, it was still Windows from the holiday, so I left it to it and I've been and enjoyed some TV...

Upon coming back up however, the machine is mental... Telling me I have no boot device, I had left the machine on... It has no network connection, so it can't have downloaded a Windows update and restarted... I was a little baffled... But fear not, I'm a trained professional...


This got us into a Windows Recovery, and after not giving a shit and starting normally, back into windows, where I started to puzzle out the problem....

Event Viewer, and Applications... Nothing but the panic about the non-clean reboot... System... Hmm... System shows the last event at 16:54 and then the reboot at 23:54 (alright, don't judge, I watched three films okay, and we had a take-away!)...

 So what was the event at 16:54... "Service Control Manager".... Hmm, which service.... "The Disk Defragmenter service entered the running state"...

OH SHIT... This is an SSD, you really shouldn't defragment them (it reduces their life)... So it tried to defrag and not only crashed windows, but made the device/bios not able to inter operate upon a warm restart.  That's quite a feat.

A hot reboot sorted everything, so I'll not dig any further, however, I'm interested in this phenomenon.  The disk is a cheap chuck away one, so I start the defrag manually... BOOM, crash, same thing.

I trawl through my box of bits and find an old OCZ 128GB SSD (which has about 26% life remaining - lol) and I throw Windows 7 onto this... Let it all set up and I come back (it's about 23:35 now, if anyone's counting).  Starting the defragger on the OCZ device, no problems.... It just does nothing, the management software from OCZ stops any nastiness.



Back to the KingDian, boot up.. .and Defrag... BOOM.

It's definitely something about the very cheap KingDian drive... Any ideas?  Drop it into the comments, but its back to Arch for this machine me thinks.