Skip to content

Instantly share code, notes, and snippets.

View luzkenin's full-sized avatar
🤙
Focusing

Joseph luzkenin

🤙
Focusing
View GitHub Profile
@luzkenin
luzkenin / PSADT-Cheatsheet.ps1
Created January 17, 2023 17:08 — forked from leeramsay/PSADT-Cheatsheet.ps1
PSADT snippits/cheatsheet
## Commonly used PSADT env variables
$envCommonDesktop # C:\Users\Public\Desktop
$envCommonStartMenuPrograms # C:\ProgramData\Microsoft\Windows\Start Menu\Programs
$envProgramFiles # C:\Program Files
$envProgramFilesX86 # C:\Program Files (x86)
$envProgramData # c:\ProgramData
$envUserDesktop # c:\Users\{user currently logged in}\Desktop
$envUserStartMenuPrograms # c:\Users\{user currently logged in}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
$envSystemDrive # c:
$envWinDir # c:\windows
@luzkenin
luzkenin / Ansible-Vault how-to.md
Created December 6, 2021 00:37 — forked from tristanfisher/Ansible-Vault how-to.md
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

Working with ansible-vault


I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@luzkenin
luzkenin / inputs.conf
Created April 16, 2021 00:01 — forked from automine/inputs.conf
Nice windows event blacklisting
[WinEventLog://Security]
disabled = 0
start_from = oldest
current_only = 0
evt_resolve_ad_obj = 1
checkpointInterval = 5
blacklist1 = EventCode="4662" Message="Object Type:(?!\s*groupPolicyContainer)"
blacklist2 = EventCode="566" Message="Object Type:(?!\s*groupPolicyContainer)"
blacklist3 = EventCode="4688" Message="New Process Name:\s*(?i)(?:[C-F]:\\Program Files\\Splunk(?:UniversalForwarder)?\\bin\\(?:btool|splunkd|splunk|splunk\-(?:MonitorNoHandle|admon|netmon|perfmon|powershell|regmon|winevtlog|winhostinfo|winprintmon|wmi|optimize))\.exe)"
blacklist4 = EventCode="4689" Message="Process Name:\s*(?i)(?:[C-F]:\\Program Files\\Splunk(?:UniversalForwarder)?\\bin\\(?:btool|splunkd|splunk|splunk\-(?:MonitorNoHandle|admon|netmon|perfmon|powershell|regmon|winevtlog|winhostinfo|winprintmon|wmi|optimize))\.exe)"
$path = 'D:\Games\Blizzard\World of Warcraft\_classic_\Interface\AddOns\ISBoxer\ISBoxer.toc'
$data = Get-Content $path
$properties = @{}
$pattern = '## (?<propertyName>[^:]*): (?<propertyValue>.*)'
foreach($line in $data)
{
@luzkenin
luzkenin / Backup.ps1
Created July 18, 2019 12:01 — forked from clijsters/Backup.ps1
Create Backups using snapshots and symlinks
Function snapshot() {
param(
[String]$Path,
[String]$Access,
[String]$BackupName
)
Write-Debug "Backing up $Path to $BackupName..."
#Create VSS Snapshot
$shadowCopy = (Get-WmiObject -List Win32_ShadowCopy).Create([System.IO.Directory]::GetDirectoryRoot($Path).ToString(), $Access)