Skip to content

Instantly share code, notes, and snippets.

@fsackur
fsackur / Get-SqlVersionName.ps1
Created February 8, 2017 17:00 — forked from indented-automation/Get-SqlVersionName.ps1
SQL version lookup table
function Get-SqlVersionName {
param(
[Version]$Version
)
$lookup = @{
'Name' = ('Major', 'Minor', 'RTM', 'SP1', 'SP2', 'SP3', 'SP4')
'2016' = ( 13, 0, 1601, 4001 )
'2014' = ( 12, 0, 2000, 4100, 5000 )
'2012' = ( 11, 0, 2100, 3000, 5058, 6020 )
<#
Work in progress
Pull build versions into PSObjects from the super-useful https://sqlserverbuilds.blogspot.co.uk
#>
#$Blog = Invoke-WebRequest https://sqlserverbuilds.blogspot.co.uk/
$TablesHtml = [regex]::Matches(
$Blog.RawContent,
function Get-DnsCache {
<#
.Synopsis
Get entries from the DNS cache
#>
$Matches.Clear()
$DnsCache = (ipconfig /displaydns) -join "`r`n"
$Chunks = $DnsCache -split '\n\s*\r'
$Pattern = (New-Object System.Text.StringBuilder).
<#
.Synopsis
Provides a mapping of Windows drive letters to WWNs using inq.exe from EMC
.Description
Gets all volumes in Windows and provides device ID, drive letter and WWN.
You must have inq.exe available.
.Parameter Path
<#
Usage:
Get-ClusterName
Get-ClusterIpAddress
Get-ClusterSqlInstanceName
#>
#Get all the DNS names used on a cluster
function Get-ClusterName {
Get-ClusterNode | select @{Name = "ClusterResource"; Expression={"Cluster Node"}}, OwnerGroup, Name, DnsSuffix
<#
When you are roughing out a C# type in powershell, and you don't want to fire up
Visual Studio, it can get tiresome having to constantly reload your script editor.
This increments the class name each time you compile it.
Blogged in https://fsackur.github.io/2018/03/30/Reflecting-on-types/
#>
$TypeDef = @'
using System;
$Frames = (@(
" <br> <br> <br> :r:. <br> :MBBBBQBv <br> sBBBBQBBBBBQBBBU: <br> 7BQBBBQghIsBbBBBBBQB: <br> iBBBBQBBQMMgQBQBQ7MBQBj <br>
@fsackur
fsackur / ConEmu.xml
Created February 2, 2019 07:54
ConEmu configuration for Powershell with solarized dark scheme and Ctrl-T / Ctrl-W for tabs. Save to ~\AppData\Roaming\ConEmu.xml.
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2019-02-01 21:41:26" build="180626">
<value name="StartType" type="hex" data="02"/>
<value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{Shells::PowerShell}"/>
<value name="StartFarFolders" type="hex" data="00"/>
<value name="StartFarEditors" type="hex" data="00"/>
Relay circuit design & spec for domestic electrical heating
============================================
I have multiple Tado Smart Thermostats, model RU01, and multiple rooms with electrical underfloor heating. I require a power-switching circuit for the heating.
The heating in the largest room has a resistance of ~14 ohms and should run at 230VAC (I'm in the UK). All other rooms have higher resistance. This is a purely resistive load.
Tado do not provide great datasheets, but they have three pins for simple NO/NC/COM. I found a downloadable user guide at http://www.free-instruction-manuals.com/pdf/pa_1184164.pdf which states:
- Relay: max. 240V AC 6(4)A / max. 36V DC 6(4)A
@fsackur
fsackur / PowerShell.svg
Created January 16, 2021 15:30 — forked from Xainey/PowerShell.svg
SVG Vector for PowerShell logo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.