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
# pwsh automatic backup | |
Set-Location $PSScriptRoot | |
git add -A | |
git commit * -m 'Automatic backup' | |
git gc |
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 <ChainableLED.h> | |
#include <Grove_LED_Bar.h> | |
#define NUM_LEDS 1 | |
// Pin for LED control | |
ChainableLED leds(2, 3, NUM_LEDS); // Pin 2 for data, pin 3 for clock | |
// Button pin | |
int buttonPin = 4; // Button is connected to pin 4 |
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
#usage: | |
# Get-MgGroupMember -GroupId <someid> | ` | |
# Select-GraphObject displayname, userprincipalname, mail, officelocation | |
#based on https://stackoverflow.com/questions/72384632/possible-to-pull-info-from-additionalproperties-dictionary-with-microsoft-graph | |
#with some changes to make it work | |
function Select-GraphObject { | |
[CmdletBinding(PositionalBinding = $false)] | |
param( |
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
* START EXE IN WINDBG | |
* Based on https://web.archive.org/web/20160223063851/http://blogs.msdn.com/b/dsui_team/archive/2012/10/31/debugging-windows-forms-application-hangs-during-systemevents.userpreferencechanged.aspx | |
sxe ld clrjit | |
g | |
.sympath srv*http://msdl.microsoft.com/download/symbols | |
.reload | |
.loadby sos.dll clr |
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-AccessTokenClientCredentialsFlow { | |
param ( | |
[string]$ClientId, | |
[string]$ClientSecret, | |
[string]$Audience | |
) | |
Add-Type -AssemblyName System.Web | |
$clientidEnc = [System.Web.HttpUtility]::UrlEncode($ClientId) |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<link rel="icon" href="/favicon.ico" /> | |
<link rel="stylesheet" href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-core/11.0.0/css/fabric.min.css" /> | |
<title>Microsoft Teams Tab</title> | |
</head> | |
<body> | |
<noscript>You need to enable JavaScript to run this app.</noscript> |
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
cat /var/log/auth.log /var/log/auth.log | grep 'authentication failure;' | sed 's/.*rhost=\([^ ]*\).*/\1/' | sort | uniq -c |
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
# Example usage: | |
# . C:\temp\Test-EnduranceSqlConnection.ps1 | |
# Test-EnduranceSqlConnection '192.168.253.127\Corflow' -Interval ([timespan]::FromSeconds(1)) | |
function Test-Key { | |
[CmdletBinding()] | |
param ( | |
[System.ConsoleKey]$Key | |
) |
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 Match([string]$x, [string]$y) { | |
if ($x.Length -ne $y.Length) { return '' } | |
$result = '' | |
@(0..($x.Length - 1)) | %{ | |
if ($x[$_] -eq $y[$_]) { | |
$result += '*' | |
} elseif ($y.Contains($x[$_])) { | |
$result += '?' | |
} else { | |
$result += '.' |
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
dir -Recurse -Filter *.cs | gc | %{ if ($_ -match '^.*(http(?:s)?\://[^/]*/).*$') { $Matches[1] } } | select -Unique |
NewerOlder