Skip to content

Instantly share code, notes, and snippets.

View MasFlam's full-sized avatar
🦽
universitting

MasFlam MasFlam

🦽
universitting
View GitHub Profile
@CallumDev
CallumDev / fontconfig.c
Created January 21, 2015 14:08
FontConfig sample in C
//compiled gcc fonttest.c -o fonttest -lfontconfig
//Sample output: /usr/share/fonts/steam-fonts/arial.ttf
#include <stdio.h>
#include <stdlib.h>
#include <fontconfig/fontconfig.h>
int main()
{
FcConfig* config = FcInitLoadConfigAndFonts();
//make pattern from font name
FcPattern* pat = FcNameParse((const FcChar8*)"Arial");
@christoph-frick
christoph-frick / Awesome-Fennel.md
Last active May 8, 2024 21:15
Use fennel to write the awesome-wm config

How to write an awesome-wm config with Fennel

Awesome-WM is a X11 window manager, that is configured via Lua. Fennel is a Lisp for Lua. This shows a general setup of how to write your awesome-wm config using fennel directly without the compilation step (which would also work, but is not needed).

General setup

Fetch a recent Fennel version (the

@MasFlam
MasFlam / ForkSort.java
Last active August 21, 2020 13:59
ForkBombSort or ForkSort is a version of MergeSort, where on every recursion, two new threads are created.
public final class ForkSort {
private ForkSort() {}
public static <T> List<T> forkSort(List<T> list, Comparator<T> comp) {
int len = list.size();
int mid = len / 2;
List<T> one = new ArrayList<>(mid);
List<T> two = new ArrayList<>(len - mid);

JAMTIS

This document describes a new addressing scheme for Monero.

Chapters 1-2 are intended for general audience.

Chapters 3-7 contain technical specifications.

Table of Contents

@MasFlam
MasFlam / SatoriSigma.user.js
Created June 10, 2022 23:43
Tampermonkey/whatever else userscript for satori sigma grinders
// ==UserScript==
// @name Satori Sigma
// @namespace https://masflam.com
// @version 21.37
// @description satori grind
// @author MasFlam
// @match *://satori.tcs.uj.edu.pl/*
// @icon https://satori.tcs.uj.edu.pl/files/satori_logo.png
// @grant none
// ==/UserScript==
@MasFlam
MasFlam / monero-address-regex.md
Last active March 25, 2024 02:22
Regular expressions for matching monero addresses

Tip

See the XmrAddr libraries.

Monero Address Regex

This is a collection of best-you-can-do regular expressions matching Monero addresses of each kind and network type. Keep in mind to actually verify an address you should validate the checksum, so use these only for preliminary filtering of data, UI validation, etc. where false positives won't hurt. Also, I semi-purposefully didn't include regex for integrated addresses, which are nowadays considered deprecated by many, including myself.

@kayabaNerve
kayabaNerve / deanon_dero.md
Last active June 20, 2024 07:47
Deanonymization of the Dero Network

The Dero Protocol

The protocol uses a pair of rings, one for the senders, one for the receivers, represented as a singular ring. With each transfer, a list of ElGamal ciphertexts is provided for all accounts within the joint ring. This ElGamal ciphertext is formed as r * G, (r * K) + (a * G), where r is some randomness, K is the key for the account the ciphertext is for, and a is the amount.

The Dero Wallet Protocol

Dero offers an 'encrypted message' with every transaction. Even if the user does not explicitly provide one, a message will exist (either with internally provided values or left empty). For the only defined type of message, the message is encoded as the index of the sender, a CBOR-encoded object, and zero-padding. The message is encrypted with the Chacha20 stream created by a key of H(H(r * K) || K) where r is some randomness and K is the key for the account the ciphertext is for.

The Issue