Monday, February 10, 2020

VMMEM.EXE High CPU Useage with Hyper-V

If you're using Hyper-V and finding that VMMEM is using a lot of CPU on your host you might want to swich scheduler type from root to core or classic. To find out what you're currently using run the following in power shell:
Get-WinEvent -FilterHashTable @{ProviderName="Microsoft-Windows-Hyper-V-Hypervisor"; ID=2} -MaxEvents 1

1 = Classic scheduler, SMT disabled
2 = Classic scheduler
3 = Core scheduler
4 = Root scheduler
To switch run the following in an elevated command prompt:
bcdedit /set hypervisorschedulertype type
Where type is one of:
Classic
Core
Root
It seems classic is probably best for most of us.

Thursday, August 08, 2019

How to get AirBnB to (really) delete your account (really).

  1. Email their data controller at dpo@airbnb.com asking them to delete your account attaching a scanned copy of some ID (I know, right!). If you are an EU citizen 😢 they are obligated to delete your data under the GDPR's right to erasure.
  2. Er, that's it.
Deleting Your AirBnB Account - A Flow Chart

Sunday, May 26, 2019

systemd unit to start a browser/user process on network up

It took me far too long to get this script right. The gottchas:
  1. User units cannot reference or interact with system units.
  2. On my system at least I needed to specifically enable systemd-networkd-wait-online.service to have network-online.target work.
  3. To enable pulse audio from a system process you need to
    1. set XDG_RUNTIME_DIR, which
    2. needs uid, not user name.
[Unit]
Description=Start Firefox
Wants=network-online.target
After=network-online.target

[Service]
User=[USER]
Environment="DISPLAY=:0"
Environment="XAUTHORITY=/home/[USER]/.Xauthority"
Environment="XDG_RUNTIME_DIR=/run/user/[UID]"
ExecStart=/usr/bin/firefox

[Install]
WantedBy=multi-user.target



I haven't looked into using this unit as a template as I'm not sure how to translate the user name into uid for the XDG_RUNTIME_DIR variable. It's a real shame we can't run it as a user process else we'd be able to use %u and %U.

Monday, December 10, 2018

Fitting a 15mm High Drive into a Gigabyte BRIX GB-BXBT-1900

You can just about squeeze a 15mm high hard drive into a Gigabyte BRIX BXBT case. I did it with the GB-BXBT-1900, but all the BXBT cases look to be the same.

The first thing I did was break off the U bend/clips at the end of the hard drive caddy.
Caddy
And fit the drive.
IMAG0168
Since every picometre counts screw the drive on to the bottom of the mount, not the side.
IMAG0169
The highest component in the case is the pair of USB sockets, but if you turn the base plate through 180° the drive will miss this and hit the slightly lower ethernet port.
IMAG0171
You still need an extra couple of mm and I found that nuts from a meccano set were perfect.
DSCF4203
Carefully place your spacers over the screw holes, put the base plate back in place and screw the screws back in.
IMAG0166
As you'd expect the case doesn't quite go back together perfectly but it seems stable enough.
IMAG0176
I checked the distance by dabbing a bit of paint on the top of the ethernet port. It's extremely close but not touching. I've had it running for a few days now without issue.

Wednesday, September 14, 2016

That time a BT rep. recommended I use "something like Password123"

There are loads and loads of sites out there with ridiculous password rules, but BT gets a special shout-out for their special, multiple, password policies. In case it's not obvious no one has any business capping the length of a password or disallowing certain characters. A hash will always end up the same length and you can hash any character. Besides, once the password is hashed you don't know what characters it's made up of anyway. If nothing else BT is a technology company so really should know better.

We are moving, BT has a sale on, my wallet beat my morals and I decided to go back to BT from Andrews & Arnold.

