A Pen by Gerardo Aguilar on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI, Request, HTTPException | |
from starlette.responses import RedirectResponse | |
from keycloak import KeycloakOpenID | |
import logging | |
app = FastAPI() | |
keycloak_openid = KeycloakOpenID( | |
server_url="https://keycloak.example.com/", | |
client_id="your-client", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %% | |
import jwt | |
import time | |
from datetime import timedelta | |
from cryptography.hazmat.primitives import serialization | |
from cryptography.hazmat.backends import default_backend | |
# Load your private key from the .p8 file | |
with open('./your_key.p8', 'rb') as key_file: | |
private_key = serialization.load_pem_private_key( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %% | |
import requests | |
url = "https://api.music.apple.com/v1/me/library" | |
params = { | |
"ids[albums]": "1590556925" | |
} | |
headers = { | |
"Authorization": "Bearer changeme", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %% | |
import requests | |
import csv | |
region = "us" | |
base_url = f"https://api.music.apple.com/v1/catalog/{region}/search" | |
bearer_token = "changme" | |
music_user_token = "changeme" | |
def search_artist(artist_name): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <linux/init.h> | |
#include <linux/module.h> | |
#include <linux/kernel.h> | |
#include <linux/mm.h> // For get_vmalloc_info | |
MODULE_LICENSE("GPL"); | |
MODULE_AUTHOR("Dan Slinky"); | |
MODULE_DESCRIPTION("A simple Linux module for displaying basic system stats."); | |
MODULE_VERSION("0.1"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <linux/if_link.h> | |
#include <linux/socket.h> | |
#include <linux/ip.h> | |
#include <linux/icmp.h> | |
#include <linux/tcp.h> | |
#include <linux/udp.h> | |
#include <linux/in.h> | |
#include <linux/module.h> | |
#include <linux/init.h> | |
#include <linux/string.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %% [markdown] | |
# Send a DKIM-signed email from a home Postfix server | |
import smtplib | |
from email.mime.text import MIMEText | |
from email.mime.multipart import MIMEMultipart | |
import dkim | |
import uuid | |
# SMTP server configuration |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %% [markdown] | |
# # RunPod Automatic1111 Stable Diffusion | |
# | |
# A text-to-image toy that creates images on a serverless | |
# [RunPod](https://www.runpod.io/) endpoint. Enter a prompt, | |
# using the form or function. | |
# | |
# ```py | |
# new("a cow in space") | |
# ``` |
NewerOlder