Dark's Code Dump

Possibly useful

Fix for League of Legends patch error code 004

Patching failed and we’re not sure why. Please restart the client to try patching again. (Error code 004)

If you have moved your League installation to another disk and used a symlink from the previous location to the new one, as of roughly patch 9.10, this no longer works.

Simply update your shortcuts to point directly to the new location, including the working directory, and all will be well.

GitHub does not respect GDPR in a reasonable way

Comment edit history is public (not a fan, but Facebook does this so whatever).

Deleted comments and their edit history are visible to the repository owner (yikes).

And the clincher: their support refuses to directly delete/anonymise comments under GDPR. (Mega yikes.) They claim to be a ‘processor’ and that any GDPR request has to be forwarded to the repository owner.

I’ve never heard of such a ridiculous policy and I can’t believe this is legally possible within the spirit of the GDPR. You don’t have to ask permission from a Facebook page owner to delete a comment left on their page! Somehow GitHub has managed to get themselves classed as a hosting service, not a social network. Fair enough for the git repos themselves, but god only knows how they legally wrangled that one for things like Issues.

In conclusion, think very carefully before posting anything whatsoever on GitHub. The only way to remove it is the nuclear option (delete account).

Bitlocker EDrive / IEEE 1667 Hardware SSD encryption on Dell XPS 15 9550

There is a lot of conflicting information about whether hardware encryption for Bitlocker works on the older XPS 15 laptops (9550 and probably 9560).

The answer is no, it does not work. The BIOS does not implement the required UEFI features. It fails when rebooting to apply, and when skipping the hardware test, soft-bricks the SSD.

Note I am referring specifically to Bitlocker EDrive mode (hardware encryption). Class 0 encryption also does not work on these laptops as there is no facility to set a BIOS password for NVMe disks.

Collectd disk plugin produces no output

I spent a while scratching my head over the collectd ‘disk’ plugin producing no output whatsoever on a Debian 9 server. No log output (other than successful load), no rrd files, nothing.

Frustratingly, debug logging in collectd is compiled out by default, and compiling collectd from debian source packages requires an insane number of dependencies, so I avoided that route.

Instead through analysing the source and history of the disk plugin I came across this commit. The issue turned out to be simple – in the backported kernel I was using, /proc/diskstats has a tonne more fields than the default 4.9 kernel, and this was causing the disk plugin to fall over silently.

It’s a ballache to do anything about this situation on Debian 9, assuming the backported kernel is essential. If you hit it then best just wait for Buster.

Tvheadend smooth output for 60hz display

Tvheadend 4.3 adds support for custom ffmpeg parameters via the ‘spawn’ stream profile. The following command line facilitates smooth output from interlaced 25/50hz Freeview to 60hz, without introducing the soap opera effect (only simple linear blending is used).

/usr/bin/ffmpeg -i pipe:0 -vf "yadif=1, minterpolate='mi_mode=blend:fps=60'" -bitrate 3000k -bufsize 3000k -c:v libx264 -preset veryfast -c:a aac -c:s copy -f mpegts pipe:1

This uses a disgusting amount of CPU time, but given there are no alternative ways of producing a watchable output on many devices, it’s well worth it. For example there is no alternative on Android, Kodi, etc. You can either have linear blending or questionable deinterlacing, but not both, and certainly not as nice deinterlacing as yadif=1.

Update: I stand corrected on the Kodi front, at least on Windows if you disable DXVA2, set output to Pixel Shaders and set deinterlacing to Deinterlace (not half), you can get high quality deinterlacing and linear blending, but it comes at a substantial CPU/GPU cost.

Brief review of Dell PowerEdge T110 II

  • Well designed + built
  • Quiet even at high load, more so than most desktop PCs
  • BIOS is absolute garbage:
    • No PCI-express 1.0(a) support, which prevents the use of many old low-speed PCIe cards such as NICs and TV tuners
      • Dell couldn’t give a toss about this, because hurr durr it’s a server who cares about standards if we can line our pockets from makers of PCIe NICs and raid cards via a little something we call Planned Obsolescence(tm)
    • Power saving features such as PCI ASPM are missing
    • Can’t disable onboard GPU in spite of a perfectly functional serial port and SoL implementation, unless a discrete GPU is present, but surprise surprise 99% of GPUs don’t work due to PCIe and power limitations.
    • Cannot boot from USB (or at all?) without at least one SATA device present
    • It’s made by Insyde, need I say more?

