Browsed by
Category: Problem solutions

Beating splosh-kaboom minigame in Legend of Zelda: Wind Waker

Beating splosh-kaboom minigame in Legend of Zelda: Wind Waker

It took them about 10 years to build this speed running tool, but here it is. How it helps you win is even more fascinating than the minigame itself. Random number generators on consoles are notoriously simple and have been exploited for some time – but this takes it to a whole new level.

It’s a beautiful example of how a computer scientist would break down and solve a problem. It’s also a perfect example of why cryptographically secure random number generators are essential to computer security.

I think I might use this question in future interviews…

Understanding SSD form factors and interfaces

Understanding SSD form factors and interfaces

SSD’s have been transformative to the entire storage market. The use of solid state memory instead of spinning platters changed how thin, light, rugged, and power efficient modern laptops are.

However, understanding them well enough to upgrade your system has not been easy. Turns out, there have been not only a bunch of different form factors, but interfaces as well. Most guides I found do a terrible job explaining the differences – and often use form factor and interface types interchangeably in confusing ways.

Lets start our journey in understanding different SSD form factors and interfaces with termenology:

Form factor: The form factor is the physical dimensions for the drive. The form factors tells you if the drive will physically FIT in the system. They tell you nothing about whether the drive will actually WORK with your system – or even plug in.

It is possible to find two drives that have the same form factor, but be based on very different physical or interface technologies. For example: it’s possible to find a 2.5″ hard drive that uses traditional physical platters or solid state memory. It’s also possible to find 2.5″ drives that use the SATA interface or IDE (or many others too).

Interface: The interface of a drive tells you how the drive communicates and transmits data with the rest of the system. The interface is often (but not always) revealed by the type of power/data plugs that the drive has.

It is possible to buy a drive with the right interface for your system, but find out it won’t physically fit in the system. It is also important to know that, just like USB ports, some interfaces have the same physical plugs, but support many different speeds of data transfer. It’s possible to buy a drive with the right interface, but find that it’s nowhere near as fast as the interfaces allows (such as plugging in a USB 1.x device to a USB 3.x port).

Traditional hard drive form factors

These drives look very much like the old platter drives of days gone by. They came in a standardized 5.25″, 3.5″, 2.5″ and 1.8″ drive sizes. This size refers to their form factor – their physical dimensions. You can buy both SSD or older platter sized drives in these same form factors. It’s also often possible to buy display units and usb or flash drive readers in this form factor.

USB 3.0 and audio port kit that mounts in a 3.5″ drive bay

These form factors are legacy from older platter and CDROM drive dimensions; but kept because it made mounting and replacing drives easier for PC manufacturers. Desktop systems often have several 5.25″ drive bays for CDROM/Blu-ray or other optical disk formats (though back in the day, there were even 5.25″ hard drives and 5.25″ floppy drives). 3.5″ and 2.5″ drive bays can be found in desktops and laptops. As laptops shrunk, hard drive sizes did too. 1.8″ drive sizes were the smallest things got before we moved to even smaller formats that didn’t need 4 point physical mountings that spinning drives did.

  • 2.5″ Physical size: 100.5mm x 69.85mm x 9.5mm (height can vary by manufacturer)
  • Connector type: 22-pin standard 2.5” SATA connector

PCI Express Mini/Mini-PCIe/mSATA/MO-300 (full or half size)

This form factor isn’t very common for storage and is something of a halfway step between platter drive form factors and M.2. You’re likely to encounter it in laptops. This form factor comes in two varieties: full size and half size.

Great care must be taken with this form factor. Both mSATA and mini PCIe cards have the exact same form factor AND connector type – but may or may not support both product types.

  • Physical size: 50.8mm x 29.85mm
  • Connector type: 52-pin card edge connector (split into 16-pin & 36-pin sections)

Half slimSATA/SlimSATA (MO-297)

This is a rarer format these days. This form factor comes in half and full sized versions. It can be identified by the fact it uses the standard 22 pin SATA connector.

  • Physical size: 39.8mm x 54mm
  • Connector type: 22-pin standard 2.5” SATA SSD connector

