Skip to content

Instantly share code, notes, and snippets.

# Test for semantic between sentences using small language model
from transformers import AutoTokenizer, AutoModel
import torch
from sklearn.metrics.pairwise import cosine_similarity
# Load a multilingual lightweight model and tokenizer
model_name = "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModel.from_pretrained(model_name)

1. Build plugin

Clone plugin from https://github.com/silentsignal/oracle_forms/

Edit script for Python 3 (see pull request)

if ctx.options.corrupt_handshake:
    flow.response.content = flow.response.content.replace(b'Mate', b'Matf')
@spipm
spipm / extract_dockerimage.sh
Created June 23, 2023 17:24
Extract docker container image to folder
#!/bin/bash
docker create --name extract_test repo.foo.bar/some_image:v1337
mkdir container
docker export extract_test | tar xvf - -C container
@spipm
spipm / pxe-boot.sh
Last active July 7, 2024 17:25
Create (UEFI/Secureboot) PXE boot server on interface
#!/bin/bash
# Run PXE boot server on interface
# Seems to work with UEFI and Secureboot
# Spip, 2023
#
# Most stuff from https://www.youtube.com/watch?v=E_OlsA1hF4k
#
# Check args
@spipm
spipm / hackrf_read.c
Created March 17, 2019 20:09
libHackRF API example
/*
Simple HackRF programming exercise
Sipke '19
This program receives raw data from a certain frequency until the user pressed ctrl+c.
Code is mostly taken from hackrf_sweep.c (hackrf toolbox) and converted to the bare minimum.
It's created to learn about how the HackRF behaves and to do something with it via custom code that doesn't involve GnuRadio.
Note that you can directly use the command line tools hackrf_sweep, hackrf_transfer and rtl_sdr for the same thing and more.
@spipm
spipm / getModulus.py
Created November 7, 2017 18:43
Get an RSA modulus from a server
import ssl
from Crypto.Util import asn1
from OpenSSL.crypto import FILETYPE_PEM, FILETYPE_ASN1, load_certificate, dump_privatekey
def getModulusFromServer(host, port=443):
try:
# get cert from server
cert = ssl.get_server_certificate((host,port))
# load certificate