This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gcm | |
# Check if llm is installed, if not, install it | |
if not type -q llm | |
echo "'llm' is not installed. Attempting to install it using brew..." | |
if brew install llm | |
echo "'llm' installed successfully." | |
else | |
echo "Failed to install 'llm'. Please install it manually and try again." | |
return 1 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$MaxLogAge = 31 | |
$LogFilesDirectory = 'C:\inetpub\logs\LogFiles\' | |
$ErrorActionPreference = 'SilentlyContinue' | |
if ($LogFilesDirectory) { | |
Set-Location $LogFilesDirectory | |
# For all directories that start with "W3SVC" run the following | |
foreach ($LogDirectory in Get-ChildItem $LogFilesDirectory | Where-Object { $_.PsIsContainer -and $_.Name -match '^W3SVC' }) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"basics": { | |
"name": "Sean McGrath", | |
"label": "Solution Architect", | |
"image": "", | |
"email": "sean@mcgrath.nz", | |
"url": "https://sean.mcgrath.nz", | |
"summary": "A summary of Sean McGrath...", | |
"location": { | |
"city": "Auckland", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Intune Config Backup | |
# Controls when the workflow will run | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Runs daily at 2pm UTC | |
schedule: | |
- cron: "0 14 * * *" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -Version 7 | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory = $true, Position = 0)] | |
[string]$FolderPath, | |
[Parameter(Mandatory = $false, Position = 1)] | |
[string]$Filter, | |
[Parameter(Mandatory = $false, Position = 2)] | |
[switch]$OnlyReportSkippedFolders, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Azure AD Config Backup | |
on: | |
workflow_dispatch: | |
# Runs daily at 4pm UTC | |
schedule: | |
- cron: "0 16 * * *" | |
permissions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | |
default kubernetes ClusterIP 10.43.0.1 <none> 443/TCP 26h | |
kube-system kube-dns ClusterIP 10.43.0.10 <none> 53/UDP,53/TCP,9153/TCP 26h | |
kube-system metrics-server ClusterIP 10.43.56.59 <none> 443/TCP 26h | |
flux-system notification-controller ClusterIP 10.43.245.29 <none> 80/TCP 26h | |
flux-system source-controller ClusterIP 10.43.184.171 <none> 80/TCP 26h | |
flux-system webhook-receiver ClusterIP 10.43.92.83 <none> 80/TCP 26h | |
podinfo podinfo LoadBalancer 10.43.180.75 10.0.16.120 9898:30546/TCP,9999:31271/TCP 26h | |
kube-system traefik LoadBalancer 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get all drive info from ZDB, trim all path off the front and drop partition info from the back | |
used=$(zdb | grep -e ' path:' | sed -r "s/^.*(ata-.*)/\1/" | sed -r "s/(.*)-part1'|'/\1/" | sort) | |
#Get all ATA disks from the system | |
all=$(ls /dev/disk/by-id/ | grep -v part | grep -e ata- | sort) | |
#Compare both lists | |
unmatched=$(comm -13 <( echo "$used" ) <( echo "$all" )) | |
#Zpool status output to catch cache drives |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Create Unix VM's. | |
PREREQUISITES: | |
- A VM that has been installed with an OS that supports cloud-init | |
- cloud-init is installed on the vm | |
How it works: | |
- Asks for a bunch of parameters | |
- Creates a disk from parent vhdx for speed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description: Boxstarter Script | |
# Author: Sean McGrath <sean@mcgrath.net.nz> | |
# Last Updated: 2018-12-07 | |
# | |
# Install Boxstarter: | |
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force | |
# | |
# Set: Set-ExecutionPolicy RemoteSigned | |
# Then: Install-BoxstarterPackage -PackageName <URL-TO-RAW-GIST> -DisableReboots | |
# |
NewerOlder