M.2 – Keys and slots

M.2 is the latest, most modern form factor for SSD devices. M.2 was introduce as the Next Generation Form Factor, but I have only seen it referred to as M.2. You can find not only storage in M.2 form factor, but also WiFi, bluetooth, GPS, and other devices. This form factor comes with two important form factor parameters: length and keying.

M.2 SSDs typically come in the three sizes above, which may be deduced from the card name —2242, 2260, and 2280 – “22” represents the width in millimeters (mm), while the next two digits represent the length, also in mm.  It is possible to have a wide variety of widths and lengths – but the above sizes are the most common for storage.

Next up is their “key” type. Believe it or not, there are 12 different kinds of M.2 keying, but the most common for storage are B, M, and B+M.

In this case, you can often determine the interface type by the physical key-ing. B+M (which can fit in socks for B-keyed and M-keyed modules) are usually SATA interfaced. M.2 devices that use the NVMe interface are often only M keyed.

Interfaces

Serial-ATA/SATA

SATA is still probably the most common interface on the market today. You can find it on everything from older platter drives, SSD drives of many form factors, Blu-ray drives, CDROM drives and burners. It was a great replacement for the older IDE interfaces of the 90’s.

SATA has gone through numerous upgrades over the years as speeds have increased. Most modern drives today use SATA 3 – which delivers 600MB/s peak performance. SATA maintains very good backwards compatibility with older versions of SATA. Due to designs, most SATA3 SSD drives get 500-550MB/s. Physical spinning platter drives usually can only get to 100MB/s due to their physical speed limitations (limitations of the read heads/platters – not the interface). So just moving from a platter drive to a SSD version of the same SATA interface can often yield you around a 5x speedup.

The important point about this interfaces is to know that if your device uses the SATA 3 interface, you won’t be getting faster than 6GB/s performance. This can be confusing because some system that use the M.2 form factor supports SATA3 and the much faster NVMe interface.

You might think you are upgrading when you get rid of your 2.5″ form factor SSD drive that has the classic slimline SATA connectors (the ones shown above) for your fancy new M.2 form factor drive, but if that new M.2 drive uses the SATA 3 interface internally, you will be getting pretty much the same drive.

PCIe

PCIe drives are a little more interesting because they’re using the main interface bus of the system as opposed to through a storage protocol like IDE/SATA/NVMe. These devices typically carry additional development costs because they must write their own software/hardware layers to convert PCIe protocol read/writes to solid state memory access.

While PCIe devices have theoretical maximums that are far in excess of other drive interfaces, most typically interface via PCIe 1.x or PCIe 2.x specifications – meaning they have maximum 250-500MB/s rates. Early Intel Optane memory drives used PCIe because that interface was the only ones that could get the to the 2800MB/s range before NVMe.

NVMe

NVMe stands for the Non-Volatile Memory express interface. The Non-Volatile Memory Host Controller Interface Specification (NVMHCIS) is an open logical device specification for accessing non-volatile storage media attached via the PCI Express (PCIe) bus.

Interfaces that were designed during the era of physical platter drives (IDE/SATA/etc) have very different latency profiles and very linear/serial input/output characteristics. These interfaces weren’t designed to exploit the unique performance characteristics of non-volatile memory storage. The NVMe interface was designed to capitalize on the low latency and massive internal parallelism of solid-state storage devices.

By its design, NVMe allows host hardware and software to fully exploit the levels of parallelism possible in modern SSDs. As a result, NVMe reduces I/O overhead and implements performance improvements like multiple long command queues, and reduced latency. 

How fast is NVMe? Well, some drives advertise throughput rates up to 3500MB/s (Samsung 970 Evo Pro) – which is almost 6 times the speed of SATA 3 SSD’s. This makes them around 35 times faster than platter-based hard drives.

Putting it all together

So, now we can put these things all together to help us understand how the different combinations work; and why people often confuse performance when they are not clear about both interface and form factor

