Skip to content

Instantly share code, notes, and snippets.

View scrthq's full-sized avatar
☁️
daydreaming of pipelines and standards

Nate Ferrell scrthq

☁️
daydreaming of pipelines and standards
View GitHub Profile
@soof-golan
soof-golan / Dockerfile
Last active March 29, 2025 06:05
Python + Poetry + Docker Example
FROM python:3.10 as python-base
# https://python-poetry.org/docs#ci-recommendations
ENV POETRY_VERSION=1.2.0
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
# Tell Poetry where to place its cache and virtual environment
ENV POETRY_CACHE_DIR=/opt/.cache
@thedavecarroll
thedavecarroll / SearchADDnsRecord.psm1
Last active January 8, 2024 16:09
This simple PowerShell script module uses a custom class and Get-ADObject to search an Active Directory-integrated DNS Zone by name or partial name.
#Requires -Version 5.1
#Requires -Module ActiveDirectory
$script:ADRootDSE = Get-ADRootDSE
class ADDnsNode {
# AD Object Properties
[String]$Name
[String]$CanonicalName
@adrianord
adrianord / .dockerignore
Last active September 14, 2021 23:53
Generic DotNet Dockerfile using BuildKit `RUN --mount` directive to keep csproj structure.
# This is an example of what you might have in your .dockerignore. Some items can be omitted like `!/test/**` or added
# like `**/node_modules` if you have a node/frontend project.
*
!/*.sln
!/nuget.config
!/src/**
**/bin
**/obj
@ScriptAutomate
ScriptAutomate / AWSCFNDocHelpers.psm1
Last active September 5, 2019 02:38
PowerShell Helpers Proof-of-Concept for Comment-Based Help Generation via Parsing of AWS CFN UserGuide GitHub Docs
<#
Tested On:
PSVersion PSEdition
--------- ---------
6.2.2 Core
Prereqs:
AWS DOCS
- git clone https://github.com/awsdocs/aws-cloudformation-user-guide.git
CFN Spec File
@austoonz
austoonz / Write-SSMComplianceItemExample
Last active April 5, 2019 22:31
Sample code for writing an AWS Systems Manager Compliance Item.
$managedInstanceId = (Get-Content -Path 'C:\ProgramData\Amazon\SSM\InstanceData\Vault\Store\RegistrationKey' -Raw | ConvertFrom-Json).instanceID
$moduleNames = @(
'AWSPowerShell',
'ClipboardText',
'Convert',
'PSWindowsUpdate'
)
$complianceItems = [System.Collections.Generic.List[Amazon.SimpleSystemsManagement.Model.ComplianceItemEntry]]::new()
foreach ($moduleName in $moduleNames)
@corbob
corbob / vscode-powershell-alpha-goodness.md
Last active December 24, 2023 09:01
VSCode + PSReadline - How To Start Using the Alpha PowerShell Extension for PSReadline Goodness Now

VSCode + PSReadline - How To Start Using the Alpha PowerShell Extension for PSReadline Goodness Now

Courtesy of @scrthq from slack

Chatting on Twitter with @ctmcisco about this and figured it would be worth posting for everyone here, in case anyone else is curious!

  1. Go to the Branches tab on the vscode-powershell repo in GitHub: https://github.com/PowerShell/vscode-powershell/branches
  2. Find the 2.0.0 branch, then click the green check mark in the center of the page.
  3. Click the blue Details link next to the AppVeyor line. This will take you to the most recent AppVeyor build of that branch.
  4. On the top-right of the page, just above the console output, click the Artifacts tab.
@markwragg
markwragg / mactweaks.md
Last active January 3, 2025 12:31
Mac tweaks

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:

@jbruett
jbruett / AwsRegionDynamicParameterPowershell.json
Created April 5, 2018 01:50
vscode snippet for a dynamic parameter of aws regions
"AWS_Region_Dynamic_Param": {
"prefix": "aws_region",
"body": [
"DynamicParam {",
"\t$ParamDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary",
"\t$CR_ParamName = 'Region'",
"\t$CR_AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute]",
"\t$CR_Attribute = New-Object System.Management.Automation.ParameterAttribute",
"\t$CR_Attribute.HelpMessage = 'List all the regions to be included in the document'",
"\t$CR_Attribute.Mandatory = $true",
@SimonWahlin
SimonWahlin / pre-commit
Created March 27, 2018 12:22
Pre-Commit hook for git that will fix my user.email setting for me
#!C:\Program\ Files\PowerShell\6.0.0\pwsh.exe -File
$Pattern = '^origin\s+https://(\S+)\s\(push\)'
$Origin = (& 'git' 'remote' '-v') -match $Pattern | Where-Object -FilterScript {$_ -is [string]}
$RemoteDomain = if($Origin -match $Pattern) {$Matches[1]}
$Email = & 'git' 'config' '--get' 'user.email' | Where-Object -FilterScript {$_ -is [string]}
$DesiredEmail = switch -Wildcard ($RemoteDomain) {
'simonwahlin.visualstudio.com*' {
'[email protected]'
break
@markekraus
markekraus / GetInboxRuleReport.ps1
Last active January 31, 2019 18:33
Generates Multi-Threaded Office 365 Inbox Rule Report That Scales with the Number of Service Accounts Provided
using namespace System.Collections.Concurrent
$StartDate = [datetime]::UtcNow
# can be generated with something like
# 1..10 | %{ Get-Credential} | Export-CliXml -path 'C:\reports\InboxRules\Creds.xml'
# Which will prompt for credentials 10 times and store them in the xml file
$CredentialFile = 'C:\reports\InboxRules\Creds.xml'
$RunDate = $StartDate.ToString('o') -replace ':'
# This is the path of the CSV file. It is imperative that this file not be
# access while the script is running