Skip to content

Instantly share code, notes, and snippets.

@ekmixon
ekmixon / Match Version Number or Higher.bash
Created June 7, 2022 17:33 — forked from talkingmoose/Match Version Number or Higher.bash
Generates a regular expression (regex) that matches the provided version number or higher. Useful for Jamf Pro's "matches regex" operator in searches and smart groups where the results need to be the current version of an app or higher.
#!/bin/bash
<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
[email protected]
https://gist.github.com/2cf20236e665fcd7ec41311d50c89c0e
@PshMike
PshMike / Set-ADGroupACL.ps1
Last active October 4, 2021 18:24
Set AD Group ACL
$GroupObject = Get-ADGroup 'MyGroupName'
$NTPrincipal = Get-ADUser 'myUserName'
if ($GroupObject -and $NTPrincipal) {
$acl = Get-Acl "AD:$($GroupObject.distinguishedName)"
$identity = [System.Security.Principal.IdentityReference] $NTPrincipal.SID
$adRights = [System.DirectoryServices.ActiveDirectoryRights]::WriteProperty -bor [System.DirectoryServices.ActiveDirectoryRights]::WriteDacl
#Requires -RunAsAdministrator
<#
.SYNOPSIS
Creates a Self Signed Certificate for use in server to server authentication
.DESCRIPTION
.EXAMPLE
PS C:\> .\Create-SelfSignedCertificate.ps1 -CommonName "MyCert" -StartDate 2015-11-21 -EndDate 2017-11-21
This will create a new self signed certificate with the common name "CN=MyCert". During creation you will be asked to provide a password to protect the private key.
.EXAMPLE
PS C:\> .\Create-SelfSignedCertificate.ps1 -CommonName "MyCert" -StartDate 2015-11-21 -EndDate 2017-11-21 -Password (ConvertTo-SecureString -String "MyPassword" -AsPlainText -Force)
@RajChowdhury240
RajChowdhury240 / AD-OSCP.md
Created April 11, 2021 09:13
Active Directory Attacks OSCP
@hritik5102
hritik5102 / python-upgrade-package.md
Last active January 20, 2025 08:15
How To Update All Python Packages

Python Package Upgrade Checklist

Get a list of all the outdated packages

$ pip list --outdated

Open a command shell by typing ‘powershell’ in the Search Box of the Task bar
Update All Python Packages On Windows

@apfelchips
apfelchips / Profile.ps1
Last active December 8, 2024 02:59
my crossplatform PowerShell Profile
# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# src: https://gist.github.com/apfelchips/62a71500a0f044477698da71634ab87b
# New-Item $(Split-Path "$($PROFILE.CurrentUserCurrentHost)") -ItemType Directory -ea 0; Invoke-WebRequest -Uri "https://git.io/JYZTu" -OutFile "$($PROFILE.CurrentUserCurrentHost)"
# ref: https://devblogs.microsoft.com/powershell/optimizing-your-profile/#measure-script
# ref: Powershell $? https://stackoverflow.com/a/55362991
# ref: Write-* https://stackoverflow.com/a/38527767
# Write-Host wrapper for Write-Information -InformationAction Continue
@signalwarrant
signalwarrant / ExchangeSVCmof.ps1
Created March 9, 2021 19:07
ExchangeSVCmof.ps1
# Your Configuration
Configuration ExchangeService {
# Parameters
# Accepts a string value computername or defaults to localhost
Param([string[]]$ComputerName = "localhost")
# Target Node
Node $ComputerName {
@signalwarrant
signalwarrant / CreatePullServer.ps1
Created March 9, 2021 19:04
CreatePullsServer.ps1
# Step 1 Install xPSDesiredStateConfiguration
Install-Module -Name xPSDesiredStateConfiguration
# Step 2
# Create the Pull Server.
Configuration CreatePullServer {
param (
[string[]]$ComputerName = 'localhost'
)
@signalwarrant
signalwarrant / DSCResources.ps1
Created March 9, 2021 19:00
DSCResources.ps1
# NoGo
Get-Command -Module xPSDesiredStateConfiguration
# NoGo
xService | Get-Member
# Shows all DSC Resources currently installed in PS ModulePath
# Access PSModulepath
# cd env:
# dir | Where-Object Name -eq PSModulePath
@signalwarrant
signalwarrant / HashTables.ps1
Created March 9, 2021 18:46
HashTables.ps1
# Example No Hash table or Calculated Properties
Get-WmiObject -Class WIN32_volume -ComputerName localhost -Filter 'drivetype = 3' |
Select-Object -Property PScomputerName,
DriveLetter,
Label,
FreeSpace
# Example using a Hash table
Get-WmiObject -Class WIN32_volume -ComputerName localhost -Filter 'drivetype = 3' |
Select-Object -Property PScomputerName,