Form factorInterfaceSpeed
3.5″/2.5″/1.8″ platter-based hard driveIDE 5MB/s to 133MB/s (ATA100/133)
3.5″/2.5″/1.8″ platter-based hard drive SATA3100MB/s typical
3.5″/2.5″/1.8″ Solid State Memory hard drive SATA1/2/3 150/300/600 MB/s max
M.2 Solid State DriveSATA1/2/3 150/300/600 MB/s max
mSATA (typically SATA1)SATA1/2/3150/300/600 MB/s max
PCIePCIe 1.x, 2.x, 3.x, etc250MB/s, 500MB/s, 1GB/s, etc
M.2 Solid State DriveNVMeUp to 3500+ MB/s

Now it’s more clear why one needs to pay attention to the form factor AND interface. The form factor can give us hints as to what interface is used, but is not a sure-fired way to know the performance characteristics.

You could have a 3.5″ drive that is IDE, or a platter-based SATA3, or even a SATA3 based SSD. Each has almost an order of magnitude performance difference between the previous. A PCIe device might use PCIe 1.x and get 100MB/s or be as fast as an NVMe based M.2 drive if it’s PCIe 3.x. A mSATA/mini PCIe device might give you 150/300/600MB/s if it’s SATA1/2/3, or 250MB/s, 500MB/s, or 1GB/s if it’s PCIe.

One of the more common current difficult ones is reading advertisements that tout M.2 drives. Many do not clearly advertise the internal interface – and you can’t tell by looking at the drive or connection. As we have seen, a M.2 drive that has an internal NVMe interface might make it up to 6x faster than the same one with a SATA interface internally.

Next up:

Now that we understand form factors and interfaces, one can move on to understanding the memory technologies behind SSD drives. There are many different kinds of memory that affect performance just as greatly as interface. Most SSD’s are designed with MLC, TLC, or QLC memory configurations. Even newer is XPoint memory used in Intel’s Optane drives.

Each of these memory technologies has performance characteristics on top of the limitations of their interfaces. Some of technologies lead their drives to become slow once the drive is mostly full, some start slowing when the drive is even half full. Some have longer MTBF reliability while others statistically fail much earlier. In some cases, different controller hardware can do much better or worse jobs with these inherent limitations.

But that might be a talk for another article…

Resources:

Interfaces:

Form factors:

Upgrading ssd’s/nvme drives

Upgrading ssd’s/nvme drives

Consumer SSDs (solid state drives) have been transformative for the PC world. Their massively smaller size, temperatures, and power requirements have made ultra-thin laptops possible, nearly double battery life, massively increase drop resistance, and their speed has increased performance of disk operations/booting by 10x or more.

The only down side is that they’re fairly limited in capacity. While platter-based drives are selling consumer-priced 8-10 terabyte drives, your average consumer-level SSD is a paltry 512GB for the same price. As prices drop and one upgrades their SSD, one is faced with a terrible upgrade procedure. Upgrading your SSD often means backing up your data, making a windows re-install usb, re-installing your OS, and restoring all your data and re-installing your apps. Annoying to say the least.

It would be great if one could just copy the current image to a new drive, expand the partitions, and just swap drives – but that doesn’t seem possible…or does it.

Equipment you’ll need:

First you need to know what kind of SSD your system has. Is it SATA, PCIe, M.2, U.2, mSATA, or SATA Express, or a soldered-on drive? There is a lot of confusion here, because there is the interface type (SATA, NVMe, PCIe) but there is also the plug type (SATA, M.2, etc). Often you will find guides that interchange or equate them in confusing ways.

Once you have determined your drive type, you need to buy an appropriate drive-to-USB adapter.

Hardware you’ll need

Get one of the following that matches your system configuration:

Software you’ll need:

