Skip to content

Instantly share code, notes, and snippets.

View tillig's full-sized avatar

Travis Illig tillig

View GitHub Profile
@d8ahazard
d8ahazard / plex_cleanup.py
Last active June 22, 2023 17:49
A utility for cleaning Plex collections and identifying orphaned media.
import os
import pathlib
import sqlite3
target_path = ""
movie_list = []
tv_list = []
collection_list = []
@kevinhillinger
kevinhillinger / assign-user-to-access-kubeconfig.sh
Last active June 12, 2019 20:07
Azure AD Integration with AKS
# The following example assigns the Azure Kubernetes Service Cluster Admin Role to an individual user account.
# This is controlled via Azure AD -> Azure AKS (separate from AAD integration with
# AKS where someone can assign a user a cluster role
# Get the resource ID of your AKS cluster
AKS_CLUSTER=$(az aks show --resource-group myResourceGroup --name myAKSCluster --query id -o tsv)
# Get the account credentials for the logged in user
ACCOUNT_UPN=$(az account show --query user.name -o tsv)
@bradwilson
bradwilson / profile.ps1
Last active March 21, 2024 07:24
Downloadable files for bradwilson.io/blog/prompt/powershell
######## POSH-GIT
# ... Import-Module for posh-git here ...
# Background colors
$GitPromptSettings.AfterStash.BackgroundColor = 0x5F5FAF
$GitPromptSettings.AfterStatus.BackgroundColor = 0x5F5FAF
$GitPromptSettings.BeforeIndex.BackgroundColor = 0x5F5FAF
$GitPromptSettings.BeforeStash.BackgroundColor = 0x5F5FAF
@jkrasnay
jkrasnay / swagger-jq.sh
Last active July 19, 2023 02:49
Processing Swagger with jq
# Convert to TSV
# Note -r flag
# to_entries creates an array of key,value maps, the trailing [] converts this array to stream items
cat api-docs.json | jq -r '.paths | to_entries[] | .key as $path | .value | to_entries[] | [.key,$path,.value.tags[0]] | @tsv'
# Transform into different JSON...
cat api-docs.json | jq '[ .paths | to_entries[] | .key as $path | .value | to_entries[] | { path:$path, method:.key, tag:.value.tags[0] } ]'
@jpoehls
jpoehls / example.ps1
Created April 28, 2015 14:45
Symlink support in PowerShell V5 *-Item cmdlets
### SYMBOLIC LINK FILES
# Create a new symbolic link file named MySymLinkFile.txt in C:\Temp which links to $pshome\profile.ps1
cd C:\Temp
New-Item -ItemType SymbolicLink -Name MySymLinkFile.txt -Target $pshome\profile.ps1 # File
# Target is an alias to the Value parameter
# Equivalent to above
New-Item -ItemType SymbolicLink -Path C:\Temp -Name MySymLinkFile.txt -Value $pshome\profile.ps1
# Equivalent to above