Skip to content

Instantly share code, notes, and snippets.

@bldrdash
bldrdash / Ping-Subnet.ps1
Created November 3, 2025 16:36
Ping Subnet in Powershell
# Code was written by Google Search AI (probably Gemini)
function Ping-Subnet ($SubnetPrefix, $StartIP, $EndIP) {
# Define the range of IP addresses to sweep
$IPs = $StartIP..$EndIP | ForEach-Object { "$SubnetPrefix.$_" }
# Perform the ping sweep in parallel
$Results = $IPs | ForEach-Object -Parallel {
$IP = $_
try {
$PingResult = Test-Connection -ComputerName $IP -Count 1 -Quiet -ErrorAction SilentlyContinue
@bldrdash
bldrdash / how-to-ssh-into-windows.md
Last active March 1, 2025 17:34 — forked from teocci/how-to-ssh-into-windows.md
How to SSH into Windows 10 or 11?

How to SSH into Windows 11

This documentation was forked from teocci/how-to-ssh-into-windows.md and revised to focus on Windows 11 and limit install options to Powershell. teocci's documentation offers more options for install, whereas this documentation provides additional information regarding key-based authentication and the nessesary steps for using the authorized_keys file.

Microsoft Documentation

Install using PowerShell

Add-WindowsCapability -Online -Name OpenSSH.Server*
@bldrdash
bldrdash / SocketFactory.java
Last active May 31, 2024 13:22
SocketFactory for Self Signed PKCS12
package com.company.project;
import android.util.Log;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.security.KeyManagementException;
import java.security.KeyStore;
@bldrdash
bldrdash / go-mod-rename.sh
Created March 13, 2024 22:00
Rename golang module
#!/bin/bash
if [ -z "$1" -o -z "$2" ]; then
echo $0 oldmod newmod
exit 1
fi
OLD_MODULE="$1"
NEW_MODULE="$2"
@bldrdash
bldrdash / grafana.ini
Last active August 14, 2024 00:34
Nginx reverse proxy for Prometheus and Grafana
# Settings are in addition or replacement to default config
[server]
protocol = https
domain = fqdn.com
root_url = %(protocol)s://%(domain)s/grafana/
serve_from_sub_path = true