So I got past the BT ordering page and onto the account setup page. I generated my random 20 character password as usual and pasted it into the password field, but up came a big red banner, saying "Passwords must be 8 characters long, contain only letters & numbers and need to start with a letter." (I've only just noticed that it says "be 8 characters long", at the time I read it as "at least 8 characters long".)



Note how the text is helpfully truncated. I thought this was pretty dumb but changed my password generator to use only letters and numbers, start with a letter and set the length to 40 characters. That password was accepted by the JavaScript on the page, but then I went to paste the password into the confirmation field and nothing happened. Yep, JavaScript was now preventing me from pasting my generated password into the password confirmation field. (I'm not sure if a proper password manager would have managed to do this automatically.) No problem, I fired up the browser dev tools and removed the anti-paste code.



I filled the rest of the form in and clicked "Continue". The same page loaded again, but this time with a big red warning saying "Please ensure all required information is complete."



I wasn't even sure that this was about the password, so I got onto their chat support:

Issy: Good morning Jamie
Issy: How may I assist you with your order today?
Jamie: Hi
Jamie: I am trying to create an account
Issy: I'll be happy to assist you with that
Jamie: but at the "Please complete your set up options." page
Jamie: where I choose a password etc
Jamie: it comes back with
Jamie: "Please ensure all required information is complete."
Jamie: no indication of what is wrong
Jamie: I have filled everything in
Jamie: also
Jamie: there are a number of other issues with the form
Jamie: the password rules are stupid
Jamie: and I can't paste into the password confirmation box
Issy: Please make sure your password isn't too long. Something linke Password123 should work
Jamie: HOLY FUCK
Jamie: are you joking?
Issy: Please don't use that one. It wouldn't be too safe
Jamie: can I download this chat transcript?
Issy: Please select the small envelope at the top of this chat to send a copy to yourself
Issy: You can also copy and paste
Jamie: so is twenty characters too long?
Issy: That's right
Jamie: your password policy doesn't allow special characters
Jamie: alpha numeric only
Jamie: and twenty characters is too long?
Jamie: so what's the maximum length then?
Issy: That's correct Jamie. It would need to be within 8-16 characters. I'm aware it doesn't show this on the page
Jamie: Wow.
So yes, a 16 character alpha-numeric password worked. But this isn't the end of the story. Once I had logged into the BT website I checked to see if I could change my password to a longer one, and yes, I could! In fact there didn't seem to be limit to the length, but it still didn't like special characters. But that still isn't the end of the story, while writing this blog post I wanted to see if you could create a BT account outside of the order process. You can, and on that page once you enter an invalid password there is actually a helpful description of which special characters are allowed: "Only use numbers, letters and these special characters :!@#$%^&*()_+-=[]{};':",./?". Using these I was finally able to generate a long random password with special characters.

Bonus lolz

Remember how I said I was moving? Well during the order process I ticked the box to say that I wasn't yet living at the property, but I wasn't asked for a current postal address, where they would be able to send the confirmation details.
Jamie: do you know when/where the confirmation letter will be sent?
Issy: This would be to the address your service is to be connected
Jamie: but I'm not living there at the moment
Jamie: the current owners are
Issy: You may want to make them aware to expect the letter.
Jamie: Brilliant.

Thursday, November 19, 2015

The Martian - The Swiss Cheese of Films

Just a few of my issues with The Martian. Spoilers, obviously.
  1. The version of the human race in the film has had the foresight, ingenuity and money to start a colony on Mars, but they couldn't tie a guide rope between the spaceship and the base, or between each other. You know, like climbers have been doing for centuries. It didn't have to be a low tech hemp rope, it could have been wound kevlar, but no, nothing. And so Matt Damon gets blown away...
  2. But not that far, and yet the rocket takes off and he doesn't get burnt to a crisp. In fact there is no evidence of the rocket taking off at all...
  3. But taken off it has, and then shoots off back to earth. No "Let's hang around for a bit in case he's not dead?" Or "Why don't we just press pause on the return to earth procedure in case we need to go back to Mars?"
  4. The version of the human race in the film has had the curiosity to start a colony on Mars, and yet they are not curious enough to have a look at what might be left behind on Mars, what damage might have been done during the storm, or if Matt Damon was really dead, you know, useful stuff.
  5. Eventually they do have a look, 51 days later. And what do you know? Matt Damon's not dead. It will take over a year to prepare a ship and get it to Mars, so they turn the spaceship around and get back to Mars in just 51 days... no wait, they don't, and so the film continues.
  6. So Matt Damon wants to communicate with Earth using Path Finder, great, lets use our modern radio systems and modern computers to... no wait, we have to *physically* go and find and boot up the old Path Finder machines.
  7. Using hex to communicate through Path Finder. This is *so* inefficient, you're using 16^2 possible combinations for a possible 26 characters.
  8. So eventually they do decide to send the ship back, but wait, it doesn't have enough fuel, everyone is scratching their heads until the stereotypical loner genius has an idea! The slingshot! This is the worst moment of the film. I honestly nearly stood up and screamed "Of course! The slingshot!" The slingshot has been done to cliched death in science fiction and was first used in real life by the Marina 10 probe in 1974. This is probably why no one mentioned it, they all thought it was a bit passée.
  9. There are some women characters, but they still get a lot of patronising mansplaining.
  10. The film ends and Sean Bean is still living.

Thursday, October 01, 2015

Camera Repair Quote from Sendean Cameras

Since Yelp appear to hide bad reviews I thought I'd also post my review of Sendean here.

I dropped off a camera at Sendean for a repair quote. The camera would switch on but the lens wouldn't extend fully. The quote I got back was as much as the camera would have been worth in mint condition. When I declined they reduced the quote by a third, but I still didn't think it was worth it so I went to pick the camera up. The first time I arrived at the shop I was told that the camera was still in bits and that I'd have to come back the next day, which I did. However once I had got the camera home it wouldn't turn on any more at all (a strap lug was also missing). I called Sendean to discuss this and the guy's attitude was terrible. He first claimed that they hadn't even disassembled the camera. When I pointed out that I'd been told the camera was in bits the first time I'd come to collect it his attitude got even worse and he said "you started with a broken camera, and you've still got a broken camera." Unbelievable.

Tuesday, September 29, 2015

Flickr Auto-Uploader for Windows Phone

Flickr Auto-Uploader for Windows Phone will automatically upload pictures and videos from your Windows Phone device to Flickr. You can choose the privacy setting and tags of the uploaded files, any of your phone albums to upload from and one of your Flickr albums to upload to. If you have a Lumia 1020 it can upload the high resolution images for you.

Thursday, July 23, 2015

Flickr authorisation URL doesn't work on certain browser components

Writing a Flickr app for Windows Phone I was confused as to why the authorisation URL was forwarding the user to http://m.flickr.com instead of the authorisation page after they logged in and I had to detect that and forward them to the authentication URL again. After a while even this stopped working, despite the fact that copying the URL into IE worked as expected, ie, after the user logged in they were forwarded to the authorisation page. For a while I was convinced Flickr must be discriminating by user agent string. The answer was staring me in the face, which was pointed to by an SO answer. Scripts weren't running on the browser in the app, they are disabled by default, you have to enable scripts in the Windows Phone WebBrowser component with IsScriptEnabld.

Saturday, April 11, 2015

Manually Fixing Multiple Screens with Different DPIs in Linux

Step 1:

Set the system wide DPI to a comfortable level for your highest resolution screen, using X Resources. There is a DPI calculator here.

Step 2:

With the DPI set in step 1, work out what scaling is comfortable on your secondary screen. You can do this by adjusting the layout.css.devPixelsPerPx Firefox setting or with xrandr, eg:

xrandr --output HDMI1 --scale 1.3x1.3

Step 3:

Update 11-Nov-2016: It appears that you no longer need supply the --fb parameter, iirc the previous symptom was only being able to access a certain area of the lower DPI screen.

Calculate the total screen size for the xrandr --fb parameter. To do this multiply the x and y resolution values of your secondary screen by the scaling factor, and then add the primary value, depending on whether you have your screens left/right or above/below. In my case both my monitors are 1920x1080, my secondary monitor is scaled at 1.3 and I have my primary monitor below my secondary monitor, so my total screen size is 1920 * 1.3 x 1080 * 1.3 + 1080, or 2496x2484.

Step 4:

Update 11-Nov-2016: There is a script here which will do these calculations for you. Obviously you may want to change the scale factor of 2.

Calculate the position of your two monitors. My primary monitor is centred below my secondary monitor. So my secondary monitor is at 0x0 and my primary monitor is at (1920 * 1.3 - 1920) / 2 x 1080 * 1.3 or 285x1404. 

Step 5:

Put the above values into xrandr:

xrandr --output HDMI1 --scale 1.3x1.3 --mode 1920x1080 --fb 2496x2484 --pos 0x0
xrandr --output eDP1 --scale 1x1 --pos 285x1404

With thanks to this SE post.

Udate 09-Aug-2017

Step 6:

Out of the blue I started getting:

xrandr: screen cannot be larger than 8192x8192 (desired size 12800x2880)

To fix this I created:

/etc/X11/xorg.conf.d/85-screen.conf

Section "Screen"
        Identifier      "Default Screen"                                       
        DefaultDepth    24                                                     
        SubSection "Display"
              Virtual 12800 12800
        EndSubSection
EndSection

This didn't work when it was ordered after the monitor section.