Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Logged into org account

Brett Miller brettmillerb

💭
Logged into org account
View GitHub Profile
@Jaykul
Jaykul / SubscriptionNameCompleterAttribute.ps1
Last active Sep 14, 2020
Bonus Argument Completers For Azure
View SubscriptionNameCompleterAttribute.ps1
using namespace Microsoft.Azure.Commands.Common.Authentication.Abstractions
using namespace System.Management.Automation.Language
using namespace System.Management.Automation
using namespace System.Collections.Generic
using namespace System.Collections
[AttributeUsage("Property,Field")]
class SubscriptionNameCompleter : ArgumentCompleterAttribute {
# PowerShell expects you to write IArgumentCompleter and register them with this syntax:
# [ArgumentCompleter([MyIArgumentCompleter])]
View CurrentUserAllHosts.ps1
#region UX config
Import-Module posh-git
if (Get-Module PSReadLine) {
Import-Module oh-my-posh
$ThemeSettings.MyThemesLocation = "~/.config/powershell/oh-my-posh/Themes"
if (Get-Theme | Where-Object Name -eq Sorin-NL) {
Set-Theme Sorin-NL
@Jaykul
Jaykul / Connect-WaspRemoteDesktop.ps1
Last active Aug 14, 2020
Using WASP to remote desktop, for those ocassions when policy blocks you ...
View Connect-WaspRemoteDesktop.ps1
<#
.SYNOPSIS
Connects to remote desktop using the specified credentials by automating UI input using WASP
.DESCRIPTION
Requires the WASP (Windows Automation Scripting in PowerShell) module to be installed.
This script is a workaround for environments where GPOs don't allow saving credentials,
but we only have the credentials via an API from PowerShell.
... hey, it's better than exposing the plain text in a browser and copy-pasting via the clipboard!
View mactweaks.md

Changes to my Mac

Turn off "press and hold" for foreign letters, allowing you to then press and hold for repeat letters. Open Terminal and run:

defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false

Then you need to close/reopen any app before it takes effect.

Make the dock appear faster when using auto hide:

View Build.ps1
[cmdletbinding()]
param (
$SourceFolder = $PSScriptRoot
)
if (-not (Get-Module PSDepend -ListAvailable)) {
Install-Module PSDepend -Repository (Get-PSRepository)[0].Name -Scope CurrentUser
}
Push-Location $PSScriptRoot -StackName BuildScript
Invoke-PSDepend -Path $SourceFolder -Confirm:$false
View RDCCreator.ps1
using assembly System.Xml.Linq
using namespace System.Xml.Linq
function RdcDocument {
[CmdletBinding()]
param (
[Parameter(Mandatory, Position = 1)]
[String]$FileName,
[Parameter(Mandatory, Position = 2)]
View ActiveDirectory.md

A small collection specialised scripts for Active Directory.

Includes:

  • Compare-ADMemberOf
  • Get-ADSystemInfo
  • Get-GroupMemberTree
  • Get-LdapObject
  • Get-MemberOfTree
  • Test-LdapSslConnection
@indented-automation
indented-automation / New-Password.ps1
Last active Apr 8, 2021
PowerShell random password generator.
View New-Password.ps1
function New-Password {
<#
.SYNOPSIS
Generate a random password.
.DESCRIPTION
Generate a random password.
.NOTES
Change log:
27/11/2017 - faustonascimento - Swapped Get-Random for System.Random.
Swapped Sort-Object for Fisher-Yates shuffle.
@jasonjoh
jasonjoh / sendactionablemessage.py
Last active Jun 7, 2021
A sample Python script that sends an actionable message via the Office 365 SMTP server.
View sendactionablemessage.py
#! /usr/local/bin/python
"""Sends an actionable message to yourself
Usage: 'sendactionablemessage.py -u <username> -p <password>'
"""
import sys
import getopt
from smtplib import SMTP as SMTP
from email.mime.text import MIMEText
View wordlist.txt
Wordlist ver 0.732 - EXPECT INCOMPATIBLE CHANGES;
acrobat africa alaska albert albino album
alcohol alex alpha amadeus amanda amazon
america analog animal antenna antonio apollo
april aroma artist aspirin athlete atlas
banana bandit banjo bikini bingo bonus
camera canada carbon casino catalog cinema
citizen cobra comet compact complex context
credit critic crystal culture david delta
dialog diploma doctor domino dragon drama