Change default shell for OpenSSH on Windows

If you are using OpenSSH on Windows the default shell used when connecting is cmd.exe. To update Windows to use something different you need to update the registry and restart the OpenSSH service.

Continue Reading »

Managing hugo blog entries in Obsidian

To make using and blogging simpler I have made some scripts, templates and quickadd commands to make a new article for my blog and then be able to run a PowerShell script to publish it.

Continue Reading »

Extract tasks from Obsidian vault with Github actions

I wanted to be able to pull my tasks out of my vault as a summary view, this can open up future automation options for me. However as I use multiple devices no single place was great and if I am on my phone it makes it harder.

As I am synchronizing my vault with git I decided to use a github workflow to help me out. I have it setup to run once a hour and extract all the tasks that are visible in the Obsidian Tasks plugin. These can be found as they always have the global task tag in them. In this example I use #task, update the regex as needed.

Continue Reading »

Cleanup Empty Azure Resource Groups

I needed to cleanup empty groups on a test subscription I had, using the Azure Cloud shell the following script will do it for you.

 az group list -o tsv --query [].name | % {$resources = az resource list -g $_ -o table; if($resources) {"$_ has Resources"} else {"$_ has no resources"; az group delete -n $_ -y --no-wait}}

Using PowerShell core in Visual Studio Code on windows

This is more for me than anyone else. If you want to move to PowerShell core in Visual Studio Code then do the following.

  1. Press CTRL + , to open settings.
  2. Enter Shell: Windows in the search box.
  3. Scroll down to Terminal > Integrated > Shell: Windows
  4. Click on ‘Edit in settings.json’ and add the following.
    "terminal.integrated.automationShell.windows": "C:/Users/${env:USERNAME}/scoop/apps/pwsh/current/pwsh.exe",
    "terminal.integrated.shell.windows": "C:/Users/${env:USERNAME}/scoop/apps/pwsh/current/pwsh.exe",

Now when the terminal is opened it will be using PowerShell Core. As I use Scoop to install items on my computers the path above reflects that, if you have powershell elsewhere then use that path.

Continue Reading »

Filling your calendar for the week, increase productivity! Mileage may vary

I like to ensure my calendar gets filled for the next week, this way I know what is happening and it is hard to book a last minute meeting to surprise me. I guess this is a productivity hack. If you book more than a week out then you can take whatever time you want that is open.

Ideally no one books last minute but they do and it is really annoying to deal with. Just call me!!

Continue Reading »

New PowerShell module for Home Assistant

So after making the PowerShell script for Home Assistant I decided to spend a hour and pull it together to be a full module and push it up to GitHub. This is now in place and support just turning a switch entity on and off.

Installation

Install-Module -Name PoshHomeAssistant -Scope CurrentUser

Usage

Before you can use it set the configuration, this can be done with the following command, set the key and url to match your environment.

Continue Reading »

Rooting the WINK Hub with Windows

I do have a Linux machine in the house but that is on a Pi running as a squeezelite client for my house music collection. So looking at the instructions on the web I have translated them for use in Windows. Of course I have use PowerShell! The only addition I have is I use Kitty as a SSH client. This uses the approach @ http://www.dinnovative.com/?p=348

  1. Open up the box and plug in the WINK unit. Do not download any app or hook it up to the internet. If you do this the latest firmware will overwrite the ability to do the hack below without popping open the case and hitting the chip directly.

    Continue Reading »

Integrating ISY into OpenHAB

I am in the process of setting up OpenHAB for the extra functionality in my house. I have the ISY unit setup as the core brains for switches and scenes. All the other magic is in OpenHAB so if OpenHAB goes down the main functions of the house work. I wanted to get the OpenHAB system to be able to get the status from the ISY unit and also changes states. This was as not straight forward as I wanted. I still have a issue that the process is polling and not a subscriber model but I do not have time to create a ISY binding. Anyway, here’s the basic instructions.

Continue Reading »