Garbage text from Serial-over-LAN on Dell server

Hit an issue on a PowerEdge T110 II where SOL was completely unusable with corrupted/garbage text.

Changing the terminal mode from VT100 to ANSI in the BIOS settings fixed it. (Even though I was using fully VT100 compatible terminals ¯\_(ツ)_/¯ )

Can’t boot from USB on Dell PowerEdge T110 II

Found myself stuck and couldn’t find any options to boot from USB (no BIOS settings and boot manager was completely blank. Here’s what fixed it:

Plug in at least one SATA disk (yes this is a ridiculous limitation) then go to Boot Manager (F11) and press enter on your SATA disk.

A menu then appears giving the option to select the USB drive.

How to remove all Javascript from WordPress

Why do modern web developers insist on hundreds of kb of Javascript when it achieves literally nothing at all? Here’s how you can make WordPress load several times faster, and without breaking any functionality, assuming your use case is a simple blog + comments.

Add the following to somewhere in your theme’s shared functions file, or similar:

function remove_all_scripts()
    if (!is_user_logged_in())
        foreach (wp_scripts()->registered as &$script)

add_action('wp_enqueue_scripts', 'remove_all_scripts', PHP_INT_MAX);

The ‘is logged in’ check facilitates the wp-admin panel among other things.

Windows Dynamic Disk vs Storage Spaces vs Intel RST for RAID 1

Disks are 2x Western Digital Red 4TB. All configurations are RAID 1. (Technically Storage Spaces Mirror isn’t true RAID 1, but it’s the closest possible for this comparison.)
Disregard the varying partition sizes – all tests are at the start of the drives.

Individual disk

Dynamic Disk

Dynamic Disk

Seems to be good for performance, and is more portable than any hardware or fake RAID. Contrary to some outdated posts elsewhere, it does distribute reads across both drives. However it does not distribute sequential reads, so performance is not as great as it could be for some workloads.

The major drawback is how easily resync is triggered and how much it destroys performance for real-world read loads until complete. For example I loaded Divinity 2 while resyncing and it took minutes as opposed to seconds. Any time you happen to BSOD or otherwise improperly shutdown, or even hibernate (including fast startup) it triggers a resync.

Partition management is limited – the only software I could find capable of editing an existing Dynamic Disk setup was EaseUS, and when tested it froze attempting to resize an empty partition and hosed the RAID. Additionally if you have more than one partition on a dynamic disk RAID, resyncing occurs on each partition simultaneously, so on standard hard disks it destroys resync performance to have more than one partition!

Overall good performance and well-supported for future migrations, but a no-go for more than one partition, large disks, hibernation or PCs without flawless stability.

Storage Spaces

Storage Spaces (default Thin provisioning)

For the longest time I’ve been using Storage Spaces with zero data issues, but the poor performance of gaming workloads pushed me to look for alternatives. The preallocation done by Steam and Fortnite updates is extremely slow under Storage Spaces compared to bare disks(!) or any other type of RAID I’ve tried.

The benchmark results mask just how slow certain workloads can be – anything that involves reading/writing to the same file (e.g. patching) or allocating a large file using a non Windows API approach is dog slow. (OTOH fsutil file createnew is fast.)

Storage Spaces (fixed provisioning)

That said, Storage Spaces still manages to outperform a single disk slightly for reads, and even for writes, with the latter likely due to the abstraction reordering the random writes produced by CrystalDiskMark into something more optimal.

I’ve seen little discussion of Fixed provisioning of Storage Spaces online – it’s hidden behind arcane powershell commands. As it supports normal defrag (which implies a more natural on disk format) I was hoping for performance to exceed thin provisioned storage spaces, but it is actually slower across the board. There doesn’t seem to be any reason to use fixed provisioning over the default thin provisioned mode.

Speaking of on disk formats, it scares me slightly that the contents of each disk isn’t a carbon copy of the other.

Compared to dynamic disks, partition management is good – you can resize and add/remove partitions at will with even more flexibility than an ordinary disk. Tools support is good as each partition is presented to the system as a Basic disk.

The resyncing issue of Dynamic Disks doesn’t exist at all in Storage Spaces – throughout countless BSODs, resets, power losses, etc. I’ve not once seen Storage Spaces do any kind of resyncing, nor have I experienced any issues with my data stored on it.

Overall good support and a solid choice if redundancy and data protection are your aims, but the performance is lacking

Intel Rapid Storage Technology

I never thought I’d find myself considering fake RAID, but given I’m currently using a Supermicro server motherboard in my desktop with a special ‘enterprise’ incarnation of Intel RST, I figured I’d give it a shot. Note: I have reason to believe the performance of RSTe (as opposed to RST on desktop-grade motherboards) is improved, especially for RAID 1, so take these numbers with a pinch of salt.

Intel RSTe

The benchmark results for read performance eclipse the other options – even sequential reads are distributed across both disks. Writes are slower, but this is with all the dangerous write caching options disabled (I have no UPS). I can confirm these performance figures in real world performance – everything is subjectively faster than the other configurations.

I’m mildly concerned about what happens when I upgrade my PC and/or my motherboard fails, as my future plans lie with AMD. I put my mind at ease slightly when I discovered there is an option (unique to RAID 1) on RST that can turn the first disk back into a standard non-RAID disk without rewriting the data, so the on disk format must be close to an individual disk. Seeing the amount of recovery software available as well as a pure-software implementation in Linux also gives me hope I’m not digging my data into a hole. I actually feel happier with Intel RST than I would do with a hardware RAID card in this regard – at least it will work on any Intel board rather than one particular RAID controller.

This is good old fashioned fake raid, so partition management and tools support is flawless – as far as software is concerned it is a single disk.

Like Dynamic Disks, resyncing is an issue in the case of unclean shutdowns/BSODs/etc, but from my experience it only occurs in rare cases – many unclean shutdowns do not trigger it. It is also a nicer implementation – not triggered by hibernation/sleep, and it can be paused and resumed by hibernation or shutdown, as opposed to dynamic disks which will restart from scratch. It also does not attempt to resync multiple partitions at once, so it is a relatively fast linear operation. System performance impact during resyncing is roughly the same as dynamic disks – i.e. significant.

Overall performance is excellent, software support is flawless, future thinking is slightly better than true hardware RAID but behind the other software options.

Final thoughts

There’s no one-size-fits-all solution, but I’ve found myself doing a complete 180 from ‘lol fake raid who uses that’ to actually recommending Intel RST above other options for Windows.

Dynamic Disks work well until you inadvertently trigger a resync, then you spend the next day being reminded of how bad they are. The design goals behind Storage Spaces – archival and flexibility – clearly come at the cost of performance.

I’ve ignored proper RAID cards, but ultimately until Microsoft get their act together and create something on the same level of MD or BTRFS, hardware remains king. I wouldn’t be surprised if there was indeed a financial reason why software RAID is slower on Windows.

3 months later…

An update on this: I’ve decided to move my RAID storage to BTRFS RAID 1 and access it on Windows via SMB. Performance is remarkably good – despite benchmarking slower than any of the options here, real world use is at least as good as Storage Spaces. Annoyingly some software (Epic Games launcher, Battle.net, etc) refuses to work on a network share, but Steam works well. The integrity checking of data on BTRFS trumps all these issues in my book, alongside regular backups in case BTRFS itself falls over. Plus with zstd compression and subvolumes (shared free space), I was able to condense 6TB worth of disks into 4TB.

During the process of moving, I discovered I could mount one of the Intel RAID 1 disks on Linux directly as if it were a standalone disk (with no additional configuration) – so this is a huge positive for the safety of data on Intel RAID 1 in case of motherboard failure.