Skip to content

Instantly share code, notes, and snippets.

@Und3rf10w
Und3rf10w / extract_msft_graph_content_bytes_from_odata_response.sh
Created August 31, 2022 13:39
Extracts the contentBytes from a Microsoft Graph (o365) response and writes them to raw files using jq
for line in `cat response.json| jq '.value[].contentBytes'`; do
echo $line | tr -d '"' | base64 -d > $(echo -n $line | cut -c2-5).file;
done
@Und3rf10w
Und3rf10w / DynamicStructResolution.go
Last active September 30, 2022 05:09
I have no idea how this works, but it does?
package main
import (
"fmt"
)
type methodArgumentsInterface interface {
determineStruct() interface{}
}
@Und3rf10w
Und3rf10w / Headscale setup.md
Last active May 6, 2025 02:34
How to set up headscale with SWAG in docker-compose

Overview

This document descrives the process of setting up headscale with swag, using letsencrypt certs.

This assumes you have a subdomain (e.g. wg.example.com) pointing to your SWAG instance and want to use it as a reverse proxy.

Swag .env

Add the subdomain for your desired headscale domain to your .env file.

For example: SWAG_EXTRA_DOMAINS=wg.example.com

@Und3rf10w
Und3rf10w / cuda_flowcontrol_xor_shellcode.c
Created December 15, 2023 13:35
Offloading tasks to CUDA
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
// CUDA runtime
#include <cuda_runtime.h>
__global__ void xorObfuscatePayload(char* data, int len, char key) {
int idx = blockIdx.x * blockDim.x + threadIdx.x;
@Und3rf10w
Und3rf10w / shitty_overlay.py
Created December 17, 2023 06:07
Shitty tkinter overlay that diplays over all other apps that aren't fullscreen. Importable.
import tkinter as tk
from queue import Queue, Empty
import logging
import threading
import sys
# Configure stream redirection as a context manager
class StdoutRedirector:
def __init__(self, write_func):
self.write_func = write_func
@Und3rf10w
Und3rf10w / custom-azure-openai-completion-provider.ts
Last active June 17, 2024 15:45
A custom azure-openai-completion-provider for the vercel ai-sdk, provided as one file
import {
type LanguageModelV1,
type LanguageModelV1FinishReason,
type LanguageModelV1LogProbs,
type LanguageModelV1StreamPart,
UnsupportedFunctionalityError,
InvalidPromptError,
type LanguageModelV1Prompt,
} from '@ai-sdk/provider';
import {
import argparse
import io
import os
import torch
from datetime import datetime, timedelta
from queue import Queue
from time import sleep
from sys import platform
import speech_recognition as sr
from scipy.io import wavfile