Welcome to gmartin.org

Building a BrewPi

Tuesday 23 of January, 2018

I was a technology geek for years prior t brewing. I have a degree in Computer Science and have worked as a systems Engineer, Engineering manager and IT Director for 30 years.  5 years ago, brewing gave me a hobby different in many ways from my work.  At the same time it feeds my need to learn new things.  For Christmas this year my wife gave me a Tilt Hydrometer.  Its a great device that measures specific gravity directly and reports it via bluetooth to a smart phone app.

Getting the device developed my iterest in building a BrewPi and tying the BrewPi to it to log temperature and SG history for my brews. Here's my  experience building the device. 

First, I bought  a CanaKit from Amazon.



High Resolution screen, Remote Desktop and VirtualBox

Wednesday 27 of September, 2017

I bought a 2016 Yoga laptop with a hi-res (3200 x 1800) screen. I'm running the Windows Insider builds of Windows 10. Running a hi-res screen turns up several issues with apps that aren't prepared for all the resolution. One area I had an issue with was remote desktop which I'venow fixed.

The frst thing you do to deal with this is change Windows desktop scaling factor . Windows recommends 250% scale factor for my machine and I'm using that. The next thing to do is read a great reference from Scott Hanselman on living the hi-res lifestyle.

What I exerienced with Remote Desktop with another Win 10 machine was a small window unreadable to my 55 and over eyesight. 

Doing more research, I came across this article from Falafel on Remote Desktop and Hi-Res.  The tip from Falafel is to make use of Remote Descktop Connection Manager and configure the desplay settings to use Full Screen. This will scale thee remote desktop window to match your local screen and it solved my problem.

The last issue was VirtualBox.  One of my remote PCs has a virtualBox VM running Slackware. After scaling the remote desktop I opened the VM and it had not scaled.  After saying "hmmm", I went poking around the display settings for the VM  I found the Scale Factor setting. Setting this  to 200% gave me a usuable VM in a remote desktop session.

Powershell on Linux

Monday 18 of September, 2017

I've been learning a lot about Microsoft's Linux initiatives over the past couple weeks.  I've started using Windows Services for Linux in lieu of putty for connecting to my Linux machines and recently started playing with their PowerShell implementation on Linux.  Last week I had a need to do some scripting on Linux and wanted to re-use some code I had on hand. 

PowerShell can be installed from the repository on most machines.  The PowerShell github page has the details on how to configure your package manager to draw directly from the repository.

For my challenge, I wanted to profile the download speed of a particular website I help manage.  I already have a PS script that does most of what I wanted.  It was a simple task of reconfguring it and testing to be sure all the features were available in the current Linux PS beta.  Here's the script.

$url = "http://files.myfakeco.com/downloads/filedownload/d3974543.zip"

$timer = measure-command {

    $req = system.Net.WebRequest::Create($url)

    try {

        $res = $req.GetResponse()

        $requestStream = $res.GetResponseStream()

        $readStream = New-Object System.IO.StreamReader $requestStream



    catch System.Net.WebException {

        $res = $_.Exception.Response



$sec =  $($timer.totalmilliseconds)/1000

$size = $res.Contentlength

$kbs =  "{0:N2}" -f ($size/$sec/1000)

$ssec =  "{0:N2}" -f $sec

echo "$size, $ssec, $kbs"

"$(get-date -f "MM-dd-yyyy hh:mm tt"), $($res.StatusCode), $size, $ssec, $kbs `r`n"|out-file -append /mnt/samba/Docs/dllog.txt

The script makes use of the .Net WebRequest API. The API downloads the file and reorts status and stats derived from timing the download using measure-command.

But the best part of this is that the exact code runs on Windows Powershell.  I only modified the code to meet my specific needs for this report.

Fun with WSL (Ubuntu on Windows)

Tuesday 15 of August, 2017

I'm running WIndows 10 1703 and have been toying with the Windows Subsystem for Linux (WSL). THis version is based on Ubuntu.  There is some fun it making it useful.  

SSH into WSL

I want to use putty from anywhere to access the shell. SSH requires a few things to make it useful.  Start the bash shell and edit /etc/ssh/sshd_config (sudo nano /etc/ssh/sshd_config)

  • Change the listener.
    • port 2222

  • Turn on Password Authentication (I'll discuss key auth in a bit)

  • Turn off Privilege separation. Rumor has it it isn't implemented

  • Allow TCP port 2222 in the Windows Firewall

  • Generate host key
    • sudo ssh-keygen -A

  • Restart ssh service
    • sudo service ssh --full-restart

You should be able to ssh into the host.






Using Powershell to post data to IFTTT WebHooks service

Monday 07 of August, 2017

IFTTT has many useful triggers and I like Webhooks because it can enable so many fun interactions.  My goal today is sending JSON key:value pairs to WebHooks from Powershell (my preferred scripting language and now available on Linux!).  

WebHooks will accept three named parameters vis JSON (also form data and url parameters) that can be referenced within the Action of your applet.  The paramaeters are named value1, 2 & 3. so the JSON should look like this: 

    "value1":  "Good Morning",
    "value3":  "That is all.",
    "value2":  "Greg"

PowerShell has two methods for posting this to a URL Invoke-WebRequest and Invoke-Restmethod.  The latter is apparently a wrapper of the former and return onthe the string output from the POST. Because of the possible error-checking needs, I'll focus on Invoke-WebRequest.  

Here is the code that made this work:

$BaseURL = "https://maker.ifttt.com/trigger/GMhit/with/key/enteryourkeyhere"

  1. Note: The key (last part of URL is user unique

  2. The Trigger here is GMhit and unique to me. You would declare your own in the IFTTT service

$body = @{ value1="Good Morning" value2="Greg" value3="That is all." }

  1. Either works. Webrequest return status code

  2. Invoke-RestMethod -URI $BaseURL -Body (ConvertTo-Json $body) -Method Post -ContentType application/json

Invoke-WebRequest -URI $BaseURL -Body (ConvertTo-Json $body) -Method Post -ContentType application/json


  • Setting the ContentType to `application/json` is important here.  This call didn't work until this was set correctly.

  • The value names are fixed and cannot be customized.

Click here for the full blog

Here are some special links


Created by gmartin. Last Modification: Tuesday 27 of December, 2016 17:16:22 EST by gmartin.