Skip to content

Instantly share code, notes, and snippets.

View petervandivier's full-sized avatar
🌶️
Why is it spicy?

Peter Vandivier petervandivier

🌶️
Why is it spicy?
View GitHub Profile
@craigmccauley
craigmccauley / ConvertFrom-MarkdownTemplate.ps1
Last active July 17, 2023 16:13
Mermaid diagrams in ADO workaround
# This script file regenerates all the generated markdown files.
# This is needed because Azure DevOps (ADO) does not support mermaid charts
# in the preview pane. Once ADO supports this functionality, remove
# this script, delete the generated files, move and rename the template
# files, and update the links that are going to the generated files.
# Requires a directory structure like so
# |- docs
# |- scripts
# |- ConvertFrom-MarkdownTemplate.ps1
# |- templates
@curz46
curz46 / XM3-GUIDE.md
Last active April 15, 2024 05:52
Sony WH-1000XM3 Headphones not working on Windows?

Edit: This method usually works but there is an easier way explained by @Instinctlol in the comments below. You might want to try that way first!

Introduction

When I first got these headphones they worked perfectly with my phone but trying to get them to connect to my Windows pc seemed hopeless. In my case, they paired & pressing 'connect' showed the headphones as connected, but the audio device was disabled & disconnected in sound settings. I later realised that they instantly connected & worked properly with my newer laptop, so the following guide was produced by imitating the setup my laptop automatically configured. This is something you should only have to do once when initially pairing the device.

Method

  1. First ensure that you are attempting to pair the device as WH-1000XM3 and not LE_WH-1000XM3. I'm not sure what the latter is for but it will not let you connect/play s
@Neo23x0
Neo23x0 / Base64_CheatSheet.md
Last active March 10, 2024 09:15
Learning Aid - Top Base64 Encodings Table

Base64 Patterns - Learning Aid

Base64 Code Mnemonic Aid Decoded* Description
JAB 🗣 Jabber $. Variable declaration (UTF-16), e.g. JABlAG4AdgA for $env:
TVq 📺 Television MZ MZ header
SUVY 🚙 SUV IEX PowerShell Invoke Expression
SQBFAF 🐣 Squab favorite I.E. PowerShell Invoke Expression (UTF-16)
SQBuAH 🐣 Squab uahhh I.n. PowerShell Invoke string (UTF-16) e.g. Invoke-Mimikatz
PAA 💪 "Pah!" <. Often used by Emotet (UTF-16)
@jkatz
jkatz / encrypt_password.py
Last active March 26, 2024 16:37
Methods to create password verifiers for PostgreSQL
# Copyright 2019-2022 Jonathan S. Katz
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@SteveL-MSFT
SteveL-MSFT / profile.ps1
Last active March 11, 2024 01:21
PowerShell Prompt
#Requires -Version 7
# Version 1.2.13
# check if newer version
$gistUrl = "https://api.github.com/gists/a208d2bd924691bae7ec7904cab0bd8e"
$latestVersionFile = [System.IO.Path]::Combine("$HOME",'.latest_profile_version')
$versionRegEx = "# Version (?<version>\d+\.\d+\.\d+)"
if ([System.IO.File]::Exists($latestVersionFile)) {
@sirsql
sirsql / GetAGLatency.sql
Created December 20, 2018 17:46
Grabs AG latency information. Run on primary to get information for all replicas and all databases, run on a secondary to get information for just that server. *note: MintoRedo is approximate based on the size of the queue and rates, this fluctuates so it not always accurate
SELECT DB_NAME(database_id),
a.replica_server_name,
database_id AS di,
last_redone_time,
DATEDIFF(MINUTE, last_sent_time, last_received_time) AS ReceiveLatencyS,
DATEDIFF(SECOND, last_sent_time, last_redone_time) AS RedoLatencyS,
CASE
WHEN redo_queue_size = 0 THEN
0
WHEN redo_rate = 0 THEN
@pezhore
pezhore / source.csv
Last active November 20, 2019 10:39
Kaomoji source
HumanReadable Kaomoji KaomojiEscaped
Shruggie ¯\_(ツ)_/¯ ¯\\\_(ツ)_/¯
TableFlip (╯°□°)╯︵ ┻━┻ (╯°□°)╯︵ ┻━┻
TableDown ┬─┬ノ( º _ ºノ) ┬─┬ノ( º _ ºノ)
Angry (/゚Д゚)/ (/゚Д゚)/
Disappointed ಠ_ಠ ಠ_ಠ
Strut ᕕ( ᐛ )ᕗ ᕕ( ᐛ )ᕗ
@Odepax
Odepax / 1-PowerShell-Tips.md
Last active December 1, 2023 09:33
What I Understand about PowerShell Approved Verbs

PowerShell Tips

Write-Host vs Write-Output

Write-Host writes directly to the console; Write-Output writes to the pipeline, which often ends up to the console but not necessarily.

For example: Write-Host "The Cake is a lie" | Out-Null won't work as expected, Write-Output "The Cake is a lie" | Out-Null will.

False Friends

@NReilingh
NReilingh / Script DB to Files.ps1
Created February 9, 2018 17:16
Using SQL SMO in PowerShell to script SQL Server objects
Add-Type -Path 'C:\Program Files\Microsoft SQL Server\140\SDK\Assemblies\Microsoft.SqlServer.Smo.dll'
$SmoServer = New-Object ('Microsoft.SqlServer.Management.Smo.Server') -argumentlist 'localhost'
$SmoServer.ConnectionContext.LoginSecure = $false
$SmoServer.ConnectionContext.set_Login("sa")
$SmoServer.ConnectionContext.set_Password("Passw0rd!")
$db = $SmoServer.Databases['msdb']
$Objects = $db.Tables
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 2, 2024 16:19
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux