Skip to content

Instantly share code, notes, and snippets.

@f-bader
f-bader / GetAllRegisterdaaGuids.ps1
Last active April 14, 2024 19:46
List all AAGUIDs in an Entra ID / Azure AD tenant
# looking for a all in one solution?
# https://github.com/f-bader/EntraIDPasskeyHelper
Connect-MGGraph -UseDeviceAuthentication -Scopes "AuditLog.Read.All", "UserAuthenticationMethod.Read.All"
$NextUri = "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails?`$filter=methodsRegistered/any(x:x eq 'passKeyDeviceBound')"
do {
$Result = Invoke-MgGraphRequest -Uri $NextUri
$NextUri = $Result['@odata.nextLink']
$ReturnValue += $Result['value']
Key,Value
dc890d15-9560-4a4c-9b7f-a736ec74ec40,full_access_as_app
73a45059-f39c-4baf-9182-4954ac0e55cf,TeamsAppInstallation.ReadWriteSelfForChat.All
59a6b24b-4225-4393-8165-ebaec5f55d7a,Channel.ReadBasic.All
a25ca244-bc95-4be7-bd58-ca9325bd24b2,AzureContainerRegistryRP
7b2ebf90-d836-437f-b90d-7b62722c4456,Schedule.Read.All
c7283fbe-34b8-4134-a6b4-771e6a87a497,
efe4d732-bfbb-4617-8a77-349a9d67c720,app_impersonation
66a874a2-b739-43fa-8e1a-176cd8290cf5,Collection.Read.All
9125c627-3755-4ad3-8742-4d6b193c4fc2,filteredhierarchy.read.all
@saleem-mirza
saleem-mirza / logger.go
Last active October 22, 2021 19:04
Azure Log Analytics Logger in Golang
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"net/http"
"time"
"unicode/utf8"
"strconv"
@indrayam
indrayam / create-jwt-using-unix-commands-on-mac.md
Last active September 21, 2022 08:08
Create JWT Token Header Using Unix Command line tools ONLY!

Pseudocode:

Y = Base64URLEncode(Header) + ‘.’ + Base64URLEncode(Payload)
JWT = Y + ‘.’ + Base64URLEncode(HMACSHA256(Y))

The steps called out here should work on a Mac as well. The only thing that might be different is the sed command used below. Instead of using -E, you will have to use -r to run sed with extended regular expression support

Use data from this tutorial:

scotch.io

@Kartones
Kartones / postgres-cheatsheet.md
Last active April 19, 2024 13:15
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
#!/usr/bin/python
# https://timwise.co.uk/2014/02/03/converting-kml-to-gpx-with-python/
# https://gist.github.com/timabell/8791116
import argparse
import xml.sax
parser = argparse.ArgumentParser(description='Convert annoying google android my tracks kml data to sensible gpx files')
parser.add_argument('input_file')