Skip to content

Instantly share code, notes, and snippets.

View linnaea's full-sized avatar

Linnaea Von Lavia linnaea

View GitHub Profile
# >>> 111
# <<< Your token: 111,9f2f2061e1898665c6ae49e665bc5f344a6005104c242d53f74c8548de7a468569dacd3a006354ef5dfdd8151e996ff1b981f24270287b6462c6b97509490041
# >>> 222
# <<< Your token: 222,9f2f2061e1898665c6ae49e665bc5f344a6005104c242d53f74c8548de7a4685377f65dbb5b54173f4626ccd8b765b2cc75d7a4e4949a43614528f496710c986
# ECDSA overview:
# 0. Private key d, curve generator point G, message m
# 1. Select any number k
# 2. Calculate r = (kG).x, if r = 0 goto 1
# 3. Calculate s = (m+rd)/k, if s = 0 goto 1
#!/usr/bin/env python3
from os import listdir
from time import time, sleep
from math import log10, copysign
from typing import List
energy = dict()
si_prefix = 'M', 'k', '', 'm', 'u'
hsign = lambda x: copysign(0.5, x)
def stat_energy(domain: str, readout: int, rollover: int) -> int:
@linnaea
linnaea / README.md
Last active December 1, 2022 14:33
Use the module in the official FreeRADIUS v3.1.x branch, this Gist is kept only for history purpose.

Cassandra backend for FreeRADIUS.

Please make sure that in accounting section of the site config, cassacctsupplement appears before cassacct, cassauth should also be added to the accounting section to enforce Simultaneous-Use checks.

@linnaea
linnaea / fbvnc.c
Created April 24, 2014 03:55
VNC Server exporting framebuffer device content, I wrote it for use with fbterm. It doesn't handle input. Updates at 5fps, very CPU hungry. Code released into the public domain.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/fb.h>
#include <errno.h>
#include <string.h>
#include <rfb/rfb.h>
#include <semaphore.h>