Skip to content

Instantly share code, notes, and snippets.

View ramiil's full-sized avatar

Nikita Lindmann ramiil

View GitHub Profile
@ramiil
ramiil / hsm.py
Last active January 16, 2018 08:35
HashSumMicro - Tiny hash function
BSIZE = 4
HSIZE = 32
def xor(xs, ys):
if type(ys)==list:
return [x^y for x, y in zip(xs, ys)]
else:
return [(x^ys)%256 for x in xs]
def hsm(data):
@ramiil
ramiil / gist:9343fee3a436d4085ace3185c8fbffb0
Created February 24, 2020 04:39
mikrotik pcc 2 isp config
/interface bridge
add name=GUEST protocol-mode=none
add name=LAN protocol-mode=none
/interface ethernet
set [ find default-name=ether1 ] name=ISP1-NLS
set [ find default-name=ether2 ] name=ISP2-BLN
/ip pool
add name=dhcp_pool0 ranges=10.202.100.51-10.202.100.249
add name=guest_pool0 ranges=192.168.1.100-192.168.1.200
/ip dhcp-server
# -*- coding: utf-8 -*-
import os
import tiktoken
import time
import multiprocessing
working_dir = os.path.dirname(os.path.realpath(__file__))
dataset = 'data'
ws = 512*1024*1024 # 128k per chunk