Skip to content

Instantly share code, notes, and snippets.

View DEberhardt's full-sized avatar

David Eberhardt DEberhardt

View GitHub Profile
@Jaykul
Jaykul / Select-CapturedString.ps1
Last active February 20, 2022 17:43
Collect named capture groups to allow parsing text even with uneven properties
function Select-CapturedString {
<#
.Synopsis
Collect named capture groups from regular expression matches
.Description
Takes string data and a regular expression containing named captures,
and outputs all of the resulting captures in one (or more) hashtable(s)
.Example
netstat | Select-CapturedString "(?<Protocol>\w{3})\s+(?<LocalIP>(\d{1,3}\.){3}\d{1,3}):(?<LocalPort>\d+)\s+(?<ForeignIP>.*):(?<ForeignPort>\d+)\s+(?<State>\w+)?"
@f-steff
f-steff / excel formulas.md
Last active May 16, 2024 16:56
Excel formulas to calculate IP values such as Netmask, IP range start, IP range end, Broadcast IP, Number of hosts.

Excel formulas to calculate IP values - Works in Excel and Google Sheet.

Updated 2023-12-11: Hosts calculation updated to support CIDR or 31 and 32.

Prerequisites:

  • A1 contains an IP address, such as 10.0.0.2
  • B1 contains the number of bits in the netmask (CIDR) such as 24

The below formulas then go into C1, D1 etc. to perform the various calculations. Some calculations depends on other calculations.

@gtankha
gtankha / Regular_Expression_HEX_gt.md
Last active September 26, 2023 09:28
Regular Expressions - Match HEX Values

Regular Expression -- Match HEX Values

This file is intended to explain the details of how a specific regular expression works. This particular regular expression is used to match a HEX value. The description below will detail each component of the regular expression and how it works.

Summary

We will be evaluating the following regular expressions used to match HEX values:

/^#?([a-f0-9]{6}|[a-f0-9]{3})$/

@get-itips
get-itips / InterpretedUserTypes.md
Last active June 2, 2022 12:57
InterpretedUserType table

InterpretedUserType table

InterpretedUserType Possible Description
AADConnectDisabledOnlineActiveDirectoryDisabledUser
AADConnectDisabledOnlineActiveDirectoryDisabledUserPendingDeletionFromAD
AADConnectDisabledOnlineSfBUserWithTeamsLicensePendingDeletionFromAD
AADConnectDisabledOnlineTeamsUserPendingDeletionFromAD
AADConnectDisabledOnlineTeamsUser
AADConnectDisabledOnlineUserNotLicensedForServicePendingDeletionFromAD
@hkamran80
hkamran80 / SmartTV2.txt
Last active February 28, 2024 01:03
Pi-hole Blocklist for Smart TVs
# THIS FILE IS NO LONGER BEING MAINTAINED. FOR A MAINTAINED VERSION, PLEASE USE THE VERSION IN THE NEW REPOSITORY.
# Repository: https://github.com/hkamran80/blocklists
# New link for this file: https://raw.githubusercontent.com/hkamran80/blocklists/main/smart-tv
# ------
# This is a blocklist to block Smart TVs sending data home.
# Please help to collect domains!
# It could be that the TV does not receive any more updates or other services no longer work. Please report such an incident.