Skip to content

Instantly share code, notes, and snippets.

View biacz's full-sized avatar

Nikolas Beutler biacz

View GitHub Profile
@biacz
biacz / .ps1
Last active November 6, 2015 14:03
$report = @()
foreach ($vm in $view) {
foreach ($vc in $vcenter) {
if($vm.Name -eq $vc.Name) {
$entry = [PSCustomObject] @{
Name = $vm.Name
CPU = $vc.summary.config.NumCpu
Memory = $vc.summary.config.MemorySizeMB
}}
$brokers = "mapvasdfp02", "natviasdf2", "stpvasdf02"
$vcenters = "mapvasdfp02", "natasdf2", "stasdfp02"
#$creds = Get-Credential -Message "Please enter your credentials"
"Connecting to vCenter Servers"
connect-viserver $vcenters -Credential $creds
Set-StrictMode -Version 2.0
//include all libraries
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <ESP8266httpUpdate.h>
#include <PubSubClient.h>
#include <RCSwitch.h>
#include <fauxmoESP.h>
//basic defines
#define MQTT_VERSION MQTT_VERSION_3_1_1
@biacz
biacz / check_pir.ino
Last active March 13, 2017 11:53
check_pir
#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"
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
IRsend irsend;
boolean recording = true;
decode_results results;
@biacz
biacz / servo_test.ino
Created July 25, 2018 10:09 — 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.
#include <Servo.h>
Servo esc;
int escPin = 9;
int minPulseRate = 1000;
int maxPulseRate = 2000;
int throttleChangeDelay = 100;
void setup() {
@biacz
biacz / main.cpp
Created December 19, 2018 23:21
basic_mqtt_framework
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include "secrets.h"
#define ROOM "what"
#define NAME "ever"
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 / helphelphelp.txt
Created August 13, 2019 09:44
help help help.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
@biacz
biacz / asdf.ps1
Created August 14, 2019 12:57
diskspaceanalyzer
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