The Procedure:

  1. Make a backup. No, seriously. You should make a full backup of your system and all those important photos and documents. Go buy an external hard drive and download a free backup program, or buy a cloud storage solution right now, and back up your system. What you’re about to undertake could result in a dead drive if something goes really wrong (static discharge, select wrong source/dest drive, etc). Besides, you have already been doing backups of all your stuff already – right. RIGHT?
  2. Plug in your new SSD/M.2 drive into your USB adapter and plug it into the USB port. To be safe, unplug ALL unnecissary drives – including USB, external backup drives, etc. The less confusion the better.
  3. The procedure I’m going to use is more fully outlined here. And more discussion here.
    1. Start up EaseUS Backup Home (free version).
    2. Click on the ‘Clone’ operation in the lower left sidebar.
    3. Select your SOURCE drive. Proceed to the next step.
    4. Select your DESTINATION drive. Make SURE this drive is your brand new, empty drive.
    5. When you click next here, you’ll see the partition layout of the source and destination drives. You’ll notice there is a tiny partition at the start of the drive – this is the boot partition and doesn’t need to be touched. The next, largest bar will be the system drive. Many laptops will have a 3rd, very tiny partition as a backup partition.
  1. While not immediately clear, you can actually click, move, and resize these partitions! If you can expand the second/larger partition to the end of the space, do so. If you cannot, you need to carefully MOVE (not resize) the 3rd/recovery partition to the end of the drive. Then you can resize the larger middle partition until there is no more free space between the tiny first and tiny 3rd partitions.
  2. Click proceed to image the source drive to the new destination drive. This could easily take 30-90 minutes or longer.
  3. Once you are done, shut down the program and power down the system.
  4. Take your new cloned disk out of the USB adapter.
  5. Physically swap the old drive in your laptop/PC with the newer drive. Unplug the system/disconnect internal batteries to avoid accidental poweron while doing this.
  6. Plug back in and boot. If you did everything correctly, you should be able to power up with the new drive and boot right back up like nothing changed. When you check the free drive space, you should notice all that new capacity!

Wiping and selling

If you wish to sell your old drive, then I recommend using the program DiscGenius to wipe it before selling it. Simply deleting the partitions doesn’t actually wipe the data – and it can all be read by crafty people. Don’t do this wipe of the old drive until you’ve used your new SSD for at least a week to make sure it won’t prematurely fail.

  1. Take the old, smaller drive you wish to wipe+sell and plug it into the USB adapter you used above. Plug this into your PC.
  2. Start up DiscGenius
  3. Delete all the partitions on the old drive. Make SURE you are picking the correct, old drive and not your current boot or a spare drive that’s plugged in.
  4. Right click on the now empty drive, and select ‘Erase Sectors’. Fill the sectors with random data and then click proceed. This will overwrite EVERYTHING on that drive with junk data. It will take around an hour or two. Once you’ve done this, nothing can be recovered from the drive. Safely unmount the drive, shut the program down, and unplug the drive.
  5. You can now sell or use the drive for some other purpose.
Removing the 60fps limit in Dead by Daylight

Removing the 60fps limit in Dead by Daylight

It seems that as games target more platforms on release, they are increasingly dumbing down the controls and limit features to the lowest common denominator platform. For PC’s, this mean frame rates are often capped at 60fps. Dead by Daylight goes even further by not even allowing you to change the FPS limit in the PC game. Those that have tried increasing the limit have run into various animation/physics bugs – indicating that this limit on the PC is due to lack of validation/issues.

The good news is you can remove this limit. If you want to change the VSync or FPS limit then edit GameUserSettings.ini located in your user directory:

C:\Users\'yourUsername'\AppData\Local\DeadByDaylight\Saved\Config\WindowsNoEditor\GameUserSettings.ini 

Change the following line to whatever you want your max frame rate to be. I have a 144hz display, so I set mine to this:

FrameRateLimit=144

This next step is not required if you just want to set the FPS limit, but you can also to turn vsync on/off by changing this line to true/false respectively:

bUseVsync=False

Save file. Play game.

Source: https://steamcommunity.com/app/381210/discussions/0/1741106440032943073/

Setting up a Raspberry Pi-hole

Setting up a Raspberry Pi-hole

Ad blockers such as uBlock Origin and Adblocker make the web usable – but are not available on every platform and not of the same quality.

