This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
title: Home | |
views: | |
- theme: Backend-selected | |
path: default_view | |
title: Basics | |
icon: mdi:home | |
badges: [] | |
cards: | |
- type: entities | |
title: Main House Lights |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <M5StickCPlus.h> | |
#include <M5UNIT_DIGI_CLOCK.h> | |
#include <Wire.h> | |
#include <WiFi.h> | |
#include "time.h" | |
#include <NTPClient.h> | |
// Wireless details | |
const char* ssid = "SSID"; | |
const char* password = "PSK"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function readRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getValue{ | |
# Define the dict of our products | |
$productsByMem = @{} | |
$productsByMem.Add(0.5,40) | |
$productsByMem.Add(1,60) | |
$productsByMem.Add(2,90) | |
$productsByMem.Add(3,130) | |
$productsByMem.Add(4,160) | |
$productsByMem.Add(6,210) | |
$productsByMem.Add(8,260) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filter Get-CPURatio { | |
$vcpus=0 | |
$ratio=$null | |
$hostthreads=$_.extensiondata.hardware.cpuinfo.numcputhreads | |
$_ | Get-VM | ForEach {$vcpus+=$_.numcpu} | |
if ($vcpus -ne "0") {$ratio= "$("{0:N2}" -f ($vcpus/$hostthreads))" + ":1"} | |
$temp = New-Object psobject | |
$temp | Add-Member -MemberType Noteproperty "Hostname" -value $_.name | |
$temp | Add-Member -MemberType Noteproperty "PhysicalThreads" -Value $Hostthreads |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filter Set-IOPSLimit { | |
$_ | % { | |
$DiskLimitIOPerSecond = 300 | |
# $DiskLimitIOPerSecond = -1 # Unlimited | |
$vm = Get-VM -Name $_.Name | |
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec | |
$vm.ExtensionData.Config.Hardware.Device | | |
where {$_ -is [VMware.Vim.VirtualDisk]} | %{ | |
$dev = New-Object VMware.Vim.VirtualDeviceConfigSpec |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-SnapshotReport { | |
Get-VM | Sort-Object | Get-Snapshot | Where-Object {$_.Created -lt (Get-Date).AddDays(-28)} | Format-Table VM, Created, @{Name="Size GB"; Expression={$_.SizeGB}; FormatString="N1"}, ParentSnapshot, Name, Description, PowerState -AutoSize | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filter Get-IOPSLimit { | |
$_ | % { | |
$VmHdds = Get-HardDisk -VM $_.Name | select Name, ExtensionData, Filename, CapacityKB | |
foreach ($VmHdd in $VmHdds) { | |
$row = "" | select VmName, HddName, ScsiID, Datastore, CapacityGB, CurrentIOLimit | |
$row.VmName = $_.Name | |
$row.HddName = $VmHdd.Name | |
$row.ScsiID = $([string]$VmHdd.extensiondata.controllerkey).substring(3,1) +":"+ $([string]$VmHdd.extensiondata.unitnumber) | |
$row.Datastore = $($VmHdd.Filename.TrimStart("[")).split("]")[0] | |
$row.CapacityGB = $VmHdd.capacitykb / 1024 / 1024 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filter Get-FolderPath { | |
$_ | Get-View | % { | |
$row = "" | select Name, Path | |
$row.Name = $_.Name | |
$current = Get-View $_.Parent | |
# $path = $_.Name # Uncomment out this line if you do want the VM Name to appear at the end of the path | |
$path = "" | |
do { | |
$parent = $current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-VM -Tag LoadBalancer | Where {$_.PowerState -eq "PoweredOn"} | Select Name, VMHost, NumCPU, MemoryGB, ` | |
@{N="CPU MHz (Avg)" ; E={[Math]::Round((($_ | Get-Stat -Stat cpu.usagemhz.average -Start (Get-Date).AddDays(-30) -IntervalMins 5 | Measure-Object Value -Average).Average),2)}}, ` | |
@{N="CPU Mhz (Max)" ; E={[Math]::Round((($_ | Get-Stat -Stat cpu.usagemhz.average -Start (Get-Date).AddDays(-30) -IntervalMins 5 | Measure-Object Value -maximum).maximum),2)}}, ` | |
@{N="Memory % (Avg)" ; E={[Math]::Round((($_ | Get-Stat -Stat mem.usage.average -Start (Get-Date).AddDays(-30) -IntervalMins 5 | Measure-Object Value -Average).Average),2)}} , ` | |
@{N="Memory % (Max)" ; E={[Math]::Round((($_ | Get-Stat -Stat mem.usage.average -Start (Get-Date).AddDays(-30) -IntervalMins 5 | Measure-Object Value -maximum).maximum),2)}} , ` | |
@{N="Network KBps (Max)" ; E={[Math]::Round((($_ | Get-Stat -Stat net.usage.average -Start (Get-Date).AddDays(-30) -IntervalMins 5 | Measure-Object Value -maximum).maximum),2)}} , ` | |
@{N="Network KBps (A |
NewerOlder