Certifiable


I recently switched to a new ISP, who have so far been excellent, however they use certificates signed by CAcert. While I generally agree with the principle behind that decision, it does make life difficult. They cheerfully say, “You can check the certificate is signed by CAcert, if you like, before accepting it.” But how?

Warning: the following approach to checking the certificate is signed by CAcert is quite likely to be rubbish, so it’s probably not a good idea to follow it! In my defense, it seemed like a reasonable balance between just accepting some random certificate and complete paranoia but if you know a better way, please let me know.

They aren’t on Windows but the CAcert root certificates are already included in various places, so it turns out that the simple answer might be to grab the certificate from a suitable Linux distribution. Just to be on the safe side, I wanted to find a distribution I could download securely. The best option I found was Tails, which has a secure download and, for extra peace of mind, can be verified with OpenPGP.

My chosen method for trusting the tails signing key was a tad more interesting on Windows due to the lack of an sha256sum command. Luckily it seems you can do anything in PowerShell, so with a little help from Brian Hartsock’s blog, this did the trick instead:

$ha = [System.Security.Cryptography.HashAlgorithm]::Create(“SHA256”)
$stream = New-Object System.IO.FileStream(“tails-signing.key”, [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read)
$sb = New-Object System.Text.StringBuilder
$ha.ComputeHash($stream) | % { [void] $sb.Append($_.ToString(“x2”)) }
$sb.ToString()

 

All good, certificate verified. I would still rather Andrews & Arnold just used a proper certificate though: there are clearly problems with trusting all the certificate authorities that are included in browsers/operating systems by default but CAcert doesn’t exactly look like a fantastic example either, and normal users really don’t have any chance of making a more informed choice.

Another Arduino Oscilloscope


On a bit of a tangent from my Home Easy hacking, I’ve been experimenting with an alternative to the poorman’s oscilloscope. The arduino + processing hack is brilliantly simple but it wasn’t much use with the signals I was trying to look at.

Zelscope looks quite interesting but it’s a trial download, plus I wanted to keep the arduino end of the poorman’s oscilloscope hack the same if possible. The Universal Real-Time Software Oscilloscope GUI DLL Library didn’t initially look as interesting since I was hoping not to have to write any code. On closer inspection, it does have a test .exe which will import data, which only needed a tiny change to the arduino sketch from the original hack:

Serial.print( val );
Serial.print(“\t0.0000000000\t0.0000000000\n\r”);

So just get the data from the serial port, into a file and import it… either I’m missing something or getting data from a serial port on Windows is a bit of a pain. I ended up using PowerShell to do the job, starting with some instructions for reading from a serial port on the PowerShell blog. Unfortunately that doesn’t seem to work, but getting rid of the add_DataReceived line and using ReadLine() did the job:

[string]$str = $port.ReadLine()
Add-Content “C:\Temp\Data.txt” $str

I do wonder if I could use the oscilloscope GUI DLL library directly from PowerShell. I get the impression that might be possible- I expect Dale will know the answer! For now, here are the results importing a file:

arduinoscope

Not bad, although I’ve yet to see if it makes finding the signal I want any easier. Next week I’ll be at my mum’s house trying to find an actual oscilloscope which I used to have!

Hats off to PowerShell, AS400 and Dale


Dale spotted a great write up of his PowerShell for WebSphere MQ SupportPac this morning. I was also really pleased to see that I wasn’t imagining the AS400 influence on PowerShell!

So far I love PowerShell and judging by my blog stats (my last PowerShell post is still the most popular), I’m not the only one who’s interested. Like Jeffrey, I want to see more products supporting it. I would also like to see PowerShell on more platforms! Also, MQ had a bit of a head start towards PowerShell cmdlets- I would love to find out more about how predominantly Java based products could take advantage of PowerShell. Does anyone have any idea if that is possible or how easy/difficult it would be?

Downloading PowerShell


I have just spent a very interesting hour watching Dale give a talk about PowerShell- he has a summary on his blog if you haven’t come across it before. Until today I was only vaguely aware of its existence but hadn’t had the time to take a look, so I’m very glad Dale took the time to share his presentation.

My immediate thought was how much it reminded me of the excellent OS/400 CL commands (I used to work with MQ on the AS/400 in my youth and, on a slight tangent, am quite fond of the rather splendid WRKMQM). Among other reasons for liking CL, I think it proves that it is possible to have a very usable command line interface; a concept which, while lost on some people, is very definitely evident in PowerShell.

What became clear was that the power in PowerShell is largely derived from its object orientated nature. No need for tortuous string parsing between piped commands (or commandlets in PowerShell speak). For example, instead of having to process a text list of process information, you get a list of process objects, which you could then display as a list, or simply select one to end (or all of them in Dale’s case- oops!). You can also extend PowerShell very nicely to add product related commandlets which, keeping the same noun and verb format along with all the generic commandlets like Sort and Select, make picking up a new product much easier for an admin.

So, cross product: good. Cross platform… hmmm, I wonder… Mono? Well, it seems others have asked the same question (and that wasn’t actually a ‘no’ in response to the open source question!) but not yet at least.