Skip to content

Instantly share code, notes, and snippets.

View gnuos's full-sized avatar

Kevin gnuos

View GitHub Profile
@gnuos
gnuos / ipv4_ipv6_doh_doq.md
Created October 2, 2025 08:24 — forked from leiless/ipv4_ipv6_doh_doq.md
List of direct IPv4/IPv6 DoH/DoQ

dns.google / 8888.google

8.8.4.4
8.8.8.8
2001:4860:4860:0:0:0:0:64
2001:4860:4860:0:0:0:0:6464
2001:4860:4860:0:0:0:0:8844
2001:4860:4860:0:0:0:0:8888
@gnuos
gnuos / t.py
Created September 14, 2023 01:52
Enumerate all possible RSA plaintexts given a ciphertext, two primes p and q, and any integer e.
from Crypto.Util.number import GCD, bytes_to_long, long_to_bytes
class CRT:
def __init__(self, p, q):
self.p_p_inv = p * pow(p,-1,q)
self.p_q = p * q
def calc(self, a, b):
x = a + (b - a) * self.p_p_inv
return x % self.p_q
@gnuos
gnuos / musl-bootstrap.sh
Created September 13, 2023 21:15
musl-bootstrap.sh
#!/bin/bash
# This script builds a (hopefully) working gcc based cross compiler
# Update to latest stable release
BINUTILS_VERSION=2.27
GMP_VERSION=6.1.2
MPFR_VERSION=3.1.5
MPC_VERSION=1.0.3
ISL_VERSION=0.16.1
GCC_VERSION=6.3.0
@gnuos
gnuos / bootstrap.sh
Created September 13, 2023 21:13
Create a cross gcc toolchain for any target! And it only builds everything once!
#!/bin/bash
# This script builds a (hopefully) working gcc based cross compiler
# Update to latest stable release
BINUTILS_VERSION=2.27
GMP_VERSION=6.1.2
MPFR_VERSION=3.1.5
MPC_VERSION=1.0.3
ISL_VERSION=0.16.1
GCC_VERSION=6.3.0
@gnuos
gnuos / intercept.js
Created May 6, 2021 06:17 — forked from suprememoocow/intercept.js
AJAX timing interceptor: this class intercepts all AJAX calls and records the time taken for the HTTP request to complete. These timings are posted back to the server in batches, if there are any to send, about every two seconds. Tested in Firefox, Chrome
(function(XHR) {
"use strict";
var stats = [];
var timeoutId = null;
var open = XHR.prototype.open;
var send = XHR.prototype.send;
@gnuos
gnuos / pandas-read_sql-from-sqlalchemy-models.py
Created February 21, 2020 11:05 — forked from samukasmk/pandas-read_sql-from-sqlalchemy-models.py
Pandas: read_sql from SQLAlchemy Models
# Example of read_sql loading dataframe from database, using SQLAlchemy Models (possibily from flask app)
# import pandas lib
import pandas as pd
# import sqlalchemy libs
from flask_app.db import express_session
from flask_app.models import SalesRegistry
from flask_app.app import create_app, db
@gnuos
gnuos / make-san-cert.rb
Created July 24, 2019 08:58 — forked from arusso/make-san-cert.rb
Generating a SAN Certificate in Ruby
require 'openssl'
require 'openssl-extensions/all'
keyfile = '/tmp/mycert.key'
csrfile = '/tmp/mycert.csr'
file = File.new(keyfile,'w',0400)
key = OpenSSL::PKey::RSA.new 2048
file.write(key)