Skip to content

Instantly share code, notes, and snippets.

View stephenpaulger's full-sized avatar

Stephen Paulger stephenpaulger

View GitHub Profile
@stephenpaulger
stephenpaulger / cve-scores2023.csv
Created December 19, 2023 16:40
2023 CVEs with CVSS Scores
We can't make this file beautiful and searchable because it's too large.
ID,CVSS3.1,CVSS3.0,CVSS2.0
CVE-2023-2387,2.4,2.4,3.3
CVE-2023-2738,6.3,6.3,6.5
CVE-2023-2368,4.7,4.7,5.8
CVE-2023-2692,3.5,3.5,4
CVE-2023-2942,None,8.1,None
CVE-2023-2041,6.3,6.3,6.5
CVE-2023-2411,6.3,6.3,6.5
CVE-2023-2104,None,5.4,None
CVE-2023-2554,None,7.2,None
@stephenpaulger
stephenpaulger / function_identifiers.go
Created August 6, 2018 08:49
Extract golang function identifiers
package main
import (
"errors"
"fmt"
"go/ast"
"go/parser"
"go/token"
)
@stephenpaulger
stephenpaulger / bubble_sort.asm
Created June 3, 2017 18:54
Assembler simulator bubble sort
; Runs on https://schweigi.github.io/assembler-simulator/
; https://en.wikipedia.org/wiki/Bubble_sort
MOV C, data ; C tracks the address of end
ADD C, 16 ; of the unsorted section of data.
start:
DEC C ; One byte is sorted each pass
MOV D, data ; Start of the data
bubble:
import timeit
import random
from math import log, ceil
def sum_digits(num):
sum_dig = 0
while num > 0:
last_digit = num % 10 # extract the last digit
@stephenpaulger
stephenpaulger / otp.py
Created March 12, 2012 09:40
Why two time pads are a BadThing™
#!/usr/bin/env python
def xor_int_tuple(tup):
return reduce(lambda a,b:a^b, tup)
def xor_tuple(tup):
return ord(tup[0]) ^ ord(tup[1])
def encrypt(m, k, op=xor_tuple):
return map(op, zip(m, k))
@stephenpaulger
stephenpaulger / sigquit.py
Created January 18, 2012 17:14
SIGQUIT handler
import signal
import sys
import time
def handle(sig, frame):
print all_signals[sig]
all_signals = dict((getattr(signal, attr), attr) for attr in dir(signal) if attr.startswith("SIG"))
-module(sieve).
-export([sieve/1]).
sieve(N) ->
[1 | sieve(lists:seq(2, N), N)].
sieve([Head|L], N) when Head * 2 < N ->
[Head | sieve(L -- lists:seq(Head * 2, N, Head), N)];
sieve([Head|L], _) ->