Pi-hole is an Linux-based server setup that absorbs ads by filtering DNS requests. You set up the Pi-hole server on a simple Raspberry Pi, set your devices to use the pi-hole server to resolve DNS entries, and voila – any requests to ad sites are immediately and transparently absorbed.

This is far superior to ad block applications for a few reasons. First, because the websites doesn’t even know you’re using it, you will never get those annoying ‘disable adblock to continue’ messages. With a little extra work, you can make your wired/wireless router also run DNS requests through it so that all devices wifi connected phones/laptops/game systems/etc get free ad filtering.

I just set one up this weekend on a raspberry pi and it’s been interesting to play with so far. Pi-hole has been a bit too fiddly in the past, but seems to be working pretty well these days with a slick web interface and easy installation. So far, it has worked really well – but I do occasionally get a false positive and have to turn the filtering off. I’ll give it a few days and see if it grows on me.

Here’s the instructions I used: https://blog.cryptoaustralia.org.au/instructions-for-setting-up-pi-hole/

Changing the DNS for your Win10 system while still using DHCP:
https://www.windowscentral.com/how-change-your-pcs-dns-settings-windows-10

Setting up SSH after install on your raspberry pi so you can access your pi hole via windows/putty/etc.
https://www.raspberrypi.org/documentation/remote-access/ssh/

Here’s the parts list from Amazon:

Raspberry Pi 3 b+ Case, iUniker Raspberry Pi 3 Model B+ Transparent Case with Raspberry Pi Heatsink for Raspberry Pi 3B+, 3B, 2B – Access to All Ports (Clear) $5.68
Samsung 32GB 95MB/s (U1) MicroSDHC EVO Select Memory Card with Adapter (MB-ME32GA/AM) $7.49
Element14 Raspberry Pi 3 B+ Motherboard $36.97
iTrunk Raspberry Pi 3 Model B+ (B Plus) Power Supply, 5V 2.5A Extra Long 2M Micro USB Power Supply Charger Adapter for 2018 New Version Raspberry Pi $8.15
Windows 10 99% memory usage even when nothing is running

Windows 10 99% memory usage even when nothing is running

Running out of memory while running Windows isn’t exactly a new phenomenon. But since Windows 8, things have mostly gotten better from memory usage/performance.

I recently ran into an issue where I’d close down all of my apps, but leave my system on overnight. When I’d jiggle the mouse in the morning, I would be greeted with horrendously sluggish drive swapping and 100% memory utilization. On a system with 32 gigs of memory. Even worse, I opened up my task manager and shut down everything possible – but nothing was indicated where 25+ gigs of memory went. Bad job Microsoft, shouldn’t your performance tools be able to tell me what is using up 90% of my system memory?

I got a clue from the fact my non-pageable memory usage was huge. This, apparently, indicates a driver or service with a memory leak:
https://windows101tricks.com/fix-memory-leak-problem-on-windows-10/

The problem was the Killer Network Suite. Apparently, this is a pretty common problem with the Killer network driver. I uninstalled it, and the problems seemed to go away.
https://www.reddit.com/r/buildapc/comments/3yzjyz/killer_network_suite_gave_me_a_major_memory_leak/

I then downloaded and installed the DRIVER ONLY package for the network interface by going directly to the Killer network website.

Turns out that the Killer network suite unfortunately lives up to it’s name: it certainly killed all the memory on my system. 🙁

MacOS 10.14 Mojave in VMWare

MacOS 10.14 Mojave in VMWare

Developing a iOS app used to require buying a Macbook or Mac mini. With VMWare, it is no longer necessary. I used VMWare Workstation 15.0 Pro and was able to develop an app and debug it on real iPad/iPhone hardware. Setup instructions are here:
https://techsviewer.com/install-macos-mojave-vmware-windows/

Here’s the latest VMWare Mojave 10.14.4, 18E226 (March 25, 2019) image:

Further tips after the above setup

Sprite Dicing

Sprite Dicing

Handy technique for saving texture space! There are various tools to do this, but the basic scheme is to split up a large texture into much smaller chunks, individually trimming these chunks, and seamlessly reconstructing the sprite in the viewport.

Source image
Compresses down to this!