Skip to content

Instantly share code, notes, and snippets.

Avatar

Nikolas Beutler biacz

View GitHub Profile
View addwvdstohostpool.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"artifactsLocation": {
"defaultValue": "https://wvdportalstorageblob.blob.core.windows.net/galleryartifacts/Configuration.zip",
"type": "String",
"metadata": {
"description": "The base URI where artifacts required by this template are located."
}
View slowAF.ps1
$output = get-childitem -force \\$computer\c$\users\$user -Directory |
foreach-object {
$len = 0
measure-childitem $_.FullName -ErrorAction SilentlyContinue | foreach-object { $len += $_.Size }
[pscustomobject]@{
Name = $_.FullName
SizeGB = [math]::round($len / 1Gb, 2)
}
}
@biacz
biacz / diskspace.ps1
Created Aug 15, 2019
Checking disk space
View diskspace.ps1
function CleanVariables { Get-Variable | Where-Object { $startupVariables -notcontains $_.Name } | ForEach-Object {
try { Remove-Variable -Name "$($_.Name)" -Force -Scope "global" -ErrorAction SilentlyContinue -WarningAction SilentlyContinue }
catch { }
}
}
CleanVariables
<# This form was created using POSHGUI.com a free online gui designer for PowerShell
.NAME
@biacz
biacz / asdf.ps1
Created Aug 14, 2019
diskspaceanalyzer
View asdf.ps1
function CleanVariables { Get-Variable | Where-Object { $startupVariables -notcontains $_.Name } | ForEach-Object {
try { Remove-Variable -Name "$($_.Name)" -Force -Scope "global" -ErrorAction SilentlyContinue -WarningAction SilentlyContinue }
catch { }
}
}
CleanVariables
<# This form was created using POSHGUI.com a free online gui designer for PowerShell
.NAME
@biacz
biacz / helphelphelp.txt
Created Aug 13, 2019
help help help.txt
View helphelphelp.txt
2019-08-08T22:47:43.993+02:00> LVL:1 RC: 0 VGMAC :Stat frms: R=000000/000000/002750 T=000000/001365/001098 (A/I/O) Loss=0.00%/0.00% (R/T)
2019-08-08T22:48:44.071+02:00> LVL:1 RC: 0 VGMAC :Stat frms: R=000000/000000/004875 T=000000/002682/002119 (A/I/O) Loss=0.00%/0.00% (R/T)
2019-08-08T22:49:44.328+02:00> LVL:1 RC: 0 VGMAC :Stat frms: R=000000/000000/008169 T=000000/004467/003477 (A/I/O) Loss=0.00%/0.00% (R/T)
2019-08-08T22:50:44.324+02:00> LVL:1 RC: 0 VGMAC :Stat frms: R=000000/000000/010081 T=000356/005626/004329 (A/I/O) Loss=0.00%/0.00% (R/T)
2019-08-08T22:51:44.569+02:00> LVL:1 RC: 0 VGMAC :Stat frms: R=000000/000000/012161 T=000356/006768/005296 (A/I/O) Loss=0.00%/0.00% (R/T)
2019-08-08T22:52:44.641+02:00> LVL:1 RC: 0 VGMAC :Stat frms: R=000000/000000/013773 T=000356/007559/005970 (A/I/O) Loss=0.00%/0.00% (R/T)
2019-08-08T22:53:44.899+02:00> LVL:1 RC: 0 VGMAC :Stat frms: R=000000/000000/015832 T=000356/009122/00685
View feed_powerbi.ps1
Connect-VIServer asdf
Clear-Variable report
$report = Get-Datacenter -PipelineVariable datacenter |
ForEach-Object {
get-cluster -Location $_ -PipelineVariable cluster |
ForEach-Object { get-vmhost -Location $_ |
foreach-object {[pscustomobject]@{
Datacenter=$datacenter.Name;
@biacz
biacz / main.cpp
Created Dec 19, 2018
basic_mqtt_framework
View main.cpp
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include "secrets.h"
#define ROOM "what"
#define NAME "ever"
@biacz
biacz / servo_test.ino
Created Jul 25, 2018 — forked from col/servo_test.ino
A simple Arduino sketch that allows you to control a brushless motor via an ESC (or any servo really) using inputs from the Arduino IDE serial monitor.
View servo_test.ino
#include <Servo.h>
Servo esc;
int escPin = 9;
int minPulseRate = 1000;
int maxPulseRate = 2000;
int throttleChangeDelay = 100;
void setup() {
View gist:d1255d44841736e09f1234d0e4418cae
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
IRsend irsend;
boolean recording = true;
decode_results results;
View check_pir.ino
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
// WiFi Settings
#define wifi_ssid "ssid"
#define wifi_password "pw"
// MQTT Settings
#define mqtt_server "192.168.0.27"