Posts

Showing posts from December, 2017

Alright, alright, here it is....

Image
Happy New Year... Now fuck off and stop saying I'm not festive!

Using Flash Drives in ZFS Mirror

Image
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

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.

Windows Defrag v KingDian SSD... FAIL

Image
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 be

C/C++ Stop Miss using inline.... PLEASE!

Image
This is a plea, from the bottom of my rotten black heart, please... Please... PLEASE stop miss using the inline directive in your C and C++. Now, I can't blame you for this, I remember back in the 90's being actually taught (at degree level) "use inline to make a function faster", and this old lie still bites today. inline does not make your function faster, it simply forces the compiler to insert "inline" another copy of the same code whenever you call it, so this code: #include <iostream> inline void Hello() {     std::cout << "Hello"; } int main () {     Hello();     Hello();     Hello(); } Turns into the effective output code of: int main () {     std::cout << "Hello";     std::cout << "Hello";     std::cout << "Hello"; } What does this mean in practice?  Well, you saves yourself a JMP into the function, and the position on the stack holding the return address, and the RET from the fun

C++ : The unrandom random number...

Image
I've been working in some C++, with boost to be precise, the machine I'm working towards finally has a processor with SSE3 in it, and so I've been to revisit the GUID generation code, boost specifies a couple of defines you can set up before incluiding the uuids header to help... #include <iostream> #ifndef BOOST_UUID_USE_SSE3 #define BOOST_UUID_USE_SSE3 #endif #include <boost/uuid/uuid.hpp> #include <boost/uuid/uuid_io.hpp> #include <boost/uuid/uuid_generators.hpp> #include <boost/lexical_cast.hpp> const std::string GetGuid(); int main () { for (unsigned int i(0); i < 100000; ++i) { std::cout << GetGuid() << "\r\n"; } } const std::string GetGuid() { boost::uuids::uuid l_guid = boost::uuids::random_generator()(); return boost::lexical_cast<std::string>(l_guid); } This code looks fairly innocuous, "GetGuid" is the key part, you may argue that you're always setting the random number gener

Manifold Garden - Chyr's Update

Image
I've previously mentioned William Chyrs work of art that is Manifold Garden in previous posts, however, he's just released a development update to the world that the game is slightly behind schedule, but he is hopeful of an early 2018 release. You hear more from William himself on YouTube below: Or you can get the low-down via the Steam app entry here . I'm sure, if you're anything like me, you'll still see this amazing development as worthy of your attention. Enjoy!

Virgin Media Cable to Wet String Maybe?

It has been just under a month since I started to measure my internet connection speed, I've been paying for 50Mbit, and receiving pittifully less at all times of the day, and huge dips during what is tabbed the "peak time".  We get massive slow-downs whilst streaming - constantly - opening say ITV player and then opening a web-site for wikipedia totally freezes the player until the whole wikipedia page has loaded - remember wikipedia is mainly text, there's very little media data being exchanged, but the player is just cut off; it's dreadful. There's no reason for this, when I was paying for 200Mbit I was receiving around 33-36MBit at all times, so deciding to pay for only 50Mbit I was to save money and still get this speed I had had - since I never ever got more... But it seems this is totally beyond Virgin Media, they're playing speed throttling shenanigans .... However, the clever chaps at Andrews and Arnold engineering might just have the solution for

Crashed my Build Server....

Image
When I say I crashed it, I mean... It just locked up and I had to soft reboot it... And when I say build server I mean one of the virtual machines on one of my Xen Hosts.... So, the machine is a fairly beefy 16 core machine with 48GB of RAM running on a Dell server under the desk, this disk base is a RAID-0 200GB unit over a bunch of 2.5" 10,000 RPM SAS Drives to a Perci5 RAID Controller.... The machine is only really spooled up for big builds, and this was one of them, I wanted to build LLVM support before bed. The problem?  When I performed the build with "make -j all" it would get to 16% and then blank the screen, and totally lock up, nothing, nada, nowt... I left it for a while but nothing happened, and yes the LLVM build is time consuming but it doesn't lock at 16% for minutes. Soft reboot, and the same happened again... I've started the build again with "make -j 15" rather than all sixteen cores.  And it's already up into the 35% area of the b

Start C++?

I've been writing C++11 or better code, well since 2010, as I started doing so with the TR1 as was.  We're nearing eight years since then, and it starts to show. So, where would I recommend starting to learn modern C++?  Well, if you've never programmed before, don't start by learning C or C++, go learn Pascal, or Python , or something else which is more friendly.  I started out in Pascal, for a good three years, before I started to work in C and later moved into C++ (in 1998) so if 20 years of C++ teach me anything, it's don't try to learn if as your first language. Once you have a concept of how to program, then start to learn C++, and I would recommend finding someone - hopefully like me - and asking them.  An hours chat with them, to help swap what you know with what they know, is a good start. Saving any such friends, YouTube, watch CPPCon, BoostCon, watch talks about programming C++ but most importantly get a development environment and cut some code, if y

Great Rack Mount Mistakes #5

Image
It has been a while since I've brought to you the tales of woe from my past... But this one isn't a tale of woe for myself, it was some other poor bugger who had to suffer, though I was involved. After my first in-depth IT related job, I got into looking after some big systems, and I mean so Big they could have starred Tom Hanks... The last one of which ended, officially in early 2001, this was my looking after an IBM AS400 machine. It had several terminals hooked into it, many suited analysts (as the non-programmers were called) regally sipped coffee and generated reports from it, there were also several ASCII Serial wireless hand-held terminals for roaming about the site with, all pretty cool.  I however was not involved in any of this, my job was to look after the PC's on the site and keep the AS400 fed with back-up tapes. One of the PC's however took me within a solar breath of the chorona of glory that was working with the BIG IRON, and this was a little IBM PC, ru