Skip to content

Instantly share code, notes, and snippets.

View Honzaik's full-sized avatar

Jan Oupický Honzaik

View GitHub Profile
@Honzaik
Honzaik / glwe.sage
Created May 26, 2023 13:08
GLWE example
#GLWE PKE, q = 1423, n=2, d=2, https://eprint.iacr.org/2011/277.pdf
Z5x.<x> = GF(1423)[]
R = Z5x.quotient(x**2+1,"a")
a = R.gen()
ss = matrix([[1],[a]])
s = block_matrix([[1],[ss]])
AA = matrix([[a+1,a],[2*a,1],[2,4*a+4],[4*a+2,3*a]])
@Honzaik
Honzaik / block.js
Created March 30, 2022 15:37
twitch adblock ublock
twitch-videoad.js application/javascript
(function() {
if ( /(^|\.)twitch\.tv$/.test(document.location.hostname) === false ) { return; }
function declareOptions(scope) {
// Options / globals
scope.OPT_ROLLING_DEVICE_ID = true;
scope.OPT_MODE_STRIP_AD_SEGMENTS = true;
scope.OPT_MODE_NOTIFY_ADS_WATCHED = true;
scope.OPT_MODE_NOTIFY_ADS_WATCHED_MIN_REQUESTS = false;
scope.OPT_MODE_NOTIFY_ADS_WATCHED_RELOAD_PLAYER_ON_AD_SEGMENT = false;
@Honzaik
Honzaik / .bash
Created October 17, 2020 13:07
bashrc new
export PS1="[\t]\[$(tput sgr0)\]\[\033[38;5;127m\]\u\[$(tput sgr0)\]\[\033[38;5;14m\]@\[$(tput sgr0)\]\[\033[38;5;200m\]\h\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;208m\]\w\[$(tput sgr0)\]\[\033[38;5;14m\]\\$\[$(tput sgr0)\] \[$(tput sgr0)\]"
/// twitch-videoad.js
const origFetch = window.fetch;
window.fetch = (url, init, ...args) => {
if (typeof url === "string") {
if (url.includes("/access_token")) {
url = url.replace("player_type=site", "player_type=embed");
} else if (
url.includes("/gql") &&
init &&
typeof init.body === "string" &&
@Honzaik
Honzaik / dp.txt
Created February 26, 2019 17:29
sireni diference sbox
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0.25 0 0.125 0.125 0.125 0.375 0 0 0 0
0 0 0.125 0 0.125 0 0 0 0.125 0.25 0.125 0.125 0 0 0 0.125
0 0.25 0.375 0 0.125 0 0 0 0 0.125 0 0 0 0 0 0.125
0 0 0 0 0 0 0 0 0.25 0 0 0 0.25 0 0.5 0
0 0 0 0 0.125 0.375 0.125 0.125 0 0 0 0 0 0 0.25 0
0 0.125 0 0 0.125 0.125 0.125 0.25 0 0 0.125 0 0.125 0 0 0
0 0.125 0 0 0 0 0 0.125 0 0 0.125 0 0.125 0 0.25 0.25
0 0 0 0.125 0 0.125 0 0 0 0 0 0.125 0 0.375 0 0.25
0 0 0 0.125 0.125 0.125 0.375 0 0 0.125 0 0 0 0.125 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0.5 0.25 0.25 -0.25 0.25 0 0 0 0.5 -0.25 -0.25 0.25 -0.25
0 0 0.25 -0.25 0 0 0.25 0.75 0 0 -0.25 0.25 0 0 -0.25 0.25
0 0 0.25 0.25 0.25 0.25 0 0 0 0 -0.25 -0.25 0.75 -0.25 0 0
0 0 -0.25 0.25 0.25 -0.25 0 0 0.25 0.75 0 0 0 0 -0.25 0.25
0 0 0.25 0.25 0 -0.5 -0.25 0.25 0.25 -0.25 0.5 0 0.25 0.25 0 0
0 0 0 0 0.25 -0.25 0.25 -0.25 0.25 -0.25 -0.25 0.25 0 0 0.5 0.5
0 0 -0.5 0 0 0.5 0 0 0.25 -0.25 0.25 0.25 0.25 0.25 -0.25 0.25
0 -0.5 0 0 0 0 -0.5 0 0 0 -0.5 0 0 0.5 0 0
0 -0.5 -0.5 0 -0.25 -0.25 0.25 0.25 0 0 0 0 0.25 -0.25 0.25 -0.25
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
0a:56:c3:c3:16:55:8f:04:ef:79:2c:3b:28:e5:e9:28
Signature Algorithm: sha256WithRSAEncryption
Issuer: C = NL, ST = Noord-Holland, L = Amsterdam, O = TERENA, CN = TERENA SSL CA 3
Validity
Not Before: Mar 27 00:00:00 2017 GMT
Not After : Mar 31 12:00:00 2020 GMT
import hashlib
prefix = "JanOupicky"
counter = 0
seznam = dict()
h = hashlib.sha256((prefix + str(counter)).encode("utf-8")).hexdigest()
#include <stdio.h>
#include <stdlib.h> //atol
typedef struct strom {
char znamenko;
unsigned long cislo;
struct strom *L;
struct strom *P;
int isFull;
} strom;
@Honzaik
Honzaik / c.c
Created November 2, 2017 19:03
c.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct strom {
char val[20];
struct strom *L;
struct strom *P;
} strom;