Skip to content

Instantly share code, notes, and snippets.

@darrenjrobinson
darrenjrobinson / Microsoft Graph using MSAL with Python and Delegated Permissions.py
Last active May 1, 2023 13:59
Microsoft Graph using MSAL with Python and Delegated Permissions using a persistent local MSAL Cache. Associated Blogpost https://blog.darrenjrobinson.com/microsoft-graph-using-msal-with-python-and-delegated-permissions/
import msal
import jwt
import json
import sys
import requests
from datetime import datetime
from msal_extensions import *
graphURI = 'https://graph.microsoft.com'
tenantID = 'yourTenantID'
@esummers
esummers / Samba Domain Controller.md
Last active November 14, 2024 07:53
Samba Domain Controller on a Raspberry Pi

Running a Samba 4.x Domain Controller on a Raspberry Pi

If you don't have a Windows server available for testing, a Raspberry Pi makes a great test environment. It works with Mac AD Binding, Apple Enterprise Connect, and the Mac Kerberos SSO Extension.

Configuring a Domain Controller on Rasbian or other Debian-based Linux distribution:

  1. Install Rasbian. Use NOOBS if you are new to Raspberry Pi at https://www.raspberrypi.org/downloads/. Optionally enable SSH or VNC support in Raspbian settings menu to remote in to the machine.

  2. Install Samba and related packages. Some packages may launch setup tools. Skip through the Kerberos configuration with defaults. We will be deleting the Kerberos configuration in a later step.

@shu-yusa
shu-yusa / create_jwt.sh
Last active May 10, 2025 22:21
Generate private and public keys, and create JWT and JWKs
#!/bin/sh
## Requires openssl, nodejs, jq
header='
{
"kid": "12345",
"alg": "RS256"
}'
payload='
{
"iss": "https://example.com",

Flask Stuff

Notes from 6/28

Today's tasks:

  • Use flask-migrate to manage db state
  • manage flash messages with session
  • hash + salt with flask bcrypt

Setup instructions