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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Threading; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace hollow | |
{ |
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
<# | |
To easily find out why a sign-in failed for a specific user, | |
you can use the Where-Object cmdlet to filter the sign-in logs | |
by the user's display name, and then output information | |
about the failed sign-in attempt. | |
№ Here's an example of how you might use the Where-Object cmdlet to find out | |
why a sign-in failed for a specific user: | |
#> |
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 NSLookup(type, domain) { | |
if (typeof type == 'undefined') { | |
throw new Error('Missing parameter 1 dns type'); | |
} | |
if (typeof domain == 'undefined') { | |
throw new Error('Missing parameter 2 domain name'); | |
} | |
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
az group list | convertfrom-json | select -expand name | ?{$_ -like "*-rg-*"}| %{az group delete --name=$_ -y & } |
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
<# Ignore SSL Cert Hack #> | |
Add-Type @" | |
using System.Net; | |
using System.Security.Cryptography.X509Certificates; | |
public class TrustAllCertsPolicy : ICertificatePolicy { | |
public bool CheckValidationResult( | |
ServicePoint srvPoint, X509Certificate certificate, | |
WebRequest request, int certificateProblem) { | |
return true; | |
} |
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
#Check if PowerShell version is greater than 2. If not, set $PSSriptRoot. | |
if ($PSVersionTable.PSVersion.Major -lt 3) { | |
$PSScriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Definition | |
} | |
#Check if the user is a local admin. If they are, set $LocalAdmin to $True. | |
$LocalAdmin = $false | |
if ((net localgroup administrators) -match ([System.Environment]::UserDomainName + "\\" + [System.Environment]::Username)) { | |
$LocalAdmin = $true | |
} |
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
https://docs.microsoft.com/api/search/rss?search=SEARCH_TERM_HERE&locale=en-us |
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
docker-ips() { | |
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}} %tab% {{.Name}}' $(docker ps -aq) | | |
sed 's#%tab%#\t#g' | | |
sed 's#/##g' | | |
sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n | |
} | |
## docker-ips output | |
# 172.18.0.2 memcached | |
# 172.18.0.3 nginx |
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
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow |
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
#!/bin/bash | |
# This file is designed to spin up a Wireguard VPN quickly and easily, | |
# including configuring Pi-Hole as a recursive local DNS server using | |
# Unbound to block ads a the DNS level | |
# | |
# Make sure to change the public/private keys before running the script | |
# Also change the IPs, IP ranges, and listening port if desired | |
# add wireguard repo | |
sudo add-apt-repository ppa:wireguard/wireguard -y |