Welcome to gmartin.org

converting audio with ffmpeg

Monday 08 of April, 2019

Needed to convert a couple wma files to mp3 because their stream layout wouldn't play with subsonic without a special conversion command. This took care of it:

for file in *.wma; do ffmpeg -i "$file" -map 0:1? -b:a 320k -v 32 -f mp3 "/$(basename -s .wma "$file").mp3"; done   

The tricky part was using basename to cut off the extension so I could rename the file.


Manipulating Native Excel Files in Powershell

Wednesday 03 of October, 2018

The first time I used Import-CSV to access data in a CSV file, I knew I was leaving VBScript behind for PowerShell.  That was probably more than 10 years ago and I have had a lot of fun with PowerShell since then.  Today, I had reason to manipulate native Excel files (OOXML) and found the process as simple as CSV.  This all starts with a module from the PowerShell Gallery called ImportExcel and it can be installed runnning Install-Module ImportExcel in a pwsh window.

Once installed, accessing an excel file is as simple as accessing a csv file.  Execute

$Data = Import-Excel C:\temp\somefile.xlsx

As with Import-csv, you can now access the various columns of the worksheet using the header name and the rows by the array index of the $Data object.  

EX: $Data2.Name will display the value of the column Name in the second row.


Managin TPLink Wifi Smart PLug with Powershell

Thursday 14 of June, 2018

I was given a TPLink HP100 WiFi Smart Plug the other day.  HS100 It works wit TPLink's Kasa service and from your smart phone.  Kasa does support remote control of the devices and this is done through a Restful API service.  As  have a SmartThings hub, I went looking for a way to integrate it with that.  Integration isn't directly available but I found this useful article from the ITNerd Space blog that shows you how to use .json posts to a Rest service to manages the device.

My scripting language of choice is PowerShell (now available on Linux) so I wrote a couple scripts to turn the plug on & off and query the state.

The script handles all the setup, you need only provide it with your Kasa service credentials and the alias for the smart plug.



Building a BrewPi

Tuesday 23 of January, 2018

I was a technology geek for years prior to brewing. I have a degree in Computer Science and have worked as a Systems Engineer and Engineering manager for 30 years.  Since 2012, 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.  It's a great device that measures specific gravity by   floating in the wort and reports it via bluetooth to a smart phone app.

Of course, the first question I asked was - what if I want to log this data. A bit of research lead  me to the BrewPi software and then to Fermentrack. Fermentrack is derived from Brewpi and it has the ability to receive the bluetooth dat from Tilt and graph it over time.  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.

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.