Surface Go: Fonts look a little heavy? Don’t forget ClearType tuning!

The title kinda says it all.

If you, like me, are the owner of a brand-new Surface Go, but also own another Surface Pro, you might find that the font weight is a little heavy by default when switching between side-by-side devices.

To fix that, just hit Start, type ClearType (OK, “Clear” is often enough) and run the ClearType text tuner. Then squint and/or answer honestly 🙂

It’s not something everyone needs to do – my Mum doesn’t have competing devices on a day-to-day basis – but it’s worthwhile to do the “ClearType eye test” for whatever eye-distance at which you actually use your new Surface buddy!

 

(This post brought to you by someone that noticed BGR on my RGB display while reading this!) Hint: Ctrl+Win+= zooms in Magnifier, and Ctrl+Win+- zooms out again… No extra software needed…

Conditional Formatting Text in Excel from PowerShell

Hopefully a helpful note, as this had me confused for a while…

I wanted to add text-based conditional formatting to an Excel sheet I was creating from PowerShell – so I could colour one of the columns automatically depending on the values.

I used the technique any self-respecting dabbler would: I recorded a macro in Excel VBA and then tried to convert it over.

But no matter what I tried, I couldn’t get the !&$^$^@ FormatConditions.Add function to work.

After debugging the idiot-level mistakes (null variables; debugging without parameters 😐 ) out of the script, I was left with:

Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
At C:\Users\tristank\Desktop\excelfmt.ps1:201 char:1
+ $newthing=$ActionColumn.FormatConditions.Add($xlTextString, $cond, $x …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException

Soo… not enough arguments, then?

The VBA reference which comes up first in Bing (and Google for that matter) wasn’t helpful – 4 arguments and I’d tried every combination of arguments I could conceive. The count seemed fine. But no FormatConditions object…

But debugging from the command line (thanks ISE), I tried punching in $ActionColumn.FormatConditions.Add( , and was stunned to see 7 arguments in the tooltip.

I added $null to all of them (natch) – and it worked! (Or at least I had a rule with the right conditions and formatting, but the condition was in the wrong spot).

So, armed with this new knowledge, I found the Excel Interop Object Reference for FormatConditions.Add … and there ya go. 7 arguments.

Object Add( XlFormatConditionType Type, Object Operator, Object Formula1, Object Formula2, Object String, Object TextOperator, Object DateOperator, Object ScopeType )

As I’d already been experimenting by the time I found the documentation, it seems like several bits might be interchangeable. I don’t know what I’m doing; I can’t warrant that this will work under any conditions except my own.

But to save someone else the time, here’s mine:

$ActionColumn = $worksheet.Range(“G:G”)
$xlTextString = [Microsoft.Office.Interop.Excel.XlFormatConditionType]::xlTextString
$xlContains = [Microsoft.Office.Interop.Excel.XlContainsOperator]::xlContains
$cond = “ACTION”
$newthing=$ActionColumn.FormatConditions.Add($xlTextString, “”, $xlContains , $cond, $cond, 0, 0) # hacky dodgy hacky hack / works

$fcs=$ActionColumn.FormatConditions.Count
$ActionColumn.FormatConditions.item($fcs).SetFirstPriority()
$ActionColumn.FormatConditions[$fcs].Font.ThemeColor = [Microsoft.Office.Interop.Excel.XlThemeColor]::xlThemeColorDark1
$ActionColumn.FormatConditions[$fcs].Font.TintAndShade = 0
$ActionColumn.FormatConditions[$fcs].Interior.Color = 255
$ActionColumn.FormatConditions[$fcs].Interior.TintAndShade = 0
$ActionColumn.FormatConditions[$fcs].StopIfTrue = $false;
   

And yes, I was naughty and used two indexing operators (during my “long script debugging” phase, when I was troubleshooting an uninitialized object and didn’t know it).

Sigh. And hope that helps!

Note: Surface Pro Volume-Up Reset

I once experienced a problem with my Surface Pro 3 where the keyboard (and screen rotation) stopped working while I was working in another State.

I can never find the instructions I used to fix it, so I thought I’d post them here.

Note: For Surface Pro devices only.

Hold Power and Volume Up for 15 seconds. The screen may do things (turn off, turn on. weird clown images appearing) during this time, but just keep pressing and holding.

After 15 seconds, release the buttons, and then press the Power button to boot the Surface again.

And check to see how things are…

The RDP Ghost is real.

Recently, when connecting to a reasonably-sleepy Windows system, I’ve seen the RDP Ghost.

An 8 bit rendition of a scary, scary ghost. It scared me.

If you’ve seen it, you’re not alone. It’s a thing.

I hope – one day – to capture a screenshot of this apparition.

The Rules appear to be that you can never be ready for a screenshot when RDP Ghost appears.

Update 22/04/17: I WAS READY! Kinda. And caught enough that I can understand the cause and the effect.

The good news is, you’re probably not hacked by a supernatural force. Probably. It’s just Windows trying to draw the sign-in guy before it’s ready!

image

Huh.

You find lots of draft posts when your user interface changes…

Hi! I’ve been waiting for my blog to migrate for what seems like forever. Now it’s back, and Open Live Writer’s a thing, and so I guess I might be back too. Sweet. Somewhere to jot things and rant a bit.

FAQ: Yep, still alive.

Hyper-V Synthetic Networking Is Much Faster

I decided it was time to look at upgrading my home broadband, mostly to get better-than-128KB upload speeds.

After the ISP-side change had eventually wound its way through, I was interested to see that while my upload speeds had improved, my download speeds still seemed capped at about 25Mbits/s (rule of thumb: divide by 8 to get megabytes per sec, so about 3MBytes/sec), despite a new modem and speeds that should’ve been “up to 100Mbit/sec”.

Before launching a tirade at the ISP, I re-plugged my laptop directly into the cable modem, and got around 120MBit/sec test results from speedtest.net, so knew it wasn’t the ISP-side plan itself rate-limiting me any more. And thus began the investigation.

A packet walks into a bar

My setup looks basically like this:

(regular internal networks on 10.x subnets) -> [ TMG -> DMZ -> Smoothwall ->] Cable

With a “side path” for the Xbox, which goes (10.x) -> Smoothwall -> Cable, to benefit from the UPNP mapping feature of Smoothwall.

Technically, any UPnP device or app can use the same side path, but “regular” browsing by WPAD-enabled stuff can benefit from TMG’s web proxy cache to some extent.

Any testing I performed through Smoothwall led me back to the 25MBit capped rate. I checked QoS was off, which it was, and then decided I’d eliminate Smoothwall and try pushing the laptop through TMG directly (bypassing the Smoothwall) as a test.

The test gave me ~115MBit/sec+. Good enough!

Leaping to conclusions

The complicating factor is that everything to the right of the internal networks above is virtualized on my WS2012 R2 Hyper-V box, and I guessed that the rate limiting might have something to do with the legacy network adapters in the Smoothwall VM (one each for internal and external, plus a perimeter NIC for fun). My TMG VM uses synthetic NICs only, so I assumed that it was probably the key performance improvement when using it. The CPU on the router VM didn’t seem to be breaking 0% (externally; 4% is 100% of one core), so I guessed that was a sign the cause might’ve been semi-external, or in the hypervisor.

Rather than work out what performance counters I could use to prove this, I figured I’d try to get the legacy NICs upgraded to the new Hyper-V synthetic NICs instead.

And after reading the vast array of “here’s how you compile XYZ into your kernel” articles on it, I figured that it sounded way too hard (especially as I was using a now-legacy copy of SmoothWall Express 3.0) and finding some kind of distro which worked with Hyper-V enlightenments was probably the easiest route! No pun intended.

How do you test that? Easy, you just leave a VM at default settings – which include a new NIC – and see if it can detect the adapter. If it can, great! If it can’t, try another!

My Little Firewall (packets are magic)

First, I did a little research as to what might support Hyper-V natively, and found pfSense 2.2, based on FreeBSD 10.2, which has inbuilt Hyper-V integration services. I installed it, it found the new NICs, and after minimal faffing around, I had a working firewall, which speed tested up around 115-120MBit/sec. Boosh!

pfSense looks really capable and has lots of new options to explore, but I wondered whether upgrading to SmoothWall 3.1 (which I’d been putting off) would have yielded similar results? I don’t have a huge rule set to migrate, so I started building a fresh Smoothwall Express 3.1 VM from the 200MB ISO, and after configuring my networks from scratch, tried that… also a nice, fast result with synthetic NICs.

So I now have a choice of external firewalls (and whether to bridge the cable modem again, which I like: fewer moving parts to manage), with speedy integrated networking components, and I’m generally quite happy that non-Windows distros seem to be integrating the Hyper-V components for faster-than-legacy networking!

[Update and aside 2017-03-03 – I eventually added a scooter computer to the lineup as an always-on low-power host, and put PfSense onto it “bare metal”. But it quickly became apparent that the Realtek NIC driver included in the box was pretty suboptimal, and would drop out under mild load. So I’m now running Server 2016 on the tiny host, and PfSense in a VM on it, and it’s fast and reliable using the Windows Realtek NIC driver virtualized through Hyper-V. Ironic fun!]

MSDEToText for TMG sometimes produces negative IP addresses

… which can be annoying when you're trying to work out where your traffic's headed, with something like LogParser.

I fixed my MSDEToTSV (note, I renamed it so that it reminded me what format it produces – I only need to use it once in a blue moon), and I'm posting the fixed version here in case you'd like a copy.

The edits were just to the IpFromDbl function.

MSDEToTsv.zip

Installing Windows from a USB Stick (and copying it to that stick from an ISO)

(Quick public dump so I can find the tool link again easily)

 

  1. Download the Windows 7 USB/DVD tool from here. (NB links to the page, not the EXE)
  2. Download ISO image from store or MSDN
  3. Run Win7 USB DVD Tool and point it to ISO and USB Stick
    • Label stick
    • Seriously Tristan, label the damn stick
    • You know what happens when you don’t.
  4. Boot from stick, or run Setup from stick
  5. ???
  6. Profit!

Works for Windows 8, worked for Windows 8.1 Preview, no reason to think it won’t work for Windows 8.1 RTM, or Windows Server 2012 R2 etc.

Good if you’re planning a clean installation; otherwise, simply double-clicking the ISO is probably enough to do the upgrade as of Windows 8, which can mount ISOs and VHDs from a double-click.

Office Web Viewer

While Skydrive’s been able to display Office documents in your web browser for what seems like ages now, check this out:

Do you have Office documents on your website or blog that you want your readers to view even if they don’t have Office installed?  Would you rather view a document before downloading it?  To give your audience a better experience, try the Office Web Viewer.

What is the Office Web Viewer?

It’s a service that creates Office Web Viewer links.  Office Web Viewer links open Word, PowerPoint or Excel files in the browser that would otherwise be downloaded. You can easily turn a download link into an Office Web Viewer link to use in your website or blog (e.g., recipes, photo slide show, a menu, or a budget template).

Some benefits of the Office Web Viewer include:

  • You don’t need to convert Office files for the web (e.g., PDF, HTML).
  • Anyone can view Office files from your website or blog, even if they don’t have Office.
  • It keeps eyes on your website or blog, because readers don’t need to download the file and they stay in the browser.
  • One link will work for computers, tablets, and mobile phones.

Yup, it’s a service which creates viewable links to Office documents, in a browser.